import { Chain1 } from 'fp-ts/lib/Chain'; import { ChainRec1 } from 'fp-ts/lib/ChainRec'; import { Either } from 'fp-ts/lib/Either'; import { AsyncStream, URI } from './uri'; /** * Chains a {@link AsyncStream} by evaluating the function passed with the * items of it that returns another {@link AsyncStream} instance of type `B`. * * @export * @template A The value type. * @template B The new value/output type. * @param {(a: A) => AsyncStream} f The function that produces an async * stream of type `B` from given `A` value. * * @return {(fa: AsyncStream) => AsyncStream} A function that takes an * async stream of type `A` and returns another async stream of type `B`. * * @__PURE__ */ export declare function chain(f: (a: A) => AsyncStream): (fa: AsyncStream) => AsyncStream; /** * Chains a {@link AsyncStream} by evaluating the function passed with the items * of it with an index that returns another {@link AsyncStream} instance of * type `B`. * * @export * @template A The value type. * @template B The new value/output type. * @param {(i: number, a: A) => AsyncStream} f The function that produces an * async stream of type `B` from given `A` value. * * @return {(fa: AsyncStream) => AsyncStream} A function that takes an * async stream of type `A` and returns another async stream of type `B`. * * @__PURE__ */ export declare function chainWithIndex(f: (i: number, a: A) => AsyncStream): (fa: AsyncStream) => AsyncStream; /** * Recursively chain a {@link AsyncStream} with a function that produces an * {@link Either} of `A` and `B` async stream. * * All the `A` items in the async stream will be used to recursively produce * more async streams to chain. * * @export * @template A The producing type. * @template B The output type. * @param {(a: A) => AsyncStream>} f The stream producter function. * @return {(a: A) => AsyncStream} A function that takes an initial value to * start producing `B`s. * * @__PURE__ */ export declare function chainRecDepthFirst(f: (a: A) => AsyncStream>): (a: A) => AsyncStream; /** * Recursively chain a {@link AsyncStream} with a function that produces an * {@link Either} of `A` and `B` async stream. * * All the `A` items in the async stream will be used to recursively produce * more async streams to chain. * * @export * @template A The producing type. * @template B The output type. * @param {(a: A) => AsyncStream>} f The async stream producter * function. * * @return {(a: A) => AsyncStream} A function that takes an initial value to * start producing `B`s. * * @__PURE__ */ export declare function chainRecBreadthFirst(f: (a: A) => AsyncStream>): (a: A) => AsyncStream; /** * The `Chain` category instance for {@link AsyncStream}. */ export declare const Chain: Chain1; /** * The `ChainRec` category instance for {@link AsyncStream} that uses * `depth-first` approach. */ export declare const ChainRecDepthFirst: ChainRec1; /** * The `ChainRec` category instance for {@link AsyncStream} that uses * `breadth-first` approach. */ export declare const ChainRecBreadthFirst: ChainRec1; /** * @category do notation */ export declare const Do: AsyncStream<{}>; /** * @category do notation */ export declare const bind: (name: Exclude, f: (a: A) => AsyncStream) => (ma: AsyncStream) => AsyncStream<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B; }>; /** * @category sequencing */ export declare const chainFirst: (f: (a: A) => AsyncStream) => (first: AsyncStream) => AsyncStream; /** * @category sequencing */ export declare const chainIOK: (f: (a: A) => import("fp-ts/lib/IO").IO) => (first: AsyncStream) => AsyncStream; /** * @category sequencing */ export declare const chainFirstIOK: (f: (a: A) => import("fp-ts/lib/IO").IO) => (first: AsyncStream) => AsyncStream; /** * @category sequencing */ export declare const chainEitherK: (f: (a: A) => Either) => (ma: AsyncStream) => AsyncStream; /** * @category sequencing */ export declare const chainFirstEitherK: (f: (a: A) => Either) => (ma: AsyncStream) => AsyncStream;