mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
19 lines
670 B
TypeScript
19 lines
670 B
TypeScript
// Type definitions for promises-a-plus
|
|
// Project: http://promisesaplus.com/
|
|
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare namespace PromisesAPlus {
|
|
interface PromiseCtor {
|
|
<T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable<T>;
|
|
}
|
|
|
|
interface PromiseImpl {
|
|
new <T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable<T>;
|
|
}
|
|
|
|
interface Thenable<T> {
|
|
then<R>(onFulfill?: (value: T) => Thenable<R>|R, onReject?: (error: any) => Thenable<R>|R): Thenable<R>;
|
|
}
|
|
}
|