import { Signal } from "signal-polyfill"; /** * Subscribe to a single signal using the canonical one-shot watcher lifecycle. * * The callback runs from a queued microtask after pending notifications are * drained, then the watcher re-arms itself so future updates are not missed. * The returned cleanup keeps teardown idempotent by tolerating already-detached * watchers. * * **Memory safety (Phase 29):** * - `disposed` flag prevents post-cleanup callback execution: if cleanup is * called before a pending microtask fires, the microtask returns early. * - `needsEnqueue` guard dedups rapid synchronous signal changes: only one * microtask is ever queued per batch of synchronous mutations. * * @param signal - A `Signal.State` or `Signal.Computed` to subscribe to. * @param onValue - Called with the current signal value after each change. * @returns A cleanup function that unregisters the watcher. */ export declare function watchSignal(signal: Signal.State | Signal.Computed, onValue: (value: T) => void): () => void; //# sourceMappingURL=watch-signal.d.ts.map