import type { ThemeConfig, ThemeColorScheme, DensityType } from '../types'; import type { ThemeBuilder } from './builder'; interface HotInstance { guid: string; rootDocument: Document; rootWrapperElement: HTMLElement; rootPortalElement: HTMLElement; stylesHandler: { clearCache(): void; }; render(): void; runHooks(hookName: string, ...args: unknown[]): void; themeManager: ThemeManager | null | undefined; [key: string]: unknown; } /** * Per-instance theme overrides applied on top of the theme configuration. * * They let a single grid pick a color scheme and a density without declaring its own theme, leaving * the shared theme object (and therefore every other grid using it) untouched. */ export interface ThemeOverrides { colorScheme?: ThemeColorScheme; density?: DensityType; } /** * Unvalidated theme overrides as they arrive from the grid settings. * * The values are `unknown` because the settings object is an external boundary — `setOverrides()` * validates them and throws on an unsupported value. */ export interface ThemeOverridesInput { colorScheme?: unknown; density?: unknown; } /** * Checks whether an override value means "use the theme value". * * `undefined` is the documented way to clear an override, and the other empty values are treated * the same so a framework wrapper passing `null` or `''` for an unset prop clears rather than * fails. Exported so the settings layer applies exactly the same rule. * * @param {*} value The raw override value. * @returns {boolean} `true` when the value clears the override. */ export declare function isThemeOverrideEmpty(value: unknown): boolean; /** * ThemeManager class provides methods to manage the theme styles. * * @class ThemeManager */ export declare class ThemeManager { #private; /** * The Handsontable instance. * * @type {Handsontable} */ hot: HotInstance; /** * The theme styles element. * * @type {HTMLStyleElement} */ themeStyles: HTMLStyleElement | null; /** * The theme class name. * * @type {string} */ themeClassName: string; /** * The theme config. * * @type {object} */ themeConfig: ThemeConfig | null; /** * Class that scopes the per-instance override rules to this grid only. Stamped on the wrapper and * the portal element, so menus and dialogs rendered in the portal follow the same overrides. * * @type {string} */ scopeClassName: string; /** * The theme manager constructor. * * @param {object} options - The options object. * @param {Handsontable} options.hot - The Handsontable instance. * @param {object} options.themeObject - The theme object. * @param {object} [options.overrides] - The per-instance color scheme and density overrides. */ constructor({ hot, themeObject, overrides }: { hot: HotInstance; themeObject: ThemeBuilder; overrides?: ThemeOverridesInput; }); /** * Gets the theme class name. * * @returns {string} The theme class name. */ getClassName(): string; /** * Gets the per-instance color scheme and density overrides. * * @returns {object} A copy of the currently applied overrides. */ getOverrides(): ThemeOverrides; /** * Gets the color scheme this grid renders with, taking the per-instance override into account. * * @returns {string|undefined} The color scheme ('light', 'dark', or 'auto'). */ getColorScheme(): ThemeColorScheme | undefined; /** * Gets the density type this grid renders with, taking the per-instance override into account. * * @returns {string|undefined} The density type ('default', 'compact', or 'comfortable'). */ getDensityType(): DensityType | undefined; /** * Applies per-instance color scheme and density overrides and re-injects the theme styles. * * The shared theme object is never mutated, so other grids using the same theme keep their look. * * @param {object} overrides The color scheme and density overrides. An `undefined` value clears * the given override and falls back to the theme configuration. * @returns {boolean} `true` when the effective overrides changed and the styles were re-injected. */ setOverrides(overrides: ThemeOverridesInput): boolean; /** * Updates the theme manager. * * @param {object} themeObject - The theme object. */ update(themeObject: ThemeBuilder): void; /** * Mounts the theme manager. */ mount(): void; /** * Unmounts the theme manager. */ unmount(): void; /** * Destroys the theme manager. */ destroy(): void; } /** * Creates a new ThemeManager instance. * * @param {object} options - The options object. * @param {Handsontable} options.hot - The Handsontable instance. * @param {object} options.themeObject - The theme object. * @param {object} [options.overrides] - The per-instance color scheme and density overrides. * @returns {ThemeManager} The ThemeManager instance. */ export declare function createThemeManager({ hot, themeObject, overrides }: { hot: HotInstance; themeObject: ThemeBuilder; overrides?: ThemeOverridesInput; }): ThemeManager; export {};