changemaker.lite/api/dist/utils/fetch-with-timeout.d.ts

15 lines
576 B
TypeScript

/**
* Fetch wrapper with automatic timeout protection
* Prevents thread exhaustion from slow external services
*/
/**
* Wrapper for fetch with automatic timeout using AbortController
*
* @param url - The URL to fetch
* @param options - Standard fetch options
* @param timeoutMs - Timeout in milliseconds (default: 5000)
* @returns Response from fetch
* @throws Error if request times out or fails
*/
export declare function fetchWithTimeout(url: string, options?: RequestInit, timeoutMs?: number): Promise<Response>;
//# sourceMappingURL=fetch-with-timeout.d.ts.map