import { CacheDriverInterface } from "../types.mjs"; import { BaseCacheEngine } from "./BaseCacheEngine.mjs"; //#region ../cache/src/drivers/RunTimeDriver.d.ts declare class RunTimeDriver extends BaseCacheEngine implements CacheDriverInterface { /** * Set the storage engine * * The driver is its own backend: `getItem` / `setItem` / `removeItem` * below stay synchronous, and `BaseCacheEngine` lifts them into * promises so this driver satisfies the async contract shared with * IndexedDB without paying for real asynchrony. */ storage: this; /** * Data list * * Backed by a `Map` rather than a plain object: cache keys are * caller-controlled, and on a plain object keys like `__proto__`, * `constructor` or `toString` resolve through the prototype chain. * That made `has("constructor")` report `true` without anything * being set, `set("__proto__", value)` write to the store's * prototype instead of the store, and `remove("__proto__")` a silent * no-op. A `Map` has no prototype-chain lookup, so every key is * treated as plain data. */ data: Map; /** * Get item * * Returns `null` for missing keys (when no `defaultValue` is given) * to match the Web Storage API contract. The previous implementation * returned `undefined`, which broke `BaseCacheEngine.has()` — the * base engine checks `getItem(...) !== null` and `undefined !== null` * is `true`, so `has(missingKey)` reported `true` on this driver. */ getItem(key: string, defaultValue?: any): any; /** * Set item */ setItem(key: string, value: any, expiresAfter?: number): void; /** * Remove item */ removeItem(key: string): void; /** * {@inheritDoc} */ protected convertValue(value: any): any; /** * {@inheritDoc} */ protected parseValue(value: any): any; /** * {@inheritDoc} */ protected storageKeys(): Promise; /** * Clear the cache storage * * Overridden because `storage` points back at the driver itself, so * the base implementation's `storage.clear()` fallback would recurse * into this very method. Prefix scoping matches the base engine: with * a prefix only the owned keys are dropped, without one the whole * in-memory store is wiped. */ clear(): Promise; } //#endregion export { RunTimeDriver }; //# sourceMappingURL=RunTimeDriver.d.mts.map