import type { CacheStore } from '@expo/metro/metro-cache'; export type { AmbientVaryScheme } from './ambient'; /** * A cache-store decorator that keeps transform results separate when they depend on ambient * values such as environment variables. * * @remarks * Metro supplies a cache key for a transform. The first result for that key is stored unchanged in * the base slot at that key. The result's `expoCacheVary` metadata records the ambient names that * affected the transform and the fingerprints of their values at transform time. * * On a read, this store recomputes the fingerprints for those names. If they match, it returns the * base result with one store read. If they differ, it derives a variant key from Metro's key and * the current fingerprints, then reads the matching result from that key. Each distinct set of * ambient values can therefore have its own cached transform. * * A transform should consistently report the same ambient names for one Metro key. If it does not, * this store wraps the base result in a small registry containing the other reported name sets. * Reads try those name sets as fallbacks. This preserves cache entries produced by different * versions or by a producer that violated the name-set contract. * * Metro normally follows a cache miss with a write. A small in-memory LRU carries the observed base * state between those calls, avoiding another base read. It is only an optimization: if the * observation is missing or evicted, `set()` derives the same state from the stored base value. * * @typeParam T - The value type accepted by the wrapped Metro cache store. */ export declare class VaryingCacheStore implements CacheStore { #private; constructor(inner: CacheStore); get(key: Buffer): Promise; set(key: Buffer, value: T): Promise; clear(): void | Promise; }