Make Measure and Measurement types generic.

This commit is contained in:
Jonathan Bernard 2019-04-02 23:22:43 -05:00
parent 5887368ed1
commit e542f44505

16
web/src/models.d.ts vendored
View File

@ -1,3 +1,5 @@
export enum MeasureType { Simple }
export interface ApiToken {
id: string;
userId: string;
@ -12,21 +14,27 @@ export interface LoginSubmit {
password: string;
}
export interface Measure {
export interface MeasureConfig {
type: string;
}
export interface Measure<C extends MeasureConfig> {
id: string;
userId: string;
slug: string;
name: string;
description: string;
config: object;
config: C;
}
export interface Measurement {
export interface MeasurementMeta {}
export interface Measurement<M extends MeasurementMeta> {
id: string;
measureId: string;
value: number;
timestamp: Date;
extData: object;
extData: M;
}
export interface User {