MCPcopy
hub / github.com/coder/mux / StoryDef

Interface StoryDef

scripts/capture-readme-screenshots.ts:60–74  ·  view source on GitHub ↗

* Story definitions. `playInteraction` is a Playwright callback that replicates * the Storybook play function for stories that require user interaction before * the screenshot is taken.

Source from the content-addressed store, hash-verified

58 * the screenshot is taken.
59 */
60interface StoryDef {
61 exportName: string;
62 storyId: string;
63 outputFile: string;
64 /** Optional crop region in CSS pixels for focused README screenshots. */
65 clip?: { x: number; y: number; width: number; height: number };
66 /** Optional per-story viewport override (CSS pixels). Defaults to global VIEWPORT. */
67 viewport?: { width: number; height: number };
68 /** Optional context overrides for device-specific stories (mobile touch/user-agent). */
69 contextOptions?: BrowserContextOptions;
70 /** Replicate the Storybook play function via Playwright interactions. */
71 playInteraction?: (page: Page) => Promise<void>;
72 /** Custom Sharp post-processing instead of the default full-page → WebP conversion. */
73 postProcess?: (pngBuffer: Buffer) => Promise<Buffer>;
74}
75
76const STORIES: StoryDef[] = [
77 // README hero uses mux-demo.gif; screenshot captures start at code-review.webp.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected