UNPKG

@wonderwhy-er/desktop-commander

Version:

MCP server for terminal operations and file editing

12 lines (11 loc) 595 B
/** * Executes a promise with a timeout. If the promise doesn't resolve or reject within * the specified timeout, returns the provided default value. * * @param operation The promise to execute * @param timeoutMs Timeout in milliseconds * @param operationName Name of the operation (for logs) * @param defaultValue Value to return if the operation times out * @returns Promise that resolves with the operation result or the default value on timeout */ export declare function withTimeout<T>(operation: Promise<T>, timeoutMs: number, operationName: string, defaultValue: T): Promise<T>;