import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'; import type { WorkspaceEventBus } from '@scalar/workspace-store/events'; import { type OAuthFlowsObjectSecret } from '@scalar/workspace-store/request-example'; import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'; import type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'; import type { OAuth2Options } from '../../../../v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js'; import { type OAuth2Tokens } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/oauth.js'; /** * Persists OAuth2 tokens split across the two schemes that care about them: * * - The **access token** lands on the consuming HTTP bearer scheme, so it is sent as * `Authorization: Bearer ` without the bearer scheme losing focus. * - The **refresh token** stays on the oauth2 scheme, which is the only place that knows * how to refresh (token URL, flow, client credentials). */ export declare const storeOAuth2Tokens: (eventBus: WorkspaceEventBus, params: { bearerSchemeName: string; oauth2Name: string; flowType: keyof OAuthFlowsObjectSecret; tokens: OAuth2Tokens; }) => void; /** * Runs the OAuth2 authorization flow and stores the resulting tokens on the bearer scheme * (access token) and the oauth2 scheme (refresh token). * * Used by the bearer scheme's "Authorize via OAuth2" shortcut: it defaults the redirect URI * (`authorizeOauth2` reads it straight off the flow), kicks off the flow, then routes the * tokens through {@link storeOAuth2Tokens}. */ export declare const runOAuth2Authorize: (params: { eventBus: WorkspaceEventBus; bearerSchemeName: string; oauth2Name: string; flows: OAuthFlowsObjectSecret; flowType: keyof OAuthFlowsObjectSecret; scopes: string[]; server: ServerObject | null; proxyUrl: string; environment: XScalarEnvironment; options?: OAuth2Options; }) => Promise>; //# sourceMappingURL=run-oauth2-authorize.d.ts.map