/** * Derived -- computed reactive value. * * @module */ import type { Scope } from 'effect'; import { Effect, Stream } from 'effect'; import type { Cell } from './cell.js'; interface DerivedShape { readonly _tag: 'Derived'; readonly changes: Stream.Stream; readonly get: Effect.Effect; } /** * Derived — read-only reactive view computed from upstream {@link Cell}s. * A `Derived` recomputes lazily and pushes the new value into its own stream * when any dependency changes; composes via `combine`, `map`, and `flatten`. */ export declare const Derived: { /** Build a derived cell from a factory computing against upstream sources. */ make: (compute: Effect.Effect, sources?: ReadonlyArray>) => Effect.Effect, never, Scope.Scope>; /** Combine multiple cells into a single derived cell of their tuple. */ combine: (cells: { [K in keyof T]: Cell.Shape; }, combiner: (...args: T) => U) => Effect.Effect, never, Scope.Scope>; /** Pure projection of an existing cell/derived. */ map: (derived: DerivedShape, f: (a: A) => B) => Effect.Effect, never, Scope.Scope>; /** Flatten a derived-of-derived into a single derived of the inner value. */ flatten: (nested: DerivedShape>) => Effect.Effect, never, Scope.Scope>; }; export declare namespace Derived { /** Structural shape of a {@link Derived}: `_tag`, `get`, `changes`. */ type Shape = DerivedShape; } export {}; //# sourceMappingURL=derived.d.ts.map