import { CancellablePromise } from '../types/cancellable-promise';
import { FutureContainer } from '../models/future/future-types';

/**
 * Wraps a @kosFuture method call to return a CancellablePromise
 * This gives you direct cancellation control without needing to access model.future
 *
 * @example
 * ```typescript
 * // Instead of:
 * const promise = model.performOperation('data');
 * // Later: await model.future?.cancelFuture();
 *
 * // Use:
 * const cancellable = makeCancellable(model, m => m.performOperation('data'));
 * // Later: await cancellable.cancel();
 * ```
 */
export declare function makeCancellable<T extends FutureContainer, R>(model: T, methodCall: (model: T) => Promise<R>): CancellablePromise<R>;
/**
 * Alternative approach using method decoration at call time
 * This is more explicit but requires wrapping individual calls
 *
 * @example
 * ```typescript
 * const cancellable = withCancellation(model, 'performOperation', 'data');
 * await cancellable.cancel();
 * ```
 */
export declare function withCancellation<T extends FutureContainer, K extends keyof T>(model: T, methodName: K, ...args: T[K] extends (...args: infer A) => any ? A : never): CancellablePromise<T[K] extends (...args: any[]) => Promise<infer R> ? R : never>;
/**
 * Batch cancellation utility for multiple operations
 *
 * @example
 * ```typescript
 * const batch = createCancellationBatch();
 *
 * const op1 = batch.add(model, m => m.performOperation1());
 * const op2 = batch.add(model, m => m.performOperation2());
 *
 * // Cancel all operations at once
 * await batch.cancelAll();
 * ```
 */
export declare class CancellationBatch {
    private operations;
    add<T extends FutureContainer, R>(model: T, methodCall: (model: T) => Promise<R>): CancellablePromise<R>;
    cancelAll(): Promise<void>;
    getAllControllers(): Array<AbortController | undefined>;
    getActiveCount(): number;
    clear(): void;
}
export declare function createCancellationBatch(): CancellationBatch;
//# sourceMappingURL=cancellable-future-call.d.ts.map