@ucam/design-system
Version:
University of Cambridge Design System
26 lines (25 loc) • 748 B
TypeScript
import { Theme } from '../themes';
export interface ThemeUpdate {
/**
* The name of the theme that the user selected
*/
requestedThemeName: string | undefined;
/**
* The name of the currently rendered theme. This may not match the user selection.
* they might have selected "Browser Preference" which would either result in "Light" or "Dark"
*/
renderedThemeName: string;
/**
* The current theme
*/
theme: Theme;
/**
* Set the current theme (by name)
*/
setTheme: (themeName: string | undefined) => void;
}
/**
* A hook to get the current theme.
* Must be used inside a `<ThemeProvider />`
*/
export declare const useTheme: () => ThemeUpdate;