histoire
Version:
A fast story book powered by Vite
22 lines • 1.36 kB
TypeScript
import type { UiChannelError, UiScreenshotRequest, UiScreenshotResult } from '@histoire/shared';
import type { PreviewSessionOptions } from '../../runtime/browser/session.js';
import type { ExecutionService } from '../../runtime/execution-service.js';
/** Keep host failures deliberate and avoid leaking filesystem paths or credentials. */
export declare function screenshotError(error: unknown, setup?: UiChannelError['setup']): UiChannelError;
/** UI owns file delivery while runtime owns the exact shared browser capture task. */
export declare function createUiScreenshotService(options: {
/** Real project root. */
root: string;
/** Shared MCP/UI lane. */
execution: ExecutionService;
/** Resolve catalog authority synchronously before each enqueue. */
resolve: (request: UiScreenshotRequest, target: UiScreenshotRequest['targets'][number]) => PreviewSessionOptions;
}): {
/** One target per lane job; partial failure keeps all successfully written files. */
capture(input: UiScreenshotRequest, owner: object): Promise<UiScreenshotResult>;
/** Cancellation never touches another browser or MCP execution. */
cancel(requestId: string, owner: object): void;
/** Drain owned resources before the generation retires its preview host. */
close(): Promise<void>;
};
//# sourceMappingURL=screenshot-service.d.ts.map