mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 06:50:19 +00:00
Add an unrelated type parameter and this parameter
This returns `call` to its previous level of fidelity. Thanks (?) to @weswigham for this hack.
This commit is contained in:
@@ -553,7 +553,7 @@ bool = fooProm.isResolved();
|
||||
strProm = fooProm.call("foo");
|
||||
strProm = fooProm.call("foo", 1, 2, 3);
|
||||
|
||||
// $ExpectType Bluebird<any>
|
||||
// $ExpectType Bluebird<never>
|
||||
quxProm.call("qux");
|
||||
|
||||
strProm = fooProm.get("foo").then(method => method());
|
||||
|
||||
Vendored
+1
-1
@@ -350,7 +350,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
* });
|
||||
* </code>
|
||||
*/
|
||||
call<U extends keyof R>(propertyName: U, ...args: any[]): Bluebird<any>;
|
||||
call<U extends keyof Q, Q>(this: Bluebird<Q>, propertyName: U, ...args: any[]): Bluebird<Q[U] extends (...args: any[]) => any ? ReturnType<Q[U]> : never>;
|
||||
|
||||
/**
|
||||
* This is a convenience method for doing:
|
||||
|
||||
Reference in New Issue
Block a user