/** * Fine-grained signals - the reactive core of `@nifrajs/islets`. Pull-based auto-tracking with * per-run re-tracking (a branch switch drops the stale branch's subscriptions), `Object.is` * equality skips, and an explicit synchronous {@link batch} that coalesces effect re-runs. * * Deliberately tiny and synchronous: writes outside `batch` re-run subscribers immediately - * predictable for island-scale code (a counter, a filter drawer), and the whole core stays well * under a kilobyte. This is NOT a general app framework - just island-scale reactivity. */ /** A readable/writable reactive value: call it to read (tracking), `.set` to write. */ export type Signal = { (): T; set(next: T | ((prev: T) => T)): void; }; /** * Batch writes: effects triggered inside `fn` run ONCE after it returns, deduplicated - so * `setA(); setB()` updates the DOM once, not twice. Re-entrant; an effect re-queued during the * flush runs in the same flush. */ export declare function batch(fn: () => T): T; /** Create a signal. Reads inside an {@link effect} (or {@link computed}) subscribe automatically. */ export declare function signal(initial: T): Signal; /** Derived value, cached into a signal - recomputes when its tracked inputs change. */ export declare function computed(fn: () => T): () => T; /** * Run `fn` now and again whenever any signal it read changes. Returns a disposer. Dependencies * re-track on every run, so conditional reads subscribe to exactly the live branch. */ export declare function effect(fn: () => void): () => void; //# sourceMappingURL=signals.d.ts.map