Permalink
Browse files

update invoker function signature

  • Loading branch information...
raynerpupo committed Dec 20, 2017
1 parent f87e32c commit 18ebf4d5f82174031d3fab899c8b2936e80a2bd2
Showing with 8 additions and 9 deletions.
  1. +6 −7 types/ramda/index.d.ts
  2. +2 −2 types/ramda/ramda-tests.ts
@@ -11,6 +11,7 @@
// Charles-Philippe Clermont <https://github.com/charlespwd>
// Samson Keung <https://github.com/samsonkeung>
// Angelo Ocana <https://github.com/angeloocana>
// Rayner Pupo <https://github.com/raynerd>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
@@ -812,15 +813,13 @@ declare namespace R {
invertObj(obj: { [index: string]: string } | { [index: number]: string }): { [index: string]: string };
/**
* Turns a named method of an object (or object prototype) into a function that can be
* called directly. Passing the optional `len` parameter restricts the returned function to
* the initial `len` parameters of the method.
* Turns a named method with a specified arity into a function that can be called directly
* supplied with arguments and a target object.
*
* The returned function is curried and accepts `len + 1` parameters (or `method.length + 1`
* when `len` is not specified), and the final parameter is the target object.
* The returned function is curried and accepts `arity + 1` parameters where the final
* parameter is the target object.
*/
invoker(name: string, obj: any, len?: number): (...a: any[]) => any;
invoker(name: string): (obj: any, len?: number) => (...a: any[]) => any;
invoker(arity: number, method: string): (...a: any[]) => any;
/**
* See if an object (`val`) is an instance of the supplied constructor.
@@ -202,8 +202,8 @@ class F2 {
};
() => {
R.invoker("charAt", String.prototype);
R.invoker("charAt", String.prototype, 1);
R.invoker(1, "slice")(6, "abcdefghijklm");
R.invoker(2, "slice")(6)(8, "abcdefghijklm");
};
(() => {

0 comments on commit 18ebf4d

Please sign in to comment.