/** * `'dark'` adds the dark class. `'light'` removes it. */ export type SpdsColorScheme = 'light' | 'dark'; /** * Adds or removes the dark class on `document.documentElement`. Repeated calls with the same value do not change the * class list. Other classes on the element are left in place. Does nothing when `window` or `document` is missing, * and does nothing for a value other than `'light'` or `'dark'`. Does not read or write storage. * * Pass an explicit scheme to force light or dark. To follow `prefers-color-scheme`, call `listenToColorSchemeChange` * and do not also call this function. If both run, the later call wins. * * PrimeNG emits `color-scheme: light` on the light root block and `color-scheme: dark` under the configured dark * selector. This function does not write a `color-scheme` rule. * @param colorScheme `'dark'` adds the dark class. `'light'` removes it. Any other runtime value is ignored. */ export declare function applySpdsColorScheme(colorScheme: SpdsColorScheme): void; /** * Reads `prefers-color-scheme` and reports the effective scheme. Reports the current match immediately, then * subscribes to `change`. By default it keeps the SPDS dark class in sync; callers can provide a callback when they * own the DOM effects. Returns a function that removes that subscription. Calling the returned function more than * once is safe. Each call adds its own listener. * * Inside an embedded document, the query follows the embedding page's used `color-scheme` in Firefox 105+ and * Chromium 129+ (Chrome, Edge, Opera, and current Samsung Internet). In Safari, including Safari 27.2, the query * follows the operating-system preference rather than live changes from the embedding page. * * Callers that need the embedding page's scheme in every supported browser should receive that scheme from the * embedding page and pass it to `applySpdsColorScheme`. * * Does nothing and returns a no-op disposer when `window`, `document`, or `matchMedia` is missing. Does not read or * write storage. * @param onChange Receives the current scheme and later changes. Defaults to applying the SPDS dark class. * @returns A function that removes this call's listener. A second call does nothing. */ export declare function listenToColorSchemeChange(onChange?: (colorScheme: SpdsColorScheme) => void): () => void; //# sourceMappingURL=color-scheme.d.ts.map