From b5fee6dcbc339067b52e5e16c73ffdb813793850 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Fri, 29 Nov 2024 21:00:27 +0200 Subject: [PATCH] Add Statistics types as entities --- src/lib/entities.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/entities.ts b/src/lib/entities.ts index f3c1a32..615e8b6 100644 --- a/src/lib/entities.ts +++ b/src/lib/entities.ts @@ -137,6 +137,17 @@ export interface Currency { symbol: string; } +export interface StatsType { + value: number; + name: string; + color: string; +} + +export interface StatsTypeCurrencyChart { + label: string; + elements: StatsType[]; +} + export const EntityTypes = { card: "Card", type: "Type", @@ -148,6 +159,9 @@ export const EntityTypes = { metric: "Metric", currency: "Currency", 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; export type EntityName = keyof typeof EntityTypes; @@ -162,6 +176,8 @@ export type EntityType = T extends "metric" ? Metric : T extends "currency" ? Currency : T extends "expense_bulk" ? ExpenseBulk : + T extends "stats_type" ? StatsType : + T extends "stats_type_currency_chart" ? StatsTypeCurrencyChart : never; //