import { OAuth2Client, type Credentials } from "google-auth-library"; import { ProfileStore } from "../storage/profile-store.js"; import type { AccessMode, AuthStatus, OAuthClientConfig, ProfileMetadata } from "../types.js"; export type BrowserAuthorizer = (client: OAuthClientConfig, scopes: string[], browserOpener: (url: string) => Promise) => Promise; export type AuthorizedChannelLister = (client: OAuthClientConfig, credentials: Credentials) => Promise>; export type TokenRevoker = (client: OAuthClientConfig, credential: string) => Promise; export interface LoginOptions { profile: string; mode: AccessMode; clientSecretsPath: string; channelId?: string; openBrowser?: (url: string) => Promise; } export interface AuthContext { auth: OAuth2Client; profile: ProfileMetadata; mode: AccessMode; } export declare function mergeCredentials(current: Credentials, update: Credentials): Credentials; export declare function authorizeWithBrowser(client: OAuthClientConfig, scopes: string[], browserOpener: (url: string) => Promise): Promise; export declare class AuthManager { readonly store: ProfileStore; private readonly authorize; private readonly listChannels; private readonly revokeRemote; constructor(store?: ProfileStore, authorize?: BrowserAuthorizer, listChannels?: AuthorizedChannelLister, revokeRemote?: TokenRevoker); login(options: LoginOptions): Promise; getStatus(profileName: string, mode: AccessMode): Promise; getContext(profileName: string, mode: AccessMode): Promise; revoke(profileName: string, mode: AccessMode): Promise<{ revokedRemotely: boolean; }>; }