From 7c175b9026ecd4d27c61fc52d8fa22e4c7e467d9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 23 Jan 2026 18:10:02 -0800 Subject: fix(Notification): Align Options interface with Notification type --- src/lib/Notification/options.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/lib/Notification/options.ts b/src/lib/Notification/options.ts index 3ccb20b9..be972a7e 100644 --- a/src/lib/Notification/options.ts +++ b/src/lib/Notification/options.ts @@ -1,19 +1,24 @@ type Position = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; export interface Options { - heading: string | number; - description: string | number | undefined; + heading: string; + description?: string; position: Position; duration: number; id: string; } -export const options = (preferences: { [key: string]: number | string }): Options => { +export const options = (preferences: { + heading: string; + description?: string; + position?: string; + duration?: number; +}): Options => { return { position: (preferences.position || 'top-right') as Position, - duration: Number(preferences.duration || 3000), - heading: preferences.heading || 'Notification', - description: preferences.description || undefined, + duration: preferences.duration || 3000, + heading: preferences.heading, + description: preferences.description, id: Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15) }; }; -- cgit v1.2.3