theme-o-rama
Version:
A TypeScript library for dynamic theme management in react + shadcn + tailwind applications
26 lines • 1.07 kB
TypeScript
import React from "react";
import { Theme } from "./index.js";
import { ImageResolver } from "./theme-loader.js";
export type ThemeDiscoveryFunction = () => Promise<Theme[]>;
export type ThemeChangeCallback = (themeName: string) => void;
interface ThemeContextType {
currentTheme: Theme | null;
setTheme: (themeName: string) => void;
setCustomTheme: (themeJson: string) => Promise<boolean>;
availableThemes: Theme[];
isLoading: boolean;
error: string | null;
reloadThemes: () => Promise<void>;
initializeTheme: (theme: Theme) => Promise<Theme>;
}
interface ThemeProviderProps {
children: React.ReactNode;
discoverThemes?: ThemeDiscoveryFunction;
imageResolver?: ImageResolver;
defaultTheme?: string;
onThemeChange?: ThemeChangeCallback;
}
export declare function ThemeProvider({ children, discoverThemes, imageResolver, defaultTheme, onThemeChange, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useTheme(): ThemeContextType;
export {};
//# sourceMappingURL=theme-context.d.ts.map