UNPKG

histoire

Version:

A fast story book powered by Vite

28 lines • 1.8 kB
import type { HistoireProjectTestCollectionResult } from '@histoire/protocol'; import type { ServerStoryFile } from '@histoire/shared'; import type { Context } from '../context.js'; import type { CollectionEvidence } from './eligibility/evidence.js'; /** Detached variant definitions of one collection. */ type CollectedVariants = HistoireProjectTestCollectionResult['variants']; /** * Read/write detached definitions without retaining any browser, handler, or runner resource. * @param ctx Context owning the cache. * @param source Catalog publication of the operation; no publication, no reuse. * @param verify Revalidates one story's dependency evidence; absent without an eligibility service. * @param inventory Current story files of the operation snapshot. */ export declare function getTestCollectionCache(ctx: Context, source: object | undefined, verify: ((evidence: CollectionEvidence) => Promise<boolean>) | undefined, inventory: ServerStoryFile[]): { /** Cache misses may shrink without resetting Vite's existing dependency cache; inventory changes re-scan. */ captureOptimizerEntries(entries: string[]): string[]; /** Forced refresh, changed variants, and invalid evidence remove entries before new mounts. */ read(ids: string[], force?: boolean): Promise<CollectedVariants>; /** * Caller confirms cancellation and provenance before this atomic admission. * @param variants Collected entries; stories missing a variant are skipped. * @param evidence Proofs of stories eligible for reuse. * @param assertCurrent Publication fence of the operation. */ write(variants: CollectedVariants, evidence: ReadonlyMap<string, CollectionEvidence>, assertCurrent: () => void): void; }; export {}; //# sourceMappingURL=collection-cache.d.ts.map