import type { Composable, UnpackData } from '../types.js'; import type { BranchReturn, PipeReturn, SequenceReturn } from './types.js'; import type { Internal } from '../internal/types.js'; /** * Creates a single composable out of a chain of multiple functions. It will pass the same context to all given functions, and it will pass the output of a function as the next function's input in left-to-right order. The resulting data will be the output of the rightmost function. * * @example * * ```ts * import { withContext } from 'composable-functions' * * const a = (aNumber: number) => String(aNumber) * const b = (aString: string) => aString === '1' * const d = withContext.pipe(a, b) * // ^? ComposableWithSchema * ``` */ declare function pipe(...fns: Fns): PipeReturn>; /** * Works like `withContext.pipe` but it will collect the output of every function in a tuple. * * @example * * ```ts * import { withContext } from 'composable-functions' * * const a = (aNumber: number) => String(aNumber) * const b = (aString: string) => aString === '1' * const aComposable = withContext.sequence(a, b) * // ^? ComposableWithSchema<[string, boolean]> * ``` */ declare function sequence(...fns: Fns): SequenceReturn>; /** * Like branch but preserving the context parameter. */ declare function branch>>) => Internal.AnyFn | null | Promise>(cf: SourceComposable, resolver: Resolver): SourceComposable extends Internal.AnyFn ? BranchReturn, Resolver> : never; export { branch, pipe, sequence }; //# sourceMappingURL=combinators.d.ts.map