diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 7fde62feee..d74b8b3e14 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1728,6 +1728,7 @@ declare namespace R { * portion of the data structure is visible. */ view(lens: Lens, obj: T): U; + view(lens: Lens): (obj: T) => U; /** * Tests the final argument by passing it to the given predicate function. If the predicate is satisfied, the function diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 5c5948b047..9afa47ba04 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1161,6 +1161,7 @@ class Rectangle { () => { var xLens = R.lens(R.prop('x'), R.assoc('x')); R.view(xLens, {x: 1, y: 2}); //=> 1 + R.view(xLens)({x: 1, y: 2}); //=> 1 R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2} R.set(xLens)(4, {x: 1, y: 2}); //=> {x: 4, y: 2} R.set(xLens, 4)({x: 1, y: 2}); //=> {x: 4, y: 2}