import { type ComponentType, type ReactNode } from "react"; import { type ITheme } from "@gooddata/sdk-model"; /** * @public */ export type ThemeStatus = "pending" | "loading" | "success"; /** * @public */ export interface IThemeContextProviderProps { /** * Theme object contains properties to be used instead of default ones. * When undefined, no theme is applied and default styling is used. */ theme: ITheme | undefined; /** * Theme of record for computations that must not depend on application-specific * presentation adjustments (e.g. a stripped complementary palette). * * @remarks * When undefined, the reference from an enclosing provider is inherited, * falling back to the theme itself. */ referenceTheme?: ITheme; /** * Flag telling whether the theme object is being loaded or not * @deprecated use themeStatus instead * */ themeIsLoading: boolean; /** * Status telling whether the theme object is being loaded or not * Started in pending state, then switches to loading and finally to success * Can skip loading if theme does not have to be loaded from backend * */ themeStatus?: ThemeStatus; /** * Whether the theme object comes from ScopedThemeProvider */ isScopeThemed?: boolean; /** * React children */ children?: ReactNode; } /** * Provides the theme object, themeIsLoading flag and themeStatus into context * * @public */ export declare function ThemeContextProvider({ children, theme, referenceTheme, themeIsLoading, themeStatus, isScopeThemed }: IThemeContextProviderProps): import("react/jsx-runtime").JSX.Element; /** * Hook for reaching the theme from context. * * @remarks * You can optionally set a theme override that will be returned if defined. * This makes the usage more ergonomic (see the following example). * * @example * ``` * // instead of * const fromContext = useTheme(); * const effectiveTheme = fromArguments ?? fromContext. * // you can write * const theme = useTheme(fromArguments); * ``` * * @param theme - theme to use instead of context value. If undefined, the context value is used. * @public */ export declare const useTheme: (theme?: ITheme | undefined) => ITheme | undefined; /** * Hook for reaching the reference theme from context. * * @remarks * The reference theme is the workspace theme prepared with the complementary palette enabled, * regardless of how the application presents itself. Use it for computations that must be * consistent across applications (e.g. color derivation); use {@link useTheme} for presentation. * * @public */ export declare const useReferenceTheme: () => ITheme | undefined; /** * Hook that returns whether the current theme is dark * * @public */ export declare const useIsDarkTheme: () => boolean; /** * Hook for reaching the themeIsLoading flag from context * * @public */ export declare const useThemeIsLoading: () => boolean | undefined; /** * Hook for reaching the themeStatus from context * * @public */ export declare const useThemeStatus: () => ThemeStatus | undefined; /** * Hook for reaching the isScopeThemed flag from context * * @internal */ export declare const useIsScopeThemed: () => boolean | undefined; /** * @internal */ export declare function withThemeObject(Component: ComponentType): ComponentType>; /** * @internal */ export declare function withThemeIsLoading(Component: ComponentType): ComponentType>; /** * @internal */ export declare function withThemeStatus(Component: ComponentType): ComponentType>; /** * Injects both theme object and isThemeLoading flag into component as properties * * @public */ export declare function withTheme(Component: ComponentType): ComponentType>; //# sourceMappingURL=Context.d.ts.map