mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add when(x) overloads
This commit is contained in:
Vendored
+8
@@ -3,6 +3,10 @@
|
||||
// Definitions by: Derek Cicerone <https://github.com/derekcicerone>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare function When<T>(value: When.Promise<T>): When.Promise<T>;
|
||||
declare function When<T>(value: When.Thenable<T>): When.Promise<T>;
|
||||
declare function When<T>(value: T): When.Promise<T>;
|
||||
|
||||
declare module When {
|
||||
|
||||
/**
|
||||
@@ -80,6 +84,10 @@ declare module When {
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise<U>;
|
||||
}
|
||||
|
||||
interface Thenable<T> {
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Thenable<U>;
|
||||
}
|
||||
|
||||
interface Snapshot<T> {
|
||||
state: string;
|
||||
value?: T;
|
||||
|
||||
Reference in New Issue
Block a user