import type { OAuthMetadataFetch, StoredOAuthTokens } from "./types.js"; interface OAuthErrorShape { error: string; error_description?: string; error_uri?: string; } export declare class OAuthError extends Error { readonly error: string; readonly errorDescription: string | undefined; readonly errorUri: string | undefined; readonly error_description: string | undefined; readonly error_uri: string | undefined; readonly status: number; readonly retryable: boolean; readonly terminal: boolean; constructor(shape: OAuthErrorShape, status: number); } export declare function isRetryableOAuthError(error: unknown): error is OAuthError; export declare function exchangeAuthorizationCode(input: { tokenEndpoint: string; clientId: string; clientSecret?: string; code: string; codeVerifier: string; redirectUri: string; resource: string; fetch: OAuthMetadataFetch; now: () => number; }): Promise; export declare function refreshAccessToken(input: { tokenEndpoint: string; clientId: string; clientSecret?: string; refreshToken: string; resource: string; fetch: OAuthMetadataFetch; now: () => number; }): Promise; export declare function readOAuthJsonObjectResponse(response: Response): Promise>; export {};