webdev-power-kit
Version:
A powerful toolkit that simplifies access to browser features like clipboard, notifications, battery, vibration, and more — perfect for modern web developers.
16 lines (15 loc) • 541 B
TypeScript
/**
* Checks if user's OS prefers dark mode.
* @returns boolean - true if dark mode is preferred
*/
export declare function isDarkMode(): boolean;
/**
* Toggle dark mode by adding/removing a class on <html>.
* @param className Optional CSS class to toggle (default: "dark")
*/
export declare function toggleDarkMode(className?: string): void;
/**
* Subscribe to changes in system theme (dark/light).
* @param callback Function triggered on change
*/
export declare function onThemeChange(callback: (isDark: boolean) => void): void;