import { ResolvedScreenshotOptions, ScreenshotContext, ScreenshotHook, ScreenshotOptions, ScreenshotParameters, ScreenshotViewportConfig } from "@storycap-testrun/internal"; import { BrowserPage } from "vitest/browser"; import { TestContext } from "vitest"; import "vitest/config"; //#region src/context.d.ts /** * Screenshot context for browser environment with test file information */ export type BrowserScreenshotContext = ScreenshotContext & { file: string; }; //#endregion //#region src/hooks/types.d.ts /** * Screenshot hook type for Vitest browser environment */ export type BrowserScreenshotHook = ScreenshotHook; //#endregion //#region src/options.d.ts /** * Screenshot options for Vitest browser environment */ export type BrowserScreenshotOptions = ScreenshotOptions; /** * Resolved screenshot options for Vitest browser environment */ export type BrowserResolvedScreenshotOptions = ResolvedScreenshotOptions; //#endregion //#region src/vitest-plugin/index.d.ts type ResolveScreenshotFilepathParams = [context: BrowserScreenshotContext]; type ResolveScreenshotFilepathResult = Promise; type TakeScreenshotParams = [filepath: string, options: { fullPage?: boolean; omitBackground?: boolean; scale?: "css" | "device"; type?: "jpeg" | "png"; viewport?: ScreenshotViewportConfig | null; }]; type TakeScreenshotResult = Promise; type PrepareViewportParams = [viewportOverride?: ScreenshotViewportConfig | null]; type PrepareViewportResult = Promise; type RestoreViewportParams = []; type RestoreViewportResult = Promise; //#endregion //#region src/screenshot.d.ts declare module "vitest/browser" { interface BrowserCommands { resolveScreenshotFilepath: (...params: ResolveScreenshotFilepathParams) => ResolveScreenshotFilepathResult; __storycap_takeScreenshot: (...params: TakeScreenshotParams) => TakeScreenshotResult; __storycap_prepareViewport: (...params: PrepareViewportParams) => PrepareViewportResult; __storycap_restoreViewport: (...params: RestoreViewportParams) => RestoreViewportResult; } } /** * Captures screenshot in Vitest browser environment using Storybook test context */ export declare const screenshot: (page: BrowserPage, context: TestContext, options?: BrowserScreenshotOptions) => Promise; //#endregion export type { ScreenshotParameters }; //# sourceMappingURL=index.d.cts.map