/** A resolve/reject callback used within PromiseEx. */ export type PromiseExSubFunc = (value: T) => TResult; /** The executor function passed to the PromiseEx constructor. */ export type PromiseExFunc = (resolve?: PromiseExSubFunc, reject?: PromiseExSubFunc) => void; /** A callback that inspects the attached value and returns whether to cancel the promise. */ export type PromiseExValueFunc = (value?: V) => boolean; /** * An extended Promise that carries an optional attached value and supports cancellation. * The value can be inspected via the `then` or `value` methods to conditionally cancel. */ export declare class PromiseEx extends Promise { /** Whether the promise has been cancelled via a value callback. */ cancelled?: boolean; private _value?; constructor(func: PromiseExFunc, value?: V); then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null | undefined, onvalue?: (value?: V) => boolean): Promise; /** * Inspects the attached value via the callback; if it returns true, marks the promise as cancelled. * @param onvalue - A callback that receives the attached value and returns whether to cancel. * @returns This instance for chaining. */ value(onvalue?: (value?: V) => boolean): this; } //# sourceMappingURL=PromiseEx.d.ts.map