diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 52872755d0..6337e08d9e 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -254,6 +254,16 @@ declare namespace R { * Returns a new list, composed of n-tuples of consecutive elements If n is greater than the length of the list, * an empty list is returned. */ + aperture(n: 1, list: T[]): Array<[T]>; + aperture(n: 2, list: T[]): Array<[T, T]>; + aperture(n: 3, list: T[]): Array<[T, T, T]>; + aperture(n: 4, list: T[]): Array<[T, T, T, T]>; + aperture(n: 5, list: T[]): Array<[T, T, T, T, T]>; + aperture(n: 6, list: T[]): Array<[T, T, T, T, T, T]>; + aperture(n: 7, list: T[]): Array<[T, T, T, T, T, T, T]>; + aperture(n: 8, list: T[]): Array<[T, T, T, T, T, T, T, T]>; + aperture(n: 9, list: T[]): Array<[T, T, T, T, T, T, T, T, T]>; + aperture(n: 10, list: T[]): Array<[T, T, T, T, T, T, T, T, T, T]>; aperture(n: number, list: ReadonlyArray): T[][]; aperture(n: number): (list: ReadonlyArray) => T[][]; diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 27898696b7..00591ebf94 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -475,6 +475,9 @@ R.times(i, 5); R.aperture(3, [1, 2, 3, 4, 5]); // => [[1, 2, 3], [2, 3, 4], [3, 4, 5]] R.aperture(7, [1, 2, 3, 4, 5]); // => [] R.aperture(7)([1, 2, 3, 4, 5]); // => [] + + const res1: Array<[number, number]> = R.aperture(2, [1, 2, 3, 4, 5]); + const res2: number[][] = R.aperture(11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); }; () => {