import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'; import type { OAuthFlowsObjectSecret } from '@scalar/workspace-store/request-example'; import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; export type OAuth2Tokens = { accessToken: string; refreshToken?: string; }; /** Flow types that support token refresh (all except implicit) */ type RefreshableFlows = Exclude; /** * Authorize oauth2 flow * * @returns the resolved oauth2 tokens */ export declare const authorizeOauth2: (flows: OAuthFlowsObjectSecret, type: keyof OAuthFlowsObjectSecret, selectedScopes: string[], /** We use the active server to set a base for relative redirect uris */ activeServer: ServerObject | null, /** If we want to use the proxy */ proxyUrl: string, /** Flattened environment variables used to resolve server URL templates like `{protocol}` */ environmentVariables?: Record) => Promise>; /** * Exchange a refresh token for a new access token using the `grant_type=refresh_token` flow. * * Uses the stored refresh token, client credentials, and the token URL (or refreshUrl when available) * to request fresh tokens from the authorization server per RFC 6749 Section 6. */ export declare const refreshOauth2Token: (flows: OAuthFlowsObjectSecret, type: RefreshableFlows, /** If we want to use the proxy */ proxyUrl: string, /** We use the active server to set a base for relative URLs */ activeServer: ServerObject | null, /** Flattened environment variables used to resolve server URL templates */ environmentVariables?: Record) => Promise>; export {}; //# sourceMappingURL=oauth.d.ts.map