diff --git a/index.ts b/index.ts index 463cb39..ed4f848 100644 --- a/index.ts +++ b/index.ts @@ -10,7 +10,14 @@ export function load_theme(name: string) { return null; } - return structuredClone(require(`./themes/${name}/theme.json`)); + const theme = require(`./themes/${name}/theme.json`); + validate_theme(theme); + + return structuredClone(theme); +} + +export function validate_theme(theme: unknown) : asserts theme is ColorTheme { + // todo: validate } export type ColorThemeLabel