UNPKG

tamda

Version:

Practical functional programming library for TypeScript

123 lines (122 loc) 5.11 kB
import { Unary } from '../operators'; declare type Fn = (...args: any) => any; declare type In<F extends Fn, R> = Unary<ReturnType<F>, R>; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn>(operator: Op): Op; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, R>(op1: Op, ops2: In<Op, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, C, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, C>, op5: Unary<C, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, C, D, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, C>, op5: Unary<C, D>, op6: Unary<D, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, C, D, E, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, C>, op5: Unary<C, D>, op6: Unary<D, E>, op7: Unary<E, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, C, D, E, F, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, C>, op5: Unary<C, D>, op6: Unary<D, E>, op7: Unary<E, F>, op8: Unary<F, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, C, D, E, F, G, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, C>, op5: Unary<C, D>, op6: Unary<D, E>, op7: Unary<E, F>, op8: Unary<F, G>, op9: Unary<G, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; /** * Composes a series of `Unary` operations into a single function. * * Performs left-to-right function composition. * * Opposite function composition direction of `compose`. * * In some libraries this function is named `sequence`. */ export declare function pipe<Op extends Fn, A, B, C, D, E, F, G, H, R>(op1: Op, op2: In<Op, A>, op3: Unary<A, B>, op4: Unary<B, C>, op5: Unary<C, D>, op6: Unary<D, E>, op7: Unary<E, F>, op8: Unary<F, G>, op9: Unary<G, H>, op10: Unary<H, R>): /** Executes all the previously specified functions in the pipe. */ (...args: Parameters<Op>) => R; export {};