/** * all() — combine several AsyncStates into one, for all-or-nothing gating * (one `match` for a whole dashboard). Partial loading wants independent * `match` calls instead. * * A pure derived view: no fetching, no effects — every property read * recomputes from the members (and subscribes through their signals). * * Derived-state rules (docs/rfc-async.md rev 8): * - any member 'idle' ⇒ combined 'idle' (a conditional member holds the gate) * - else any 'errored' ⇒ combined 'errored' (`.error` is first-error-wins; * `.errors` collects all) * - else any 'pending' ⇒ combined 'pending' (until ALL first settle) * - else any 'refreshing' ⇒ combined 'refreshing' (all members have values — * keeps rendering the ready arm) * - else ⇒ 'ready' */ import { type AsyncState } from './async/shared.js'; /** * An intersection, not an interface — `AsyncState` is a union, and * intersecting distributes over its members so discriminant narrowing * (`if (x.hasValue) x.value // T`) works through the combination too. */ export type AllState = AsyncState & { /** Collect-all counterpart to first-error-wins `.error`. */ readonly errors: E; }; type ValuesOf = { [K in keyof S]: S[K] extends AsyncState ? V : never; }; type ErrorsOf = { [K in keyof S]: Error | null; }; /** Object form (primary): `all({ user, posts })` — named value/errors records. */ export declare function all>>(sources: S): AllState, ErrorsOf>; /** Rest-tuple form for quick cases: `all(user, posts)` — positional tuples. */ export declare function all[]>(...sources: S): AllState, ErrorsOf>; export {}; //# sourceMappingURL=all.d.ts.map