Index
Type aliases
Type aliases
Pipe
Type parameters
returns
Function
example
import {F} from 'ts-toolbelt'
/// If you are looking for creating types for `pipe`
/// `Piper` will check for input & `Piped` the output
declare function pipe<Fns extends F.Function[]>(...args: F.Piper<Fns>): F.Pipe<Fns>
const a = (a1: number) => `${a1}`
const b = (b1: string) => [b1]
const c = (c1: string[]) => [c1]
pipe(a, b, c)(42)
/// And if you are looking for an async `pipe` type
declare function pipe<Fns extends F.Function[]>(...args: F.Piper<Fns, 'async'>): F.Pipe<Fns, 'async'>
const a = async (a1: number) => `${a1}`
const b = async (b1: string) => [b1]
const c = async (c1: string[]) => [c1]
await pipe(a, b, c)(42)
PipeFnAsync
Type parameters
- Fns: Function[]
- K: keyof Fns
PipeFnSync
Type parameters
- Fns: Function[]
- K: keyof Fns
Piper
Compute what the input of Pipe
should be
Type parameters
example
Pipe
Function
s together