import { DarkModeStrategy, Engine, NibConfig } from '@nibcss/core'; /** Where the manual light/dark choice is kept, for `darkMode: "class"`. */ declare const DARK_STORAGE_KEY = "nib-dark"; /** * The same decision as `resolveInitial()`, as a string to inline in ``. * * `html.dark` is added by the runtime, which cannot run before the document * exists — so a server-rendered page in dark mode painted light first and * turned dark a moment later. On a reload that is a white flash in a dark app, * and the one thing a stylesheet cannot fix: the class has to be there before * the first paint. * * Kept tiny and `try`-wrapped, because it runs blocking, before anything else, * in whatever state the browser is in — private mode, storage blocked, no * `matchMedia`. */ declare function darkModeBootScript(): string; /** * Toggles the `.dark` class on `` for the `"class"` strategy. * Persists the choice and falls back to the OS preference. * A no-op (but safe to call) for `"media"` / `false` / non-browser. */ declare class DarkModeController { private strategy; private mql; private onSystem; constructor(strategy: DarkModeStrategy); private active; private systemPrefersDark; private readStored; private resolveInitial; private apply; /** * Whether dark rules are in effect right now. * * Under `"media"` that is the OS preference, not `html.dark`: the generated * CSS is inside `@media (prefers-color-scheme: dark)`, so the page really is * dark while the class is absent. Reading only the class made * `NibService.isDark` always answer `false` under `"media"`, and a template * showing a sun or a moon from it showed the wrong one. */ isDark(): boolean; enable(): void; disable(): void; /** * Flip the class, when there is a class to flip. * * A no-op under `"media"` and `false` — every one of these used to write * `html.dark` whatever the strategy said. `darkMode: false` therefore looked * like it did nothing at all: NibCSS dropped its own `dark:` rules, as asked, * but a project's hand-written `html.dark body { … }` still fired on the * class the toggle had just added, so the page still went dark. */ toggle(): boolean; /** Forget the manual choice and follow the OS again. */ useSystem(): void; setStrategy(strategy: DarkModeStrategy): void; private persist; destroy(): void; } interface RuntimeOptions extends NibConfig { /** * Where to scan and observe. Default: `document.documentElement`, so the * runtime can start from a `` * 3. `data-nib-*` attributes on the loading `