Skip to content

Commit

Permalink
add flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Harris-Miller committed Apr 26, 2024
1 parent c3c91a8 commit 50197f8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions types/flow.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function flow<S, R1>(seed: S, pipeline: [(a: S) => R1]): R1;
export function flow<S, R1, R2>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2]): R2;
export function flow<S, R1, R2, R3>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3]): R3;
export function flow<S, R1, R2, R3, R4>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3, (a: R3) => R4]): R4;
export function flow<S, R1, R2, R3, R4, R5>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3, (a: R3) => R4, (a: R4) => R5]): R5;
export function flow<S, R1, R2, R3, R4, R5, R6>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3, (a: R3) => R4, (a: R4) => R5, (a: R5) => R6]): R6;
export function flow<S, R1, R2, R3, R4, R5, R6, R7>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3, (a: R3) => R4, (a: R4) => R5, (a: R5) => R6, (a: R6) => R7]): R7;
export function flow<S, R1, R2, R3, R4, R5, R6, R7, R8>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3, (a: R3) => R4, (a: R4) => R5, (a: R5) => R6, (a: R6) => R7, (a: R7) => R8]): R8;
export function flow<S, R1, R2, R3, R4, R5, R6, R7, R8, R9>(seed: S, pipeline: [(a: S) => R1, (a: R1) => R2, (a: R2) => R3, (a: R3) => R4, (a: R4) => R5, (a: R5) => R6, (a: R6) => R7, (a: R7) => R8, (a: R8) => R9]): R9;
// catch all
export function flow<S, R>(seed: S, pipeline: [(a: S) => any, ...((a: any) => any)]): R;

0 comments on commit 50197f8

Please sign in to comment.