diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 0994fe3651..9c55fae594 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -28,6 +28,7 @@ // Krantisinh Deshmukh // Pierre-Antoine Mills // Brekk Bockrath +// Jituan Lin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 @@ -964,6 +965,7 @@ declare namespace R { */ chain(fn: (n: T) => ReadonlyArray, list: ReadonlyArray): U[]; chain(fn: (n: T) => ReadonlyArray): (list: ReadonlyArray) => U[]; + chain(fn: (x0: X0, x1: X1) => R, fn1: (x1: X1) => X0): (x1: X1) => R; /** * Restricts a number to be within a range. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index cb16a1c2a9..5b63b3123f 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -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(R.append, R.head)([ + 1, + 2, + 3 + ]); // => [1, 2, 3, 1] }; () => {