import { AuthorizeDeviceOptions, DiscoveredMetadata, OAuthRegistration, OAuthSession } from "./types.js"; //#region src/oauth/authorize-device-flow.d.ts /** Device-authorization request response (RFC 8628 ยง 3.2). */ interface DeviceAuthorizationResponse { readonly device_code: string; readonly user_code: string; readonly verification_uri: string; readonly verification_uri_complete?: string; readonly expires_in: number; readonly interval?: number; readonly [extra: string]: unknown; } /** Strategy hook used by tests to stub the device-authorization request. */ type DeviceAuthFetcher = (url: string, init: { body: string; signal?: AbortSignal; }) => Promise<{ ok: boolean; status: number; statusText?: string; json: () => Promise; }>; /** * Override the device-authorization fetcher. Used by the test suite. * * @experimental */ declare function _setDeviceAuthFetcherForTesting(fetcher: DeviceAuthFetcher | null): void; /** Internal arguments fed into {@link runDeviceAuthorizationFlow}. */ interface DeviceAuthorizationFlowArgs { readonly serverId: string; readonly metadata: DiscoveredMetadata; readonly registration: OAuthRegistration; readonly options: AuthorizeDeviceOptions; /** * Sleep helper. Defaults to `setTimeout`. Tests use this to fast- * forward the polling cadence. */ readonly sleep?: (ms: number, signal?: AbortSignal) => Promise; } /** * Drive the Device Authorization Grant flow. * * @stable */ declare function runDeviceAuthorizationFlow(args: DeviceAuthorizationFlowArgs): Promise; //#endregion export { DeviceAuthFetcher, DeviceAuthorizationFlowArgs, DeviceAuthorizationResponse, _setDeviceAuthFetcherForTesting, runDeviceAuthorizationFlow }; //# sourceMappingURL=authorize-device-flow.d.ts.map