import type http from "node:http"; import type { OAuthLandingPage } from "./loopback-authorization.js"; export interface OAuthClientConfig { clientId: string; authorizationEndpoint?: string; tokenEndpoint?: string; landingPage?: OAuthLandingPage; openBrowser?: (url: string) => Promise; readLine?: () => Promise; createServer?: () => http.Server; fetch?: typeof globalThis.fetch; } export interface OAuthResult { apiKey: string; expiresIn: number | null; } export interface OAuthAuthorization { authorizationUrl: string; waitForResult: () => Promise; } export interface OAuthClient { authorize(): Promise; } export interface CreateOAuthAuthorizationUrlOptions { clientId: string; redirectUri: string; state: string; codeChallenge: string; authorizationEndpoint?: string; } export interface ExchangeOAuthCodeOptions { clientId: string; redirectUri: string; code: string; codeVerifier: string; tokenEndpoint?: string; fetch?: typeof globalThis.fetch; } export declare function createOAuthClient(config: OAuthClientConfig): OAuthClient; export declare function createOAuthAuthorizationUrl(options: CreateOAuthAuthorizationUrlOptions): string; export declare function exchangeOAuthCode(options: ExchangeOAuthCodeOptions): Promise;