/** * 超时控制工具模块 * * 为异步操作提供统一的超时保护机制 */ /** * 为 Promise 添加超时保护 * * @param promise - 原始 Promise * @param timeoutMs - 超时时间(毫秒) * @param message - 超时错误消息 * @returns 带超时保护的 Promise */ export declare function withTimeout(promise: Promise, timeoutMs: number, message?: string): Promise; /** * 超时错误类型 */ export declare class TimeoutError extends Error { constructor(message: string); }