import { type AuthorizeOptions, type Fetch, OAuthClient, type OAuthClientOptions, type OAuthSession } from '@atproto/oauth-client'; import { type OAuthClientMetadataInput, type OAuthResponseMode } from '@atproto/oauth-types'; import { type Simplify } from './util.js'; export type BrowserOAuthClientOptions = Simplify<{ clientMetadata?: Readonly; responseMode?: Exclude; fetch?: Fetch; } & Omit>; export type BrowserOAuthClientLoadOptions = Simplify<{ clientId: string; signal?: AbortSignal; } & Omit>; export declare class BrowserOAuthClient extends OAuthClient implements AsyncDisposable { static load({ clientId, ...options }: BrowserOAuthClientLoadOptions): Promise; private readonly ac; private readonly database; constructor({ clientMetadata, responseMode, ...options }: BrowserOAuthClientOptions); /** * This method will automatically restore any existing session, or attempt to * process login callback if the URL contains oauth parameters. * * Use {@link BrowserOAuthClient.initCallback} instead of this method if you * want to force a login callback. This can be esp. useful if you are using * this lib from a framework that has some kind of URL manipulation (like a * client side router). * * Use {@link BrowserOAuthClient.initRestore} instead of this method if you * want to only restore existing sessions, and bypass the automatic processing * of login callbacks. */ init(refresh?: boolean): Promise<{ session: OAuthSession; state?: never; } | { session: OAuthSession; state: string | null; } | undefined>; initRestore(refresh?: boolean): Promise<{ session: OAuthSession; } | undefined>; restore(sub: string, refresh?: boolean): Promise; revoke(sub: string): Promise; signIn(input: string, options?: AuthorizeOptions): Promise; signInRedirect(input: string, options?: AuthorizeOptions): Promise; signInPopup(input: string, options?: Omit & { popupName?: string; popupFeatures?: string; }): Promise; findRedirectUrl(): "http://127.0.0.1" | `${string}.${string}:/${string}` | `http://127.0.0.1#${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `http://127.0.0.1?${string}` | `http://[::1]${string}` | `https://${string}` | undefined; readCallbackParams(): URLSearchParams | null; initCallback(params?: URLSearchParams | null, redirectUri?: "http://127.0.0.1" | `${string}.${string}:/${string}` | `http://127.0.0.1#${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `http://127.0.0.1?${string}` | `http://[::1]${string}` | `https://${string}` | undefined): Promise<{ session: OAuthSession; state: string | null; }>; [Symbol.asyncDispose](): Promise; dispose(): Promise; } //# sourceMappingURL=browser-oauth-client.d.ts.map