/** * calendar-api-shared.ts, the bearer-auth HTTP helper and honest degraded-state * mapping shared by the Google Calendar and Microsoft Graph clients. Every failed * response is turned into a NAMED ApiDegradedState (never a generic throw): a 401 is * `reconnect-needed`, a 403 that names a missing scope is `insufficient-scope` naming * that scope, a 429 is `rate-limited` carrying the honored Retry-After, everything * else is `provider-error` with the status. */ import type { ApiDegradedState, CalendarProviderId, HttpFetch, HttpResponse } from './oauth-types.js'; /** A named, honest API failure. */ export declare class CalendarApiError extends Error { readonly degraded: ApiDegradedState; constructor(degraded: ApiDegradedState); } /** Map a non-OK response to a CalendarApiError with a named degraded state. */ export declare function errorFromResponse(res: HttpResponse, provider: CalendarProviderId): Promise; /** Issue a bearer-authorized request, throwing a CalendarApiError on failure. */ export declare function authedRequest(fetchImpl: HttpFetch, provider: CalendarProviderId, input: { readonly url: string; readonly method: 'GET' | 'POST'; readonly token: string; readonly body?: unknown; readonly extraHeaders?: Readonly>; }): Promise; //# sourceMappingURL=calendar-api-shared.d.ts.map