@mayank1513/nthul
Version:
Unleash the Power of React Server Components! Use multiple themes on your site with confidence, without losing any advantages of React Server Components.
16 lines (15 loc) • 666 B
TypeScript
import type { ColorSchemePreference } from "../constants";
export interface UseTheme {
theme: string;
colorSchemePreference: ColorSchemePreference;
systemColorScheme: "dark" | "light";
resolvedColorScheme: "dark" | "light";
setColorSchemePreference: (colorSchemePreference: ColorSchemePreference) => void;
setTheme: (theme: string) => void;
}
/**
* use this hook to gain access to theme state and setters from your components.
* @param targetId - targetId corresponding to `ThemeSwitcher` and others tied to specific container.
* @returns themeState and setter fucntions
*/
export declare const useTheme: (targetId?: string) => UseTheme;