mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
22 lines
923 B
TypeScript
22 lines
923 B
TypeScript
// Type definitions for promises-a-plus
|
|
// Project: http://promisesaplus.com/
|
|
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
declare module 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<R> {
|
|
then<U>(onFulfill: (value: R) => Thenable<U>, onReject: (error: any) => Thenable<U>): Thenable<U>;
|
|
then<U>(onFulfill: (value: R) => Thenable<U>, onReject?: (error: any) => U): Thenable<U>;
|
|
then<U>(onFulfill: (value: R) => U, onReject: (error: any) => Thenable<U>): Thenable<U>;
|
|
then<U>(onFulfill?: (value: R) => U, onReject?: (error: any) => U): Thenable<U>;
|
|
}
|
|
}
|