declare class Promise implements Promise.Thenable { constructor( callback: ( resolve: (value: Promise.Thenable) => void, reject: (reason: any) => void ) => void ); constructor( callback: ( resolve: (value: T) => void, reject: (reason: any) => void ) => void ); static resolve(): Promise; static resolve(value: Promise.Thenable): Promise; static resolve(value: U): Promise; static reject(reason: any): Promise; static join( a: Promise.Thenable, b: Promise.Thenable, handler: (a: V, b: W) => Promise.Thenable ): Promise; static join( a: V, b: Promise.Thenable, handler: (a: V, b: W) => Promise.Thenable ): Promise; static join( a: Promise.Thenable, b: W, handler: (a: V, b: W) => Promise.Thenable ): Promise; static join( a: Promise.Thenable, b: Promise.Thenable, handler: (a: V, b: W) => U ): Promise; static join( a: V, b: W, handler: (a: V, b: W) => Promise.Thenable ): Promise; static join( a: V, b: Promise.Thenable, handler: (a: V, b: W) => U ): Promise; static join( a: Promise.Thenable, b: W, handler: (a: V, b: W) => U ): Promise; static join( a: V, b: W, handler: (a: V, b: W) => U ): Promise; static join( a: Promise.Thenable, b: Promise.Thenable, c: Promise.Thenable, handler: (a: V, b: W, c: X) => Promise.Thenable ): Promise; static promisify( nodeFunction: (callback: (err: any, result: U) => void) => void, receiver?: any ): () => Promise; static promisify( nodeFunction: (a: V, callback: (err: any, result: U) => void) => void, receiver?: any ): (a: V) => Promise; static promisifyAll(target: Object, options?: Promise.PromisifyOptions): void; static map( values: Promise.Thenable[]>, mapper: (item: V, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.MapOptions ): Promise; static map( values: Promise.Thenable[]>, mapper: (item: V, index: number, arrayLength: number) => U, options?: Promise.MapOptions ): Promise; static map( values: Promise.Thenable, mapper: (item: V, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.MapOptions ): Promise; static map( values: Promise.Thenable, mapper: (item: V, index: number, arrayLength: number) => U, options?: Promise.MapOptions ): Promise; static map( values: Promise.Thenable[], mapper: (item: V, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.MapOptions ): Promise; static map( values: Promise.Thenable[], mapper: (item: V, index: number, arrayLength: number) => U, options?: Promise.MapOptions ): Promise; static map( values: V[], mapper: (item: V, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.MapOptions ): Promise; static map( values: V[], mapper: (item: V, index: number, arrayLength: number) => U, options?: Promise.MapOptions ): Promise; then( fulfilledHandler: (value: T) => Promise.Thenable, rejectedHandler: (reason: any) => Promise.Thenable ): Promise; then( fulfilledHandler: (value: T) => Promise.Thenable, rejectedHandler?: (reason: any) => U ): Promise; then( fulfilledHandler: (value: T) => U, rejectedHandler: (reason: any) => Promise.Thenable ): Promise; then( fulfilledHandler?: (value: T) => U, rejectedHandler?: (reason: any) => U ): Promise; catch(handler: (reason: any) => Promise.Thenable): Promise; catch(handler: (reason: any) => U): Promise; catch( predicate: (reason: any) => boolean, handler: (reason: any) => Promise.Thenable ): Promise; catch( predicate: (reason: any) => boolean, handler: (reason: any) => U ): Promise; catch( errorClass: Function, handler: (reason: any) => Promise.Thenable ): Promise; catch( errorClass: Function, handler: (reason: any) => U ): Promise; finally(handler: () => Promise.Thenable): Promise; finally(handler: () => U): Promise; map( mapper: (item: V, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.MapOptions ): Promise; map( mapper: (item: V, index: number, arrayLength: number) => U, options?: Promise.MapOptions ): Promise; filter( filterer: (item: V, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.MapOptions ): Promise; filter( filterer: (item: V, index: number, arrayLength: number) => boolean, options?: Promise.MapOptions ): Promise; each( iterator: (item: V, index: number, arrayLength: number) => Promise.Thenable ): Promise; each( iterator: (item: V, index: number, arrayLength: number) => U ): Promise; tap(handler: (value: T) => Promise.Thenable): Promise; tap(handler: (value: T) => U): Promise; return(value: Promise.Thenable): Promise; return(value: U): Promise; throw(reason: any): Promise; disposer(disposer: (value: T) => Promise.Thenable): Promise.Disposer; disposer(disposer: (value: T) => U): Promise.Disposer; static using( promise: Promise.Disposer, handler: (value: T) => Promise.Thenable ): Promise; static using( promise: Promise.Disposer, handler: (value: T) => U ): Promise; } declare module Promise { export interface Thenable { then( fulfilledHandler: (value: T) => Thenable, rejectedHandler: (error: any) => Thenable ): Thenable; then( fulfilledHandler: (value: T) => Thenable, rejectedHandler?: (error: any) => U ): Thenable; then( fulfilledHandler: (value: T) => U, rejectedHandler: (error: any) => Thenable ): Thenable; then( fulfilledHandler?: (value: T) => U, rejectedHandler?: (error: any) => U ): Thenable; } export interface PromisifyOptions { suffix?: string; filter?: ( name: string, func: Function, target: Object, passesDefaultFilter: boolean ) => boolean; promisifier?: ( originalMethod: Function, defaultPromisifer: (originalMethod: Function) => (...args: any[]) => Promise ) => (...args: any[]) => Promise; } export interface MapOptions { concurrency?: number } export class Disposer extends Promise { } } declare module 'bluebird' { export = Promise; }