import { Exception } from '@angularity/core'; import * as i0 from '@angular/core'; import { ProviderToken, Injector, EnvironmentProviders } from '@angular/core'; import { Observable } from 'rxjs'; /** * Name-value pairs that represent the small, repeated design decisions that make * up a design system's visual style. * @see https://m3.material.io/foundations/design-tokens/overview * @see `TokenBuilder` */ interface ThemeTokens { [name: string]: string; } /** * Registry for active theme tokens in the current application. * * On server, the tokens will be written to `TransferState`, and * can be later reused on browser via the `transfer` method. * * @remarks * By default, uses `InMemoryThemeTokenRegistry` * decorated with `WriteTokensToRootCssVariables`. */ declare abstract class ThemeTokenRegistry { /** * Retrieve the value of a theme token. * @param name the name of the theme token * @returns the value if registered, or `null` if not found */ abstract get(name: string): string | null; /** * Retrieve all theme tokens. * @returns copy of all theme tokens */ abstract getAll(): ThemeTokens; /** * Define a new value for a theme token. Duplicate defines overwrite the * previous value. * @param name the name of the theme token * @param value new value for the theme token */ abstract set(name: string, value: string | null): void; /** * Define all theme tokens, replacing all existing tokens. * @param tokens new theme tokens */ abstract setAll(tokens: ThemeTokens): void; /** * Transfer theme tokens from `TransferState` to this registry, * if `TransferState` is available and contains theme tokens. * This will clear all existing tokens in this registry. * @returns `true` if tokens are transferred, `false` otherwise */ abstract transfer(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Exception thrown when a theme token is not found in the registry. */ declare class ThemeTokenNotFoundException extends Exception { constructor(name: string); } /** * Implementation of `ThemeTokenRegistry` that * stores theme tokens in memory. */ declare class InMemoryThemeTokenRegistry implements ThemeTokenRegistry { #private; constructor(); get(name: string): string | null; getAll(): ThemeTokens; set(name: string, value: string | null): void; setAll(tokens: ThemeTokens): void; transfer(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Decorator of `ThemeTokenRegistry` that * writes theme tokens to the root element as CSS variables. * * - On server, the tokens will be written to * the root element's style properties as CSS variables. * - On modern browser, the tokens will be written to * a constructed `CSSStyleSheet` object adopted by the document. * - On legacy browser, the tokens will be written to * a `