histoire
Version:
A fast story book powered by Vite
15 lines • 966 B
TypeScript
/** Validated cached JSON and source freshness. */
export interface CacheResult<T> {
/** Parsed response. */ value: T;
/** Past TTL; refresh failed or was skipped by a read-only lookup. */ stale: boolean;
}
/** Existing persistent location, shared by registry readers and fixtures. */
export declare const REGISTRY_CACHE_PATH = "node_modules/.cache/histoire/marketplace/registry";
/** Release generation metadata and fence already running fetches from republishing it. */
export declare function clearRegistryMemory(root: string): void;
/** Project-shared bounded metadata, with per-client identical in-flight work sharing. */
export declare function createRegistryCache(root: string, now?: () => number): {
get: <T>(key: string, parse: (value: unknown) => T, fetch: () => Promise<unknown>) => Promise<CacheResult<T>>;
read: <T>(key: string, parse: (value: unknown) => T) => Promise<CacheResult<T> | undefined>;
};
//# sourceMappingURL=cache.d.ts.map