reablocks
Version:
Component library for React
23 lines (22 loc) • 906 B
TypeScript
/**
* Gets the theme name from the document element.
* @returns The theme name.
*/
export declare const getThemeName: () => string;
/**
* Observes class attribute changes on the document element to detect theme switching.
* @param callback - Function called with the new theme ("light" or "dark") whenever the theme changes.
* @returns The MutationObserver instance (can be disconnected later via observer.disconnect()).
*/
export declare const observeThemeSwitcher: (callback: (theme: string) => void) => MutationObserver;
/**
* Gets the theme variables from the document.
* @returns The theme variables.
*/
export declare const getThemeVariables: () => Record<string, string>;
/**
* Gets the theme variable from the document.
* @param variable - The variable to get the value of.
* @returns The value of the variable.
*/
export declare const getThemeVariable: (variable: string) => string;