Make Measure and Measurement types generic.
This commit is contained in:
parent
5887368ed1
commit
e542f44505
16
web/src/models.d.ts
vendored
16
web/src/models.d.ts
vendored
@ -1,3 +1,5 @@
|
|||||||
|
export enum MeasureType { Simple }
|
||||||
|
|
||||||
export interface ApiToken {
|
export interface ApiToken {
|
||||||
id: string;
|
id: string;
|
||||||
userId: string;
|
userId: string;
|
||||||
@ -12,21 +14,27 @@ export interface LoginSubmit {
|
|||||||
password: string;
|
password: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Measure {
|
export interface MeasureConfig {
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Measure<C extends MeasureConfig> {
|
||||||
id: string;
|
id: string;
|
||||||
userId: string;
|
userId: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
config: object;
|
config: C;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Measurement {
|
export interface MeasurementMeta {}
|
||||||
|
|
||||||
|
export interface Measurement<M extends MeasurementMeta> {
|
||||||
id: string;
|
id: string;
|
||||||
measureId: string;
|
measureId: string;
|
||||||
value: number;
|
value: number;
|
||||||
timestamp: Date;
|
timestamp: Date;
|
||||||
extData: object;
|
extData: M;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user