/** * `'safe'` retries a timeout once. The caller picks the policy because Subsonic sends idempotent * writes such as `/star` as POST. */ export type RetryPolicy = 'safe' | 'never'; export interface FetchWithTimeoutOptions { /** The value is used as given. Only the env getters clamp it to the MIN and MAX fetch timeout. */ readonly timeoutMs: number; readonly retryPolicy: RetryPolicy; readonly operationLabel: string; /** * Third-party internet APIs may be unreachable without the proxy. Navidrome and other LAN calls * leave it off and stay direct. */ readonly respectProxy?: boolean; /** A timeout leaves the write's outcome unknown, so the error says to check state first. */ readonly nonIdempotent?: boolean; } export declare class FetchTimeoutError extends Error { readonly name = "TimeoutError"; readonly attempts: number; readonly timeoutMs: number; constructor(operationLabel: string, timeoutMs: number, attempts: number, nonIdempotent?: boolean); } export declare function getNavidromeRequestTimeoutMs(): number; export declare function getNavidromeAuthTimeoutMs(): number; export declare function getExternalApiTimeoutMs(): number; /** 4xx and 5xx responses resolve normally, so callers check `response.ok`. */ export declare function fetchWithTimeout(url: string, init: RequestInit, options: FetchWithTimeoutOptions): Promise; //# sourceMappingURL=fetch-with-timeout.d.ts.map