import { CacheProvider } from "../cache/CacheProvider.js"; import { SourceConfigResolver as Resolver } from "../SourceConfigResolver.js"; import type { StorageRepository } from "./StorageRepository.js"; /** * CachedRepository: wraps any StorageRepository with a CacheProvider layer. * * Caches readFile, openFileStream, and exists results so that subsequent * accesses for the same path skip the underlying I/O (e.g. HTTP fetch). * * Usage: * ```ts * import { FetchRepository } from "staticql/repo/fetch"; * import { CachedRepository } from "staticql/repo/cached"; * import { IndexedDBCacheProvider } from "staticql/cache/indexeddb"; * * const repo = new CachedRepository( * new FetchRepository("https://cdn.example.com/"), * new IndexedDBCacheProvider({ version: "abc123" }) * ); * ``` */ export declare class CachedRepository implements StorageRepository { private readonly inner; private readonly cache; constructor(inner: StorageRepository, cache: CacheProvider); setResolver(resolver: Resolver): void; readFile(path: string): Promise; openFileStream(path: string): Promise; exists(path: string): Promise; listFiles(pattern: string): Promise; writeFile(path: string, data: Uint8Array | string): Promise; removeFile(path: string): Promise; removeDir(path: string): Promise; }