import { DeviceCodeFlowManager, type DeviceAuthParams, type DeviceAuthResponse } from './deviceCodeFlow.js'; import { AuthCodeFlowManager, type AuthCodeFlowParams, type AuthCodeStartResponse } from './authCodeFlow.js'; export interface OAuthTokenRequest { cacheKey: string; tokenUrl: string; clientId: string; clientSecret: string; scopes: string[]; tokenEndpointAuthMethod: 'client_secret_basic' | 'client_secret_post'; } export interface OAuthPasswordGrantRequest extends OAuthTokenRequest { username: string; password: string; } export interface OAuthTokenResult { accessToken: string; expiresIn?: number; } export type InteractiveAuthResult = DeviceAuthResponse | AuthCodeStartResponse | { status: 'authorization_pending'; method: 'device_code' | 'authorization_code'; message: string; instruction: string; }; export declare class OAuthClient { private readonly cache; readonly deviceCodeFlow: DeviceCodeFlowManager; readonly authCodeFlow: AuthCodeFlowManager; getClientCredentialsToken(request: OAuthTokenRequest): Promise; getPasswordGrantToken(request: OAuthPasswordGrantRequest): Promise; getCachedToken(cacheKey: string): OAuthTokenResult | undefined; cacheToken(cacheKey: string, accessToken: string, expiresIn?: number): void; startOrPollDeviceCode(params: DeviceAuthParams): Promise; startOrPollAuthCode(params: AuthCodeFlowParams): Promise; }