import { type AcEdUiTheme } from '@mlightcad/cad-simple-viewer'; import { AcDbDatabase } from '@mlightcad/data-model'; /** * Reads the UI theme from a host element's `data-ml-ui-theme` attribute. * * @param host - Viewer host element. * @returns `'light'`, `'dark'`, or `undefined` when unset or invalid. */ export declare function acuiReadUiThemeFromHost(host: HTMLElement): AcEdUiTheme | undefined; /** * Reads the UI theme from the drawing `COLORTHEME` system variable. * * @param database - Drawing database. */ export declare function acuiReadUiThemeFromDatabase(database: AcDbDatabase): AcEdUiTheme; /** * Keeps `data-ml-ui-theme` on the host in sync with `COLORTHEME` and document activation. */ export declare class AcUiThemeSync { private readonly host; private readonly onThemeChanged?; /** Applies theme when `COLORTHEME` changes on the active database. */ private handleSysVarChanged; /** Applies theme from a newly activated document's database. */ private handleDocumentActivated; /** * @param host - Element receiving `acedApplyUiTheme` and `data-ml-ui-theme`. * @param onThemeChanged - Optional callback after each theme application (e.g. toolbar refresh). */ constructor(host: HTMLElement, onThemeChanged?: (() => void) | undefined); /** Subscribes to sysvar and document events and performs an initial sync. */ start(): void; /** Unsubscribes from sysvar and document events. */ stop(): void; /** * Returns the theme currently applied on the host. * * Defaults to `'dark'` when the attribute is missing. */ getTheme(): AcEdUiTheme; /** * Sets the UI theme via `COLORTHEME` when a document is open, otherwise on the host. * * @param theme - Target light or dark theme. */ setTheme(theme: AcEdUiTheme): void; /** * Applies theme from the active document or existing host attribute on startup. */ private syncFromCurrentSource; /** * Calls {@link acedApplyUiTheme} and notifies {@link onThemeChanged}. * * @param theme - Theme to apply. */ private applyTheme; } //# sourceMappingURL=AcUiThemeSync.d.ts.map