1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export as namespace Promise;
|
7 |
|
8 | export = Promise;
|
9 | declare var Promise: Promise.IPromise;
|
10 |
|
11 | declare namespace Promise {
|
12 | export interface IPromise {
|
13 | new <T>(resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): IThenable<T>;
|
14 |
|
15 | resolve: <T>(value: T) => IThenable<T>;
|
16 | reject: <T>(value: T) => IThenable<T>;
|
17 | all: (array: Array<IThenable<any>>) => IThenable<Array<any>>;
|
18 | denodeify: (fn: Function) => (...args: any[]) => IThenable<any>;
|
19 | nodeify: (fn: Function) => Function;
|
20 | }
|
21 |
|
22 | export interface IThenable<T> {
|
23 | then<R>(onFulfilled?: (value: T) => IThenable<R>|R, onRejected?: (error: any) => IThenable<R>|R): IThenable<R>;
|
24 | catch<R>(onRejected?: (error: any) => IThenable<R>|R): IThenable<R>;
|
25 | done<R>(onFulfilled?: (value: T) => IThenable<R>|R, onRejected?: (error: any) => IThenable<R>|R): IThenable<R>;
|
26 | nodeify<R>(callback: Function): IThenable<R>;
|
27 | }
|
28 | }
|
29 |
|
\ | No newline at end of file |