// Type definitions for promise v7.1.1 // Project: https://www.promisejs.org/ // Definitions by: Manuel Rueda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export as namespace Promise; export = Promise; declare var Promise: Promise.IPromise; declare namespace Promise { export interface IPromise { new (resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): IThenable; resolve: (value: T) => IThenable; reject: (value: T) => IThenable; all: (array: Array>) => IThenable>; denodeify: (fn: Function) => (...args: any[]) => IThenable; nodeify: (fn: Function) => Function; } export interface IThenable { then(onFulfilled?: (value: T) => IThenable|R, onRejected?: (error: any) => IThenable|R): IThenable; catch(onRejected?: (error: any) => IThenable|R): IThenable; done(onFulfilled?: (value: T) => IThenable|R, onRejected?: (error: any) => IThenable|R): IThenable; nodeify(callback: Function): IThenable; } }