/**
 * Timeout protection for async operations
 * Prevents operations from hanging indefinitely
 */
export interface TimeoutOptions {
    /** Timeout in milliseconds */
    timeout: number;
    /** Operation name for error messages */
    operation?: string;
    /** Custom error message */
    errorMessage?: string;
}
/**
 * Wrap an async operation with a timeout
 */
export declare function withTimeout<T>(promise: Promise<T>, options: TimeoutOptions): Promise<T>;
/**
 * Custom error for timeout operations
 */
export declare class TimeoutError extends Error {
    readonly timeout: number;
    readonly operation?: string | undefined;
    constructor(message: string, timeout: number, // eslint-disable-line no-unused-vars
    operation?: string | undefined);
}
/**
 * Create a timeout wrapper function for repeated use
 */
export declare function createTimeoutWrapper(defaultTimeout: number): <T>(promise: Promise<T>, options?: Partial<TimeoutOptions>) => Promise<T>;
/**
 * Wrap multiple promises with individual timeouts
 */
export declare function allWithTimeout<T>(promises: Array<{
    promise: Promise<T>;
    options: TimeoutOptions;
}>, options?: {
    /** Fail fast on first timeout (default: false) */
    failFast?: boolean;
}): Promise<T[]>;
/**
 * Aggregate error for multiple timeout failures
 */
export declare class AggregateTimeoutError extends Error {
    readonly errors: Error[];
    constructor(errors: Error[]);
}
//# sourceMappingURL=async-timeout.d.ts.map