import type { Signal, MappedSignal } from './types.js'; declare const SIGNAL: unique symbol; /** A runtime `Signal`: the read surface PLUS the binding info needed to build a * reactive slot at runtime (view-helper composition). */ export interface SignalHandle extends Signal { readonly [SIGNAL]: true; /** resolve the value from the binding's state (component or row ctx) */ readonly produce: (state: unknown) => T; /** dependency paths into the binding's state */ readonly deps: readonly string[]; /** Root discriminant for row rebasing. `true` ⇒ this handle reads the ROW ctx * (an `item`/`index` handle from `rowHandle`, or a row-aware `derived`); `false` * (or absent) ⇒ it reads the COMPONENT state and must be rebased to `ctx.state` * when placed inside an `each` row. Set at construction from the getter's origin, * so locality never depends on string-inferring a `state`/`item`/`index` field * name (which collides with a component field literally named that). */ readonly rowLocal?: boolean; } /** A runtime handle produced by `.map()` / `derived()` — same carrier as * {@link SignalHandle}, but its public `at` is the {@link MappedSignal} `never` * (a mapped signal has no static path to slice). A `MappedHandle` is * assignable to `SignalHandle`, so it flows through the build helpers * unchanged. */ export interface MappedHandle extends MappedSignal { readonly [SIGNAL]: true; readonly produce: (state: unknown) => T; readonly deps: readonly string[]; readonly rowLocal?: boolean; } export declare function isSignalHandle(v: unknown): v is SignalHandle; /** A path-rooted handle: `produce` resolves `base` from the binding state; * `peek` reads the live value via `get`. `at` extends the path; `map` derives. * `rowLocal` marks a handle rooted at a ROW ctx (the internal `rowHandle` for * `item`/`index`); it propagates through `.at`/`.map` so row locality is carried, * never string-inferred. Component-state handles default to `false`. */ export declare function pathHandle(get: () => unknown, base: string, rowLocal?: boolean): SignalHandle; /** A ROW-rooted path handle (`item`/`index` inside an `each`/`virtualEach` row). * Identical to {@link pathHandle} but branded `rowLocal` — so a spec built from it * (or from `.at`/`.map` off it) reads the row ctx and is NOT rebased to * `ctx.state`. This is the emission target for the compiled each-arm prelude * (`const item = rowHandle(getCtx, 'item')`) and the authoring `each`/`virtualEach` * item/index handles. */ export declare function rowHandle(get: () => unknown, base: string): SignalHandle; /** * Combine N independent signals into one derived signal. Use when the inputs have * no shared parent signal (cross-tree, or a per-row item signal + a component-state * signal); for a single source, prefer {@link Signal.map}. * * Two call forms — pick whichever reads cleaner: * * derived(a, b, (va, vb) => …) // variadic: 2–4 sources, positional values * derived([a, b, …c], (…vals) => …) // array: any N, tuple-typed values * * The compiler lowers `derived(...)` inside a DIRECT view to an inline call. This * is the equivalent RUNTIME handle for view-helper composition (where there is no * statically-known path): `produce`/`peek` apply `fn` over the resolved sources and * `deps` is the UNION of the sources' deps — so the chunked-mask reconciler fires * the binding whenever ANY source changes, and commits only on an output change. * All inputs must resolve against the same binding state (the common case: each is * rooted at the component state, or all at the same row ctx). The result is a * {@link MappedSignal} — like a `.map()`, it carries no path, so `.at()` on it is * a compile error (slice the sources before combining). */ export declare function derived(a: Signal, b: Signal, fn: (a: A, b: B) => U): MappedSignal; export declare function derived(a: Signal, b: Signal, c: Signal, fn: (a: A, b: B, c: C) => U): MappedSignal; export declare function derived(a: Signal, b: Signal, c: Signal, d: Signal, fn: (a: A, b: B, c: C, d: D) => U): MappedSignal; export declare function derived(sigs: { readonly [K in keyof T]: Signal; }, fn: (...values: T) => U): MappedSignal; export {}; //# sourceMappingURL=handle.d.ts.map