/** * Cancellation Support * * Provides operation cancellation capabilities using AbortController/AbortSignal. * Compatible with Node.js streams and async operations. */ export declare class CancellableOperation { private abortController; private startTime; private cancelledAt?; private reason?; constructor(); /** * Get AbortSignal for use with operations */ getSignal(): AbortSignal; /** * Cancel the operation with optional reason */ cancel(reason?: string): void; /** * Check if operation has been cancelled */ isCancelled(): boolean; /** * Get cancellation reason */ getReason(): string | undefined; /** * Get time when operation was cancelled */ getCancelledAt(): number | undefined; /** * Get duration before cancellation (milliseconds) */ getDurationBeforeCancel(): number | undefined; /** * Execute operation with timeout */ withTimeout(operation: (signal: AbortSignal) => Promise, timeoutMs: number): Promise; /** * Create a child cancellable operation * When parent is cancelled, child is automatically cancelled */ createChild(): CancellableOperation; } /** * Execute multiple operations with shared cancellation */ export declare class CancellableGroup { private operations; private mainController; /** * Add operation to group */ add(): CancellableOperation; /** * Cancel all operations in group */ cancelAll(reason?: string): void; /** * Check if any operation is cancelled */ isAnyCancelled(): boolean; /** * Check if all operations are cancelled */ isAllCancelled(): boolean; /** * Get count of cancelled operations */ getCancelledCount(): number; } /** * Utility: Create a race between operation and cancellation */ export declare function raceWithCancellation(operation: Promise, signal: AbortSignal): Promise; /** * Utility: Delay with cancellation support */ export declare function delay(ms: number, signal?: AbortSignal): Promise; //# sourceMappingURL=cancellation.d.ts.map