/**
 * Wraps a promise with a timeout. If the promise doesn't resolve within the
 * specified timeout, it rejects with a TimeoutError.
 *
 * This is particularly useful for browser RPC calls which can hang indefinitely
 * if the browser tab becomes unresponsive or disconnects.
 */
export declare class RpcTimeoutError extends Error {
    readonly operationName: string;
    readonly timeoutMs: number;
    constructor(operationName: string, timeoutMs: number);
}
/**
 * Default timeout for browser RPC calls (60 seconds).
 * This is generous enough for slow operations but will catch hung calls.
 */
export declare const DEFAULT_RPC_TIMEOUT_MS = 60000;
/**
 * Wraps a promise with a timeout.
 *
 * @param promise - The promise to wrap
 * @param timeoutMs - Timeout in milliseconds (default: 30000)
 * @param operationName - Name of the operation for error messages
 * @returns The result of the promise if it resolves within the timeout
 * @throws RpcTimeoutError if the promise doesn't resolve within the timeout
 *
 * @example
 * ```ts
 * const integrations = await withRpcTimeout(
 *   editorClient.call.aiGetIntegrations(),
 *   30000,
 *   'aiGetIntegrations'
 * );
 * ```
 */
export declare function withRpcTimeout<T>(promise: Promise<T>, timeoutMs?: number, operationName?: string): Promise<T>;
//# sourceMappingURL=rpc-timeout.d.ts.map