import type { TokenCache } from "./cache/types.js"; export type TokenScope = "preview" | "production"; export interface OAuthConfig { apiBaseUrl: string; apiClientId: string; apiClientSecret: string; previewApiClientId: string; previewApiClientSecret: string; } interface TokenManagerOptions { cache?: TokenCache; refreshBuffer?: number; maxConcurrentFetches?: number; maxQueuedFetches?: number; maxConcurrentResolutions?: number; } export interface TokenRequestOptions { signal?: AbortSignal; } export declare class TokenResolutionCapacityError extends Error { readonly capacity: "admission" | "resolutions"; constructor(capacity: "admission" | "resolutions"); } export declare class TokenFetchSupersededError extends Error { constructor(); } export declare class TokenManager { private config; private cache; private pendingRequests; private negativeCache; private refreshBuffer; private fetchAdmission; private maxConcurrentResolutions; private activeResolutions; private invalidations; private keyGenerations; private nextKeyGeneration; private globalGeneration; private maintenancePromise; private closePromise; private closed; constructor(config: OAuthConfig, options?: TokenManagerOptions); getToken(scope: TokenScope, projectSlug?: string, customDomain?: string, options?: TokenRequestOptions): Promise; private validateSignal; private waitForPendingRequest; /** Reserve capacity before any maintenance, cache, or producer I/O begins. */ private acquireResolutionSlot; private fetchAndCacheTokenWithAdmission; invalidateToken(scope: TokenScope, projectSlug?: string, customDomain?: string): Promise; clearCache(): Promise; private performClear; getStats(): Promise<{ hits: number; misses: number; size: number; type: string; }>; close(): Promise; private assertOpen; private normalizeIdentity; private getCacheKey; private getGeneration; private isGenerationCurrent; private bumpGeneration; private advanceGlobalGeneration; private performInvalidation; private readValidCachedToken; private fetchAndCacheToken; private calculateExpiresAt; } export {}; //# sourceMappingURL=token-manager.d.ts.map