// TypeScript Version: 3.4 import { Iter, EP, Flat, PFlat, PDFlat, CurriedFunction2, FlatForInternalFn, CurriedFunction3, MergeObject, InnerJoinObject, } from './utils'; /** * https://github.com/rudty/nodekell#head * * @param iter */ // export function head(iter: Iter>): Promise; export function head(iter: Iter): Promise>; /** * https://github.com/rudty/nodekell#tail * * @param iter */ // export function tail(iter: Iter>): AsyncIterableIterator; export function tail(iter: Iter): AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#drop * * @param count * @param iter */ export function drop(count: number, iter: Iter>): AsyncIterableIterator; // export function drop(count: number, iter: Iter): AsyncIterableIterator>; export function drop>(count: number, iter: T): AsyncIterableIterator>; export function drop>(count: number): (iter: T) => AsyncIterableIterator>; export function drop(count: number): (iter: Iter>) => AsyncIterableIterator; // export function drop(count: number): (iter: Iter) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#droplast * * @param count * @param iter */ export function dropLast(count: number, iter: Iter>): AsyncIterableIterator; export function dropLast>(count: number, iter: T): AsyncIterableIterator>; export function dropLast>(count: number): (iter: T) => AsyncIterableIterator>; export function dropLast(count: number): (iter: Iter>) => AsyncIterableIterator; /** * https://github.com/rudty/nodekell#dropwhile * * @param f * @param iter */ export function dropWhile(f: (elem: T) => (boolean | Promise), iter: Iter>): AsyncIterableIterator; // export function dropWhile(f: (elem: EP) => (boolean | Promise), iter: Iter): AsyncIterableIterator>; export function dropWhile>(f: (elem: FlatForInternalFn) => (boolean | Promise), iter: T): AsyncIterableIterator>; export function dropWhile>(f: (elem: FlatForInternalFn) => (boolean | Promise)): (iter: T) => AsyncIterableIterator>; export function dropWhile(f: (elem: T) => (boolean | Promise)): (iter: Iter>) => AsyncIterableIterator; // export function dropWhile(f: (elem: EP) => (boolean | Promise)): (iter: Iter) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#filter * * @param f * @param iter */ export function filter(f: (elem: T) => (boolean | Promise), iter: Iter>): AsyncIterableIterator; // export function filter(f: (elem: EP) => (boolean | Promise), iter: Iter): AsyncIterableIterator>; export function filter>(f: (elem: FlatForInternalFn) => (boolean | Promise), iter: T): AsyncIterableIterator>; export function filter>(f: (elem: FlatForInternalFn) => (boolean | Promise)): (iter: T) => AsyncIterableIterator>; export function filter(f: (elem: T) => (boolean | Promise)): (iter: Iter>) => AsyncIterableIterator; // export function filter(f: (elem: EP) => (boolean | Promise)): (iter: Iter) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#filterindexed * * @param f * @param iter */ export function filterIndexed(f: (idx: number, elem: T) => (boolean | Promise), iter: Iter>): AsyncIterableIterator; export function filterIndexed>(f: (idx: number, elem: FlatForInternalFn) => (boolean | Promise), iter: T): AsyncIterableIterator>; export function filterIndexed>(f: (idx: number, elem: FlatForInternalFn) => (boolean | Promise)): (iter: T) => AsyncIterableIterator>; export function filterIndexed(f: (idx: number, elem: T) => (boolean | Promise)): (iter: Iter>) => AsyncIterableIterator; /** * https://github.com/rudty/nodekell#filternot * * @param f * @param iter */ export function filterNot(f: (elem: T) => (boolean | Promise), iter: Iter>): AsyncIterableIterator; export function filterNot>(f: (elem: FlatForInternalFn) => (boolean | Promise), iter: T): AsyncIterableIterator>; export function filterNot>(f: (elem: FlatForInternalFn) => (boolean | Promise)): (iter: T) => AsyncIterableIterator>; export function filterNot(f: (elem: T) => (boolean | Promise)): (iter: Iter>) => AsyncIterableIterator; /** * https://github.com/rudty/nodekell#map * * @param f * @param iter */ export function map(f: (elem: T) => (R | Promise), iter: Iter>): AsyncIterableIterator; // export function map(f: (elem: EP) => (R | Promise), iter: Iter): AsyncIterableIterator; export function map, R>(f: (elem: FlatForInternalFn) => R, iter: T): AsyncIterableIterator>; export function map, R>(f: (elem: FlatForInternalFn) => R): (iter: T) => AsyncIterableIterator>; export function map(f: (elem: T) => (R | Promise)): (iter: Iter>) => AsyncIterableIterator; // export function map(f: (elem: EP) => (R | Promise)): (iter: Iter) => AsyncIterableIterator; /** * https://github.com/rudty/nodekell#mapindexed * * @param f * @param iter */ export function mapIndexed(f: (idx: number, elem: T) => (R | Promise), iter: Iter>): AsyncIterableIterator; export function mapIndexed, R>(f: (idx: number, elem: FlatForInternalFn) => R, iter: T): AsyncIterableIterator>; export function mapIndexed, R>(f: (idx: number, elem: FlatForInternalFn) => R): (iter: T) => AsyncIterableIterator>; export function mapIndexed(f: (idx: number, elem: T) => (R | Promise)): (iter: Iter>) => AsyncIterableIterator; /** * https://github.com/rudty/nodekell#fmap * * @param f * @param iter */ export function fmap(f: (elem: EP) => R, iter: Iter): AsyncIterableIterator>>; export function fmap>(f: (elem: EP) => (R | Promise), iter: Iter>): AsyncIterableIterator>; // export function fmap, R = PFlat>(f: (elem: PFlat) => R, iter: T): AsyncIterableIterator>>; // export function fmap, R = PFlat>(f: (elem: PFlat) => R): (iter: T) => AsyncIterableIterator>>; export function fmap(f: (elem: EP) => R): (iter: Iter) => AsyncIterableIterator>>; export function fmap>(f: (elem: EP) => (R | Promise)): (iter: Iter>) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#flatmap * * as fmap * * @param f * @param iter */ export function flatMap(f: (elem: EP) => R, iter: Iter): AsyncIterableIterator>>; export function flatMap>(f: (elem: EP) => (R | Promise), iter: Iter>): AsyncIterableIterator>; export function flatMap(f: (elem: EP) => R): (iter: Iter) => AsyncIterableIterator>>; export function flatMap>(f: (elem: EP) => (R | Promise)): (iter: Iter>) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#flat * * @param iter */ export function flat(iter: Iter): AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#dflat * * **Note** * - don't use too deep iter * * @param t */ export function dflat(...a: T): AsyncIterableIterator>>; /** * https://github.com/rudty/nodekell#take * * @param count * @param iter */ export function take(count: number, iter: Iter>): AsyncIterableIterator; // export function take(count: number, iter: Iter): AsyncIterableIterator>; export function take>(count: number, iter: T): AsyncIterableIterator>; export function take>(count: number): (iter: T) => AsyncIterableIterator>; export function take(count: number): (iter: Iter>) => AsyncIterableIterator; // export function take(count: number): (iter: Iter) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#takelast * * @param count * @param iter */ export function takeLast(count: number, iter: Iter>): AsyncIterableIterator; export function takeLast>(count: number, iter: T): AsyncIterableIterator>; export function takeLast>(count: number): (iter: T) => AsyncIterableIterator>; export function takeLast(count: number): (iter: Iter>) => AsyncIterableIterator; /** * https://github.com/rudty/nodekell#takewhile * * @param f * @param iter */ export function takeWhile(f: (elem: T) => (boolean | Promise), iter: Iter>): AsyncIterableIterator; // export function takeWhile(f: (elem: EP) => (boolean | Promise), iter: Iter): AsyncIterableIterator>; export function takeWhile>(f: (elem: FlatForInternalFn) => (boolean | Promise), iter: T): AsyncIterableIterator>; export function takeWhile>(f: (elem: FlatForInternalFn) => (boolean | Promise)): (iter: T) => AsyncIterableIterator>; export function takeWhile(f: (elem: T) => (boolean | Promise)): (iter: Iter>) => AsyncIterableIterator; // export function takeWhile(f: (elem: EP) => (boolean | Promise)): (iter: Iter) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#foldl * * @param f * @param init * @param iter */ // export function foldl(f: (acc: T, elem: T) => (T | Promise)): (init: T | Promise) => (iter: Iter>) => Promise; // export function foldl(f: (acc: T, elem: T) => (T | Promise)): (init: T | Promise, iter: Iter>) => Promise; export function foldl(f: (acc: U, elem: T) => (U | Promise), init: U | Promise, iter: Iter>): Promise; // export function foldl(f: (acc: EP, elem: EP) => (EP | Promise>), init: T, iter: Iter): Promise>; export function foldl, U>(f: (acc: U, elem: FlatForInternalFn) => (U | Promise), init: U | Promise, iter: T): Promise; export function foldl, U>(f: (acc: U, elem: FlatForInternalFn) => (U | Promise), init: U | Promise): (iter: T) => Promise; export function foldl, U>(f: (acc: U, elem: FlatForInternalFn) => (U | Promise)): CurriedFunction2, T, Promise>; export function foldl(f: (acc: U, elem: T) => (U | Promise), init: U | Promise): (iter: Iter>) => Promise; // export function foldl(f: (acc: EP, elem: EP) => (EP | Promise>), init: T): (iter: Iter) => Promise>; export function foldl(f: (acc: U, elem: T) => (U | Promise)): CurriedFunction2, Iter>, Promise>; // export function foldl(f: (acc: EP, elem: EP) => (EP | Promise>)): CurriedFunction2, Promise>>; /** * https://github.com/rudty/nodekell#foldl1 * * @param f * @param iter */ export function foldl1(f: (acc: T, elem: T) => (T | Promise), iter: Iter>): Promise; // export function foldl1(f: (acc: EP, elem: EP) => (EP | Promise>), iter: Iter): Promise>; export function foldl1>(f: (acc: FlatForInternalFn, elem: FlatForInternalFn) => (FlatForInternalFn | Promise>), iter: T): Promise>; export function foldl1>(f: (acc: FlatForInternalFn, elem: FlatForInternalFn) => (FlatForInternalFn | Promise>)): (iter: T) => Promise>; export function foldl1(f: (acc: T, elem: T) => (T | Promise)): (iter: Iter>) => Promise; // export function foldl1(f: (acc: EP, elem: EP) => (EP | Promise>)): (iter: Iter) => Promise>; /** * https://github.com/rudty/nodekell#reduce * * as foldl1 * * @param f * @param iter */ export function reduce(f: (acc: T, elem: T) => (T | Promise), iter: Iter>): Promise; // export function reduce(f: (acc: EP, elem: EP) => (EP | Promise>), iter: Iter): Promise>; export function reduce>(f: (acc: FlatForInternalFn, elem: FlatForInternalFn) => (FlatForInternalFn | Promise>), iter: T): Promise>; export function reduce>(f: (acc: FlatForInternalFn, elem: FlatForInternalFn) => (FlatForInternalFn | Promise>)): (iter: T) => Promise>; export function reduce(f: (acc: T, elem: T) => (T | Promise)): (iter: Iter>) => Promise; // export function reduce(f: (acc: EP, elem: EP) => (EP | Promise>)): (iter: Iter) => Promise>; /** * https://github.com/rudty/nodekell#scanl * * @param f * @param init * @param iter */ // export function scanl(f: (a: T, b: T) => (T | Promise)): (init: T | Promise) => (iter: Iter>) => AsyncIterableIterator; // export function scanl(f: (a: T, b: T) => (T | Promise)): (init: T | Promise, iter: Iter>) => AsyncIterableIterator; export function scanl(f: (a: T, b: T) => (T | Promise), init: T | Promise, iter: Iter>): AsyncIterableIterator; // export function scanl(f: (a: EP, b: EP) => (EP | Promise>), init: T, iter: Iter): AsyncIterableIterator>; export function scanl>(f: (a: FlatForInternalFn, b: FlatForInternalFn) => (FlatForInternalFn | Promise>), init: FlatForInternalFn | Promise>, iter: T): AsyncIterableIterator>; export function scanl>(f: (a: FlatForInternalFn, b: FlatForInternalFn) => (FlatForInternalFn | Promise>), init: FlatForInternalFn | Promise>): (iter: T) => AsyncIterableIterator>; export function scanl>(f: (a: FlatForInternalFn, b: FlatForInternalFn) => (FlatForInternalFn | Promise>)): CurriedFunction2 | Promise>, T, AsyncIterableIterator>>; export function scanl(f: (a: T, b: T) => (T | Promise), init: T | Promise): (iter: Iter>) => AsyncIterableIterator; // export function scanl(f: (a: EP, b: EP) => (EP | Promise>), init: T): (iter: Iter) => AsyncIterableIterator>; export function scanl(f: (a: T, b: T) => (T | Promise)): CurriedFunction2, Iter>, AsyncIterableIterator>; // export function scanl(f: (a: EP, b: EP) => (EP | Promise>)): CurriedFunction2, AsyncIterableIterator>>; /** * https://github.com/rudty/nodekell#scanl1 * * @param f * @param iter */ export function scanl1(f: (a: T, b: T) => (T | Promise), iter: Iter>): AsyncIterableIterator; // export function scanl1(f: (a: EP, b: EP) => (EP | Promise>), iter: Iter): AsyncIterableIterator>; export function scanl1>(f: (acc: FlatForInternalFn, elem: FlatForInternalFn) => (FlatForInternalFn | Promise>), iter: T): AsyncIterableIterator>; export function scanl1>(f: (acc: FlatForInternalFn, elem: FlatForInternalFn) => (FlatForInternalFn | Promise>)): (iter: T) => AsyncIterableIterator>; export function scanl1(f: (a: T, b: T) => (T | Promise)): (iter: Iter>) => AsyncIterableIterator; // export function scanl1(f: (a: EP, b: EP) => (EP | Promise>)): (iter: Iter) => AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#reverse * * @param iter */ export function reverse(iter: Iter): AsyncIterableIterator>; // export function reverse(iter: Iter>): AsyncIterableIterator; /** * https://github.com/rudty/nodekell#foldr * * @param f * @param init * @param iter */ // export function foldr(f: (acc: T, elem: T) => (T | Promise)): (init: T | Promise) => (iter: Iter>) => Promise; // export function foldr(f: (acc: T, elem: T) => (T | Promise)): (init: T | Promise, iter: Iter>) => Promise; export function foldr(f: (elem: T, acc: U) => (U | Promise), init: U | Promise, iter: Iter>): Promise; // export function foldr(f: (elem: EP, acc: EP) => (EP | Promise>), init: T, iter: Iter): Promise>; export function foldr, U>(f: (elem: FlatForInternalFn, acc: U) => (U | Promise), init: U | Promise, iter: T): Promise; export function foldr, U>(f: (elem: FlatForInternalFn, acc: U) => (U | Promise), init: U | Promise): (iter: T) => Promise; export function foldr, U>(f: (elem: FlatForInternalFn, acc: U) => (U | Promise)): CurriedFunction2, T, Promise>; export function foldr(f: (elem: T, acc: U) => (U | Promise), init: U | Promise): (iter: Iter>) => Promise; // export function foldr(f: (elem: EP, acc: EP) => (EP | Promise>), init: T): (iter: Iter) => Promise>; export function foldr(f: (elem: T, acc: U) => (U | Promise)): CurriedFunction2, Iter>, Promise>; // export function foldr(f: (elem: EP, acc: EP) => (EP | Promise>)): CurriedFunction2, Promise>>; /** * https://github.com/rudty/nodekell#foldr1 * * @param f * @param iter */ export function foldr1(f: (elem: T, acc: T) => (T | Promise), iter: Iter>): Promise; // export function foldr1(f: (elem: EP, acc: EP) => (EP | Promise>), iter: Iter): Promise>; export function foldr1>(f: (elem: FlatForInternalFn, acc: FlatForInternalFn) => (FlatForInternalFn | Promise>), iter: T): Promise>; export function foldr1>(f: (elem: FlatForInternalFn, acc: FlatForInternalFn) => (FlatForInternalFn | Promise>)): (iter: T) => Promise>; export function foldr1(f: (elem: T, acc: T) => (T | Promise)): (iter: Iter>) => Promise; // export function foldr1(f: (elem: EP, acc: EP) => (EP | Promise>)): (iter: Iter) => Promise>; /** * https://github.com/rudty/nodekell#zip * * @param iter1 * @param iter2 */ export function zip(iter1: Iter>, iter2: Iter>): AsyncIterableIterator<[T, Y]>; // export function zip(iter1: Iter, iter2: Iter): AsyncIterableIterator<[EP, EP]>; export function zip, Y extends Iter>(iter1: T, iter2: Y): AsyncIterableIterator<[FlatForInternalFn, FlatForInternalFn]>; export function zip, Y extends Iter>(iter1: T): (iter2: Y) => AsyncIterableIterator<[FlatForInternalFn, FlatForInternalFn]>; export function zip(iter1: Iter>): (iter2: Iter>) => AsyncIterableIterator<[T, Y]>; // export function zip(iter1: Iter): (iter2: Iter) => AsyncIterableIterator<[EP, EP]>; /** * https://github.com/rudty/nodekell#zipwith * * **Note** * - if you want high quality type, use type assertion * ```ts * const a = [1, 2, 3, 4]; * const b = 'abcd'; * const r = F.zipWith((a, b) => [a, b] as [number, string]); * ``` * * @param f * @param iter1 * @param iter2 */ // export function zipWith(f: (a: T, b: Y) => [R1, R2]): (a: Iter>) => (b: Iter>) => AsyncIterableIterator<[R1, R2]>; // export function zipWith(f: (a: T, b: Y) => (Promise<[R1, R2]> | Promise<(R1 | R2)[]>)): (a: Iter>) => (b: Iter>) => AsyncIterableIterator<[R1, R2]>; // export function zipWith(f: (a: T, b: Y) => [R1, R2]): (a: Iter>, b: Iter>) => AsyncIterableIterator<[R1, R2]>; // export function zipWith(f: (a: T, b: Y) => (Promise<[R1, R2]> | Promise<(R1 | R2)[]>)): (a: Iter>, b: Iter>) => AsyncIterableIterator<[R1, R2]>; export function zipWith(f: (elem1: T, elem2: Y) => (R | Promise), iter1: Iter>, iter2: Iter>): AsyncIterableIterator; // export function zipWith(f: (a: EP, b: EP) => R, iter1: Iter, iter2: Iter): AsyncIterableIterator>; export function zipWith, Y extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn) => R, iter1: T, iter2: Y): AsyncIterableIterator>; export function zipWith, Y extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn) => R, iter1: T): (iter2: Y) => AsyncIterableIterator>; export function zipWith, Y extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn) => R): CurriedFunction2>>; export function zipWith(f: (elem1: T, elem2: Y) => (R | Promise), iter1: Iter>): (iter2: Iter>) => AsyncIterableIterator; // export function zipWith(f: (a: EP, b: EP) => R, iter1: Iter): (iter2: Iter) => AsyncIterableIterator>; export function zipWith(f: (elem1: T, elem2: Y) => (R | Promise)): CurriedFunction2>, Iter>, AsyncIterableIterator>; // export function zipWith(f: (a: EP, b: EP) => R): CurriedFunction2, Iter, AsyncIterableIterator>>; /** * https://github.com/rudty/nodekell#zip3 * * @param iter1 * @param iter2 * @param iter3 */ export function zip3(iter1: Iter>, iter2: Iter>, iter3: Iter>): AsyncIterableIterator<[T, Y, Z]>; export function zip3, Y extends Iter, Z extends Iter>(iter1: T, iter2: Y, iter3: Z): AsyncIterableIterator<[FlatForInternalFn, FlatForInternalFn, FlatForInternalFn]>; export function zip3, Y extends Iter, Z extends Iter>(iter1: T, iter2: Y): (iter3: Z) => AsyncIterableIterator<[FlatForInternalFn, FlatForInternalFn, FlatForInternalFn]>; export function zip3, Y extends Iter, Z extends Iter>(iter1: T): CurriedFunction2, FlatForInternalFn, FlatForInternalFn]>>; export function zip3(iter1: Iter>, iter2: Iter>): (iter3: Iter>) => AsyncIterableIterator<[T, Y, Z]>; export function zip3(iter1: Iter>): CurriedFunction2>, Iter>, AsyncIterableIterator<[T, Y, Z]>>; /** * https://github.com/rudty/nodekell#zipwith3 * * **Note** * - if you want high quality type, use type assertion * ```ts * const a = [1, 2, 3, 4]; * const b = 'abcd'; * const c = [5, 6, 7, 8]; * const r = F.zipWith3((a, b, c) => [a, b, c] as [number, string, number]); * ``` * * @param f * @param iter1 * @param iter2 * @param iter3 */ export function zipWith3(f: (elem1: T, elem2: Y, elem3: Z) => (R | Promise), iter1: Iter>, iter2: Iter>, iter3: Iter>): AsyncIterableIterator; export function zipWith3, Y extends Iter, Z extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn, elem3: FlatForInternalFn) => R, iter1: T, iter2: Y, iter3: Z): AsyncIterableIterator>; export function zipWith3, Y extends Iter, Z extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn, elem3: FlatForInternalFn) => R, iter1: T, iter2: Y): (iter3: Z) => AsyncIterableIterator>; export function zipWith3, Y extends Iter, Z extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn, elem3: FlatForInternalFn) => R, iter1: T): CurriedFunction2>>; export function zipWith3, Y extends Iter, Z extends Iter, R>(f: (elem1: FlatForInternalFn, elem2: FlatForInternalFn, elem3: FlatForInternalFn) => R): CurriedFunction3>>; export function zipWith3(f: (elem1: T, elem2: Y, elem3: Z) => (R | Promise), iter1: Iter>, iter2: Iter>): (iter3: Iter>) => AsyncIterableIterator; export function zipWith3(f: (elem1: T, elem2: Y, elem3: Z) => (R | Promise), iter1: Iter>): CurriedFunction2>, Iter>, AsyncIterableIterator>; export function zipWith3(f: (elem1: T, elem2: Y, elem3: Z) => (R | Promise)): CurriedFunction3>, Iter>, Iter>, AsyncIterableIterator>; /** * https://github.com/rudty/nodekell#run * * **Note** * - originally allow Promise wrapped functions. but that is complicated. so don't support Promise wrapped functions type. * - please use functions length 20 or less * * ```ts * // like `$` or `.` * * let a = [1,2,3,4,5]; * let r = await F.run(a, * F.map(e => e + 1), // a = [2,3,4,5,6] * F.filter(e => e < 4), // a = [2,3] * F.take(Infinity), * F.collect); * * console.log(r); // print [2,3] * * ``` * * @param t * @param ...f */ export function run(t: T | Promise, f0: (t: T) => (R0 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise), f17: (r16: R16) => (R17 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise), f17: (r16: R16) => (R17 | Promise), f18: (r17: R17) => (R18 | Promise)): Promise; export function run(t: T | Promise, f0: (t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise), f17: (r16: R16) => (R17 | Promise), f18: (r17: R17) => (R18 | Promise), f19: (r18: R18) => (R19 | Promise)): Promise; /** * https://github.com/rudty/nodekell#pipe * **Note** * - please use functions length 20 or less * - please specify argument type in first function * ```ts * const double1 = F.pipe(F.map((e: number) => e + e), F.collect); * const double2 = F.pipe((t: number[]) => t.map(e => e + e)); * const a = [1,2,3,4]; * const r1 = await double1(a); * const r2 = await double2(a); * console.log(r1); // [2,4,6,8] * console.log(r2); // [2,4,6,8] * ``` * * @param ...f * @param t */ export function pipe(f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise), f17: (r16: R16) => (R17 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise), f17: (r16: R16) => (R17 | Promise), f18: (r17: R17) => (R18 | Promise)): (...t: T) => Promise; export function pipe(f0: (...t: T) => (R0 | Promise), f1: (r0: R0) => (R1 | Promise), f2: (r1: R1) => (R2 | Promise), f3: (r2: R2) => (R3 | Promise), f4: (r3: R3) => (R4 | Promise), f5: (r4: R4) => (R5 | Promise), f6: (r5: R5) => (R6 | Promise), f7: (r6: R6) => (R7 | Promise), f8: (r7: R7) => (R8 | Promise), f9: (r8: R8) => (R9 | Promise), f10: (r9: R9) => (R10 | Promise), f11: (r10: R10) => (R11 | Promise), f12: (r11: R11) => (R12 | Promise), f13: (r12: R12) => (R13 | Promise), f14: (r13: R13) => (R14 | Promise), f15: (r14: R14) => (R15 | Promise), f16: (r15: R15) => (R16 | Promise), f17: (r16: R16) => (R17 | Promise), f18: (r17: R17) => (R18 | Promise), f19: (r18: R18) => (R19 | Promise)): (...t: T) => Promise; /** * https://github.com/rudty/nodekell#compose * **Note** * - please use functions length 20 or less * - please specify argument type in first function * ```ts * const double1 = F.compose(F.collect, F.map((e: number) => e + e)); * const double2 = F.compose((t: number[]) => t.map(e => e + e)); * const a = [1,2,3,4]; * const r1 = await double1(a); * const r2 = await double2(a); * console.log(r1); // [2,4,6,8] * console.log(r2); // [2,4,6,8] * ``` * * @param ...f * @param t */ export function compose(f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f14: (r13: R13) => (R14 | Promise), f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f15: (r14: R14) => (R15 | Promise), f14: (r13: R13) => (R14 | Promise), f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f16: (r15: R15) => (R16 | Promise), f15: (r14: R14) => (R15 | Promise), f14: (r13: R13) => (R14 | Promise), f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f17: (r16: R16) => (R17 | Promise), f16: (r15: R15) => (R16 | Promise), f15: (r14: R14) => (R15 | Promise), f14: (r13: R13) => (R14 | Promise), f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f18: (r17: R17) => (R18 | Promise), f17: (r16: R16) => (R17 | Promise), f16: (r15: R15) => (R16 | Promise), f15: (r14: R14) => (R15 | Promise), f14: (r13: R13) => (R14 | Promise), f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; export function compose(f19: (r18: R18) => (R19 | Promise), f18: (r17: R17) => (R18 | Promise), f17: (r16: R16) => (R17 | Promise), f16: (r15: R15) => (R16 | Promise), f15: (r14: R14) => (R15 | Promise), f14: (r13: R13) => (R14 | Promise), f13: (r12: R12) => (R13 | Promise), f12: (r11: R11) => (R12 | Promise), f11: (r10: R10) => (R11 | Promise), f10: (r9: R9) => (R10 | Promise), f9: (r8: R8) => (R9 | Promise), f8: (r7: R7) => (R8 | Promise), f7: (r6: R6) => (R7 | Promise), f6: (r5: R5) => (R6 | Promise), f5: (r4: R4) => (R5 | Promise), f4: (r3: R3) => (R4 | Promise), f3: (r2: R2) => (R3 | Promise), f2: (r1: R1) => (R2 | Promise), f1: (r0: R0) => (R1 | Promise), f0: (...t: T) => (R0 | Promise)): (...t: T) => Promise; /** * https://github.com/rudty/nodekell#random * max: 4294967295 * random() => 0 ~ 4294967295 (unsigned int max) * random(10) => 0 ~ 9 [begin end) max: 4294967295 * random(1, 42) => 1 ~ 41 [begin end) max: 429496729 * @param endOrBegin * @param end * @param step */ export function random(end?: number): number; export function random(begin: number, end?: number): number; /** * * first argument is the calling function. from the second argument, * the argument is entered as the first argument. * returns a function calls first argument, * if a function has a argument, it acts as a substitute for an existing argument. * * @example * function sayHello(who: any) { * console.log("hello " + who); * } * * const sayHelloWithDefault = F.fnil(sayHello, "javascript"); * sayHelloWithDefault(); // print hello javascript * sayHelloWithDefault("leanne"); // print hello leanne * * @param fn call function * @param dArgs defaultArguments * @return function that calls fn */ export function fnil

