mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-31 05:57:33 +00:00
ramda: add support of applying chain to function type argument (#36078)
* ramda: add support of applying `chain` to function type argument * lint * add test for `chain`
This commit is contained in:
parent
eff7ed18e6
commit
d3cf467af3
2
types/ramda/index.d.ts
vendored
2
types/ramda/index.d.ts
vendored
@ -28,6 +28,7 @@
|
||||
// Krantisinh Deshmukh <https://github.com/krantisinh>
|
||||
// Pierre-Antoine Mills <https://github.com/pirix-gh>
|
||||
// Brekk Bockrath <https://github.com/brekk>
|
||||
// Jituan Lin <https://github.com/jituanlin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.3
|
||||
|
||||
@ -964,6 +965,7 @@ declare namespace R {
|
||||
*/
|
||||
chain<T, U>(fn: (n: T) => ReadonlyArray<U>, list: ReadonlyArray<T>): U[];
|
||||
chain<T, U>(fn: (n: T) => ReadonlyArray<U>): (list: ReadonlyArray<T>) => U[];
|
||||
chain<X0, X1, R>(fn: (x0: X0, x1: X1) => R, fn1: (x1: X1) => X0): (x1: X1) => R;
|
||||
|
||||
/**
|
||||
* Restricts a number to be within a range.
|
||||
|
||||
@ -723,6 +723,11 @@ R.times(i, 5);
|
||||
|
||||
R.chain(duplicate, [1, 2, 3]); // => [1, 1, 2, 2, 3, 3]
|
||||
R.chain(duplicate)([1, 2, 3]); // => [1, 1, 2, 2, 3, 3]
|
||||
const result1: number[] = R.chain<number, number[], number[]>(R.append, R.head)([
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]); // => [1, 2, 3, 1]
|
||||
};
|
||||
|
||||
() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user