/** * Internal reactive plumbing shared across primitives. * @internal */ export type Observer = () => void; export type CleanupFn = () => void; /** * Interface for reactive sources (Signals, Computed) that can unsubscribe observers. * @internal */ export interface ReactiveSource { unsubscribe(observer: Observer): void; } /** * Mark an observer as a derivation, so the flush orders it ahead of effects. * @internal */ export declare const markDerivation: (observer: Observer) => void; export declare const track: (observer: Observer, fn: () => T) => T; export declare const getCurrentObserver: () => Observer | undefined; /** * Executes a function without exposing the current observer to dependencies. * Unlike disabling tracking globally, this still allows nested reactive internals * (e.g., computed recomputation) to track their own dependencies. * @internal */ export declare const withoutCurrentObserver: (fn: () => T) => T; export declare const scheduleObserver: (observer: Observer) => void; /** * Run any pending observers now instead of waiting for the microtask. * * Needed by tests and by code that depends on the synchronous timing the * `'sync'` scheduler gives. A no-op when nothing is queued, and safe to call * inside a batch — the work then stays with the enclosing batch. * @internal */ export declare const flushSyncInternal: () => void; /** * Whether a flush is running right now — i.e. whether the caller is inside * an observer. `flushSyncInternal` cannot do anything in that case, so the * public wrapper warns instead of silently doing nothing. * @internal */ export declare const isFlushingNow: () => boolean; export declare const beginBatch: () => void; export declare const endBatch: () => void; /** * Registers a dependency between an observer and a reactive source. * @internal */ export declare const registerDependency: (observer: Observer, source: ReactiveSource) => void; /** * Removes a specific source from an observer's dependency set. * Used when a source (e.g. Signal) is disposed to prevent stale references. * @internal */ export declare const removeDependency: (observer: Observer, source: ReactiveSource) => void; /** * Clears all dependencies for an observer, unsubscribing from all sources. * @internal */ export declare const clearDependencies: (observer: Observer) => void; //# sourceMappingURL=internals.d.ts.map