UNPKG

histoire

Version:

A fast story book powered by Vite

26 lines • 1.48 kB
import type { ServerStoryFile } from '@histoire/shared'; import type { Context } from '../context.js'; import type { StoryCollectionOutcome } from './outcome.js'; /** Last collection outcome of every story file, reused when the dev server starts again. */ export interface CollectionCache { /** * Cached outcomes keyed by story file path, or `undefined` unless every given * story file has an entry for its current source. Inline docs of the cached * stories are captured again, as no transform of this run produced them yet. */ read: (storyFiles: ServerStoryFile[]) => Promise<Map<string, StoryCollectionOutcome> | undefined>; /** Replaces the cache with these outcomes; failed and unhashed files are left out. */ write: (storyFiles: ServerStoryFile[], outcomes: ReadonlyMap<string, StoryCollectionOutcome>) => Promise<void>; } /** * Fingerprint of a story file's registered source (module code of virtual * stories), `undefined` when it can't be read. */ export declare function readStorySourceSha256(ctx: Context, storyFile: ServerStoryFile): Promise<string | undefined>; /** * Cache of the dev story catalog in `.histoire/cache/collection`. It only * spares the wait for a first collection: the dev server still collects every * story again in the background and publishes any difference. */ export declare function createCollectionCache(ctx: Context, file?: string): CollectionCache; //# sourceMappingURL=catalog-cache.d.ts.map