From 6471bbf93e91f0a07f7fa1074c1fbb146a4584e1 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 20 May 2025 13:32:11 -0700 Subject: [PATCH 1/5] changes customProperty to key in CustomTheme type interface --- src/components/Theme/@types/component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Theme/@types/component.ts b/src/components/Theme/@types/component.ts index 325faed0..94e8eb7e 100644 --- a/src/components/Theme/@types/component.ts +++ b/src/components/Theme/@types/component.ts @@ -50,5 +50,5 @@ export interface Theme { export interface CustomTheme { colour?: Partial; font?: Partial; - [customProperty: string]: unknown; + [key: string]: unknown; } From 5d64c5be5f4e56d10a0518ec41e11b4debb35d88 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 20 May 2025 13:37:35 -0700 Subject: [PATCH 2/5] modifies CustomProperties to avoid unknown --- src/components/Theme/@types/component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Theme/@types/component.ts b/src/components/Theme/@types/component.ts index 94e8eb7e..b8e93e9e 100644 --- a/src/components/Theme/@types/component.ts +++ b/src/components/Theme/@types/component.ts @@ -47,8 +47,12 @@ export interface Theme { font: Font; } +export interface CustomProperties { + [key: string]: string | number | boolean | object | []; +} + export interface CustomTheme { colour?: Partial; font?: Partial; - [key: string]: unknown; + customProperties?: CustomProperties; } From 843e3d81bc1947e8bc453951cd81da6ab2c13aa2 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 20 May 2025 13:38:43 -0700 Subject: [PATCH 3/5] formats --- src/components/Theme/@types/component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Theme/@types/component.ts b/src/components/Theme/@types/component.ts index b8e93e9e..c771d653 100644 --- a/src/components/Theme/@types/component.ts +++ b/src/components/Theme/@types/component.ts @@ -50,7 +50,7 @@ export interface Theme { export interface CustomProperties { [key: string]: string | number | boolean | object | []; } - + export interface CustomTheme { colour?: Partial; font?: Partial; From 92c710ef5d145ad098ac749ab8d28ba099373870 Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Wed, 21 May 2025 09:48:30 +0100 Subject: [PATCH 4/5] allow unknown type on theme --- src/components/Theme/@types/component.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/Theme/@types/component.ts b/src/components/Theme/@types/component.ts index c771d653..7788d6b4 100644 --- a/src/components/Theme/@types/component.ts +++ b/src/components/Theme/@types/component.ts @@ -47,12 +47,8 @@ export interface Theme { font: Font; } -export interface CustomProperties { - [key: string]: string | number | boolean | object | []; -} - export interface CustomTheme { colour?: Partial; font?: Partial; - customProperties?: CustomProperties; + customProperties?: unknown; } From 49096d43a40657d4ea14c0ee1897c9abb2bf990b Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Wed, 21 May 2025 10:02:01 +0100 Subject: [PATCH 5/5] fix type --- src/components/Theme/@types/component.ts | 2 +- src/components/Theme/Theme.svelte | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Theme/@types/component.ts b/src/components/Theme/@types/component.ts index 7788d6b4..325faed0 100644 --- a/src/components/Theme/@types/component.ts +++ b/src/components/Theme/@types/component.ts @@ -50,5 +50,5 @@ export interface Theme { export interface CustomTheme { colour?: Partial; font?: Partial; - customProperties?: unknown; + [customProperty: string]: unknown; } diff --git a/src/components/Theme/Theme.svelte b/src/components/Theme/Theme.svelte index 8185c7e4..002dfcb7 100644 --- a/src/components/Theme/Theme.svelte +++ b/src/components/Theme/Theme.svelte @@ -14,7 +14,7 @@ import mergeThemes from './utils/merge.js'; // Types - import type { CustomTheme } from './@types/component'; + import type { CustomTheme, Theme } from './@types/component'; import type { Snippet } from 'svelte'; type Base = 'light' | 'dark'; @@ -22,7 +22,7 @@ /** Custom theme object. Can be a partial theme with just * what you want to change. */ - theme?: CustomTheme; + theme?: CustomTheme | Theme; /** * Base theme is one of `light` or `dark` and will be merged * with your custom theme to fill in any values you don't