import { type OAuthTokens } from "./credential-store.js"; export interface OAuthSettings { environment: string; issuer: string; clientId: string; clientSecret?: string; tokenEndpointAuthMethod: "none" | "client_secret_basic"; baseUrl: string; redirectUri: string; scope: string; anonKey?: string; } export interface OAuthTokenResponse { access_token: string; refresh_token?: string; expires_in?: number; token_type?: string; scope?: string; } export interface DecodedAccessToken { sub?: string; email?: string; exp?: number; [key: string]: unknown; } export declare function base64Url(input: Buffer): string; export declare function generatePkce(): { codeVerifier: string; codeChallenge: string; }; export declare function randomState(): string; export declare function tokenResponseToStoredTokens(response: OAuthTokenResponse): OAuthTokens; export declare function mergeRefreshedOAuthTokens(current: OAuthTokens, response: OAuthTokenResponse): OAuthTokens; export declare function decodeAccessToken(token: string): DecodedAccessToken; export declare function resolveOAuthSettings(opts: { environment?: string; issuer?: string; clientId?: string; clientSecret?: string; tokenEndpointAuthMethod?: "none" | "client_secret_basic"; baseUrl?: string; redirectUri?: string; redirectPort?: string; scope?: string; anonKey?: string; }): OAuthSettings; export declare function buildAuthorizeUrl(settings: OAuthSettings, codeChallenge: string, state: string): string; export declare function openBrowser(url: string): void; export declare function runBrowserAuthFlow(settings: OAuthSettings, codeVerifier: string, expectedState: string, options?: { explicitMfaCode?: string; }): Promise; export declare function exchangeAuthorizationCode(settings: OAuthSettings, code: string, codeVerifier: string): Promise; export interface MfaFactor { id: string; status: string; factor_type: string; friendly_name?: string; } export declare function fetchMfaFactors(settings: { issuer: string; anonKey?: string; }, accessToken: string): Promise; export declare function challengeMfaFactor(settings: { issuer: string; anonKey?: string; }, accessToken: string, factorId: string): Promise; export declare function verifyMfaChallenge(settings: { issuer: string; anonKey?: string; }, accessToken: string, factorId: string, challengeId: string, code: string): Promise; export declare function refreshOAuthToken(settings: { issuer: string; clientId: string; clientSecret?: string; tokenEndpointAuthMethod?: "none" | "client_secret_basic"; }, refreshToken: string): Promise; export declare function saveTokenResponse(account: string, response: OAuthTokenResponse): OAuthTokens;