import { Chunk } from "@tsplus/stdlib/collections/Chunk/definition"; import { Sink } from "@effect/core/stream/Sink/definition/base"; import { Channel } from "@effect/core/stream/Channel/definition/base"; /** * Creates a sink that folds elements of type `In` into a structure of type * `S`, until `max` worth of elements (determined by the `costFn`) have been * folded. * * The `decompose` function will be used for decomposing elements that cause * an `S` aggregate to cross `max` into smaller elements. * * Be vigilant with this function, it has to generate "simpler" values or the * fold may never end. A value is considered indivisible if `decompose` yields * the empty chunk or a single-valued chunk. In these cases, there is no other * choice than to yield a value that will cross the threshold. * * The `foldWeightedDecomposeEffect` allows the decompose function to return a * `Effect` value, and consequently it allows the sink to fail. * @tsplus static effect/core/stream/Sink.Ops foldWeightedDecompose * @tsplus location "@effect/core/stream/Sink/operations/foldWeightedDecompose" */ export declare function foldWeightedDecompose(z: S, costFn: (s: S, input: In) => number, max: number, decompose: (input: In) => Chunk, f: (s: S, input: In) => S): Sink; //# sourceMappingURL=foldWeightedDecompose.d.ts.map