import * as i0 from '@angular/core'; import { InjectionToken, Signal, EnvironmentProviders } from '@angular/core'; /** Density scale. Components multiply their paddings by the matching multiplier. */ type WrDensityValue = 'sm' | 'md' | 'lg' | 'touch'; /** Configuration for {@link WrDensityValueService}. */ interface WrDensityConfig { /** Initial density used when no persisted value is present. @default 'md' */ readonly defaultDensity: WrDensityValue; /** Storage key for persistence (via `WrStorage`). Set to `null` to disable. @default 'wr-density' */ readonly storageKey: string | null; /** Attribute written to `` to expose the active density. @default 'data-wr-density' */ readonly attribute: string; } /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ declare const DEFAULT_WR_DENSITY_CONFIG: WrDensityConfig; declare const WR_DENSITY_CONFIG: InjectionToken; /** * Global density scale. Writes `[data-wr-density]` on `` so the * stylesheet's density-scoped CSS-variable rules apply, then components * pick up the new multipliers without re-rendering. * * - **Per-subtree override** — drop `[wrDensity]` on any element; its * descendants read the override instead of the global value. * - **Persisted** via {@link WrStorage} (swap the engine globally if you * need a different store). * * @example * ```ts * const density = inject(WrDensity); * density.set('sm'); * density.current(); // 'sm' * ``` * * @see https://ngwr.dev/services/density */ declare class WrDensity { private readonly doc; private readonly storage; private readonly config; /** Active density. */ readonly current: Signal; private readonly _current; constructor(); /** Switch the active density. Ignores unknown values. */ set(density: WrDensityValue): void; /** Cycle sm → md → lg → touch → sm … */ cycle(): void; private readPersisted; private persist; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Scope a density override to a subtree. Writes the same `data-*` * attribute the global service writes — but on the host instead of * `` — so the CSS-variable scope rules cascade only to descendants. * * @example * ```html * * * ``` */ declare class WrDensityDirective { /** Density to apply to this subtree. */ readonly wrDensity: i0.InputSignal; private readonly host; private readonly config; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** Configure {@link WrDensity}. All fields optional — merged with defaults. */ declare function provideWrDensity(config?: Partial): EnvironmentProviders; export { DEFAULT_WR_DENSITY_CONFIG, WR_DENSITY_CONFIG, WrDensity, WrDensityDirective, provideWrDensity }; export type { WrDensityConfig, WrDensityValue };