/** * A zero-argument getter for a reactive value. * * @remarks * Passing an accessor as a JSX prop marks the prop reactive: the render loop * re-reads it every frame and re-applies the result to the mounted object. * * @typeParam T - Value type produced by the read. */ export type Accessor = () => T; /** * Writes a signal's value; takes the next value or an updater `prev => next`. * * @remarks * Synchronous and schedules nothing — the new value is simply observed the * next time the frame loop polls the paired accessor. * * @typeParam T - Value type stored. */ export type Setter = (next: T | ((prev: T) => T)) => void; /** * Create a reactive value as an `[Accessor, Setter]` pair. * * @remarks * There are no subscriptions and no dependency tracking: `set` stores the * value, and anything reading through `get` — reactive JSX props, frame * callbacks — sees it on the next frame poll. * * @typeParam T - Stored value type. * @param initial - Starting value. * @returns `[get, set]`; pass `get` (or a closure over it) as a JSX prop to * drive that prop every frame. */ export declare function signal(initial: T): [Accessor, Setter]; /** A derived accessor — just a memo-free computed read, re-run when polled. */ export declare function derived(fn: Accessor): Accessor; /** Marker so the reconciler can distinguish accessors from plain values. */ export declare function isAccessor(value: unknown): value is Accessor; //# sourceMappingURL=signal.d.ts.map