stoop
Version:
CSS-in-JS library with type inference, theme creation, and variants support.
20 lines (19 loc) • 922 B
TypeScript
/**
* Theme Provider component.
* Manages theme state, localStorage persistence, and centralized theme variable updates.
*/
import { type ComponentType, type Context } from "react";
import type { ProviderProps, Theme, ThemeContextValue, ThemeManagementContextValue } from "../types";
/**
* Creates a Provider component for theme management.
*
* @param ThemeContext - Stoop's theme context for styled components
* @param themes - Map of theme names to theme objects
* @param defaultTheme - Default theme object
* @param prefix - Optional prefix for CSS variable scoping
* @returns Provider component and theme management context
*/
export declare function createProvider(ThemeContext: Context<ThemeContextValue | null>, themes: Record<string, Theme>, defaultTheme: Theme, prefix?: string): {
Provider: ComponentType<ProviderProps>;
ThemeManagementContext: Context<ThemeManagementContextValue | null>;
};