import * as i0 from '@angular/core'; import { Signal } from '@angular/core'; /** Public state of the loading bar. */ type WrLoadingState = 'idle' | 'running' | 'completing'; /** * @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 */ /** * Singleton state machine for a top-of-page progress indicator. Driven * by router events out of the box, plus a manual `start()` / `complete()` * API for HTTP-interceptor-style usage. * * Pair with `` to render the bar at the top of your shell. * * @example * ```ts * // From an HttpInterceptor: * const bar = inject(WrLoadingBar); * bar.start(); * return next(req).pipe(finalize(() => bar.complete())); * ``` * * @see https://ngwr.dev/services/loading-bar */ declare class WrLoadingBar { private readonly router; /** Live count of pending "tasks" (manual + router). */ private readonly count; /** Tween value `[0, 1]` — the bar's actual width. */ private readonly _progress; readonly progress: Signal; readonly state: Signal; private timer; constructor(); /** Reserve a slot. The bar starts trickling as long as `count > 0`. */ start(): void; /** Release a slot. When the last one closes, the bar fast-forwards to 100% then resets. */ complete(): void; /** Cancel without animating the bar to 100%. Resets immediately. */ reset(): void; private beginTrickle; private stopTrickle; private finish; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Thin progress bar fixed to the top of the viewport. * * Drop one at the root of your shell. Reads the singleton {@link WrLoadingBar} * — every router navigation drives it automatically; HTTP interceptors * can call `start()` / `complete()` to add their own slots. * * @example * ```html * * * ``` */ declare class WrLoadingBarComponent { /** Bar colour. Defaults to the primary brand colour. */ readonly color: i0.InputSignal; /** Bar height. */ readonly height: i0.InputSignal; protected readonly bar: WrLoadingBar; protected readonly active: i0.Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { WrLoadingBar, WrLoadingBarComponent }; export type { WrLoadingState };