import * as _angular_core from '@angular/core'; import { InjectionToken, Signal, Provider } from '@angular/core'; import * as forty_cdk_progress from 'forty-cdk/progress'; /** State of a progress bar reflected on `data-state`. */ type ForProgressState = 'indeterminate' | 'loading' | 'complete'; /** Shape exposed to descendant pieces (the indicator). */ interface ForProgressContext { /** Raw value as written by the consumer, or `null` when indeterminate. */ readonly value: Signal; /** Value clamped to `[0, max]`, or `null` when indeterminate. Use this for any visual / ARIA reflection. */ readonly clampedValue: Signal; /** Current max as written by the consumer. */ readonly max: Signal; /** * `max` clamped to a strictly positive value, used for every ARIA / visual * reflection. Descendant pieces mirror this instead of the raw {@link max} * so root and indicator never diverge for a non-positive `max`. */ readonly effectiveMax: Signal; /** `null` when indeterminate; otherwise `0..100`. */ readonly percentage: Signal; /** * {@link percentage} rounded to two decimals for the `data-percentage` * reflection, or `null` when indeterminate. Owned by the root so the * indicator mirrors it instead of re-implementing the rounding. */ readonly percentageAttr: Signal; /** Logical state, mirrored on `data-state`. */ readonly state: Signal; } declare const FOR_PROGRESS_CONTEXT: InjectionToken; /** * Headless progress bar. Implements the * [WAI-ARIA progressbar role](https://www.w3.org/TR/wai-aria-1.2/#progressbar) * for tasks whose completion is communicated visually. * * `value === null` puts the bar in **indeterminate** mode (no `aria-valuenow`). * Use it for "loading…" states whose duration cannot be predicted. Otherwise * pass a number in `[0, max]`; values outside the range are clamped before * being reflected. * * The directive only handles state and ARIA. The visual fill is up to the * consumer — see `ForProgressIndicator`. * * @example * ```html *
*
*
* *
*
*
* ``` */ declare class ForProgress implements ForProgressContext { #private; /** * Current progress in `[0, max]`, or `null` for the indeterminate state. * One-way `[value]` input: a progress bar is display-only and reports no * interactive value, so it exposes no two-way binding. Values outside the * range are clamped for ARIA; the input retains the raw value. */ readonly value: _angular_core.InputSignal; /** Maximum value. Defaults to `100` (so a raw value reads as a percentage). */ readonly max: _angular_core.InputSignal; /** * `max` clamped to a strictly positive value. `progressbar` requires * `aria-valuemax` to exceed `aria-valuemin` (which is fixed at `0` here), so a * non-positive `max` would reflect invalid ARIA. Mirrors the way `ForMeter` * keeps `max >= min`; here the floor is `1` so the reflected range is always * valid and the percentage math has a non-zero denominator. */ readonly effectiveMax: _angular_core.Signal; /** * Optional override for `aria-valuetext`. Useful for non-percentage * progress (e.g. `"Step 3 of 5"`, `"42 MB of 200 MB"`). Receives the * clamped value and the effective max (the configured max sanitized to * `>= 1`). */ readonly getValueLabel: _angular_core.InputSignal<((value: number, max: number) => string) | null>; /** * Accessible name for the progressbar. Defaults to `null`, emitting no * `aria-label`; prefer a visible label referenced via `aria-labelledby` when * one exists. */ readonly ariaLabel: _angular_core.InputSignal; protected readonly resolvedAriaLabel: _angular_core.Signal; /** * When true, transitions to `value === max` are announced once via the * live announcer using the current `aria-valuetext` (or the scope's * `completeAnnouncement` string when none). Repeated transitions to the * same complete state do not re-fire. Both the enablement and the announced * string default to `provideForProgressDefaults` for the surrounding scope. */ readonly announceCompletion: _angular_core.InputSignalWithTransform; readonly clampedValue: _angular_core.Signal; readonly percentage: _angular_core.Signal; readonly state: _angular_core.Signal; readonly ariaValueText: _angular_core.Signal; readonly percentageAttr: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Visual fill paired with `[forProgress]`. Reflects `data-state` and * `data-percentage` so the consumer can drive width / transform from CSS. * * The directive does NOT set any visual style itself. Typical usage: * * ```css * [forProgressIndicator] { * width: 100%; * transform: translateX(calc(-100% + var(--for-progress-percentage, 0%))); * } * [forProgressIndicator][data-state="indeterminate"] { * animation: stripes 1s infinite linear; * } * ``` * * with the `--for-progress-percentage` custom property fed from `data-percentage`. */ declare class ForProgressIndicator { protected readonly context: forty_cdk_progress.ForProgressContext; protected percentageStyle(): string | null; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Defaults inherited by descendant progress bars in the surrounding injector * scope. Configure with `provideForProgressDefaults` either at the * application root or in any component's `providers` array; partial * overrides merge with the parent scope. */ interface ForProgressDefaults { /** * Whether to announce completion (or the label) once via `aria-live` on * the loading→complete transition. Opt-in — useful on flows where the * user explicitly waits for completion (uploads, submissions). */ announceCompletion: boolean; /** * String announced via `aria-live` on the loading→complete transition when * no `aria-valuetext` is available. A screen reader verbalizes it, so * override it per scope to localize the announcement; defaults to the * English `'Complete'`. */ completeAnnouncement: string; } /** Token holding the resolved progress defaults for the current scope. */ declare const FOR_PROGRESS_DEFAULTS: _angular_core.InjectionToken; /** * Configures forty-cdk progress defaults for this injector scope. Partial * overrides inherit unspecified keys from the parent scope (or library * defaults at the root). */ declare function provideForProgressDefaults(defaults?: Partial): Provider[]; export { FOR_PROGRESS_CONTEXT, FOR_PROGRESS_DEFAULTS, ForProgress, ForProgressIndicator, provideForProgressDefaults }; export type { ForProgressContext, ForProgressDefaults, ForProgressState };