tamda
Version:
Practical functional programming library for TypeScript
103 lines (102 loc) • 4.56 kB
TypeScript
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 right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn>(operator: Op): Op;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, R>(op2: In<Op, R>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, R>(op3: Unary<A, R>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, R>(op4: Unary<B, R>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, C, R>(op5: Unary<C, R>, op4: Unary<B, C>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, C, D, R>(op6: Unary<D, R>, op5: Unary<C, D>, op4: Unary<B, C>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, C, D, E, R>(op7: Unary<E, R>, op6: Unary<D, E>, op5: Unary<C, D>, op4: Unary<B, C>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, C, D, E, F, R>(op8: Unary<F, R>, op7: Unary<E, F>, op6: Unary<D, E>, op5: Unary<C, D>, op4: Unary<B, C>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, C, D, E, F, G, R>(op9: Unary<G, R>, op8: Unary<F, G>, op7: Unary<E, F>, op6: Unary<D, E>, op5: Unary<C, D>, op4: Unary<B, C>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
/**
* Composes a series of `Unary` operations into a single function.
*
* Performs right-to-left function composition.
*
* Opposite function composition direction of `pipe`.
*/
export declare function compose<Op extends Fn, A, B, C, D, E, F, G, H, R>(op10: Unary<H, R>, op9: Unary<G, H>, op8: Unary<F, G>, op7: Unary<E, F>, op6: Unary<D, E>, op5: Unary<C, D>, op4: Unary<B, C>, op3: Unary<A, B>, op2: In<Op, A>, op1: Op):
/** Executes all the previously specified functions in the composition. */
(...args: Parameters<Op>) => R;
export {};