/** * Copyright (c) 2026, Salesforce, Inc., * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * Manages CSRF token fetching and caching for secure requests. * Implements a singleton pattern to ensure consistent token management across the application. */ declare class CsrfTokenManager { private endpoint; private cacheName?; private tokenPromise; private refreshPromise; constructor(endpoint: string, cacheName?: string | undefined); /** * Returns the current token value as a Promise. * Lazy-loads the token on first call (from cache or by fetching). */ getToken(): Promise; /** * Obtains and returns a new token value as a promise. * This will clear the cached token and fetch a fresh one. * If a refresh is already in progress, all callers share the same in-flight promise. */ refreshToken(): Promise; /** * Obtains a CSRF token, using cache when available or fetching a new one. * * @returns Promise that resolves to the CSRF token string */ private obtainToken; /** * Provides a safe way to interact with the Cache API with fallback for unsupported environments. * * @param callback - Function that receives the cache instance and returns a promise * @returns The result of the callback, or undefined if caches API is not available */ private withCache; } export { CsrfTokenManager }; //# sourceMappingURL=token-manager.d.ts.map