export declare const DEFAULT_SCOPE = "openid profile email offline_access wiki:read wiki:write"; export interface AuthManagerOptions { baseUrl: string; credentialsPath?: string; scope?: string; clientName?: string; fetchImpl?: typeof fetch; loopbackPorts?: number[]; /** Logger for status messages, defaults to process.stderr.write. */ log?: (message: string) => void; openBrowser?: (url: string) => Promise; /** If false, the interactive browser flow is never triggered. Used for HTTP mode. */ interactive?: boolean; } /** * Manages OAuth credentials for the local server. * * On the first call to ensureAccessToken it runs discovery, dynamic client * registration and the authorization code flow if needed. Later calls reuse * the refresh token as long as possible. */ export declare class AuthManager { private readonly baseUrl; private readonly credentialsPath; private readonly scope; private readonly clientName; private readonly fetchImpl; private readonly loopbackPorts; private readonly log; private readonly openBrowser?; private readonly interactive; private credentials; private metadata; private inflight; constructor(options: AuthManagerOptions); getBaseUrl(): string; ensureAccessToken(): Promise; private ensureAccessTokenInner; /** Forces a refresh, for example after a 401 response. */ invalidateAndRefresh(): Promise; private getCredentials; private getMetadata; private runInitialAuth; } /** * Holds the active organization id and lets callers update it at runtime. * Shared with the server so that zuwiki_set_active_organization can take effect. */ export declare class OrganizationState { private organizationId; constructor(organizationId: string | null); get(): string | null; set(id: string | null): void; }