/** * Future is a resolve-later Promise, you can resolve it any time after a future is created. * * @public this feature is stable and is guaranteed to not have breaking change before v1.0.0 * @example * * ```typescript * const future = new Future() * // somewhere * const count = await future * // elsewhere, and the future becomes `fullfilled` * future.resolve(count) * ``` */ export declare class Future extends Promise { private static _constructors; protected _resolve: (value: T | PromiseLike) => void; protected _reject: (error: unknown) => void; protected promiseState: symbol; protected settledValue?: T | unknown; static get [Symbol.species](): PromiseConstructor; constructor(); /** * resolve the future with given value * * tips: the method has already bound to `this`, so you can write `emitter.on('event', future.resolve)` */ get resolve(): (value: T | PromiseLike) => void; /** * reject the future with given value. * * the method has already bound to `this`, so you can write `emitter.on('error', future.reject)` */ get reject(): (error?: unknown) => void; /** * check if the promise is neither fulfilled nor rejected */ get pending(): boolean; /** * check if future has been fullfilled. */ get fulfilled(): boolean; /** * check if future has been rejected. */ get rejected(): boolean; /** * get the promise settled result, for debug purpose only. */ get settled(): unknown; } //# sourceMappingURL=future.d.ts.map