From 38f8858426d63b283ae20131e82a9ad7dab3c8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krystian=20Droz=CC=87dz=CC=87yn=CC=81ski?= Date: Thu, 24 Oct 2024 17:25:06 +0200 Subject: [PATCH] Fix `DefaultTheme` interface --- .changeset/two-mangos-attack.md | 5 +++++ packages/core/src/constructor.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/two-mangos-attack.md diff --git a/.changeset/two-mangos-attack.md b/.changeset/two-mangos-attack.md new file mode 100644 index 0000000..0b05d3e --- /dev/null +++ b/.changeset/two-mangos-attack.md @@ -0,0 +1,5 @@ +--- +"@teiler/core": patch +--- + +Fix `DefaultTheme` interface diff --git a/packages/core/src/constructor.ts b/packages/core/src/constructor.ts index b0893af..efdada6 100644 --- a/packages/core/src/constructor.ts +++ b/packages/core/src/constructor.ts @@ -5,14 +5,16 @@ import type { Pattern } from './pattern' import hash from './hash' import { compile, transpile } from './css' -type DefaultTheme = {} +interface DefaultTheme { + [key: string]: unknown +} type Arguments = { theme: DefaultTheme } & Props type CSS = { styles: Style[]; id: string; __css__: true } -type Expression = (props: Arguments) => string | boolean | CSS +type Expression = (props: Arguments) => string | boolean | undefined | CSS type Raw = string | number type Properties = Expression | StyleDefinition | Pattern | TeilerComponent | Raw type Style = [string[], Properties[]]