UNPKG

histoire

Version:

A fast story book powered by Vite

21 lines • 1.22 kB
import type { HistoireTestRegistration } from '@histoire/shared'; import type { SessionStoryFile, VariantTestSessionOptions } from './types.js'; /** The subset of the session options the story module cache needs. */ type StoryModuleCacheOptions = Pick<VariantTestSessionOptions, 'files' | 'moduleLoaders' | 'loadStoryEntry' | 'runWithDynamicImport' | 'ensureEnvironment'>; /** * Creates the cache that imports story modules once and hands the session a * freshly mapped story file per collect/run flow. * * Importing a story executes its top-level code, which may already register * tests — those registrations are captured here and replayed as their own * group by the session. * @param options Story metadata, module loaders and the dynamic-import wrapper. */ export declare function createStoryModuleCache(options: StoryModuleCacheOptions): { createSessionStoryFile: (storyId: string, testing?: boolean) => Promise<SessionStoryFile>; getStoryModuleVersion: (storyId: string) => number; invalidateStory: (storyId: string) => void; rememberSetupModuleRegistrations: (storyId: string, registrations: HistoireTestRegistration[]) => void; }; export {}; //# sourceMappingURL=story-modules.d.ts.map