From 24d722aeca8484d6312e206e3c3d134544182d8d Mon Sep 17 00:00:00 2001 From: "Leon.Schmidt" Date: Sat, 8 Aug 2026 22:47:58 +0200 Subject: [PATCH] ADD - define home widget contracts --- frontend/src/types/widgets.ts | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 frontend/src/types/widgets.ts diff --git a/frontend/src/types/widgets.ts b/frontend/src/types/widgets.ts new file mode 100644 index 0000000..e654af6 --- /dev/null +++ b/frontend/src/types/widgets.ts @@ -0,0 +1,41 @@ +export type WidgetKind = + | 'clock' + | 'date' + | 'weather' + | 'music' + | 'wallet' + | 'transactions' + | 'contacts' + +export type WidgetSize = 'small' | 'medium' | 'large' + +export type WidgetSettings = { + balanceSource?: 'bank' | 'cash' + contactIds?: string[] + showDate?: boolean +} + +export type WidgetInstance = { + column: number + id: string + kind: WidgetKind + page: number + row: number + settings: WidgetSettings + size: WidgetSize +} + +export type WidgetLayout = { + instances: WidgetInstance[] + version: 1 +} + +export type WidgetDefinition = { + categoryKey: string + configurable: boolean + defaultSize: WidgetSize + descriptionKey: string + kind: WidgetKind + labelKey: string + supportedSizes: WidgetSize[] +}