/** * Bounded LRU of `WebGLTexture` keyed by tile cache key (see * `tile-loader.tileKey`). Evicts least-recently-touched entries on * insert past `capacity`, deleting their GPU textures. * * Default capacity of 256 is enough to cover a full screen worth of * tiles at zoom-1 jumps either side of the current viewport plus the * parent fallbacks — at 256×256 RGBA that's ~64 MB of texture memory, * which sits comfortably under the 256 MB headroom most browsers * grant to a tab. */ export declare class TileCache { private _entries; private readonly _capacity; constructor(capacity?: number); /** * Fetch a texture by key. Touching an existing entry moves it to * the LRU tail so it survives the next eviction sweep. */ get(key: string): WebGLTexture | undefined; /** * Insert a texture under `key`. If the cache is at capacity, evict * the oldest entry first (calling `gl.deleteTexture` on its GPU * resource). */ set(gl: WebGL2RenderingContext | WebGLRenderingContext, key: string, texture: WebGLTexture): void; /** * Whether a key is resident. Used to gate the "kick off a fetch" * branch in the layer's render loop. */ has(key: string): boolean; /** * Release every texture. Called on chart destroy. Safe to call * with a stale `gl` reference (no-op if `deleteTexture` rejects), * but in practice the caller passes the still-live worker context. */ dispose(gl: WebGL2RenderingContext | WebGLRenderingContext): void; }