@helpwave/hightide
Version:
helpwave's component and theming library
28 lines (25 loc) • 1.11 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as react from 'react';
import { Dispatch, SetStateAction, PropsWithChildren } from 'react';
import { TranslationPlural, Translation } from '../localization/useTranslation.mjs';
import '../localization/util.mjs';
declare const themes: readonly ["light", "dark", "system"];
type ThemeType = typeof themes[number];
type ThemeTypeTranslation = Record<ThemeType, string> & {
theme: TranslationPlural;
};
declare const ThemeUtil: {
themes: readonly ["light", "dark", "system"];
translation: Translation<ThemeTypeTranslation>;
};
type ThemeContextType = {
theme: ThemeType;
setTheme: Dispatch<SetStateAction<ThemeType>>;
};
declare const ThemeContext: react.Context<ThemeContextType>;
type ThemeProviderProps = {
initialTheme?: ThemeType;
};
declare const ThemeProvider: ({ children, initialTheme }: PropsWithChildren<ThemeProviderProps>) => react_jsx_runtime.JSX.Element;
declare const useTheme: () => ThemeContextType;
export { ThemeContext, ThemeProvider, type ThemeType, type ThemeTypeTranslation, ThemeUtil, useTheme };