diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index f437464da3..4d37cccf10 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1917,7 +1917,7 @@ declare namespace R { * Note that the order of the output array is not guaranteed across * different JS platforms. */ - values(obj: { [index: string]: T } | any): T[]; + values(obj: T): Array; /** * Returns a list of all the properties, including prototype properties, of the supplied diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 38806fb3b4..eae917d93e 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1567,7 +1567,19 @@ class Rectangle { }; () => { - const a = R.values({a: 1, b: 2, c: 3}); // => [1, 2, 3] + interface A { + a: string; + b: string; + } + const a1: A = { a: 'something', b: 'else' }; + const v1 = R.values(a1); + + const a = R.values({a: 1, b: 2, c: 3}); // => [1, 2, 3] (number[]) + const addition = a[0] + a[1]; + + const b = R.values({a: 1, b: 'something'}); // b = (string|number)[] + const c = R.values({1: 3}); + // const d = R.values('something'); }; () => {