declare namespace DojoPromise { interface Thenable extends PromiseLike { /** * Add new callbacks to the promise. */ then(callback?: PromiseCallback, errback?: PromiseErrback, progback?: PromiseProgback): Thenable; } type PromiseCallback = ((value: T) => U | PromiseLike) | undefined | null; type PromiseErrback = PromiseCallback; type PromiseProgback = (progress: any) => void; interface DojoPromise extends Thenable { /** * Inform the deferred it may cancel its asynchronous operation. */ cancel(reason?: any, strict?: boolean): any; /** * Checks whether the promise has been resolved. */ isResolved(): boolean; /** * Checks whether the promise has been rejected. */ isRejected(): boolean; /** * Checks whether the promise has been resolved or rejected. */ isFulfilled(): boolean; /** * Checks whether the promise has been canceled. */ isCanceled(): boolean; /** * Add a callback to be invoked when the promise is resolved * or rejected. */ always(callbackOrErrback: PromiseCallback): DojoPromise; /** * Add new errbacks to the promise. */ otherwise(errback: PromiseErrback): DojoPromise; trace(): this; traceRejected(): this; toString(): string; } interface DojoPromiseConstructor { /** * The public interface to a deferred. */ new (): DojoPromise; } } type DojoPromise = DojoPromise.DojoPromise; declare const DojoPromise: DojoPromise.DojoPromiseConstructor; export = DojoPromise;