import type { McpAuthConfig } from "../types.js"; import { type LoopbackAuthorizationParams } from "./loopback.js"; import type { DeviceAuthorizationInfo, LoopbackAuthorizationResult, McpAuthProvider, OAuthTokenStore } from "./types.js"; export interface OAuthConsentInfo { readonly serverUrl: string; readonly issuer: string | undefined; readonly authorizationEndpoint: string; readonly scope: string | undefined; readonly message?: string | undefined; } export interface AuthProviderDeps { readonly serverUrl: string; readonly fetchImpl?: typeof fetch | undefined; readonly now?: (() => number) | undefined; readonly tokenStore?: OAuthTokenStore | undefined; readonly openBrowser?: ((url: string) => Promise) | undefined; readonly requestConsent?: ((info: OAuthConsentInfo) => Promise) | undefined; readonly interactive?: boolean | undefined; readonly clientName?: string | undefined; readonly validateUrl?: ((url: string) => URL) | undefined; readonly runLoopback?: ((params: LoopbackAuthorizationParams) => Promise) | undefined; readonly onDeviceAuthorization?: ((info: DeviceAuthorizationInfo) => void | Promise) | undefined; readonly onAuthorizationUrl?: ((info: { serverUrl: string; url: string; }) => void) | undefined; readonly env?: Record | undefined; readonly readHostToken?: (() => Promise) | undefined; } export declare function createAuthProvider(config: McpAuthConfig | undefined, deps: AuthProviderDeps): McpAuthProvider;