/** * @license Angular v19.2.4 * (c) 2010-2025 Google LLC. https://angular.io/ * License: MIT */ import { R as ReactiveNode, V as ValueEqualityFn, S as SIGNAL, a as SignalNode } from '../../weak_ref.d-Bp6cSy-X.js'; export { b as REACTIVE_NODE, c as Reactive, t as SIGNAL_NODE, u as SignalGetter, e as consumerAfterComputation, f as consumerBeforeComputation, g as consumerDestroy, h as consumerMarkDirty, i as consumerPollProducersForChange, v as createSignal, d as defaultEquals, j as getActiveConsumer, k as isInNotificationPhase, l as isReactive, p as producerAccessed, m as producerIncrementEpoch, n as producerMarkClean, o as producerNotifyConsumers, q as producerUpdateValueVersion, r as producerUpdatesAllowed, w as runPostSignalSetFn, s as setActiveConsumer, A as setAlternateWeakRefImpl, x as setPostSignalSetFn, y as signalSetFn, z as signalUpdateFn } from '../../weak_ref.d-Bp6cSy-X.js'; /** * A computation, which derives a value from a declarative reactive expression. * * `Computed`s are both producers and consumers of reactivity. */ interface ComputedNode extends ReactiveNode { /** * Current value of the computation, or one of the sentinel values above (`UNSET`, `COMPUTING`, * `ERROR`). */ value: T; /** * If `value` is `ERRORED`, the error caught from the last computation attempt which will * be re-thrown. */ error: unknown; /** * The computation function which will produce a new value. */ computation: () => T; equal: ValueEqualityFn; } type ComputedGetter = (() => T) & { [SIGNAL]: ComputedNode; }; /** * Create a computed signal which derives a reactive value from an expression. */ declare function createComputed(computation: () => T, equal?: ValueEqualityFn): ComputedGetter; type ComputationFn = (source: S, previous?: { source: S; value: D; }) => D; interface LinkedSignalNode extends ReactiveNode { /** * Value of the source signal that was used to derive the computed value. */ sourceValue: S; /** * Current state value, or one of the sentinel values (`UNSET`, `COMPUTING`, * `ERROR`). */ value: D; /** * If `value` is `ERRORED`, the error caught from the last computation attempt which will * be re-thrown. */ error: unknown; /** * The source function represents reactive dependency based on which the linked state is reset. */ source: () => S; /** * The computation function which will produce a new value based on the source and, optionally - previous values. */ computation: ComputationFn; equal: ValueEqualityFn; } type LinkedSignalGetter = (() => D) & { [SIGNAL]: LinkedSignalNode; }; declare function createLinkedSignal(sourceFn: () => S, computationFn: ComputationFn, equalityFn?: ValueEqualityFn): LinkedSignalGetter; declare function linkedSignalSetFn(node: LinkedSignalNode, newValue: D): void; declare function linkedSignalUpdateFn(node: LinkedSignalNode, updater: (value: D) => D): void; declare function setThrowInvalidWriteToSignalError(fn: (node: SignalNode) => never): void; /** * A cleanup function that can be optionally registered from the watch logic. If registered, the * cleanup logic runs before the next watch execution. */ type WatchCleanupFn = () => void; /** * A callback passed to the watch function that makes it possible to register cleanup logic. */ type WatchCleanupRegisterFn = (cleanupFn: WatchCleanupFn) => void; interface Watch { notify(): void; /** * Execute the reactive expression in the context of this `Watch` consumer. * * Should be called by the user scheduling algorithm when the provided * `schedule` hook is called by `Watch`. */ run(): void; cleanup(): void; /** * Destroy the watcher: * - disconnect it from the reactive graph; * - mark it as destroyed so subsequent run and notify operations are noop. */ destroy(): void; [SIGNAL]: WatchNode; } interface WatchNode extends ReactiveNode { hasRun: boolean; fn: ((onCleanup: WatchCleanupRegisterFn) => void) | null; schedule: ((watch: Watch) => void) | null; cleanupFn: WatchCleanupFn; ref: Watch; } declare function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, schedule: (watch: Watch) => void, allowSignalWrites: boolean): Watch; /** * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function * can, optionally, return a value. */ declare function untracked(nonReactiveReadsFn: () => T): T; export { type ComputationFn, type ComputedNode, type LinkedSignalGetter, type LinkedSignalNode, ReactiveNode, SIGNAL, SignalNode, ValueEqualityFn, type Watch, type WatchCleanupFn, type WatchCleanupRegisterFn, createComputed, createLinkedSignal, createWatch, linkedSignalSetFn, linkedSignalUpdateFn, setThrowInvalidWriteToSignalError, untracked };