interface Thenable { then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; } declare class Promise implements Thenable { constructor(callback: (resolve: (value?: R | Thenable) => void, reject: (error?: any) => void) => void); then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Promise; catch(onRejected?: (error: any) => U | Thenable): Promise; }