(fn: (...args: P) => R, ...dArgs: P): ((...args: Partial

) => R); // export function fnil(fn: (...args: any) => R, ...dArgs: any): (...args: any) => R; /** * curry with Object.assign * Returns the target object. * * @param target target object to copy to * @param source source objects from which to copy properties */ export function assign(target: T, source1: S1, ...sources: S): MergeObject, S>; // tslint:disable-next-line: no-unnecessary-generics export function assign(target: T): <_S1 extends object = S1, _S extends object[] = S>(source1: _S1, ...sources: _S) => MergeObject, _S>; // export function assign(target: T): CurriedFunction2, S>>; /** * curry with Object.assign * Returns the target object. * must have at least 3 arguments * * @param target target object to copy to * @param source source objects from which to copy properties */ export function assign3(target: T, source1: S1, source2: S2, ...sources: S): MergeObject, S>; // tslint:disable-next-line: no-unnecessary-generics export function assign3(target: T, source1: S1): <_S2 extends object = S2, _S extends object[] = S>(source2: _S2, ...sources: _S) => MergeObject, _S>; // tslint:disable-next-line: no-unnecessary-generics export function assign3(target: T): <_S1 extends object = S1, _S2 extends object = S2, _S extends object[] = S>(source1: _S1, source2: _S2, ...sources: _S) => MergeObject, _S>; // tslint:disable-next-line: no-unnecessary-generics export function assign3(target: T): <_S1 extends object = S1>(source1: S1) => <_S2 extends object = S2, _S extends object[] = S>(source2: _S2, ...sources: _S) => MergeObject, _S>; // export function assign3(target: T, source1: S1): CurriedFunction2, S>>; // export function assign3(target: T): CurriedFunction3, S>>;