import type { IEventDetail } from '@breadstone/mosaik-elements'; import type { ITheme, ThemeMode, ThemeScheme, ThemeSemantic } from '@breadstone/mosaik-themes'; /** * Represents a provider that can supply theme information. * This abstraction allows ThemeService to work with theme providers * without knowing their concrete implementation (e.g., Theme2Element). * * @public */ export interface IThemeProvider extends HTMLElement { /** * Gets the optional theme name for scoped theme management. * Providers with the same name share theme state. * Providers without a name (null) share the global/default theme state. */ readonly name: string | null; /** * Gets the current theme from this provider. */ readonly theme: ITheme | null; /** * Gets whether this provider applies CSS variables globally to the document. * When true, CSS variables are set both on this element and globally. * When false (default), CSS variables are set only on this element. */ readonly global: boolean; /** * Applies the complete theme. * Called by ThemeService to update the provider's internal state. * The provider should NOT set CSS variables - ThemeService handles that. * * @param theme The theme to apply. */ applyTheme(theme: ITheme): void; /** * Applies the scheme (light/dark mode color roles) from the theme. * Called by ThemeService to update the provider's internal state. * * @param scheme The scheme to apply. */ applyScheme(scheme: ITheme['scheme']): void; /** * Applies the color palette from the theme. * Called by ThemeService to update the provider's internal state. * * @param palette The palette to apply. */ applyPalette(palette: ITheme['palette']): void; /** * Applies the font family from the theme. * Called by ThemeService to update the provider's internal state. * * @param fontFamily The font family to apply. */ applyFontFamily(fontFamily: ITheme['fontFamily']): void; /** * Applies the typography settings from the theme. * Called by ThemeService to update the provider's internal state. * * @param typography The typography to apply. */ applyTypography(typography: ITheme['typography']): void; /** * Applies the layout settings from the theme. * Called by ThemeService to update the provider's internal state. * * @param layout The layout to apply. */ applyLayout(layout: ITheme['layout']): void; /** * Applies the elevation (shadow) settings from the theme. * Called by ThemeService to update the provider's internal state. * * @param elevation The elevation to apply. */ applyElevation(elevation: ITheme['elevation']): void; } /** * Represents the event detail for theme-related events. * * @public */ export interface IThemeEventDetail extends IEventDetail { readonly theme?: ITheme; readonly scheme?: ITheme['scheme'] | Partial; readonly palette?: ITheme['palette'] | Partial; readonly mode?: ThemeMode; readonly name?: string | null; } /** * Represents the options for setting a CSS variable. * * @public */ export interface ISetCssVariableOptions { /** * The target element to set the CSS variable on. * If not provided, only global styles will be applied. */ readonly element?: HTMLElement; /** * Whether to apply the variable globally to the document. * @default true */ readonly applyGlobally?: boolean; } /** * Represents options for theme application methods. * * @public */ export interface IThemeApplyOptions { /** * Whether to notify registered providers about the change. * Set to false when the call originates from a provider to avoid infinite loops. * @default true */ readonly notifyProviders?: boolean; } /** * Represents the configuration options for the `ThemeService`. * * @public */ export interface IThemeServiceConfig { /** * The unique ID for the global style element. * * @default 'mosaik-theme-vars' */ readonly styleId?: string; /** * Whether to automatically initialize the service on first access. * * @default true */ readonly autoInitialize?: boolean; /** * The default theme to use as a fallback when no theme is set. * This is reflected on the document element as `theme` attribute. * * @default undefined */ readonly defaultTheme?: ITheme; /** * The default theme mode to apply during initialization. * This is reflected on the document element as `theme-mode` attribute. * * @default 'light' */ readonly defaultThemeMode?: ThemeMode; } /** * The default configuration for the `ThemeService`. * * @public */ export declare const THEME_SERVICE_DEFAULT_CONFIG: IThemeServiceConfig; //# sourceMappingURL=IThemeService.d.ts.map