@rfkit/theme
Version:
A flexible light/dark theme switching library supporting custom theme configuration, dynamic switching, and responsive design
33 lines • 995 B
TypeScript
import { ThemeType, type ThemeConfigs } from './types';
export declare const media: MediaQueryList;
export declare const useMediaTheme: () => ThemeType;
export declare const getCurrentThemeMode: () => any;
/**
* 获取当前主题
*/
export declare const getCurrentTheme: (mode?: boolean) => ThemeType;
/**
* 初始化主题
*/
export declare function initTheme({ subscribeThemeChange, config, theme, mode, }: {
config?: ThemeConfigs;
theme?: ThemeType;
mode?: boolean;
subscribeThemeChange?: (e: {
theme: ThemeType;
mode: boolean;
}) => void;
}): ThemeType;
/**
* 切换主题(深色/浅色)
*/
export declare const toggleTheme: () => ThemeType;
/**
* 切换主题模式(跟随系统/手动设置)
*/
export declare const toggleThemeMode: (mode?: boolean) => boolean;
export declare const initMediaThemeChange: (subscribeThemeChange: (e: {
theme: ThemeType;
mode: boolean;
}) => void) => () => void;
//# sourceMappingURL=core.d.ts.map