mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #3214 from jbblanchet/master
Add when signature for Promise<void>
This commit is contained in:
@@ -94,6 +94,7 @@ Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d =>
|
||||
|
||||
Q.when(8, num => num + "!");
|
||||
Q.when(Q(8), num => num + "!").then(str => str.split(','));
|
||||
var voidPromise: Q.Promise<void> = Q.when();
|
||||
|
||||
declare function saveToDisk(): Q.Promise<any>;
|
||||
declare function saveToCloud(): Q.Promise<any>;
|
||||
|
||||
@@ -188,6 +188,9 @@ declare module Q {
|
||||
reason?: any;
|
||||
}
|
||||
|
||||
// If no value provided, returned promise will be of void type
|
||||
export function when(): Promise<void>;
|
||||
|
||||
// if no fulfill, reject, or progress provided, returned promise will be of same type
|
||||
export function when<T>(value: IPromise<T>): Promise<T>;
|
||||
export function when<T>(value: T): Promise<T>;
|
||||
|
||||
Reference in New Issue
Block a user