import { Theme } from "../types/theme.js"; import React from "react"; //#region src/hooks/useTheme.d.ts /** * Higher-Order Component (HoC) for managing theme application at the root level. * * This HoC is used to control the theme for the Root component, ensuring proper * theme management throughout the application. It's an alternative to using * React Context, which is the current best practice, but we've chosen a different * approach here with global state management. * * Wrapping a component in this HoC will ensure that the theme is applied to the * element of the page, so this HoC should be used for the Root component * only. * * The HoC: * 1. Retrieves the current theme ID from the global app store using useThemeIdAndSetter. * 2. Retrieves the list of available themes from plugin metadata using usePluginMeta. * 3. Uses an effect to find the selected or default theme and apply it using the utility function. * 4. Wraps the provided component, passing through all props. * * @param Component - The React component to be wrapped. * @returns A new component with theme management capabilities. */ /** * Hook to get the currently selected theme ID and the setter function. * This hook directly uses the UI store. */ declare const useThemeIdAndSetter: () => { setTheme: (theme: string) => void; theme: string; }; /** * Hook to get the full Theme object based on the selected theme ID and available themes from meta. */ declare const useTheme: () => Theme | undefined; declare const withTheme:
(Component: React.ComponentType
) => (props: P) => React.JSX.Element; //#endregion export { useTheme, useThemeIdAndSetter, withTheme }; //# sourceMappingURL=useTheme.d.ts.map