import { default as React, Component } from 'react'; import { Theme, ThemeProviderProps } from './theme.types.js'; import { ThemeVariablesContext } from './themeVariablesContext.js'; interface State { resolvedVariables: Record; colorFadeActive: boolean; currentThemeColor: string | null; /** What `resolvedVariables` was resolved from, to tell a theme change from any other render. */ resolvedFrom: { themes: Theme[] | undefined; currentThemeId: string | undefined; }; } declare class ThemeProvider extends Component { static contextType: React.Context | null>; context: React.ContextType; state: State; private colorFadeTimeout; private wrapperRef; private themeColorMeta; private createdThemeColorMeta; static getDerivedStateFromProps(props: ThemeProviderProps, state: State): Partial | null; componentDidMount(): void; componentDidUpdate(prevProps: ThemeProviderProps, prevState: State): void; componentWillUnmount(): void; /** * Replaces the former react-helmet usage: keep a single * in sync with the active theme's primary colour. * Reuses a tag the host app already declares; otherwise creates its own * (and removes it again on unmount). */ private syncThemeColorMeta; /** `--primary-color` as the browser resolved it, which may be a `var()` of another variable. */ private readThemeColor; render(): React.JSX.Element; } export default ThemeProvider;