declare module "bluebird" { interface Disposer { } interface MapOptions { concurrency: number } class BluebirdPromise implements Promise { constructor(callback: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: Error) => void, onCancel?: (handler: () => void) => void) => void) static config(options: any): void static all(values: Iterable>): BluebirdPromise> static map(items: Iterable>, mapper: (item: T) => PromiseLike, opts?: MapOptions): BluebirdPromise> static map(items: Iterable>, mapper: (item: T, index: number) => PromiseLike, opts?: MapOptions): BluebirdPromise> static mapSeries(items: Iterable, mapper: (item: T) => BluebirdPromise): BluebirdPromise static reject(error: Error): BluebirdPromise static coroutine(generator: Function): Function /** * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. * * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. * * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. */ static promisify(func: (callback: (err: any, result: T) => void) => void, receiver?: any): () => BluebirdPromise; static promisify(func: (arg1: A1, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1) => BluebirdPromise; static promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2) => BluebirdPromise; static promisify(func: (arg1: A1, arg2: A2, callback: (error: Error) => void) => void, receiver?: any): (arg1: A1, arg2: A2) => BluebirdPromise; static promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3) => BluebirdPromise; static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => BluebirdPromise; static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => BluebirdPromise; static promisify(nodeFunction: Function, receiver?: any): Function; static resolve(value: T | PromiseLike): BluebirdPromise static resolve(): BluebirdPromise then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): BluebirdPromise then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): BluebirdPromise //noinspection ReservedWordAsName catch(onrejected?: (reason: any) => T | PromiseLike): BluebirdPromise //noinspection ReservedWordAsName catch(onrejected?: (reason: any) => void): BluebirdPromise; [Symbol.toStringTag]: any disposer(disposer: (result: T, promise: Promise) => Promise | void): Disposer thenReturn(result: T): BluebirdPromise cancel(): void isFulfilled(): boolean isPending(): boolean isCancelled(): boolean isRejected(): boolean value(): T } export { BluebirdPromise as Promise } }