57 lines
982 B
TypeScript
57 lines
982 B
TypeScript
export enum MeasureType { List = 'list', Simple = 'simple' }
|
|
|
|
export interface ApiToken {
|
|
id: string;
|
|
userId: string;
|
|
name: string;
|
|
value?: string;
|
|
created: Date;
|
|
expires?: Date;
|
|
}
|
|
|
|
export interface LoginSubmit {
|
|
email: string;
|
|
password: string;
|
|
}
|
|
|
|
export interface MeasureConfig {
|
|
type: MeasureType;
|
|
isVisible: boolean;
|
|
}
|
|
|
|
export interface ListMeasureConfig extends MeasureConfig {
|
|
showTimestamp: boolean;
|
|
}
|
|
|
|
export interface Measure<C extends MeasureConfig> {
|
|
id: string;
|
|
userId: string;
|
|
slug: string;
|
|
name: string;
|
|
description: string;
|
|
config: C;
|
|
}
|
|
|
|
export interface MeasurementMeta {
|
|
measureType: MeasureType;
|
|
}
|
|
|
|
export interface ListMeasurementMeta extends MeasurementMeta {
|
|
entry: string;
|
|
}
|
|
|
|
export interface Measurement<M extends MeasurementMeta> {
|
|
id: string;
|
|
measureId: string;
|
|
value: number;
|
|
timestamp: Date;
|
|
extData: M;
|
|
}
|
|
|
|
export interface User {
|
|
id: string;
|
|
displayName: string;
|
|
email: string;
|
|
isAdmin: boolean;
|
|
}
|