theme.ts
ThemeColors
interface
Theme color configuration.
ThemeLayout
interface
Theme layout configuration.
ThemeFonts
interface
Theme font configuration.
ThemeHeader
interface
Theme header configuration.
ThemeFooter
interface
Theme footer configuration.
SocialLinks
interface
Social links configuration.
ThemeSlots
interface
Theme slots for injecting custom HTML.
ThemeConfig
interface
Complete theme configuration.
ResolvedThemeConfig
interface
Resolved theme configuration (after merging with defaults).
deepMerge
function
Deep merge two objects.
Returns
T -
defineTheme
function
Defines a theme configuration with type checking.
export function defineTheme(config: ThemeConfig): ThemeConfig
Returns
ThemeConfig -
Examples
const myTheme = defineTheme({
extends: defaultTheme,
colors: {
primary: '#3498db',
},
footer: {
copyright: '2025 My Company',
},
});
mergeThemes
function
Merges multiple theme configurations. Later themes override earlier ones.
export function mergeThemes(...themes: ThemeConfig[]): ThemeConfig
Returns
ThemeConfig -
Examples
const merged = mergeThemes(defaultTheme, customTheme, overrides);
resolveTheme
function
Resolves a theme configuration by merging with its extends chain and defaults.
export function resolveTheme(config?: ThemeConfig): ResolvedThemeConfig
Returns
ResolvedThemeConfig -
themeToNapi
function
Converts resolved theme to the format expected by Rust NAPI.
export function themeToNapi(theme: ResolvedThemeConfig): NapiThemeConfig
Returns
NapiThemeConfig -
NapiThemeColors
interface
NAPI-compatible theme colors type.
NapiThemeFonts
interface
NAPI-compatible theme fonts type.
NapiThemeLayout
interface
NAPI-compatible theme layout type.
NapiThemeHeader
interface
NAPI-compatible theme header type.
NapiThemeFooter
interface
NAPI-compatible theme footer type.
NapiSocialLinks
interface
NAPI-compatible social links type.
NapiThemeSlots
interface
NAPI-compatible theme slots type.
NapiThemeConfig
interface
NAPI-compatible theme configuration type.