UNPKG

@nopwdio/ui

Version:
56 lines (55 loc) 1.37 kB
import { LitElement } from "lit"; /** * Enum for theme states. * @readonly * @enum {string} */ declare enum State { DARK = "dark", LIGHT = "light", AUTO = "auto" } /** * `ui-darkmode` is a custom element that allows users to switch between light, dark, and system themes. * * @element ui-darkmode */ export declare class UiDarkMode extends LitElement { /** * The current theme state. * @type {State} */ state: State; /** * Called when the element is added to a document. * @returns {void} */ connectedCallback(): void; /** * Gets the preferred theme from local storage or system preference. * @returns {State} The preferred theme state. */ getPreferedTheme(): State; /** * Sets the theme and dispatches a custom event with the theme state. * @param {State} state - The theme state to set. * @returns {void} */ setTheme(state: State): void; /** * Renders the content of the element. * @returns {import('lit').TemplateResult} */ render(): import("lit-html").TemplateResult<1>; /** * Styles for the `ui-darkmode` element. * @type {import('lit').CSSResult[]} */ static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ui-darkmode": UiDarkMode; } } export {};