export interface ProjectEnvironmentScope { /** Canonical project slug authorized by the credential. */ projectSlug: string; /** Canonical project ID when the control plane supplied one. */ projectId?: string; environmentId: string; token: string; } export declare function unwrapReplayedProjectEnvironmentFailure(error: unknown): { error: unknown; replayed: boolean; }; type Fetcher = (scope: ProjectEnvironmentScope, signal: AbortSignal) => Promise>; export interface EnvironmentVariableCacheOptions { /** Maximum time allowed for one cache-owned upstream fetch. */ fetchTimeoutMs?: number; /** Maximum number of distinct upstream fetches across all projects. */ maxInflight?: number; /** Maximum number of distinct upstream fetches for one canonical project. */ maxInflightPerProject?: number; /** * How long a failed fetch is rethrown before the upstream is retried. * Collapses per-request refetch storms during a persistent upstream refusal * without ever serving stale or empty data. Zero disables negative caching. */ failureTtlMs?: number; /** Mark replayed failures so an error boundary can suppress duplicate reporting. */ markFailureReplays?: boolean; } export declare class EnvironmentVariableCache { private cache; private failures; private inflight; private inflightByProject; private fetcher; private ttlMs; private maxEntries; private fetchTimeoutMs; private maxInflight; private maxInflightPerProject; private failureTtlMs; private markFailureReplays; private globalEpoch; private environmentEpochs; constructor(fetcher: Fetcher, ttlMs?: number, maxEntries?: number, options?: EnvironmentVariableCacheOptions); get(scope: ProjectEnvironmentScope): Promise>; invalidate(environmentId?: string): void; private fetch; private captureEpoch; private isCurrentEpoch; private assertAdmission; private addInflight; private removeInflight; private invalidateInflight; /** Evict oldest recorded failures when they exceed maxEntries. */ private evictFailuresIfNeeded; /** Evict oldest entries when cache exceeds maxEntries. */ private evictIfNeeded; } export {}; //# sourceMappingURL=cache.d.ts.map