/** * Reads the theme declared on `root`. Without the attribute the theme is light. * * @param {Element} [root] Element carrying `data-iv-theme`. * @returns {ThemeSetting} The declared theme. */ export function getTheme(root?: Element): ThemeSetting; /** * Resolves the effective theme, following the operating system when the * declared theme is `system`. * * @param {Element} [root] Element carrying `data-iv-theme`. * @returns {ResolvedTheme} `light` or `dark`. */ export function resolveTheme(root?: Element): ResolvedTheme; /** * Sets the theme on `root`, optionally persisting it, and dispatches * `iv:themechange` on `document`. * * @param {ThemeSetting} theme Theme to apply. * @param {{ root?: Element, persist?: boolean, storageKey?: string }} [options] Options. * @returns {ResolvedTheme} The resolved theme after applying. * @throws {IvError} `invalid-option` when `theme` is not valid. */ export function setTheme(theme: ThemeSetting, options?: { root?: Element; persist?: boolean; storageKey?: string; }): ResolvedTheme; /** * Applies the persisted theme, when there is a valid one. * * @param {{ root?: Element, storageKey?: string }} [options] Options. * @returns {ThemeSetting|null} The applied theme, or `null` when nothing was applied. */ export function restoreTheme(options?: { root?: Element; storageKey?: string; }): ThemeSetting | null; export type ThemeSetting = "light" | "dark" | "system"; export type ResolvedTheme = "light" | "dark";