##// END OF EJS Templates
Added @prototype decorator
Added @prototype decorator

File last commit:

r2:8ec37bf1b4d1 default
r24:9b77ac3bf8f2 v1.0.0-rc11 default
Show More
Deferred.d.ts
76 lines | 1.9 KiB | video/mp2t | TypeScriptLexer
import { PromiseCallback, DojoPromise, PromiseErrback, PromiseProgback } from "./promise/Promise";
declare namespace dojoDeferred {
interface Deferred<T> {
/**
* The public promise object that clients can add callbacks to.
*/
promise: DojoPromise<T>;
/**
* Checks whether the deferred has been resolved.
*/
isResolved(): boolean;
/**
* Checks whether the deferred has been rejected.
*/
isRejected(): boolean;
/**
* Checks whether the deferred has been resolved or rejected.
*/
isFulfilled(): boolean;
/**
* Checks whether the deferred has been canceled.
*/
isCanceled(): boolean;
/**
* Emit a progress update on the deferred.
*/
progress(update: any, strict?: boolean): DojoPromise<T>;
/**
* Resolve the deferred.
*/
resolve(value?: T, strict?: boolean): DojoPromise<T>;
/**
* Reject the deferred.
*/
reject(error?: any, strict?: boolean): DojoPromise<T>;
/**
* Add new callbacks to the deferred.
*/
then<U>(callback?: PromiseCallback<T, U>, errback?: PromiseErrback<U>, progback?: PromiseProgback): DojoPromise<U>;
/**
* Inform the deferred it may cancel its asynchronous operation.
*/
cancel(reason?: any, strict?: boolean): any;
/**
* Returns `[object Deferred]`.
*/
toString(): string;
}
interface DeferredConstructor {
/**
* Creates a new deferred. This API is preferred over
* `dojo/_base/Deferred`.
*/
new <T>(canceller?: (reason: any) => void): Deferred<T>;
prototype: Deferred<any>;
}
}
type dojoDeferred<T> = dojoDeferred.Deferred<T>;
declare const dojoDeferred: dojoDeferred.DeferredConstructor;
export = dojoDeferred;