Add Statistics types as entities
This commit is contained in:
parent
c663a0e617
commit
b5fee6dcbc
|
@ -137,6 +137,17 @@ export interface Currency {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StatsType {
|
||||||
|
value: number;
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StatsTypeCurrencyChart {
|
||||||
|
label: string;
|
||||||
|
elements: StatsType[];
|
||||||
|
}
|
||||||
|
|
||||||
export const EntityTypes = {
|
export const EntityTypes = {
|
||||||
card: "Card",
|
card: "Card",
|
||||||
type: "Type",
|
type: "Type",
|
||||||
|
@ -148,6 +159,9 @@ export const EntityTypes = {
|
||||||
metric: "Metric",
|
metric: "Metric",
|
||||||
currency: "Currency",
|
currency: "Currency",
|
||||||
expense_bulk: "ExpenseBulk",
|
expense_bulk: "ExpenseBulk",
|
||||||
|
// I don't know if I should put Statistics interfaces to Entities
|
||||||
|
stats_type: "StatsType",
|
||||||
|
stats_type_currency_chart: "StatsTypeCurrencyChart",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type EntityName = keyof typeof EntityTypes;
|
export type EntityName = keyof typeof EntityTypes;
|
||||||
|
@ -162,6 +176,8 @@ export type EntityType<T extends EntityName> =
|
||||||
T extends "metric" ? Metric :
|
T extends "metric" ? Metric :
|
||||||
T extends "currency" ? Currency :
|
T extends "currency" ? Currency :
|
||||||
T extends "expense_bulk" ? ExpenseBulk :
|
T extends "expense_bulk" ? ExpenseBulk :
|
||||||
|
T extends "stats_type" ? StatsType :
|
||||||
|
T extends "stats_type_currency_chart" ? StatsTypeCurrencyChart :
|
||||||
never;
|
never;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user