//#region src/index.d.ts
/** Backend stores opaque strings only — never sees T, never parses JSON. */
interface CacheBackend {
  get(key: string): Promise<string | undefined>;
  set(key: string, value: string, ttlSeconds?: number): Promise<void>;
  del(key: string): Promise<void>;
}
interface SetOptions {
  /** Whole seconds. */
  ttl?: number;
}
/** The typed value cache, layered above any backend. */
interface CacheStore {
  get<T>(key: string): Promise<T | undefined>;
  set<T>(key: string, value: T | undefined, opts?: SetOptions): Promise<void>;
  del(key: string): Promise<void>;
  getOrSet<T>(key: string, loader: () => Promise<T>, opts?: SetOptions): Promise<T>;
}
/**
 * Thin prefix builder. Bump the version segment to bulk-invalidate a keyspace
 * (e.g. `namespace('tsi:v1')` → change to `tsi:v2` and old keys miss).
 */
declare function namespace(prefix: string): (key: string) => string;
declare function createCache(backend: CacheBackend): CacheStore;
//#endregion
export { CacheBackend, CacheStore, SetOptions, createCache, namespace };