/**
 * A long-running operation whose progress can be observed imperatively.
 *
 * This is the consumer-facing contract for progress surfaces (progress
 * notifications, status indicators, modals): they depend on this interface,
 * never on the producer. Producers adapt their source to it — e.g.
 * `awaitFutureCall` adapts a KOS Future, but an XHR upload or an aggregate
 * over several operations can implement it just as well.
 */
export interface ProgressOperation<T = unknown> extends Promise<T> {
    /**
     * Percent complete, 0-100. Values <= 0 mean the operation has not reported
     * real progress yet — consumers should render an indeterminate state.
     */
    readonly progress: number;
    /**
     * Current status of the operation.
     * Common values: "NOT_ACTIVE", "IN_PROGRESS", a terminal end state
     * ("SUCCESS" | "FAIL" | "ABORT" | "CANCEL"), or consumer-defined.
     */
    readonly status: string;
    /**
     * Whether the operation is currently running
     */
    readonly isRunning: boolean;
    /**
     * Human-readable time remaining (e.g. "2 minutes"), when the source can
     * estimate it. Empty/undefined when unknown.
     */
    readonly timeRemaining?: string;
    /**
     * Cancel this specific operation
     */
    cancel(): Promise<void>;
    /**
     * Check if this operation was cancelled. Optional — consumers must treat
     * a missing implementation as "unknown".
     */
    isCancelled?(): boolean;
    /**
     * Subscribe to progress updates
     * Returns a dispose function to clean up the subscription
     */
    onProgressUpdate(callback: (progress: number, status: string) => void): () => void;
}
/**
 * A Promise that can be cancelled and provides progress/state tracking
 */
export interface CancellablePromise<T> extends ProgressOperation<T> {
    /**
     * Get the underlying AbortController for this operation
     */
    getController(): AbortController | undefined;
    /**
     * Check if this operation is cancelled
     */
    isCancelled(): boolean;
}
/**
 * Options for creating a cancellable promise with progress tracking
 */
export interface CancellablePromiseOptions<T> {
    promise: Promise<T>;
    abortController?: AbortController;
    cancelFuture?: () => Promise<void>;
    future?: any;
}
/**
 * Create a cancellable promise wrapper with reactive progress tracking
 */
export declare function createCancellablePromise<T>(promise: Promise<T>, abortController?: AbortController, cancelFuture?: () => Promise<void>, future?: any): CancellablePromise<T>;
export declare function createCancellablePromise<T>(options: CancellablePromiseOptions<T>): CancellablePromise<T>;
//# sourceMappingURL=cancellable-promise.d.ts.map