/** * @module * Provides `Promise` that can be resolved from outside. * @see {@link PromiseResolutionSource} */ /** * Resolves or rejects a `Promise` from outside of it. * * This class is similar to `Deferred` but it explicitly separates * the promise and its control side into two different objects. * * @typeparam T type of the promise resolution result. * @see {@link PromiseLikeResolutionSource} */ export declare class PromiseResolutionSource { private _promise; private _resolve; private _reject; private _ensurePromiseInitialized; /** Gets the derived `Promise` controlled by the current instance. */ get promise(): Promise; /** * Resolves the derived `Promise` with the specified result. * @param result the resolution result, or a `PromiseLike` that can be furtherly *resolved*. * @returns `true` if the derived `Promise` has just been *resolved*; * otherwise it means the `Promise` has already been *settled* before. */ tryResolve(result: T | PromiseLike): boolean; /** * Cancels the derived `Promise`. * @returns `true` if the derived `Promise` has just been *rejected* with `PromiseCancelledError`; * otherwise it means the `Promise` has already been *settled* before. */ tryCancel(): boolean; /** * Rejects the derived `Promise` with the specified rason. * @param reason the rejection reason, or the `Error` causing the rejection. * @returns `true` if the derived `Promise` has just been *rejected*; * otherwise it means the `Promise` has already been *settled* before. */ tryReject(reason: any): boolean; } //# sourceMappingURL=promiseResolutionSource.d.ts.map