##// END OF EJS Templates
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods

File last commit:

r2:8ec37bf1b4d1 default
r30:a46488b209e8 v1.0.0-rc14 default
Show More
Promise.d.ts
68 lines | 1.8 KiB | video/mp2t | TypeScriptLexer
cin
created typings for basic part of dojo and dijit further work is required to...
r2 declare namespace DojoPromise {
interface Thenable<T> extends PromiseLike<T> {
/**
* Add new callbacks to the promise.
*/
then<U1, U2>(callback?: PromiseCallback<T, U1>, errback?: PromiseErrback<U2>, progback?: PromiseProgback): Thenable<U1 | U2>;
}
type PromiseCallback<T, U> = ((value: T) => U | PromiseLike<U>) | undefined | null;
type PromiseErrback<U> = PromiseCallback<any, U>;
type PromiseProgback = (progress: any) => void;
interface DojoPromise<T> extends Thenable<T> {
/**
* 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<U>(callbackOrErrback: PromiseCallback<any, U>): DojoPromise<U>;
/**
* Add new errbacks to the promise.
*/
otherwise<U>(errback: PromiseErrback<U>): DojoPromise<U>;
trace(): this;
traceRejected(): this;
toString(): string;
}
interface DojoPromiseConstructor {
/**
* The public interface to a deferred.
*/
new <T>(): DojoPromise<T>;
}
}
type DojoPromise<T> = DojoPromise.DojoPromise<T>;
declare const DojoPromise: DojoPromise.DojoPromiseConstructor;
export = DojoPromise;