@coder/pixel-storybook 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -0
  3. package/dist/api.d.ts +56 -0
  4. package/dist/api.js +238 -0
  5. package/dist/bin.d.ts +2 -0
  6. package/dist/bin.js +102 -0
  7. package/dist/checkDifferences.d.ts +63 -0
  8. package/dist/checkDifferences.js +67 -0
  9. package/dist/compare/compare.d.ts +5 -0
  10. package/dist/compare/compare.js +80 -0
  11. package/dist/compare/pixelmatch.d.ts +7 -0
  12. package/dist/compare/pixelmatch.js +46 -0
  13. package/dist/compare/utils.d.ts +2 -0
  14. package/dist/compare/utils.js +18 -0
  15. package/dist/compare/worker.d.ts +1 -0
  16. package/dist/compare/worker.js +6 -0
  17. package/dist/concurrency.d.ts +19 -0
  18. package/dist/concurrency.js +61 -0
  19. package/dist/config.d.ts +3795 -0
  20. package/dist/config.js +472 -0
  21. package/dist/configHelper.d.ts +2 -0
  22. package/dist/configHelper.js +34 -0
  23. package/dist/constants.d.ts +2 -0
  24. package/dist/constants.js +2 -0
  25. package/dist/crawler/storybook.d.ts +51 -0
  26. package/dist/crawler/storybook.js +317 -0
  27. package/dist/crawler/utils.d.ts +6 -0
  28. package/dist/crawler/utils.js +20 -0
  29. package/dist/createShots.d.ts +30 -0
  30. package/dist/createShots.js +54 -0
  31. package/dist/index.d.ts +2 -0
  32. package/dist/index.js +1 -0
  33. package/dist/log.d.ts +26 -0
  34. package/dist/log.js +99 -0
  35. package/dist/runner.d.ts +4 -0
  36. package/dist/runner.js +186 -0
  37. package/dist/schemas.d.ts +174 -0
  38. package/dist/schemas.js +73 -0
  39. package/dist/shard.d.ts +3 -0
  40. package/dist/shard.js +17 -0
  41. package/dist/shots/shots.d.ts +3 -0
  42. package/dist/shots/shots.js +196 -0
  43. package/dist/shots/utils.d.ts +33 -0
  44. package/dist/shots/utils.js +177 -0
  45. package/dist/types.d.ts +12 -0
  46. package/dist/types.js +1 -0
  47. package/dist/upload.d.ts +10 -0
  48. package/dist/upload.js +32 -0
  49. package/dist/uploadStorybook.d.ts +2 -0
  50. package/dist/uploadStorybook.js +56 -0
  51. package/dist/utils.d.ts +50 -0
  52. package/dist/utils.js +194 -0
  53. package/package.json +64 -0
@@ -0,0 +1,3795 @@
1
+ import type { BrowserContextOptions, LaunchOptions, Page } from 'playwright-core';
2
+ import * as z from 'zod';
3
+ export declare const PlatformModeConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
4
+ /**
5
+ * Browser to use: chromium, firefox, or webkit
6
+ * @default 'chromium'
7
+ */
8
+ browser: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["chromium", "firefox", "webkit"]>, z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>]>>;
9
+ /**
10
+ * Enable Storybook mode
11
+ */
12
+ storybookShots: z.ZodOptional<z.ZodObject<{
13
+ /**
14
+ * URL of the Storybook instance or local folder
15
+ * @default 'storybook-static'
16
+ */
17
+ storybookUrl: z.ZodString;
18
+ /**
19
+ * Define areas for all stories where differences will be ignored
20
+ */
21
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ selector: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ selector: string;
25
+ }, {
26
+ selector: string;
27
+ }>, "many">>;
28
+ /**
29
+ * Define custom breakpoints for all Storybook shots as width in pixels
30
+ * @default []
31
+ * @example
32
+ * [ 320, 768, 1280 ]
33
+ */
34
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
35
+ /**
36
+ * Target specific element on page with a selector
37
+ */
38
+ elementLocator: z.ZodOptional<z.ZodString>;
39
+ /**
40
+ * Wait for a specific selector before taking a screenshot
41
+ * @example '[data-storyloaded]'
42
+ */
43
+ waitForSelector: z.ZodOptional<z.ZodString>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ storybookUrl: string;
46
+ mask?: {
47
+ selector: string;
48
+ }[] | undefined;
49
+ elementLocator?: string | undefined;
50
+ waitForSelector?: string | undefined;
51
+ breakpoints?: number[] | undefined;
52
+ }, {
53
+ storybookUrl: string;
54
+ mask?: {
55
+ selector: string;
56
+ }[] | undefined;
57
+ elementLocator?: string | undefined;
58
+ waitForSelector?: string | undefined;
59
+ breakpoints?: number[] | undefined;
60
+ }>>;
61
+ /**
62
+ * Path to the current image folder
63
+ * @default '.lostpixel/current/'
64
+ */
65
+ imagePathCurrent: z.ZodDefault<z.ZodString>;
66
+ /**
67
+ * Define custom breakpoints for all tests as width in pixels
68
+ * @default []
69
+ * @example
70
+ * [ 320, 768, 1280 ]
71
+ */
72
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
73
+ /**
74
+ * Number of concurrent shots to take. Auto-scales with the number of CPUs
75
+ * available to the process by default (floor `10`, ceiling `32`). Set to
76
+ * `0` to opt back into the auto default from an explicit config.
77
+ * @default auto
78
+ */
79
+ shotConcurrency: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
80
+ /**
81
+ * Timeouts for various stages of the test
82
+ */
83
+ timeouts: z.ZodDefault<z.ZodObject<{
84
+ /**
85
+ * Timeout for fetching stories
86
+ * @default 30_000
87
+ */
88
+ fetchStories: z.ZodDefault<z.ZodNumber>;
89
+ /**
90
+ * Timeout for loading the state of the page
91
+ * @default 30_000
92
+ */
93
+ loadState: z.ZodDefault<z.ZodNumber>;
94
+ /**
95
+ * Timeout for waiting for network requests to finish
96
+ * @default 30_000
97
+ */
98
+ networkRequests: z.ZodDefault<z.ZodNumber>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ fetchStories: number;
101
+ loadState: number;
102
+ networkRequests: number;
103
+ }, {
104
+ fetchStories?: number | undefined;
105
+ loadState?: number | undefined;
106
+ networkRequests?: number | undefined;
107
+ }>>;
108
+ /**
109
+ * Maximum time to wait before taking a screenshot. When
110
+ * `stabilizeBeforeScreenshot` is `true` (the default), this is the cap on
111
+ * the adaptive stability wait. When `false`, this is the fixed sleep.
112
+ * @default 1_000
113
+ */
114
+ waitBeforeScreenshot: z.ZodDefault<z.ZodNumber>;
115
+ /**
116
+ * When `true`, the wait before taking a screenshot is adaptive: lost-pixel
117
+ * waits for web fonts, pending images, one committed frame, and a quiet
118
+ * DOM, bounded above by `waitBeforeScreenshot`. When `false`, falls back
119
+ * to a fixed sleep of `waitBeforeScreenshot` milliseconds.
120
+ * @default true
121
+ */
122
+ stabilizeBeforeScreenshot: z.ZodDefault<z.ZodBoolean>;
123
+ /**
124
+ * Time to wait for the first network request to start
125
+ * @default 200
126
+ */
127
+ waitForFirstRequest: z.ZodDefault<z.ZodNumber>;
128
+ /**
129
+ * Time to wait for the last network request to start
130
+ * @default 1_000
131
+ */
132
+ waitForLastRequest: z.ZodDefault<z.ZodNumber>;
133
+ /**
134
+ * Threshold for the difference between the baseline and current image
135
+ *
136
+ * Values between 0 and 1 are interpreted as percentage of the image size
137
+ *
138
+ * Values greater or equal to 1 are interpreted as pixel count.
139
+ * @default 0
140
+ */
141
+ threshold: z.ZodDefault<z.ZodNumber>;
142
+ /**
143
+ * How often to retry a shot for a stable result
144
+ * @default 0
145
+ */
146
+ flakynessRetries: z.ZodDefault<z.ZodNumber>;
147
+ /**
148
+ * Time to wait between flakyness retries
149
+ * @default 2_000
150
+ */
151
+ waitBetweenFlakynessRetries: z.ZodDefault<z.ZodNumber>;
152
+ /**
153
+ * Global shot filter
154
+ */
155
+ filterShot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
156
+ shotMode: z.ZodEnum<["storybook"]>;
157
+ id: z.ZodOptional<z.ZodString>;
158
+ kind: z.ZodOptional<z.ZodString>;
159
+ story: z.ZodOptional<z.ZodString>;
160
+ shotName: z.ZodOptional<z.ZodString>;
161
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
162
+ filePathBaseline: z.ZodOptional<z.ZodString>;
163
+ filePathCurrent: z.ZodOptional<z.ZodString>;
164
+ filePathDifference: z.ZodOptional<z.ZodString>;
165
+ }, "strip", z.ZodTypeAny, {
166
+ shotMode: "storybook";
167
+ id?: string | undefined;
168
+ shotName?: string | undefined;
169
+ filePathBaseline?: string | undefined;
170
+ filePathCurrent?: string | undefined;
171
+ filePathDifference?: string | undefined;
172
+ kind?: string | undefined;
173
+ story?: string | undefined;
174
+ parameters?: Record<string, unknown> | undefined;
175
+ }, {
176
+ shotMode: "storybook";
177
+ id?: string | undefined;
178
+ shotName?: string | undefined;
179
+ filePathBaseline?: string | undefined;
180
+ filePathCurrent?: string | undefined;
181
+ filePathDifference?: string | undefined;
182
+ kind?: string | undefined;
183
+ story?: string | undefined;
184
+ parameters?: Record<string, unknown> | undefined;
185
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
186
+ /**
187
+ * Shot and file name generator for images
188
+ */
189
+ shotNameGenerator: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
190
+ shotMode: z.ZodEnum<["storybook"]>;
191
+ id: z.ZodOptional<z.ZodString>;
192
+ kind: z.ZodOptional<z.ZodString>;
193
+ story: z.ZodOptional<z.ZodString>;
194
+ shotName: z.ZodOptional<z.ZodString>;
195
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
196
+ filePathBaseline: z.ZodOptional<z.ZodString>;
197
+ filePathCurrent: z.ZodOptional<z.ZodString>;
198
+ filePathDifference: z.ZodOptional<z.ZodString>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ shotMode: "storybook";
201
+ id?: string | undefined;
202
+ shotName?: string | undefined;
203
+ filePathBaseline?: string | undefined;
204
+ filePathCurrent?: string | undefined;
205
+ filePathDifference?: string | undefined;
206
+ kind?: string | undefined;
207
+ story?: string | undefined;
208
+ parameters?: Record<string, unknown> | undefined;
209
+ }, {
210
+ shotMode: "storybook";
211
+ id?: string | undefined;
212
+ shotName?: string | undefined;
213
+ filePathBaseline?: string | undefined;
214
+ filePathCurrent?: string | undefined;
215
+ filePathDifference?: string | undefined;
216
+ kind?: string | undefined;
217
+ story?: string | undefined;
218
+ parameters?: Record<string, unknown> | undefined;
219
+ }>], z.ZodUnknown>, z.ZodString>>;
220
+ /**
221
+ * Configure browser context options
222
+ */
223
+ configureBrowser: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
224
+ shotMode: z.ZodEnum<["storybook"]>;
225
+ id: z.ZodOptional<z.ZodString>;
226
+ kind: z.ZodOptional<z.ZodString>;
227
+ story: z.ZodOptional<z.ZodString>;
228
+ shotName: z.ZodOptional<z.ZodString>;
229
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
230
+ filePathBaseline: z.ZodOptional<z.ZodString>;
231
+ filePathCurrent: z.ZodOptional<z.ZodString>;
232
+ filePathDifference: z.ZodOptional<z.ZodString>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ shotMode: "storybook";
235
+ id?: string | undefined;
236
+ shotName?: string | undefined;
237
+ filePathBaseline?: string | undefined;
238
+ filePathCurrent?: string | undefined;
239
+ filePathDifference?: string | undefined;
240
+ kind?: string | undefined;
241
+ story?: string | undefined;
242
+ parameters?: Record<string, unknown> | undefined;
243
+ }, {
244
+ shotMode: "storybook";
245
+ id?: string | undefined;
246
+ shotName?: string | undefined;
247
+ filePathBaseline?: string | undefined;
248
+ filePathCurrent?: string | undefined;
249
+ filePathDifference?: string | undefined;
250
+ kind?: string | undefined;
251
+ story?: string | undefined;
252
+ parameters?: Record<string, unknown> | undefined;
253
+ }>], z.ZodUnknown>, z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>>;
254
+ /**
255
+ * Configure page before screenshot
256
+ */
257
+ beforeScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
258
+ shotMode: z.ZodEnum<["storybook"]>;
259
+ id: z.ZodOptional<z.ZodString>;
260
+ kind: z.ZodOptional<z.ZodString>;
261
+ story: z.ZodOptional<z.ZodString>;
262
+ shotName: z.ZodOptional<z.ZodString>;
263
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
264
+ filePathBaseline: z.ZodOptional<z.ZodString>;
265
+ filePathCurrent: z.ZodOptional<z.ZodString>;
266
+ filePathDifference: z.ZodOptional<z.ZodString>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ shotMode: "storybook";
269
+ id?: string | undefined;
270
+ shotName?: string | undefined;
271
+ filePathBaseline?: string | undefined;
272
+ filePathCurrent?: string | undefined;
273
+ filePathDifference?: string | undefined;
274
+ kind?: string | undefined;
275
+ story?: string | undefined;
276
+ parameters?: Record<string, unknown> | undefined;
277
+ }, {
278
+ shotMode: "storybook";
279
+ id?: string | undefined;
280
+ shotName?: string | undefined;
281
+ filePathBaseline?: string | undefined;
282
+ filePathCurrent?: string | undefined;
283
+ filePathDifference?: string | undefined;
284
+ kind?: string | undefined;
285
+ story?: string | undefined;
286
+ parameters?: Record<string, unknown> | undefined;
287
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
288
+ /**
289
+ * Perform actions after screenshot was taken
290
+ */
291
+ afterScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
292
+ shotMode: z.ZodEnum<["storybook"]>;
293
+ id: z.ZodOptional<z.ZodString>;
294
+ kind: z.ZodOptional<z.ZodString>;
295
+ story: z.ZodOptional<z.ZodString>;
296
+ shotName: z.ZodOptional<z.ZodString>;
297
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
298
+ filePathBaseline: z.ZodOptional<z.ZodString>;
299
+ filePathCurrent: z.ZodOptional<z.ZodString>;
300
+ filePathDifference: z.ZodOptional<z.ZodString>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ shotMode: "storybook";
303
+ id?: string | undefined;
304
+ shotName?: string | undefined;
305
+ filePathBaseline?: string | undefined;
306
+ filePathCurrent?: string | undefined;
307
+ filePathDifference?: string | undefined;
308
+ kind?: string | undefined;
309
+ story?: string | undefined;
310
+ parameters?: Record<string, unknown> | undefined;
311
+ }, {
312
+ shotMode: "storybook";
313
+ id?: string | undefined;
314
+ shotName?: string | undefined;
315
+ filePathBaseline?: string | undefined;
316
+ filePathCurrent?: string | undefined;
317
+ filePathDifference?: string | undefined;
318
+ kind?: string | undefined;
319
+ story?: string | undefined;
320
+ parameters?: Record<string, unknown> | undefined;
321
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
322
+ /**
323
+ * Launch options for the browser
324
+ */
325
+ browserLaunchOptions: z.ZodOptional<z.ZodObject<{
326
+ chromium: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
327
+ firefox: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
328
+ webkit: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
329
+ }, "strip", z.ZodTypeAny, {
330
+ chromium?: LaunchOptions | undefined;
331
+ firefox?: LaunchOptions | undefined;
332
+ webkit?: LaunchOptions | undefined;
333
+ }, {
334
+ chromium?: LaunchOptions | undefined;
335
+ firefox?: LaunchOptions | undefined;
336
+ webkit?: LaunchOptions | undefined;
337
+ }>>;
338
+ }, {
339
+ /**
340
+ * URL of the Lost Pixel API endpoint
341
+ * @default 'https://api.lost-pixel.com'
342
+ */
343
+ lostPixelPlatform: z.ZodDefault<z.ZodString>;
344
+ /**
345
+ * API key for the Lost Pixel platform
346
+ */
347
+ apiKey: z.ZodString;
348
+ /**
349
+ * Project ID
350
+ */
351
+ lostPixelProjectId: z.ZodString;
352
+ /**
353
+ * CI build ID
354
+ */
355
+ ciBuildId: z.ZodDefault<z.ZodString>;
356
+ /**
357
+ * CI build number
358
+ */
359
+ ciBuildNumber: z.ZodDefault<z.ZodString>;
360
+ /**
361
+ * Git repository name (e.g. 'lost-pixel/lost-pixel-storybook')
362
+ */
363
+ repository: z.ZodDefault<z.ZodString>;
364
+ /**
365
+ * Git branch name (e.g. 'main')
366
+ */
367
+ commitRefName: z.ZodDefault<z.ZodString>;
368
+ /**
369
+ * Git commit SHA (e.g. 'b9b8b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9')
370
+ */
371
+ commitHash: z.ZodDefault<z.ZodString>;
372
+ /**
373
+ * File path to event.json file
374
+ */
375
+ eventFilePath: z.ZodOptional<z.ZodString>;
376
+ /**
377
+ * Whether to set the GitHub status check on process start or not
378
+ *
379
+ * Setting this option to `true` makes only sense if the repository settings have pending status checks disabled
380
+ * @default false
381
+ */
382
+ setPendingStatusCheck: z.ZodDefault<z.ZodBoolean>;
383
+ /**
384
+ * Skip taking screenshots and only upload existing images to the platform.
385
+ *
386
+ * When enabled, lost-pixel reads `.png` files from `imagePathCurrent`
387
+ * instead of launching a browser. Useful when screenshots are produced
388
+ * by an external process.
389
+ * @default false
390
+ */
391
+ uploadOnly: z.ZodDefault<z.ZodBoolean>;
392
+ }>, "strip", z.ZodTypeAny, {
393
+ threshold: number;
394
+ waitBeforeScreenshot: number;
395
+ stabilizeBeforeScreenshot: boolean;
396
+ browser: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[];
397
+ imagePathCurrent: string;
398
+ shotConcurrency: number;
399
+ timeouts: {
400
+ fetchStories: number;
401
+ loadState: number;
402
+ networkRequests: number;
403
+ };
404
+ waitForFirstRequest: number;
405
+ waitForLastRequest: number;
406
+ flakynessRetries: number;
407
+ waitBetweenFlakynessRetries: number;
408
+ lostPixelPlatform: string;
409
+ apiKey: string;
410
+ lostPixelProjectId: string;
411
+ ciBuildId: string;
412
+ ciBuildNumber: string;
413
+ repository: string;
414
+ commitRefName: string;
415
+ commitHash: string;
416
+ setPendingStatusCheck: boolean;
417
+ uploadOnly: boolean;
418
+ breakpoints?: number[] | undefined;
419
+ storybookShots?: {
420
+ storybookUrl: string;
421
+ mask?: {
422
+ selector: string;
423
+ }[] | undefined;
424
+ elementLocator?: string | undefined;
425
+ waitForSelector?: string | undefined;
426
+ breakpoints?: number[] | undefined;
427
+ } | undefined;
428
+ filterShot?: ((args_0: {
429
+ shotMode: "storybook";
430
+ id?: string | undefined;
431
+ shotName?: string | undefined;
432
+ filePathBaseline?: string | undefined;
433
+ filePathCurrent?: string | undefined;
434
+ filePathDifference?: string | undefined;
435
+ kind?: string | undefined;
436
+ story?: string | undefined;
437
+ parameters?: Record<string, unknown> | undefined;
438
+ }, ...args: unknown[]) => boolean) | undefined;
439
+ shotNameGenerator?: ((args_0: {
440
+ shotMode: "storybook";
441
+ id?: string | undefined;
442
+ shotName?: string | undefined;
443
+ filePathBaseline?: string | undefined;
444
+ filePathCurrent?: string | undefined;
445
+ filePathDifference?: string | undefined;
446
+ kind?: string | undefined;
447
+ story?: string | undefined;
448
+ parameters?: Record<string, unknown> | undefined;
449
+ }, ...args: unknown[]) => string) | undefined;
450
+ configureBrowser?: ((args_0: {
451
+ shotMode: "storybook";
452
+ id?: string | undefined;
453
+ shotName?: string | undefined;
454
+ filePathBaseline?: string | undefined;
455
+ filePathCurrent?: string | undefined;
456
+ filePathDifference?: string | undefined;
457
+ kind?: string | undefined;
458
+ story?: string | undefined;
459
+ parameters?: Record<string, unknown> | undefined;
460
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
461
+ beforeScreenshot?: ((args_0: Page, args_1: {
462
+ shotMode: "storybook";
463
+ id?: string | undefined;
464
+ shotName?: string | undefined;
465
+ filePathBaseline?: string | undefined;
466
+ filePathCurrent?: string | undefined;
467
+ filePathDifference?: string | undefined;
468
+ kind?: string | undefined;
469
+ story?: string | undefined;
470
+ parameters?: Record<string, unknown> | undefined;
471
+ }, ...args: unknown[]) => Promise<void>) | undefined;
472
+ afterScreenshot?: ((args_0: Page, args_1: {
473
+ shotMode: "storybook";
474
+ id?: string | undefined;
475
+ shotName?: string | undefined;
476
+ filePathBaseline?: string | undefined;
477
+ filePathCurrent?: string | undefined;
478
+ filePathDifference?: string | undefined;
479
+ kind?: string | undefined;
480
+ story?: string | undefined;
481
+ parameters?: Record<string, unknown> | undefined;
482
+ }, ...args: unknown[]) => Promise<void>) | undefined;
483
+ browserLaunchOptions?: {
484
+ chromium?: LaunchOptions | undefined;
485
+ firefox?: LaunchOptions | undefined;
486
+ webkit?: LaunchOptions | undefined;
487
+ } | undefined;
488
+ eventFilePath?: string | undefined;
489
+ }, {
490
+ apiKey: string;
491
+ lostPixelProjectId: string;
492
+ threshold?: number | undefined;
493
+ waitBeforeScreenshot?: number | undefined;
494
+ stabilizeBeforeScreenshot?: boolean | undefined;
495
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
496
+ breakpoints?: number[] | undefined;
497
+ storybookShots?: {
498
+ storybookUrl: string;
499
+ mask?: {
500
+ selector: string;
501
+ }[] | undefined;
502
+ elementLocator?: string | undefined;
503
+ waitForSelector?: string | undefined;
504
+ breakpoints?: number[] | undefined;
505
+ } | undefined;
506
+ imagePathCurrent?: string | undefined;
507
+ shotConcurrency?: number | undefined;
508
+ timeouts?: {
509
+ fetchStories?: number | undefined;
510
+ loadState?: number | undefined;
511
+ networkRequests?: number | undefined;
512
+ } | undefined;
513
+ waitForFirstRequest?: number | undefined;
514
+ waitForLastRequest?: number | undefined;
515
+ flakynessRetries?: number | undefined;
516
+ waitBetweenFlakynessRetries?: number | undefined;
517
+ filterShot?: ((args_0: {
518
+ shotMode: "storybook";
519
+ id?: string | undefined;
520
+ shotName?: string | undefined;
521
+ filePathBaseline?: string | undefined;
522
+ filePathCurrent?: string | undefined;
523
+ filePathDifference?: string | undefined;
524
+ kind?: string | undefined;
525
+ story?: string | undefined;
526
+ parameters?: Record<string, unknown> | undefined;
527
+ }, ...args: unknown[]) => boolean) | undefined;
528
+ shotNameGenerator?: ((args_0: {
529
+ shotMode: "storybook";
530
+ id?: string | undefined;
531
+ shotName?: string | undefined;
532
+ filePathBaseline?: string | undefined;
533
+ filePathCurrent?: string | undefined;
534
+ filePathDifference?: string | undefined;
535
+ kind?: string | undefined;
536
+ story?: string | undefined;
537
+ parameters?: Record<string, unknown> | undefined;
538
+ }, ...args: unknown[]) => string) | undefined;
539
+ configureBrowser?: ((args_0: {
540
+ shotMode: "storybook";
541
+ id?: string | undefined;
542
+ shotName?: string | undefined;
543
+ filePathBaseline?: string | undefined;
544
+ filePathCurrent?: string | undefined;
545
+ filePathDifference?: string | undefined;
546
+ kind?: string | undefined;
547
+ story?: string | undefined;
548
+ parameters?: Record<string, unknown> | undefined;
549
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
550
+ beforeScreenshot?: ((args_0: Page, args_1: {
551
+ shotMode: "storybook";
552
+ id?: string | undefined;
553
+ shotName?: string | undefined;
554
+ filePathBaseline?: string | undefined;
555
+ filePathCurrent?: string | undefined;
556
+ filePathDifference?: string | undefined;
557
+ kind?: string | undefined;
558
+ story?: string | undefined;
559
+ parameters?: Record<string, unknown> | undefined;
560
+ }, ...args: unknown[]) => Promise<void>) | undefined;
561
+ afterScreenshot?: ((args_0: Page, args_1: {
562
+ shotMode: "storybook";
563
+ id?: string | undefined;
564
+ shotName?: string | undefined;
565
+ filePathBaseline?: string | undefined;
566
+ filePathCurrent?: string | undefined;
567
+ filePathDifference?: string | undefined;
568
+ kind?: string | undefined;
569
+ story?: string | undefined;
570
+ parameters?: Record<string, unknown> | undefined;
571
+ }, ...args: unknown[]) => Promise<void>) | undefined;
572
+ browserLaunchOptions?: {
573
+ chromium?: LaunchOptions | undefined;
574
+ firefox?: LaunchOptions | undefined;
575
+ webkit?: LaunchOptions | undefined;
576
+ } | undefined;
577
+ lostPixelPlatform?: string | undefined;
578
+ ciBuildId?: string | undefined;
579
+ ciBuildNumber?: string | undefined;
580
+ repository?: string | undefined;
581
+ commitRefName?: string | undefined;
582
+ commitHash?: string | undefined;
583
+ eventFilePath?: string | undefined;
584
+ setPendingStatusCheck?: boolean | undefined;
585
+ uploadOnly?: boolean | undefined;
586
+ }>;
587
+ export declare const GenerateOnlyModeConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
588
+ /**
589
+ * Browser to use: chromium, firefox, or webkit
590
+ * @default 'chromium'
591
+ */
592
+ browser: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["chromium", "firefox", "webkit"]>, z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>]>>;
593
+ /**
594
+ * Enable Storybook mode
595
+ */
596
+ storybookShots: z.ZodOptional<z.ZodObject<{
597
+ /**
598
+ * URL of the Storybook instance or local folder
599
+ * @default 'storybook-static'
600
+ */
601
+ storybookUrl: z.ZodString;
602
+ /**
603
+ * Define areas for all stories where differences will be ignored
604
+ */
605
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
606
+ selector: z.ZodString;
607
+ }, "strip", z.ZodTypeAny, {
608
+ selector: string;
609
+ }, {
610
+ selector: string;
611
+ }>, "many">>;
612
+ /**
613
+ * Define custom breakpoints for all Storybook shots as width in pixels
614
+ * @default []
615
+ * @example
616
+ * [ 320, 768, 1280 ]
617
+ */
618
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
619
+ /**
620
+ * Target specific element on page with a selector
621
+ */
622
+ elementLocator: z.ZodOptional<z.ZodString>;
623
+ /**
624
+ * Wait for a specific selector before taking a screenshot
625
+ * @example '[data-storyloaded]'
626
+ */
627
+ waitForSelector: z.ZodOptional<z.ZodString>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ storybookUrl: string;
630
+ mask?: {
631
+ selector: string;
632
+ }[] | undefined;
633
+ elementLocator?: string | undefined;
634
+ waitForSelector?: string | undefined;
635
+ breakpoints?: number[] | undefined;
636
+ }, {
637
+ storybookUrl: string;
638
+ mask?: {
639
+ selector: string;
640
+ }[] | undefined;
641
+ elementLocator?: string | undefined;
642
+ waitForSelector?: string | undefined;
643
+ breakpoints?: number[] | undefined;
644
+ }>>;
645
+ /**
646
+ * Path to the current image folder
647
+ * @default '.lostpixel/current/'
648
+ */
649
+ imagePathCurrent: z.ZodDefault<z.ZodString>;
650
+ /**
651
+ * Define custom breakpoints for all tests as width in pixels
652
+ * @default []
653
+ * @example
654
+ * [ 320, 768, 1280 ]
655
+ */
656
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
657
+ /**
658
+ * Number of concurrent shots to take. Auto-scales with the number of CPUs
659
+ * available to the process by default (floor `10`, ceiling `32`). Set to
660
+ * `0` to opt back into the auto default from an explicit config.
661
+ * @default auto
662
+ */
663
+ shotConcurrency: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
664
+ /**
665
+ * Timeouts for various stages of the test
666
+ */
667
+ timeouts: z.ZodDefault<z.ZodObject<{
668
+ /**
669
+ * Timeout for fetching stories
670
+ * @default 30_000
671
+ */
672
+ fetchStories: z.ZodDefault<z.ZodNumber>;
673
+ /**
674
+ * Timeout for loading the state of the page
675
+ * @default 30_000
676
+ */
677
+ loadState: z.ZodDefault<z.ZodNumber>;
678
+ /**
679
+ * Timeout for waiting for network requests to finish
680
+ * @default 30_000
681
+ */
682
+ networkRequests: z.ZodDefault<z.ZodNumber>;
683
+ }, "strip", z.ZodTypeAny, {
684
+ fetchStories: number;
685
+ loadState: number;
686
+ networkRequests: number;
687
+ }, {
688
+ fetchStories?: number | undefined;
689
+ loadState?: number | undefined;
690
+ networkRequests?: number | undefined;
691
+ }>>;
692
+ /**
693
+ * Maximum time to wait before taking a screenshot. When
694
+ * `stabilizeBeforeScreenshot` is `true` (the default), this is the cap on
695
+ * the adaptive stability wait. When `false`, this is the fixed sleep.
696
+ * @default 1_000
697
+ */
698
+ waitBeforeScreenshot: z.ZodDefault<z.ZodNumber>;
699
+ /**
700
+ * When `true`, the wait before taking a screenshot is adaptive: lost-pixel
701
+ * waits for web fonts, pending images, one committed frame, and a quiet
702
+ * DOM, bounded above by `waitBeforeScreenshot`. When `false`, falls back
703
+ * to a fixed sleep of `waitBeforeScreenshot` milliseconds.
704
+ * @default true
705
+ */
706
+ stabilizeBeforeScreenshot: z.ZodDefault<z.ZodBoolean>;
707
+ /**
708
+ * Time to wait for the first network request to start
709
+ * @default 200
710
+ */
711
+ waitForFirstRequest: z.ZodDefault<z.ZodNumber>;
712
+ /**
713
+ * Time to wait for the last network request to start
714
+ * @default 1_000
715
+ */
716
+ waitForLastRequest: z.ZodDefault<z.ZodNumber>;
717
+ /**
718
+ * Threshold for the difference between the baseline and current image
719
+ *
720
+ * Values between 0 and 1 are interpreted as percentage of the image size
721
+ *
722
+ * Values greater or equal to 1 are interpreted as pixel count.
723
+ * @default 0
724
+ */
725
+ threshold: z.ZodDefault<z.ZodNumber>;
726
+ /**
727
+ * How often to retry a shot for a stable result
728
+ * @default 0
729
+ */
730
+ flakynessRetries: z.ZodDefault<z.ZodNumber>;
731
+ /**
732
+ * Time to wait between flakyness retries
733
+ * @default 2_000
734
+ */
735
+ waitBetweenFlakynessRetries: z.ZodDefault<z.ZodNumber>;
736
+ /**
737
+ * Global shot filter
738
+ */
739
+ filterShot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
740
+ shotMode: z.ZodEnum<["storybook"]>;
741
+ id: z.ZodOptional<z.ZodString>;
742
+ kind: z.ZodOptional<z.ZodString>;
743
+ story: z.ZodOptional<z.ZodString>;
744
+ shotName: z.ZodOptional<z.ZodString>;
745
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
746
+ filePathBaseline: z.ZodOptional<z.ZodString>;
747
+ filePathCurrent: z.ZodOptional<z.ZodString>;
748
+ filePathDifference: z.ZodOptional<z.ZodString>;
749
+ }, "strip", z.ZodTypeAny, {
750
+ shotMode: "storybook";
751
+ id?: string | undefined;
752
+ shotName?: string | undefined;
753
+ filePathBaseline?: string | undefined;
754
+ filePathCurrent?: string | undefined;
755
+ filePathDifference?: string | undefined;
756
+ kind?: string | undefined;
757
+ story?: string | undefined;
758
+ parameters?: Record<string, unknown> | undefined;
759
+ }, {
760
+ shotMode: "storybook";
761
+ id?: string | undefined;
762
+ shotName?: string | undefined;
763
+ filePathBaseline?: string | undefined;
764
+ filePathCurrent?: string | undefined;
765
+ filePathDifference?: string | undefined;
766
+ kind?: string | undefined;
767
+ story?: string | undefined;
768
+ parameters?: Record<string, unknown> | undefined;
769
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
770
+ /**
771
+ * Shot and file name generator for images
772
+ */
773
+ shotNameGenerator: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
774
+ shotMode: z.ZodEnum<["storybook"]>;
775
+ id: z.ZodOptional<z.ZodString>;
776
+ kind: z.ZodOptional<z.ZodString>;
777
+ story: z.ZodOptional<z.ZodString>;
778
+ shotName: z.ZodOptional<z.ZodString>;
779
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
780
+ filePathBaseline: z.ZodOptional<z.ZodString>;
781
+ filePathCurrent: z.ZodOptional<z.ZodString>;
782
+ filePathDifference: z.ZodOptional<z.ZodString>;
783
+ }, "strip", z.ZodTypeAny, {
784
+ shotMode: "storybook";
785
+ id?: string | undefined;
786
+ shotName?: string | undefined;
787
+ filePathBaseline?: string | undefined;
788
+ filePathCurrent?: string | undefined;
789
+ filePathDifference?: string | undefined;
790
+ kind?: string | undefined;
791
+ story?: string | undefined;
792
+ parameters?: Record<string, unknown> | undefined;
793
+ }, {
794
+ shotMode: "storybook";
795
+ id?: string | undefined;
796
+ shotName?: string | undefined;
797
+ filePathBaseline?: string | undefined;
798
+ filePathCurrent?: string | undefined;
799
+ filePathDifference?: string | undefined;
800
+ kind?: string | undefined;
801
+ story?: string | undefined;
802
+ parameters?: Record<string, unknown> | undefined;
803
+ }>], z.ZodUnknown>, z.ZodString>>;
804
+ /**
805
+ * Configure browser context options
806
+ */
807
+ configureBrowser: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
808
+ shotMode: z.ZodEnum<["storybook"]>;
809
+ id: z.ZodOptional<z.ZodString>;
810
+ kind: z.ZodOptional<z.ZodString>;
811
+ story: z.ZodOptional<z.ZodString>;
812
+ shotName: z.ZodOptional<z.ZodString>;
813
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
814
+ filePathBaseline: z.ZodOptional<z.ZodString>;
815
+ filePathCurrent: z.ZodOptional<z.ZodString>;
816
+ filePathDifference: z.ZodOptional<z.ZodString>;
817
+ }, "strip", z.ZodTypeAny, {
818
+ shotMode: "storybook";
819
+ id?: string | undefined;
820
+ shotName?: string | undefined;
821
+ filePathBaseline?: string | undefined;
822
+ filePathCurrent?: string | undefined;
823
+ filePathDifference?: string | undefined;
824
+ kind?: string | undefined;
825
+ story?: string | undefined;
826
+ parameters?: Record<string, unknown> | undefined;
827
+ }, {
828
+ shotMode: "storybook";
829
+ id?: string | undefined;
830
+ shotName?: string | undefined;
831
+ filePathBaseline?: string | undefined;
832
+ filePathCurrent?: string | undefined;
833
+ filePathDifference?: string | undefined;
834
+ kind?: string | undefined;
835
+ story?: string | undefined;
836
+ parameters?: Record<string, unknown> | undefined;
837
+ }>], z.ZodUnknown>, z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>>;
838
+ /**
839
+ * Configure page before screenshot
840
+ */
841
+ beforeScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
842
+ shotMode: z.ZodEnum<["storybook"]>;
843
+ id: z.ZodOptional<z.ZodString>;
844
+ kind: z.ZodOptional<z.ZodString>;
845
+ story: z.ZodOptional<z.ZodString>;
846
+ shotName: z.ZodOptional<z.ZodString>;
847
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
848
+ filePathBaseline: z.ZodOptional<z.ZodString>;
849
+ filePathCurrent: z.ZodOptional<z.ZodString>;
850
+ filePathDifference: z.ZodOptional<z.ZodString>;
851
+ }, "strip", z.ZodTypeAny, {
852
+ shotMode: "storybook";
853
+ id?: string | undefined;
854
+ shotName?: string | undefined;
855
+ filePathBaseline?: string | undefined;
856
+ filePathCurrent?: string | undefined;
857
+ filePathDifference?: string | undefined;
858
+ kind?: string | undefined;
859
+ story?: string | undefined;
860
+ parameters?: Record<string, unknown> | undefined;
861
+ }, {
862
+ shotMode: "storybook";
863
+ id?: string | undefined;
864
+ shotName?: string | undefined;
865
+ filePathBaseline?: string | undefined;
866
+ filePathCurrent?: string | undefined;
867
+ filePathDifference?: string | undefined;
868
+ kind?: string | undefined;
869
+ story?: string | undefined;
870
+ parameters?: Record<string, unknown> | undefined;
871
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
872
+ /**
873
+ * Perform actions after screenshot was taken
874
+ */
875
+ afterScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
876
+ shotMode: z.ZodEnum<["storybook"]>;
877
+ id: z.ZodOptional<z.ZodString>;
878
+ kind: z.ZodOptional<z.ZodString>;
879
+ story: z.ZodOptional<z.ZodString>;
880
+ shotName: z.ZodOptional<z.ZodString>;
881
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
882
+ filePathBaseline: z.ZodOptional<z.ZodString>;
883
+ filePathCurrent: z.ZodOptional<z.ZodString>;
884
+ filePathDifference: z.ZodOptional<z.ZodString>;
885
+ }, "strip", z.ZodTypeAny, {
886
+ shotMode: "storybook";
887
+ id?: string | undefined;
888
+ shotName?: string | undefined;
889
+ filePathBaseline?: string | undefined;
890
+ filePathCurrent?: string | undefined;
891
+ filePathDifference?: string | undefined;
892
+ kind?: string | undefined;
893
+ story?: string | undefined;
894
+ parameters?: Record<string, unknown> | undefined;
895
+ }, {
896
+ shotMode: "storybook";
897
+ id?: string | undefined;
898
+ shotName?: string | undefined;
899
+ filePathBaseline?: string | undefined;
900
+ filePathCurrent?: string | undefined;
901
+ filePathDifference?: string | undefined;
902
+ kind?: string | undefined;
903
+ story?: string | undefined;
904
+ parameters?: Record<string, unknown> | undefined;
905
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
906
+ /**
907
+ * Launch options for the browser
908
+ */
909
+ browserLaunchOptions: z.ZodOptional<z.ZodObject<{
910
+ chromium: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
911
+ firefox: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
912
+ webkit: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ chromium?: LaunchOptions | undefined;
915
+ firefox?: LaunchOptions | undefined;
916
+ webkit?: LaunchOptions | undefined;
917
+ }, {
918
+ chromium?: LaunchOptions | undefined;
919
+ firefox?: LaunchOptions | undefined;
920
+ webkit?: LaunchOptions | undefined;
921
+ }>>;
922
+ }, {
923
+ /**
924
+ * Run in local mode
925
+ * @deprecated Defaults to running in generateOnly mode
926
+ */
927
+ generateOnly: z.ZodOptional<z.ZodBoolean>;
928
+ /**
929
+ * Skip taking screenshots and only upload them to the platform.
930
+ */
931
+ uploadOnly: z.ZodOptional<z.ZodBoolean>;
932
+ /**
933
+ * Flag that decides if process should exit if a difference is found
934
+ */
935
+ failOnDifference: z.ZodOptional<z.ZodBoolean>;
936
+ /**
937
+ * Path to the baseline image folder
938
+ * @default '.lostpixel/baseline/'
939
+ */
940
+ imagePathBaseline: z.ZodDefault<z.ZodString>;
941
+ /**
942
+ * Path to the difference image folder
943
+ * @default '.lostpixel/difference/'
944
+ */
945
+ imagePathDifference: z.ZodDefault<z.ZodString>;
946
+ /**
947
+ * Number of concurrent screenshots to compare
948
+ * @default 10
949
+ */
950
+ compareConcurrency: z.ZodDefault<z.ZodNumber>;
951
+ /**
952
+ * Which comparison engine to use for diffing images
953
+ * @default 'pixelmatch'
954
+ */
955
+ compareEngine: z.ZodDefault<z.ZodEnum<["pixelmatch", "odiff"]>>;
956
+ /**
957
+ * Filter stories to take screenshots of and run comparisons on (existing shots remain untouched)
958
+ */
959
+ filterItemsToCheck: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
960
+ shotMode: z.ZodEnum<["storybook"]>;
961
+ id: z.ZodString;
962
+ shotName: z.ZodString;
963
+ url: z.ZodString;
964
+ filePathBaseline: z.ZodString;
965
+ filePathCurrent: z.ZodString;
966
+ filePathDifference: z.ZodString;
967
+ browserConfig: z.ZodOptional<z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>;
968
+ threshold: z.ZodNumber;
969
+ waitBeforeScreenshot: z.ZodOptional<z.ZodNumber>;
970
+ stabilizeBeforeScreenshot: z.ZodOptional<z.ZodBoolean>;
971
+ importPath: z.ZodOptional<z.ZodString>;
972
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
973
+ selector: z.ZodString;
974
+ }, "strip", z.ZodTypeAny, {
975
+ selector: string;
976
+ }, {
977
+ selector: string;
978
+ }>, "many">>;
979
+ viewport: z.ZodOptional<z.ZodObject<{
980
+ width: z.ZodNumber;
981
+ height: z.ZodOptional<z.ZodNumber>;
982
+ }, "strip", z.ZodTypeAny, {
983
+ width: number;
984
+ height?: number | undefined;
985
+ }, {
986
+ width: number;
987
+ height?: number | undefined;
988
+ }>>;
989
+ breakpoint: z.ZodOptional<z.ZodNumber>;
990
+ breakpointGroup: z.ZodOptional<z.ZodString>;
991
+ elementLocator: z.ZodOptional<z.ZodString>;
992
+ waitForSelector: z.ZodOptional<z.ZodString>;
993
+ }, "strip", z.ZodTypeAny, {
994
+ shotMode: "storybook";
995
+ id: string;
996
+ shotName: string;
997
+ url: string;
998
+ filePathBaseline: string;
999
+ filePathCurrent: string;
1000
+ filePathDifference: string;
1001
+ threshold: number;
1002
+ browserConfig?: BrowserContextOptions | undefined;
1003
+ waitBeforeScreenshot?: number | undefined;
1004
+ stabilizeBeforeScreenshot?: boolean | undefined;
1005
+ importPath?: string | undefined;
1006
+ mask?: {
1007
+ selector: string;
1008
+ }[] | undefined;
1009
+ viewport?: {
1010
+ width: number;
1011
+ height?: number | undefined;
1012
+ } | undefined;
1013
+ breakpoint?: number | undefined;
1014
+ breakpointGroup?: string | undefined;
1015
+ elementLocator?: string | undefined;
1016
+ waitForSelector?: string | undefined;
1017
+ }, {
1018
+ shotMode: "storybook";
1019
+ id: string;
1020
+ shotName: string;
1021
+ url: string;
1022
+ filePathBaseline: string;
1023
+ filePathCurrent: string;
1024
+ filePathDifference: string;
1025
+ threshold: number;
1026
+ browserConfig?: BrowserContextOptions | undefined;
1027
+ waitBeforeScreenshot?: number | undefined;
1028
+ stabilizeBeforeScreenshot?: boolean | undefined;
1029
+ importPath?: string | undefined;
1030
+ mask?: {
1031
+ selector: string;
1032
+ }[] | undefined;
1033
+ viewport?: {
1034
+ width: number;
1035
+ height?: number | undefined;
1036
+ } | undefined;
1037
+ breakpoint?: number | undefined;
1038
+ breakpointGroup?: string | undefined;
1039
+ elementLocator?: string | undefined;
1040
+ waitForSelector?: string | undefined;
1041
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
1042
+ }>, "strip", z.ZodTypeAny, {
1043
+ threshold: number;
1044
+ waitBeforeScreenshot: number;
1045
+ stabilizeBeforeScreenshot: boolean;
1046
+ browser: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[];
1047
+ imagePathCurrent: string;
1048
+ shotConcurrency: number;
1049
+ timeouts: {
1050
+ fetchStories: number;
1051
+ loadState: number;
1052
+ networkRequests: number;
1053
+ };
1054
+ waitForFirstRequest: number;
1055
+ waitForLastRequest: number;
1056
+ flakynessRetries: number;
1057
+ waitBetweenFlakynessRetries: number;
1058
+ imagePathBaseline: string;
1059
+ imagePathDifference: string;
1060
+ compareConcurrency: number;
1061
+ compareEngine: "pixelmatch" | "odiff";
1062
+ breakpoints?: number[] | undefined;
1063
+ storybookShots?: {
1064
+ storybookUrl: string;
1065
+ mask?: {
1066
+ selector: string;
1067
+ }[] | undefined;
1068
+ elementLocator?: string | undefined;
1069
+ waitForSelector?: string | undefined;
1070
+ breakpoints?: number[] | undefined;
1071
+ } | undefined;
1072
+ filterShot?: ((args_0: {
1073
+ shotMode: "storybook";
1074
+ id?: string | undefined;
1075
+ shotName?: string | undefined;
1076
+ filePathBaseline?: string | undefined;
1077
+ filePathCurrent?: string | undefined;
1078
+ filePathDifference?: string | undefined;
1079
+ kind?: string | undefined;
1080
+ story?: string | undefined;
1081
+ parameters?: Record<string, unknown> | undefined;
1082
+ }, ...args: unknown[]) => boolean) | undefined;
1083
+ shotNameGenerator?: ((args_0: {
1084
+ shotMode: "storybook";
1085
+ id?: string | undefined;
1086
+ shotName?: string | undefined;
1087
+ filePathBaseline?: string | undefined;
1088
+ filePathCurrent?: string | undefined;
1089
+ filePathDifference?: string | undefined;
1090
+ kind?: string | undefined;
1091
+ story?: string | undefined;
1092
+ parameters?: Record<string, unknown> | undefined;
1093
+ }, ...args: unknown[]) => string) | undefined;
1094
+ configureBrowser?: ((args_0: {
1095
+ shotMode: "storybook";
1096
+ id?: string | undefined;
1097
+ shotName?: string | undefined;
1098
+ filePathBaseline?: string | undefined;
1099
+ filePathCurrent?: string | undefined;
1100
+ filePathDifference?: string | undefined;
1101
+ kind?: string | undefined;
1102
+ story?: string | undefined;
1103
+ parameters?: Record<string, unknown> | undefined;
1104
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
1105
+ beforeScreenshot?: ((args_0: Page, args_1: {
1106
+ shotMode: "storybook";
1107
+ id?: string | undefined;
1108
+ shotName?: string | undefined;
1109
+ filePathBaseline?: string | undefined;
1110
+ filePathCurrent?: string | undefined;
1111
+ filePathDifference?: string | undefined;
1112
+ kind?: string | undefined;
1113
+ story?: string | undefined;
1114
+ parameters?: Record<string, unknown> | undefined;
1115
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1116
+ afterScreenshot?: ((args_0: Page, args_1: {
1117
+ shotMode: "storybook";
1118
+ id?: string | undefined;
1119
+ shotName?: string | undefined;
1120
+ filePathBaseline?: string | undefined;
1121
+ filePathCurrent?: string | undefined;
1122
+ filePathDifference?: string | undefined;
1123
+ kind?: string | undefined;
1124
+ story?: string | undefined;
1125
+ parameters?: Record<string, unknown> | undefined;
1126
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1127
+ browserLaunchOptions?: {
1128
+ chromium?: LaunchOptions | undefined;
1129
+ firefox?: LaunchOptions | undefined;
1130
+ webkit?: LaunchOptions | undefined;
1131
+ } | undefined;
1132
+ uploadOnly?: boolean | undefined;
1133
+ generateOnly?: boolean | undefined;
1134
+ failOnDifference?: boolean | undefined;
1135
+ filterItemsToCheck?: ((args_0: {
1136
+ shotMode: "storybook";
1137
+ id: string;
1138
+ shotName: string;
1139
+ url: string;
1140
+ filePathBaseline: string;
1141
+ filePathCurrent: string;
1142
+ filePathDifference: string;
1143
+ threshold: number;
1144
+ browserConfig?: BrowserContextOptions | undefined;
1145
+ waitBeforeScreenshot?: number | undefined;
1146
+ stabilizeBeforeScreenshot?: boolean | undefined;
1147
+ importPath?: string | undefined;
1148
+ mask?: {
1149
+ selector: string;
1150
+ }[] | undefined;
1151
+ viewport?: {
1152
+ width: number;
1153
+ height?: number | undefined;
1154
+ } | undefined;
1155
+ breakpoint?: number | undefined;
1156
+ breakpointGroup?: string | undefined;
1157
+ elementLocator?: string | undefined;
1158
+ waitForSelector?: string | undefined;
1159
+ }, ...args: unknown[]) => boolean) | undefined;
1160
+ }, {
1161
+ threshold?: number | undefined;
1162
+ waitBeforeScreenshot?: number | undefined;
1163
+ stabilizeBeforeScreenshot?: boolean | undefined;
1164
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
1165
+ breakpoints?: number[] | undefined;
1166
+ storybookShots?: {
1167
+ storybookUrl: string;
1168
+ mask?: {
1169
+ selector: string;
1170
+ }[] | undefined;
1171
+ elementLocator?: string | undefined;
1172
+ waitForSelector?: string | undefined;
1173
+ breakpoints?: number[] | undefined;
1174
+ } | undefined;
1175
+ imagePathCurrent?: string | undefined;
1176
+ shotConcurrency?: number | undefined;
1177
+ timeouts?: {
1178
+ fetchStories?: number | undefined;
1179
+ loadState?: number | undefined;
1180
+ networkRequests?: number | undefined;
1181
+ } | undefined;
1182
+ waitForFirstRequest?: number | undefined;
1183
+ waitForLastRequest?: number | undefined;
1184
+ flakynessRetries?: number | undefined;
1185
+ waitBetweenFlakynessRetries?: number | undefined;
1186
+ filterShot?: ((args_0: {
1187
+ shotMode: "storybook";
1188
+ id?: string | undefined;
1189
+ shotName?: string | undefined;
1190
+ filePathBaseline?: string | undefined;
1191
+ filePathCurrent?: string | undefined;
1192
+ filePathDifference?: string | undefined;
1193
+ kind?: string | undefined;
1194
+ story?: string | undefined;
1195
+ parameters?: Record<string, unknown> | undefined;
1196
+ }, ...args: unknown[]) => boolean) | undefined;
1197
+ shotNameGenerator?: ((args_0: {
1198
+ shotMode: "storybook";
1199
+ id?: string | undefined;
1200
+ shotName?: string | undefined;
1201
+ filePathBaseline?: string | undefined;
1202
+ filePathCurrent?: string | undefined;
1203
+ filePathDifference?: string | undefined;
1204
+ kind?: string | undefined;
1205
+ story?: string | undefined;
1206
+ parameters?: Record<string, unknown> | undefined;
1207
+ }, ...args: unknown[]) => string) | undefined;
1208
+ configureBrowser?: ((args_0: {
1209
+ shotMode: "storybook";
1210
+ id?: string | undefined;
1211
+ shotName?: string | undefined;
1212
+ filePathBaseline?: string | undefined;
1213
+ filePathCurrent?: string | undefined;
1214
+ filePathDifference?: string | undefined;
1215
+ kind?: string | undefined;
1216
+ story?: string | undefined;
1217
+ parameters?: Record<string, unknown> | undefined;
1218
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
1219
+ beforeScreenshot?: ((args_0: Page, args_1: {
1220
+ shotMode: "storybook";
1221
+ id?: string | undefined;
1222
+ shotName?: string | undefined;
1223
+ filePathBaseline?: string | undefined;
1224
+ filePathCurrent?: string | undefined;
1225
+ filePathDifference?: string | undefined;
1226
+ kind?: string | undefined;
1227
+ story?: string | undefined;
1228
+ parameters?: Record<string, unknown> | undefined;
1229
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1230
+ afterScreenshot?: ((args_0: Page, args_1: {
1231
+ shotMode: "storybook";
1232
+ id?: string | undefined;
1233
+ shotName?: string | undefined;
1234
+ filePathBaseline?: string | undefined;
1235
+ filePathCurrent?: string | undefined;
1236
+ filePathDifference?: string | undefined;
1237
+ kind?: string | undefined;
1238
+ story?: string | undefined;
1239
+ parameters?: Record<string, unknown> | undefined;
1240
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1241
+ browserLaunchOptions?: {
1242
+ chromium?: LaunchOptions | undefined;
1243
+ firefox?: LaunchOptions | undefined;
1244
+ webkit?: LaunchOptions | undefined;
1245
+ } | undefined;
1246
+ uploadOnly?: boolean | undefined;
1247
+ generateOnly?: boolean | undefined;
1248
+ failOnDifference?: boolean | undefined;
1249
+ imagePathBaseline?: string | undefined;
1250
+ imagePathDifference?: string | undefined;
1251
+ compareConcurrency?: number | undefined;
1252
+ compareEngine?: "pixelmatch" | "odiff" | undefined;
1253
+ filterItemsToCheck?: ((args_0: {
1254
+ shotMode: "storybook";
1255
+ id: string;
1256
+ shotName: string;
1257
+ url: string;
1258
+ filePathBaseline: string;
1259
+ filePathCurrent: string;
1260
+ filePathDifference: string;
1261
+ threshold: number;
1262
+ browserConfig?: BrowserContextOptions | undefined;
1263
+ waitBeforeScreenshot?: number | undefined;
1264
+ stabilizeBeforeScreenshot?: boolean | undefined;
1265
+ importPath?: string | undefined;
1266
+ mask?: {
1267
+ selector: string;
1268
+ }[] | undefined;
1269
+ viewport?: {
1270
+ width: number;
1271
+ height?: number | undefined;
1272
+ } | undefined;
1273
+ breakpoint?: number | undefined;
1274
+ breakpointGroup?: string | undefined;
1275
+ elementLocator?: string | undefined;
1276
+ waitForSelector?: string | undefined;
1277
+ }, ...args: unknown[]) => boolean) | undefined;
1278
+ }>;
1279
+ export declare const ConfigSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1280
+ /**
1281
+ * Browser to use: chromium, firefox, or webkit
1282
+ * @default 'chromium'
1283
+ */
1284
+ browser: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["chromium", "firefox", "webkit"]>, z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>]>>;
1285
+ /**
1286
+ * Enable Storybook mode
1287
+ */
1288
+ storybookShots: z.ZodOptional<z.ZodObject<{
1289
+ /**
1290
+ * URL of the Storybook instance or local folder
1291
+ * @default 'storybook-static'
1292
+ */
1293
+ storybookUrl: z.ZodString;
1294
+ /**
1295
+ * Define areas for all stories where differences will be ignored
1296
+ */
1297
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
1298
+ selector: z.ZodString;
1299
+ }, "strip", z.ZodTypeAny, {
1300
+ selector: string;
1301
+ }, {
1302
+ selector: string;
1303
+ }>, "many">>;
1304
+ /**
1305
+ * Define custom breakpoints for all Storybook shots as width in pixels
1306
+ * @default []
1307
+ * @example
1308
+ * [ 320, 768, 1280 ]
1309
+ */
1310
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1311
+ /**
1312
+ * Target specific element on page with a selector
1313
+ */
1314
+ elementLocator: z.ZodOptional<z.ZodString>;
1315
+ /**
1316
+ * Wait for a specific selector before taking a screenshot
1317
+ * @example '[data-storyloaded]'
1318
+ */
1319
+ waitForSelector: z.ZodOptional<z.ZodString>;
1320
+ }, "strip", z.ZodTypeAny, {
1321
+ storybookUrl: string;
1322
+ mask?: {
1323
+ selector: string;
1324
+ }[] | undefined;
1325
+ elementLocator?: string | undefined;
1326
+ waitForSelector?: string | undefined;
1327
+ breakpoints?: number[] | undefined;
1328
+ }, {
1329
+ storybookUrl: string;
1330
+ mask?: {
1331
+ selector: string;
1332
+ }[] | undefined;
1333
+ elementLocator?: string | undefined;
1334
+ waitForSelector?: string | undefined;
1335
+ breakpoints?: number[] | undefined;
1336
+ }>>;
1337
+ /**
1338
+ * Path to the current image folder
1339
+ * @default '.lostpixel/current/'
1340
+ */
1341
+ imagePathCurrent: z.ZodDefault<z.ZodString>;
1342
+ /**
1343
+ * Define custom breakpoints for all tests as width in pixels
1344
+ * @default []
1345
+ * @example
1346
+ * [ 320, 768, 1280 ]
1347
+ */
1348
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1349
+ /**
1350
+ * Number of concurrent shots to take. Auto-scales with the number of CPUs
1351
+ * available to the process by default (floor `10`, ceiling `32`). Set to
1352
+ * `0` to opt back into the auto default from an explicit config.
1353
+ * @default auto
1354
+ */
1355
+ shotConcurrency: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
1356
+ /**
1357
+ * Timeouts for various stages of the test
1358
+ */
1359
+ timeouts: z.ZodDefault<z.ZodObject<{
1360
+ /**
1361
+ * Timeout for fetching stories
1362
+ * @default 30_000
1363
+ */
1364
+ fetchStories: z.ZodDefault<z.ZodNumber>;
1365
+ /**
1366
+ * Timeout for loading the state of the page
1367
+ * @default 30_000
1368
+ */
1369
+ loadState: z.ZodDefault<z.ZodNumber>;
1370
+ /**
1371
+ * Timeout for waiting for network requests to finish
1372
+ * @default 30_000
1373
+ */
1374
+ networkRequests: z.ZodDefault<z.ZodNumber>;
1375
+ }, "strip", z.ZodTypeAny, {
1376
+ fetchStories: number;
1377
+ loadState: number;
1378
+ networkRequests: number;
1379
+ }, {
1380
+ fetchStories?: number | undefined;
1381
+ loadState?: number | undefined;
1382
+ networkRequests?: number | undefined;
1383
+ }>>;
1384
+ /**
1385
+ * Maximum time to wait before taking a screenshot. When
1386
+ * `stabilizeBeforeScreenshot` is `true` (the default), this is the cap on
1387
+ * the adaptive stability wait. When `false`, this is the fixed sleep.
1388
+ * @default 1_000
1389
+ */
1390
+ waitBeforeScreenshot: z.ZodDefault<z.ZodNumber>;
1391
+ /**
1392
+ * When `true`, the wait before taking a screenshot is adaptive: lost-pixel
1393
+ * waits for web fonts, pending images, one committed frame, and a quiet
1394
+ * DOM, bounded above by `waitBeforeScreenshot`. When `false`, falls back
1395
+ * to a fixed sleep of `waitBeforeScreenshot` milliseconds.
1396
+ * @default true
1397
+ */
1398
+ stabilizeBeforeScreenshot: z.ZodDefault<z.ZodBoolean>;
1399
+ /**
1400
+ * Time to wait for the first network request to start
1401
+ * @default 200
1402
+ */
1403
+ waitForFirstRequest: z.ZodDefault<z.ZodNumber>;
1404
+ /**
1405
+ * Time to wait for the last network request to start
1406
+ * @default 1_000
1407
+ */
1408
+ waitForLastRequest: z.ZodDefault<z.ZodNumber>;
1409
+ /**
1410
+ * Threshold for the difference between the baseline and current image
1411
+ *
1412
+ * Values between 0 and 1 are interpreted as percentage of the image size
1413
+ *
1414
+ * Values greater or equal to 1 are interpreted as pixel count.
1415
+ * @default 0
1416
+ */
1417
+ threshold: z.ZodDefault<z.ZodNumber>;
1418
+ /**
1419
+ * How often to retry a shot for a stable result
1420
+ * @default 0
1421
+ */
1422
+ flakynessRetries: z.ZodDefault<z.ZodNumber>;
1423
+ /**
1424
+ * Time to wait between flakyness retries
1425
+ * @default 2_000
1426
+ */
1427
+ waitBetweenFlakynessRetries: z.ZodDefault<z.ZodNumber>;
1428
+ /**
1429
+ * Global shot filter
1430
+ */
1431
+ filterShot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1432
+ shotMode: z.ZodEnum<["storybook"]>;
1433
+ id: z.ZodOptional<z.ZodString>;
1434
+ kind: z.ZodOptional<z.ZodString>;
1435
+ story: z.ZodOptional<z.ZodString>;
1436
+ shotName: z.ZodOptional<z.ZodString>;
1437
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1438
+ filePathBaseline: z.ZodOptional<z.ZodString>;
1439
+ filePathCurrent: z.ZodOptional<z.ZodString>;
1440
+ filePathDifference: z.ZodOptional<z.ZodString>;
1441
+ }, "strip", z.ZodTypeAny, {
1442
+ shotMode: "storybook";
1443
+ id?: string | undefined;
1444
+ shotName?: string | undefined;
1445
+ filePathBaseline?: string | undefined;
1446
+ filePathCurrent?: string | undefined;
1447
+ filePathDifference?: string | undefined;
1448
+ kind?: string | undefined;
1449
+ story?: string | undefined;
1450
+ parameters?: Record<string, unknown> | undefined;
1451
+ }, {
1452
+ shotMode: "storybook";
1453
+ id?: string | undefined;
1454
+ shotName?: string | undefined;
1455
+ filePathBaseline?: string | undefined;
1456
+ filePathCurrent?: string | undefined;
1457
+ filePathDifference?: string | undefined;
1458
+ kind?: string | undefined;
1459
+ story?: string | undefined;
1460
+ parameters?: Record<string, unknown> | undefined;
1461
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
1462
+ /**
1463
+ * Shot and file name generator for images
1464
+ */
1465
+ shotNameGenerator: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1466
+ shotMode: z.ZodEnum<["storybook"]>;
1467
+ id: z.ZodOptional<z.ZodString>;
1468
+ kind: z.ZodOptional<z.ZodString>;
1469
+ story: z.ZodOptional<z.ZodString>;
1470
+ shotName: z.ZodOptional<z.ZodString>;
1471
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1472
+ filePathBaseline: z.ZodOptional<z.ZodString>;
1473
+ filePathCurrent: z.ZodOptional<z.ZodString>;
1474
+ filePathDifference: z.ZodOptional<z.ZodString>;
1475
+ }, "strip", z.ZodTypeAny, {
1476
+ shotMode: "storybook";
1477
+ id?: string | undefined;
1478
+ shotName?: string | undefined;
1479
+ filePathBaseline?: string | undefined;
1480
+ filePathCurrent?: string | undefined;
1481
+ filePathDifference?: string | undefined;
1482
+ kind?: string | undefined;
1483
+ story?: string | undefined;
1484
+ parameters?: Record<string, unknown> | undefined;
1485
+ }, {
1486
+ shotMode: "storybook";
1487
+ id?: string | undefined;
1488
+ shotName?: string | undefined;
1489
+ filePathBaseline?: string | undefined;
1490
+ filePathCurrent?: string | undefined;
1491
+ filePathDifference?: string | undefined;
1492
+ kind?: string | undefined;
1493
+ story?: string | undefined;
1494
+ parameters?: Record<string, unknown> | undefined;
1495
+ }>], z.ZodUnknown>, z.ZodString>>;
1496
+ /**
1497
+ * Configure browser context options
1498
+ */
1499
+ configureBrowser: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1500
+ shotMode: z.ZodEnum<["storybook"]>;
1501
+ id: z.ZodOptional<z.ZodString>;
1502
+ kind: z.ZodOptional<z.ZodString>;
1503
+ story: z.ZodOptional<z.ZodString>;
1504
+ shotName: z.ZodOptional<z.ZodString>;
1505
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1506
+ filePathBaseline: z.ZodOptional<z.ZodString>;
1507
+ filePathCurrent: z.ZodOptional<z.ZodString>;
1508
+ filePathDifference: z.ZodOptional<z.ZodString>;
1509
+ }, "strip", z.ZodTypeAny, {
1510
+ shotMode: "storybook";
1511
+ id?: string | undefined;
1512
+ shotName?: string | undefined;
1513
+ filePathBaseline?: string | undefined;
1514
+ filePathCurrent?: string | undefined;
1515
+ filePathDifference?: string | undefined;
1516
+ kind?: string | undefined;
1517
+ story?: string | undefined;
1518
+ parameters?: Record<string, unknown> | undefined;
1519
+ }, {
1520
+ shotMode: "storybook";
1521
+ id?: string | undefined;
1522
+ shotName?: string | undefined;
1523
+ filePathBaseline?: string | undefined;
1524
+ filePathCurrent?: string | undefined;
1525
+ filePathDifference?: string | undefined;
1526
+ kind?: string | undefined;
1527
+ story?: string | undefined;
1528
+ parameters?: Record<string, unknown> | undefined;
1529
+ }>], z.ZodUnknown>, z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>>;
1530
+ /**
1531
+ * Configure page before screenshot
1532
+ */
1533
+ beforeScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
1534
+ shotMode: z.ZodEnum<["storybook"]>;
1535
+ id: z.ZodOptional<z.ZodString>;
1536
+ kind: z.ZodOptional<z.ZodString>;
1537
+ story: z.ZodOptional<z.ZodString>;
1538
+ shotName: z.ZodOptional<z.ZodString>;
1539
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1540
+ filePathBaseline: z.ZodOptional<z.ZodString>;
1541
+ filePathCurrent: z.ZodOptional<z.ZodString>;
1542
+ filePathDifference: z.ZodOptional<z.ZodString>;
1543
+ }, "strip", z.ZodTypeAny, {
1544
+ shotMode: "storybook";
1545
+ id?: string | undefined;
1546
+ shotName?: string | undefined;
1547
+ filePathBaseline?: string | undefined;
1548
+ filePathCurrent?: string | undefined;
1549
+ filePathDifference?: string | undefined;
1550
+ kind?: string | undefined;
1551
+ story?: string | undefined;
1552
+ parameters?: Record<string, unknown> | undefined;
1553
+ }, {
1554
+ shotMode: "storybook";
1555
+ id?: string | undefined;
1556
+ shotName?: string | undefined;
1557
+ filePathBaseline?: string | undefined;
1558
+ filePathCurrent?: string | undefined;
1559
+ filePathDifference?: string | undefined;
1560
+ kind?: string | undefined;
1561
+ story?: string | undefined;
1562
+ parameters?: Record<string, unknown> | undefined;
1563
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
1564
+ /**
1565
+ * Perform actions after screenshot was taken
1566
+ */
1567
+ afterScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
1568
+ shotMode: z.ZodEnum<["storybook"]>;
1569
+ id: z.ZodOptional<z.ZodString>;
1570
+ kind: z.ZodOptional<z.ZodString>;
1571
+ story: z.ZodOptional<z.ZodString>;
1572
+ shotName: z.ZodOptional<z.ZodString>;
1573
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1574
+ filePathBaseline: z.ZodOptional<z.ZodString>;
1575
+ filePathCurrent: z.ZodOptional<z.ZodString>;
1576
+ filePathDifference: z.ZodOptional<z.ZodString>;
1577
+ }, "strip", z.ZodTypeAny, {
1578
+ shotMode: "storybook";
1579
+ id?: string | undefined;
1580
+ shotName?: string | undefined;
1581
+ filePathBaseline?: string | undefined;
1582
+ filePathCurrent?: string | undefined;
1583
+ filePathDifference?: string | undefined;
1584
+ kind?: string | undefined;
1585
+ story?: string | undefined;
1586
+ parameters?: Record<string, unknown> | undefined;
1587
+ }, {
1588
+ shotMode: "storybook";
1589
+ id?: string | undefined;
1590
+ shotName?: string | undefined;
1591
+ filePathBaseline?: string | undefined;
1592
+ filePathCurrent?: string | undefined;
1593
+ filePathDifference?: string | undefined;
1594
+ kind?: string | undefined;
1595
+ story?: string | undefined;
1596
+ parameters?: Record<string, unknown> | undefined;
1597
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
1598
+ /**
1599
+ * Launch options for the browser
1600
+ */
1601
+ browserLaunchOptions: z.ZodOptional<z.ZodObject<{
1602
+ chromium: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
1603
+ firefox: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
1604
+ webkit: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
1605
+ }, "strip", z.ZodTypeAny, {
1606
+ chromium?: LaunchOptions | undefined;
1607
+ firefox?: LaunchOptions | undefined;
1608
+ webkit?: LaunchOptions | undefined;
1609
+ }, {
1610
+ chromium?: LaunchOptions | undefined;
1611
+ firefox?: LaunchOptions | undefined;
1612
+ webkit?: LaunchOptions | undefined;
1613
+ }>>;
1614
+ }, {
1615
+ /**
1616
+ * URL of the Lost Pixel API endpoint
1617
+ * @default 'https://api.lost-pixel.com'
1618
+ */
1619
+ lostPixelPlatform: z.ZodDefault<z.ZodString>;
1620
+ /**
1621
+ * API key for the Lost Pixel platform
1622
+ */
1623
+ apiKey: z.ZodString;
1624
+ /**
1625
+ * Project ID
1626
+ */
1627
+ lostPixelProjectId: z.ZodString;
1628
+ /**
1629
+ * CI build ID
1630
+ */
1631
+ ciBuildId: z.ZodDefault<z.ZodString>;
1632
+ /**
1633
+ * CI build number
1634
+ */
1635
+ ciBuildNumber: z.ZodDefault<z.ZodString>;
1636
+ /**
1637
+ * Git repository name (e.g. 'lost-pixel/lost-pixel-storybook')
1638
+ */
1639
+ repository: z.ZodDefault<z.ZodString>;
1640
+ /**
1641
+ * Git branch name (e.g. 'main')
1642
+ */
1643
+ commitRefName: z.ZodDefault<z.ZodString>;
1644
+ /**
1645
+ * Git commit SHA (e.g. 'b9b8b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9')
1646
+ */
1647
+ commitHash: z.ZodDefault<z.ZodString>;
1648
+ /**
1649
+ * File path to event.json file
1650
+ */
1651
+ eventFilePath: z.ZodOptional<z.ZodString>;
1652
+ /**
1653
+ * Whether to set the GitHub status check on process start or not
1654
+ *
1655
+ * Setting this option to `true` makes only sense if the repository settings have pending status checks disabled
1656
+ * @default false
1657
+ */
1658
+ setPendingStatusCheck: z.ZodDefault<z.ZodBoolean>;
1659
+ /**
1660
+ * Skip taking screenshots and only upload existing images to the platform.
1661
+ *
1662
+ * When enabled, lost-pixel reads `.png` files from `imagePathCurrent`
1663
+ * instead of launching a browser. Useful when screenshots are produced
1664
+ * by an external process.
1665
+ * @default false
1666
+ */
1667
+ uploadOnly: z.ZodDefault<z.ZodBoolean>;
1668
+ }>, "strip", z.ZodTypeAny, {
1669
+ threshold: number;
1670
+ waitBeforeScreenshot: number;
1671
+ stabilizeBeforeScreenshot: boolean;
1672
+ browser: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[];
1673
+ imagePathCurrent: string;
1674
+ shotConcurrency: number;
1675
+ timeouts: {
1676
+ fetchStories: number;
1677
+ loadState: number;
1678
+ networkRequests: number;
1679
+ };
1680
+ waitForFirstRequest: number;
1681
+ waitForLastRequest: number;
1682
+ flakynessRetries: number;
1683
+ waitBetweenFlakynessRetries: number;
1684
+ lostPixelPlatform: string;
1685
+ apiKey: string;
1686
+ lostPixelProjectId: string;
1687
+ ciBuildId: string;
1688
+ ciBuildNumber: string;
1689
+ repository: string;
1690
+ commitRefName: string;
1691
+ commitHash: string;
1692
+ setPendingStatusCheck: boolean;
1693
+ uploadOnly: boolean;
1694
+ breakpoints?: number[] | undefined;
1695
+ storybookShots?: {
1696
+ storybookUrl: string;
1697
+ mask?: {
1698
+ selector: string;
1699
+ }[] | undefined;
1700
+ elementLocator?: string | undefined;
1701
+ waitForSelector?: string | undefined;
1702
+ breakpoints?: number[] | undefined;
1703
+ } | undefined;
1704
+ filterShot?: ((args_0: {
1705
+ shotMode: "storybook";
1706
+ id?: string | undefined;
1707
+ shotName?: string | undefined;
1708
+ filePathBaseline?: string | undefined;
1709
+ filePathCurrent?: string | undefined;
1710
+ filePathDifference?: string | undefined;
1711
+ kind?: string | undefined;
1712
+ story?: string | undefined;
1713
+ parameters?: Record<string, unknown> | undefined;
1714
+ }, ...args: unknown[]) => boolean) | undefined;
1715
+ shotNameGenerator?: ((args_0: {
1716
+ shotMode: "storybook";
1717
+ id?: string | undefined;
1718
+ shotName?: string | undefined;
1719
+ filePathBaseline?: string | undefined;
1720
+ filePathCurrent?: string | undefined;
1721
+ filePathDifference?: string | undefined;
1722
+ kind?: string | undefined;
1723
+ story?: string | undefined;
1724
+ parameters?: Record<string, unknown> | undefined;
1725
+ }, ...args: unknown[]) => string) | undefined;
1726
+ configureBrowser?: ((args_0: {
1727
+ shotMode: "storybook";
1728
+ id?: string | undefined;
1729
+ shotName?: string | undefined;
1730
+ filePathBaseline?: string | undefined;
1731
+ filePathCurrent?: string | undefined;
1732
+ filePathDifference?: string | undefined;
1733
+ kind?: string | undefined;
1734
+ story?: string | undefined;
1735
+ parameters?: Record<string, unknown> | undefined;
1736
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
1737
+ beforeScreenshot?: ((args_0: Page, args_1: {
1738
+ shotMode: "storybook";
1739
+ id?: string | undefined;
1740
+ shotName?: string | undefined;
1741
+ filePathBaseline?: string | undefined;
1742
+ filePathCurrent?: string | undefined;
1743
+ filePathDifference?: string | undefined;
1744
+ kind?: string | undefined;
1745
+ story?: string | undefined;
1746
+ parameters?: Record<string, unknown> | undefined;
1747
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1748
+ afterScreenshot?: ((args_0: Page, args_1: {
1749
+ shotMode: "storybook";
1750
+ id?: string | undefined;
1751
+ shotName?: string | undefined;
1752
+ filePathBaseline?: string | undefined;
1753
+ filePathCurrent?: string | undefined;
1754
+ filePathDifference?: string | undefined;
1755
+ kind?: string | undefined;
1756
+ story?: string | undefined;
1757
+ parameters?: Record<string, unknown> | undefined;
1758
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1759
+ browserLaunchOptions?: {
1760
+ chromium?: LaunchOptions | undefined;
1761
+ firefox?: LaunchOptions | undefined;
1762
+ webkit?: LaunchOptions | undefined;
1763
+ } | undefined;
1764
+ eventFilePath?: string | undefined;
1765
+ }, {
1766
+ apiKey: string;
1767
+ lostPixelProjectId: string;
1768
+ threshold?: number | undefined;
1769
+ waitBeforeScreenshot?: number | undefined;
1770
+ stabilizeBeforeScreenshot?: boolean | undefined;
1771
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
1772
+ breakpoints?: number[] | undefined;
1773
+ storybookShots?: {
1774
+ storybookUrl: string;
1775
+ mask?: {
1776
+ selector: string;
1777
+ }[] | undefined;
1778
+ elementLocator?: string | undefined;
1779
+ waitForSelector?: string | undefined;
1780
+ breakpoints?: number[] | undefined;
1781
+ } | undefined;
1782
+ imagePathCurrent?: string | undefined;
1783
+ shotConcurrency?: number | undefined;
1784
+ timeouts?: {
1785
+ fetchStories?: number | undefined;
1786
+ loadState?: number | undefined;
1787
+ networkRequests?: number | undefined;
1788
+ } | undefined;
1789
+ waitForFirstRequest?: number | undefined;
1790
+ waitForLastRequest?: number | undefined;
1791
+ flakynessRetries?: number | undefined;
1792
+ waitBetweenFlakynessRetries?: number | undefined;
1793
+ filterShot?: ((args_0: {
1794
+ shotMode: "storybook";
1795
+ id?: string | undefined;
1796
+ shotName?: string | undefined;
1797
+ filePathBaseline?: string | undefined;
1798
+ filePathCurrent?: string | undefined;
1799
+ filePathDifference?: string | undefined;
1800
+ kind?: string | undefined;
1801
+ story?: string | undefined;
1802
+ parameters?: Record<string, unknown> | undefined;
1803
+ }, ...args: unknown[]) => boolean) | undefined;
1804
+ shotNameGenerator?: ((args_0: {
1805
+ shotMode: "storybook";
1806
+ id?: string | undefined;
1807
+ shotName?: string | undefined;
1808
+ filePathBaseline?: string | undefined;
1809
+ filePathCurrent?: string | undefined;
1810
+ filePathDifference?: string | undefined;
1811
+ kind?: string | undefined;
1812
+ story?: string | undefined;
1813
+ parameters?: Record<string, unknown> | undefined;
1814
+ }, ...args: unknown[]) => string) | undefined;
1815
+ configureBrowser?: ((args_0: {
1816
+ shotMode: "storybook";
1817
+ id?: string | undefined;
1818
+ shotName?: string | undefined;
1819
+ filePathBaseline?: string | undefined;
1820
+ filePathCurrent?: string | undefined;
1821
+ filePathDifference?: string | undefined;
1822
+ kind?: string | undefined;
1823
+ story?: string | undefined;
1824
+ parameters?: Record<string, unknown> | undefined;
1825
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
1826
+ beforeScreenshot?: ((args_0: Page, args_1: {
1827
+ shotMode: "storybook";
1828
+ id?: string | undefined;
1829
+ shotName?: string | undefined;
1830
+ filePathBaseline?: string | undefined;
1831
+ filePathCurrent?: string | undefined;
1832
+ filePathDifference?: string | undefined;
1833
+ kind?: string | undefined;
1834
+ story?: string | undefined;
1835
+ parameters?: Record<string, unknown> | undefined;
1836
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1837
+ afterScreenshot?: ((args_0: Page, args_1: {
1838
+ shotMode: "storybook";
1839
+ id?: string | undefined;
1840
+ shotName?: string | undefined;
1841
+ filePathBaseline?: string | undefined;
1842
+ filePathCurrent?: string | undefined;
1843
+ filePathDifference?: string | undefined;
1844
+ kind?: string | undefined;
1845
+ story?: string | undefined;
1846
+ parameters?: Record<string, unknown> | undefined;
1847
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1848
+ browserLaunchOptions?: {
1849
+ chromium?: LaunchOptions | undefined;
1850
+ firefox?: LaunchOptions | undefined;
1851
+ webkit?: LaunchOptions | undefined;
1852
+ } | undefined;
1853
+ lostPixelPlatform?: string | undefined;
1854
+ ciBuildId?: string | undefined;
1855
+ ciBuildNumber?: string | undefined;
1856
+ repository?: string | undefined;
1857
+ commitRefName?: string | undefined;
1858
+ commitHash?: string | undefined;
1859
+ eventFilePath?: string | undefined;
1860
+ setPendingStatusCheck?: boolean | undefined;
1861
+ uploadOnly?: boolean | undefined;
1862
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1863
+ /**
1864
+ * Browser to use: chromium, firefox, or webkit
1865
+ * @default 'chromium'
1866
+ */
1867
+ browser: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["chromium", "firefox", "webkit"]>, z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>]>>;
1868
+ /**
1869
+ * Enable Storybook mode
1870
+ */
1871
+ storybookShots: z.ZodOptional<z.ZodObject<{
1872
+ /**
1873
+ * URL of the Storybook instance or local folder
1874
+ * @default 'storybook-static'
1875
+ */
1876
+ storybookUrl: z.ZodString;
1877
+ /**
1878
+ * Define areas for all stories where differences will be ignored
1879
+ */
1880
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
1881
+ selector: z.ZodString;
1882
+ }, "strip", z.ZodTypeAny, {
1883
+ selector: string;
1884
+ }, {
1885
+ selector: string;
1886
+ }>, "many">>;
1887
+ /**
1888
+ * Define custom breakpoints for all Storybook shots as width in pixels
1889
+ * @default []
1890
+ * @example
1891
+ * [ 320, 768, 1280 ]
1892
+ */
1893
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1894
+ /**
1895
+ * Target specific element on page with a selector
1896
+ */
1897
+ elementLocator: z.ZodOptional<z.ZodString>;
1898
+ /**
1899
+ * Wait for a specific selector before taking a screenshot
1900
+ * @example '[data-storyloaded]'
1901
+ */
1902
+ waitForSelector: z.ZodOptional<z.ZodString>;
1903
+ }, "strip", z.ZodTypeAny, {
1904
+ storybookUrl: string;
1905
+ mask?: {
1906
+ selector: string;
1907
+ }[] | undefined;
1908
+ elementLocator?: string | undefined;
1909
+ waitForSelector?: string | undefined;
1910
+ breakpoints?: number[] | undefined;
1911
+ }, {
1912
+ storybookUrl: string;
1913
+ mask?: {
1914
+ selector: string;
1915
+ }[] | undefined;
1916
+ elementLocator?: string | undefined;
1917
+ waitForSelector?: string | undefined;
1918
+ breakpoints?: number[] | undefined;
1919
+ }>>;
1920
+ /**
1921
+ * Path to the current image folder
1922
+ * @default '.lostpixel/current/'
1923
+ */
1924
+ imagePathCurrent: z.ZodDefault<z.ZodString>;
1925
+ /**
1926
+ * Define custom breakpoints for all tests as width in pixels
1927
+ * @default []
1928
+ * @example
1929
+ * [ 320, 768, 1280 ]
1930
+ */
1931
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1932
+ /**
1933
+ * Number of concurrent shots to take. Auto-scales with the number of CPUs
1934
+ * available to the process by default (floor `10`, ceiling `32`). Set to
1935
+ * `0` to opt back into the auto default from an explicit config.
1936
+ * @default auto
1937
+ */
1938
+ shotConcurrency: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
1939
+ /**
1940
+ * Timeouts for various stages of the test
1941
+ */
1942
+ timeouts: z.ZodDefault<z.ZodObject<{
1943
+ /**
1944
+ * Timeout for fetching stories
1945
+ * @default 30_000
1946
+ */
1947
+ fetchStories: z.ZodDefault<z.ZodNumber>;
1948
+ /**
1949
+ * Timeout for loading the state of the page
1950
+ * @default 30_000
1951
+ */
1952
+ loadState: z.ZodDefault<z.ZodNumber>;
1953
+ /**
1954
+ * Timeout for waiting for network requests to finish
1955
+ * @default 30_000
1956
+ */
1957
+ networkRequests: z.ZodDefault<z.ZodNumber>;
1958
+ }, "strip", z.ZodTypeAny, {
1959
+ fetchStories: number;
1960
+ loadState: number;
1961
+ networkRequests: number;
1962
+ }, {
1963
+ fetchStories?: number | undefined;
1964
+ loadState?: number | undefined;
1965
+ networkRequests?: number | undefined;
1966
+ }>>;
1967
+ /**
1968
+ * Maximum time to wait before taking a screenshot. When
1969
+ * `stabilizeBeforeScreenshot` is `true` (the default), this is the cap on
1970
+ * the adaptive stability wait. When `false`, this is the fixed sleep.
1971
+ * @default 1_000
1972
+ */
1973
+ waitBeforeScreenshot: z.ZodDefault<z.ZodNumber>;
1974
+ /**
1975
+ * When `true`, the wait before taking a screenshot is adaptive: lost-pixel
1976
+ * waits for web fonts, pending images, one committed frame, and a quiet
1977
+ * DOM, bounded above by `waitBeforeScreenshot`. When `false`, falls back
1978
+ * to a fixed sleep of `waitBeforeScreenshot` milliseconds.
1979
+ * @default true
1980
+ */
1981
+ stabilizeBeforeScreenshot: z.ZodDefault<z.ZodBoolean>;
1982
+ /**
1983
+ * Time to wait for the first network request to start
1984
+ * @default 200
1985
+ */
1986
+ waitForFirstRequest: z.ZodDefault<z.ZodNumber>;
1987
+ /**
1988
+ * Time to wait for the last network request to start
1989
+ * @default 1_000
1990
+ */
1991
+ waitForLastRequest: z.ZodDefault<z.ZodNumber>;
1992
+ /**
1993
+ * Threshold for the difference between the baseline and current image
1994
+ *
1995
+ * Values between 0 and 1 are interpreted as percentage of the image size
1996
+ *
1997
+ * Values greater or equal to 1 are interpreted as pixel count.
1998
+ * @default 0
1999
+ */
2000
+ threshold: z.ZodDefault<z.ZodNumber>;
2001
+ /**
2002
+ * How often to retry a shot for a stable result
2003
+ * @default 0
2004
+ */
2005
+ flakynessRetries: z.ZodDefault<z.ZodNumber>;
2006
+ /**
2007
+ * Time to wait between flakyness retries
2008
+ * @default 2_000
2009
+ */
2010
+ waitBetweenFlakynessRetries: z.ZodDefault<z.ZodNumber>;
2011
+ /**
2012
+ * Global shot filter
2013
+ */
2014
+ filterShot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2015
+ shotMode: z.ZodEnum<["storybook"]>;
2016
+ id: z.ZodOptional<z.ZodString>;
2017
+ kind: z.ZodOptional<z.ZodString>;
2018
+ story: z.ZodOptional<z.ZodString>;
2019
+ shotName: z.ZodOptional<z.ZodString>;
2020
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2021
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2022
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2023
+ filePathDifference: z.ZodOptional<z.ZodString>;
2024
+ }, "strip", z.ZodTypeAny, {
2025
+ shotMode: "storybook";
2026
+ id?: string | undefined;
2027
+ shotName?: string | undefined;
2028
+ filePathBaseline?: string | undefined;
2029
+ filePathCurrent?: string | undefined;
2030
+ filePathDifference?: string | undefined;
2031
+ kind?: string | undefined;
2032
+ story?: string | undefined;
2033
+ parameters?: Record<string, unknown> | undefined;
2034
+ }, {
2035
+ shotMode: "storybook";
2036
+ id?: string | undefined;
2037
+ shotName?: string | undefined;
2038
+ filePathBaseline?: string | undefined;
2039
+ filePathCurrent?: string | undefined;
2040
+ filePathDifference?: string | undefined;
2041
+ kind?: string | undefined;
2042
+ story?: string | undefined;
2043
+ parameters?: Record<string, unknown> | undefined;
2044
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
2045
+ /**
2046
+ * Shot and file name generator for images
2047
+ */
2048
+ shotNameGenerator: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2049
+ shotMode: z.ZodEnum<["storybook"]>;
2050
+ id: z.ZodOptional<z.ZodString>;
2051
+ kind: z.ZodOptional<z.ZodString>;
2052
+ story: z.ZodOptional<z.ZodString>;
2053
+ shotName: z.ZodOptional<z.ZodString>;
2054
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2055
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2056
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2057
+ filePathDifference: z.ZodOptional<z.ZodString>;
2058
+ }, "strip", z.ZodTypeAny, {
2059
+ shotMode: "storybook";
2060
+ id?: string | undefined;
2061
+ shotName?: string | undefined;
2062
+ filePathBaseline?: string | undefined;
2063
+ filePathCurrent?: string | undefined;
2064
+ filePathDifference?: string | undefined;
2065
+ kind?: string | undefined;
2066
+ story?: string | undefined;
2067
+ parameters?: Record<string, unknown> | undefined;
2068
+ }, {
2069
+ shotMode: "storybook";
2070
+ id?: string | undefined;
2071
+ shotName?: string | undefined;
2072
+ filePathBaseline?: string | undefined;
2073
+ filePathCurrent?: string | undefined;
2074
+ filePathDifference?: string | undefined;
2075
+ kind?: string | undefined;
2076
+ story?: string | undefined;
2077
+ parameters?: Record<string, unknown> | undefined;
2078
+ }>], z.ZodUnknown>, z.ZodString>>;
2079
+ /**
2080
+ * Configure browser context options
2081
+ */
2082
+ configureBrowser: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2083
+ shotMode: z.ZodEnum<["storybook"]>;
2084
+ id: z.ZodOptional<z.ZodString>;
2085
+ kind: z.ZodOptional<z.ZodString>;
2086
+ story: z.ZodOptional<z.ZodString>;
2087
+ shotName: z.ZodOptional<z.ZodString>;
2088
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2089
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2090
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2091
+ filePathDifference: z.ZodOptional<z.ZodString>;
2092
+ }, "strip", z.ZodTypeAny, {
2093
+ shotMode: "storybook";
2094
+ id?: string | undefined;
2095
+ shotName?: string | undefined;
2096
+ filePathBaseline?: string | undefined;
2097
+ filePathCurrent?: string | undefined;
2098
+ filePathDifference?: string | undefined;
2099
+ kind?: string | undefined;
2100
+ story?: string | undefined;
2101
+ parameters?: Record<string, unknown> | undefined;
2102
+ }, {
2103
+ shotMode: "storybook";
2104
+ id?: string | undefined;
2105
+ shotName?: string | undefined;
2106
+ filePathBaseline?: string | undefined;
2107
+ filePathCurrent?: string | undefined;
2108
+ filePathDifference?: string | undefined;
2109
+ kind?: string | undefined;
2110
+ story?: string | undefined;
2111
+ parameters?: Record<string, unknown> | undefined;
2112
+ }>], z.ZodUnknown>, z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>>;
2113
+ /**
2114
+ * Configure page before screenshot
2115
+ */
2116
+ beforeScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
2117
+ shotMode: z.ZodEnum<["storybook"]>;
2118
+ id: z.ZodOptional<z.ZodString>;
2119
+ kind: z.ZodOptional<z.ZodString>;
2120
+ story: z.ZodOptional<z.ZodString>;
2121
+ shotName: z.ZodOptional<z.ZodString>;
2122
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2123
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2124
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2125
+ filePathDifference: z.ZodOptional<z.ZodString>;
2126
+ }, "strip", z.ZodTypeAny, {
2127
+ shotMode: "storybook";
2128
+ id?: string | undefined;
2129
+ shotName?: string | undefined;
2130
+ filePathBaseline?: string | undefined;
2131
+ filePathCurrent?: string | undefined;
2132
+ filePathDifference?: string | undefined;
2133
+ kind?: string | undefined;
2134
+ story?: string | undefined;
2135
+ parameters?: Record<string, unknown> | undefined;
2136
+ }, {
2137
+ shotMode: "storybook";
2138
+ id?: string | undefined;
2139
+ shotName?: string | undefined;
2140
+ filePathBaseline?: string | undefined;
2141
+ filePathCurrent?: string | undefined;
2142
+ filePathDifference?: string | undefined;
2143
+ kind?: string | undefined;
2144
+ story?: string | undefined;
2145
+ parameters?: Record<string, unknown> | undefined;
2146
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
2147
+ /**
2148
+ * Perform actions after screenshot was taken
2149
+ */
2150
+ afterScreenshot: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
2151
+ shotMode: z.ZodEnum<["storybook"]>;
2152
+ id: z.ZodOptional<z.ZodString>;
2153
+ kind: z.ZodOptional<z.ZodString>;
2154
+ story: z.ZodOptional<z.ZodString>;
2155
+ shotName: z.ZodOptional<z.ZodString>;
2156
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2157
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2158
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2159
+ filePathDifference: z.ZodOptional<z.ZodString>;
2160
+ }, "strip", z.ZodTypeAny, {
2161
+ shotMode: "storybook";
2162
+ id?: string | undefined;
2163
+ shotName?: string | undefined;
2164
+ filePathBaseline?: string | undefined;
2165
+ filePathCurrent?: string | undefined;
2166
+ filePathDifference?: string | undefined;
2167
+ kind?: string | undefined;
2168
+ story?: string | undefined;
2169
+ parameters?: Record<string, unknown> | undefined;
2170
+ }, {
2171
+ shotMode: "storybook";
2172
+ id?: string | undefined;
2173
+ shotName?: string | undefined;
2174
+ filePathBaseline?: string | undefined;
2175
+ filePathCurrent?: string | undefined;
2176
+ filePathDifference?: string | undefined;
2177
+ kind?: string | undefined;
2178
+ story?: string | undefined;
2179
+ parameters?: Record<string, unknown> | undefined;
2180
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
2181
+ /**
2182
+ * Launch options for the browser
2183
+ */
2184
+ browserLaunchOptions: z.ZodOptional<z.ZodObject<{
2185
+ chromium: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
2186
+ firefox: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
2187
+ webkit: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
2188
+ }, "strip", z.ZodTypeAny, {
2189
+ chromium?: LaunchOptions | undefined;
2190
+ firefox?: LaunchOptions | undefined;
2191
+ webkit?: LaunchOptions | undefined;
2192
+ }, {
2193
+ chromium?: LaunchOptions | undefined;
2194
+ firefox?: LaunchOptions | undefined;
2195
+ webkit?: LaunchOptions | undefined;
2196
+ }>>;
2197
+ }, {
2198
+ /**
2199
+ * Run in local mode
2200
+ * @deprecated Defaults to running in generateOnly mode
2201
+ */
2202
+ generateOnly: z.ZodOptional<z.ZodBoolean>;
2203
+ /**
2204
+ * Skip taking screenshots and only upload them to the platform.
2205
+ */
2206
+ uploadOnly: z.ZodOptional<z.ZodBoolean>;
2207
+ /**
2208
+ * Flag that decides if process should exit if a difference is found
2209
+ */
2210
+ failOnDifference: z.ZodOptional<z.ZodBoolean>;
2211
+ /**
2212
+ * Path to the baseline image folder
2213
+ * @default '.lostpixel/baseline/'
2214
+ */
2215
+ imagePathBaseline: z.ZodDefault<z.ZodString>;
2216
+ /**
2217
+ * Path to the difference image folder
2218
+ * @default '.lostpixel/difference/'
2219
+ */
2220
+ imagePathDifference: z.ZodDefault<z.ZodString>;
2221
+ /**
2222
+ * Number of concurrent screenshots to compare
2223
+ * @default 10
2224
+ */
2225
+ compareConcurrency: z.ZodDefault<z.ZodNumber>;
2226
+ /**
2227
+ * Which comparison engine to use for diffing images
2228
+ * @default 'pixelmatch'
2229
+ */
2230
+ compareEngine: z.ZodDefault<z.ZodEnum<["pixelmatch", "odiff"]>>;
2231
+ /**
2232
+ * Filter stories to take screenshots of and run comparisons on (existing shots remain untouched)
2233
+ */
2234
+ filterItemsToCheck: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2235
+ shotMode: z.ZodEnum<["storybook"]>;
2236
+ id: z.ZodString;
2237
+ shotName: z.ZodString;
2238
+ url: z.ZodString;
2239
+ filePathBaseline: z.ZodString;
2240
+ filePathCurrent: z.ZodString;
2241
+ filePathDifference: z.ZodString;
2242
+ browserConfig: z.ZodOptional<z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>;
2243
+ threshold: z.ZodNumber;
2244
+ waitBeforeScreenshot: z.ZodOptional<z.ZodNumber>;
2245
+ stabilizeBeforeScreenshot: z.ZodOptional<z.ZodBoolean>;
2246
+ importPath: z.ZodOptional<z.ZodString>;
2247
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
2248
+ selector: z.ZodString;
2249
+ }, "strip", z.ZodTypeAny, {
2250
+ selector: string;
2251
+ }, {
2252
+ selector: string;
2253
+ }>, "many">>;
2254
+ viewport: z.ZodOptional<z.ZodObject<{
2255
+ width: z.ZodNumber;
2256
+ height: z.ZodOptional<z.ZodNumber>;
2257
+ }, "strip", z.ZodTypeAny, {
2258
+ width: number;
2259
+ height?: number | undefined;
2260
+ }, {
2261
+ width: number;
2262
+ height?: number | undefined;
2263
+ }>>;
2264
+ breakpoint: z.ZodOptional<z.ZodNumber>;
2265
+ breakpointGroup: z.ZodOptional<z.ZodString>;
2266
+ elementLocator: z.ZodOptional<z.ZodString>;
2267
+ waitForSelector: z.ZodOptional<z.ZodString>;
2268
+ }, "strip", z.ZodTypeAny, {
2269
+ shotMode: "storybook";
2270
+ id: string;
2271
+ shotName: string;
2272
+ url: string;
2273
+ filePathBaseline: string;
2274
+ filePathCurrent: string;
2275
+ filePathDifference: string;
2276
+ threshold: number;
2277
+ browserConfig?: BrowserContextOptions | undefined;
2278
+ waitBeforeScreenshot?: number | undefined;
2279
+ stabilizeBeforeScreenshot?: boolean | undefined;
2280
+ importPath?: string | undefined;
2281
+ mask?: {
2282
+ selector: string;
2283
+ }[] | undefined;
2284
+ viewport?: {
2285
+ width: number;
2286
+ height?: number | undefined;
2287
+ } | undefined;
2288
+ breakpoint?: number | undefined;
2289
+ breakpointGroup?: string | undefined;
2290
+ elementLocator?: string | undefined;
2291
+ waitForSelector?: string | undefined;
2292
+ }, {
2293
+ shotMode: "storybook";
2294
+ id: string;
2295
+ shotName: string;
2296
+ url: string;
2297
+ filePathBaseline: string;
2298
+ filePathCurrent: string;
2299
+ filePathDifference: string;
2300
+ threshold: number;
2301
+ browserConfig?: BrowserContextOptions | undefined;
2302
+ waitBeforeScreenshot?: number | undefined;
2303
+ stabilizeBeforeScreenshot?: boolean | undefined;
2304
+ importPath?: string | undefined;
2305
+ mask?: {
2306
+ selector: string;
2307
+ }[] | undefined;
2308
+ viewport?: {
2309
+ width: number;
2310
+ height?: number | undefined;
2311
+ } | undefined;
2312
+ breakpoint?: number | undefined;
2313
+ breakpointGroup?: string | undefined;
2314
+ elementLocator?: string | undefined;
2315
+ waitForSelector?: string | undefined;
2316
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
2317
+ }>, "strip", z.ZodTypeAny, {
2318
+ threshold: number;
2319
+ waitBeforeScreenshot: number;
2320
+ stabilizeBeforeScreenshot: boolean;
2321
+ browser: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[];
2322
+ imagePathCurrent: string;
2323
+ shotConcurrency: number;
2324
+ timeouts: {
2325
+ fetchStories: number;
2326
+ loadState: number;
2327
+ networkRequests: number;
2328
+ };
2329
+ waitForFirstRequest: number;
2330
+ waitForLastRequest: number;
2331
+ flakynessRetries: number;
2332
+ waitBetweenFlakynessRetries: number;
2333
+ imagePathBaseline: string;
2334
+ imagePathDifference: string;
2335
+ compareConcurrency: number;
2336
+ compareEngine: "pixelmatch" | "odiff";
2337
+ breakpoints?: number[] | undefined;
2338
+ storybookShots?: {
2339
+ storybookUrl: string;
2340
+ mask?: {
2341
+ selector: string;
2342
+ }[] | undefined;
2343
+ elementLocator?: string | undefined;
2344
+ waitForSelector?: string | undefined;
2345
+ breakpoints?: number[] | undefined;
2346
+ } | undefined;
2347
+ filterShot?: ((args_0: {
2348
+ shotMode: "storybook";
2349
+ id?: string | undefined;
2350
+ shotName?: string | undefined;
2351
+ filePathBaseline?: string | undefined;
2352
+ filePathCurrent?: string | undefined;
2353
+ filePathDifference?: string | undefined;
2354
+ kind?: string | undefined;
2355
+ story?: string | undefined;
2356
+ parameters?: Record<string, unknown> | undefined;
2357
+ }, ...args: unknown[]) => boolean) | undefined;
2358
+ shotNameGenerator?: ((args_0: {
2359
+ shotMode: "storybook";
2360
+ id?: string | undefined;
2361
+ shotName?: string | undefined;
2362
+ filePathBaseline?: string | undefined;
2363
+ filePathCurrent?: string | undefined;
2364
+ filePathDifference?: string | undefined;
2365
+ kind?: string | undefined;
2366
+ story?: string | undefined;
2367
+ parameters?: Record<string, unknown> | undefined;
2368
+ }, ...args: unknown[]) => string) | undefined;
2369
+ configureBrowser?: ((args_0: {
2370
+ shotMode: "storybook";
2371
+ id?: string | undefined;
2372
+ shotName?: string | undefined;
2373
+ filePathBaseline?: string | undefined;
2374
+ filePathCurrent?: string | undefined;
2375
+ filePathDifference?: string | undefined;
2376
+ kind?: string | undefined;
2377
+ story?: string | undefined;
2378
+ parameters?: Record<string, unknown> | undefined;
2379
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
2380
+ beforeScreenshot?: ((args_0: Page, args_1: {
2381
+ shotMode: "storybook";
2382
+ id?: string | undefined;
2383
+ shotName?: string | undefined;
2384
+ filePathBaseline?: string | undefined;
2385
+ filePathCurrent?: string | undefined;
2386
+ filePathDifference?: string | undefined;
2387
+ kind?: string | undefined;
2388
+ story?: string | undefined;
2389
+ parameters?: Record<string, unknown> | undefined;
2390
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2391
+ afterScreenshot?: ((args_0: Page, args_1: {
2392
+ shotMode: "storybook";
2393
+ id?: string | undefined;
2394
+ shotName?: string | undefined;
2395
+ filePathBaseline?: string | undefined;
2396
+ filePathCurrent?: string | undefined;
2397
+ filePathDifference?: string | undefined;
2398
+ kind?: string | undefined;
2399
+ story?: string | undefined;
2400
+ parameters?: Record<string, unknown> | undefined;
2401
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2402
+ browserLaunchOptions?: {
2403
+ chromium?: LaunchOptions | undefined;
2404
+ firefox?: LaunchOptions | undefined;
2405
+ webkit?: LaunchOptions | undefined;
2406
+ } | undefined;
2407
+ uploadOnly?: boolean | undefined;
2408
+ generateOnly?: boolean | undefined;
2409
+ failOnDifference?: boolean | undefined;
2410
+ filterItemsToCheck?: ((args_0: {
2411
+ shotMode: "storybook";
2412
+ id: string;
2413
+ shotName: string;
2414
+ url: string;
2415
+ filePathBaseline: string;
2416
+ filePathCurrent: string;
2417
+ filePathDifference: string;
2418
+ threshold: number;
2419
+ browserConfig?: BrowserContextOptions | undefined;
2420
+ waitBeforeScreenshot?: number | undefined;
2421
+ stabilizeBeforeScreenshot?: boolean | undefined;
2422
+ importPath?: string | undefined;
2423
+ mask?: {
2424
+ selector: string;
2425
+ }[] | undefined;
2426
+ viewport?: {
2427
+ width: number;
2428
+ height?: number | undefined;
2429
+ } | undefined;
2430
+ breakpoint?: number | undefined;
2431
+ breakpointGroup?: string | undefined;
2432
+ elementLocator?: string | undefined;
2433
+ waitForSelector?: string | undefined;
2434
+ }, ...args: unknown[]) => boolean) | undefined;
2435
+ }, {
2436
+ threshold?: number | undefined;
2437
+ waitBeforeScreenshot?: number | undefined;
2438
+ stabilizeBeforeScreenshot?: boolean | undefined;
2439
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
2440
+ breakpoints?: number[] | undefined;
2441
+ storybookShots?: {
2442
+ storybookUrl: string;
2443
+ mask?: {
2444
+ selector: string;
2445
+ }[] | undefined;
2446
+ elementLocator?: string | undefined;
2447
+ waitForSelector?: string | undefined;
2448
+ breakpoints?: number[] | undefined;
2449
+ } | undefined;
2450
+ imagePathCurrent?: string | undefined;
2451
+ shotConcurrency?: number | undefined;
2452
+ timeouts?: {
2453
+ fetchStories?: number | undefined;
2454
+ loadState?: number | undefined;
2455
+ networkRequests?: number | undefined;
2456
+ } | undefined;
2457
+ waitForFirstRequest?: number | undefined;
2458
+ waitForLastRequest?: number | undefined;
2459
+ flakynessRetries?: number | undefined;
2460
+ waitBetweenFlakynessRetries?: number | undefined;
2461
+ filterShot?: ((args_0: {
2462
+ shotMode: "storybook";
2463
+ id?: string | undefined;
2464
+ shotName?: string | undefined;
2465
+ filePathBaseline?: string | undefined;
2466
+ filePathCurrent?: string | undefined;
2467
+ filePathDifference?: string | undefined;
2468
+ kind?: string | undefined;
2469
+ story?: string | undefined;
2470
+ parameters?: Record<string, unknown> | undefined;
2471
+ }, ...args: unknown[]) => boolean) | undefined;
2472
+ shotNameGenerator?: ((args_0: {
2473
+ shotMode: "storybook";
2474
+ id?: string | undefined;
2475
+ shotName?: string | undefined;
2476
+ filePathBaseline?: string | undefined;
2477
+ filePathCurrent?: string | undefined;
2478
+ filePathDifference?: string | undefined;
2479
+ kind?: string | undefined;
2480
+ story?: string | undefined;
2481
+ parameters?: Record<string, unknown> | undefined;
2482
+ }, ...args: unknown[]) => string) | undefined;
2483
+ configureBrowser?: ((args_0: {
2484
+ shotMode: "storybook";
2485
+ id?: string | undefined;
2486
+ shotName?: string | undefined;
2487
+ filePathBaseline?: string | undefined;
2488
+ filePathCurrent?: string | undefined;
2489
+ filePathDifference?: string | undefined;
2490
+ kind?: string | undefined;
2491
+ story?: string | undefined;
2492
+ parameters?: Record<string, unknown> | undefined;
2493
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
2494
+ beforeScreenshot?: ((args_0: Page, args_1: {
2495
+ shotMode: "storybook";
2496
+ id?: string | undefined;
2497
+ shotName?: string | undefined;
2498
+ filePathBaseline?: string | undefined;
2499
+ filePathCurrent?: string | undefined;
2500
+ filePathDifference?: string | undefined;
2501
+ kind?: string | undefined;
2502
+ story?: string | undefined;
2503
+ parameters?: Record<string, unknown> | undefined;
2504
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2505
+ afterScreenshot?: ((args_0: Page, args_1: {
2506
+ shotMode: "storybook";
2507
+ id?: string | undefined;
2508
+ shotName?: string | undefined;
2509
+ filePathBaseline?: string | undefined;
2510
+ filePathCurrent?: string | undefined;
2511
+ filePathDifference?: string | undefined;
2512
+ kind?: string | undefined;
2513
+ story?: string | undefined;
2514
+ parameters?: Record<string, unknown> | undefined;
2515
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2516
+ browserLaunchOptions?: {
2517
+ chromium?: LaunchOptions | undefined;
2518
+ firefox?: LaunchOptions | undefined;
2519
+ webkit?: LaunchOptions | undefined;
2520
+ } | undefined;
2521
+ uploadOnly?: boolean | undefined;
2522
+ generateOnly?: boolean | undefined;
2523
+ failOnDifference?: boolean | undefined;
2524
+ imagePathBaseline?: string | undefined;
2525
+ imagePathDifference?: string | undefined;
2526
+ compareConcurrency?: number | undefined;
2527
+ compareEngine?: "pixelmatch" | "odiff" | undefined;
2528
+ filterItemsToCheck?: ((args_0: {
2529
+ shotMode: "storybook";
2530
+ id: string;
2531
+ shotName: string;
2532
+ url: string;
2533
+ filePathBaseline: string;
2534
+ filePathCurrent: string;
2535
+ filePathDifference: string;
2536
+ threshold: number;
2537
+ browserConfig?: BrowserContextOptions | undefined;
2538
+ waitBeforeScreenshot?: number | undefined;
2539
+ stabilizeBeforeScreenshot?: boolean | undefined;
2540
+ importPath?: string | undefined;
2541
+ mask?: {
2542
+ selector: string;
2543
+ }[] | undefined;
2544
+ viewport?: {
2545
+ width: number;
2546
+ height?: number | undefined;
2547
+ } | undefined;
2548
+ breakpoint?: number | undefined;
2549
+ breakpointGroup?: string | undefined;
2550
+ elementLocator?: string | undefined;
2551
+ waitForSelector?: string | undefined;
2552
+ }, ...args: unknown[]) => boolean) | undefined;
2553
+ }>]>;
2554
+ export declare const FlexibleConfigSchema: z.ZodUnion<[z.ZodObject<{
2555
+ browser: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["chromium", "firefox", "webkit"]>, z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>]>>>;
2556
+ storybookShots: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2557
+ /**
2558
+ * URL of the Storybook instance or local folder
2559
+ * @default 'storybook-static'
2560
+ */
2561
+ storybookUrl: z.ZodString;
2562
+ /**
2563
+ * Define areas for all stories where differences will be ignored
2564
+ */
2565
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
2566
+ selector: z.ZodString;
2567
+ }, "strip", z.ZodTypeAny, {
2568
+ selector: string;
2569
+ }, {
2570
+ selector: string;
2571
+ }>, "many">>;
2572
+ /**
2573
+ * Define custom breakpoints for all Storybook shots as width in pixels
2574
+ * @default []
2575
+ * @example
2576
+ * [ 320, 768, 1280 ]
2577
+ */
2578
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
2579
+ /**
2580
+ * Target specific element on page with a selector
2581
+ */
2582
+ elementLocator: z.ZodOptional<z.ZodString>;
2583
+ /**
2584
+ * Wait for a specific selector before taking a screenshot
2585
+ * @example '[data-storyloaded]'
2586
+ */
2587
+ waitForSelector: z.ZodOptional<z.ZodString>;
2588
+ }, "strip", z.ZodTypeAny, {
2589
+ storybookUrl: string;
2590
+ mask?: {
2591
+ selector: string;
2592
+ }[] | undefined;
2593
+ elementLocator?: string | undefined;
2594
+ waitForSelector?: string | undefined;
2595
+ breakpoints?: number[] | undefined;
2596
+ }, {
2597
+ storybookUrl: string;
2598
+ mask?: {
2599
+ selector: string;
2600
+ }[] | undefined;
2601
+ elementLocator?: string | undefined;
2602
+ waitForSelector?: string | undefined;
2603
+ breakpoints?: number[] | undefined;
2604
+ }>>>;
2605
+ imagePathCurrent: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2606
+ breakpoints: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
2607
+ shotConcurrency: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>>;
2608
+ waitBeforeScreenshot: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2609
+ stabilizeBeforeScreenshot: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2610
+ waitForFirstRequest: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2611
+ waitForLastRequest: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2612
+ threshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2613
+ flakynessRetries: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2614
+ waitBetweenFlakynessRetries: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2615
+ filterShot: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2616
+ shotMode: z.ZodEnum<["storybook"]>;
2617
+ id: z.ZodOptional<z.ZodString>;
2618
+ kind: z.ZodOptional<z.ZodString>;
2619
+ story: z.ZodOptional<z.ZodString>;
2620
+ shotName: z.ZodOptional<z.ZodString>;
2621
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2622
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2623
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2624
+ filePathDifference: z.ZodOptional<z.ZodString>;
2625
+ }, "strip", z.ZodTypeAny, {
2626
+ shotMode: "storybook";
2627
+ id?: string | undefined;
2628
+ shotName?: string | undefined;
2629
+ filePathBaseline?: string | undefined;
2630
+ filePathCurrent?: string | undefined;
2631
+ filePathDifference?: string | undefined;
2632
+ kind?: string | undefined;
2633
+ story?: string | undefined;
2634
+ parameters?: Record<string, unknown> | undefined;
2635
+ }, {
2636
+ shotMode: "storybook";
2637
+ id?: string | undefined;
2638
+ shotName?: string | undefined;
2639
+ filePathBaseline?: string | undefined;
2640
+ filePathCurrent?: string | undefined;
2641
+ filePathDifference?: string | undefined;
2642
+ kind?: string | undefined;
2643
+ story?: string | undefined;
2644
+ parameters?: Record<string, unknown> | undefined;
2645
+ }>], z.ZodUnknown>, z.ZodBoolean>>>;
2646
+ shotNameGenerator: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2647
+ shotMode: z.ZodEnum<["storybook"]>;
2648
+ id: z.ZodOptional<z.ZodString>;
2649
+ kind: z.ZodOptional<z.ZodString>;
2650
+ story: z.ZodOptional<z.ZodString>;
2651
+ shotName: z.ZodOptional<z.ZodString>;
2652
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2653
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2654
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2655
+ filePathDifference: z.ZodOptional<z.ZodString>;
2656
+ }, "strip", z.ZodTypeAny, {
2657
+ shotMode: "storybook";
2658
+ id?: string | undefined;
2659
+ shotName?: string | undefined;
2660
+ filePathBaseline?: string | undefined;
2661
+ filePathCurrent?: string | undefined;
2662
+ filePathDifference?: string | undefined;
2663
+ kind?: string | undefined;
2664
+ story?: string | undefined;
2665
+ parameters?: Record<string, unknown> | undefined;
2666
+ }, {
2667
+ shotMode: "storybook";
2668
+ id?: string | undefined;
2669
+ shotName?: string | undefined;
2670
+ filePathBaseline?: string | undefined;
2671
+ filePathCurrent?: string | undefined;
2672
+ filePathDifference?: string | undefined;
2673
+ kind?: string | undefined;
2674
+ story?: string | undefined;
2675
+ parameters?: Record<string, unknown> | undefined;
2676
+ }>], z.ZodUnknown>, z.ZodString>>>;
2677
+ configureBrowser: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2678
+ shotMode: z.ZodEnum<["storybook"]>;
2679
+ id: z.ZodOptional<z.ZodString>;
2680
+ kind: z.ZodOptional<z.ZodString>;
2681
+ story: z.ZodOptional<z.ZodString>;
2682
+ shotName: z.ZodOptional<z.ZodString>;
2683
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2684
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2685
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2686
+ filePathDifference: z.ZodOptional<z.ZodString>;
2687
+ }, "strip", z.ZodTypeAny, {
2688
+ shotMode: "storybook";
2689
+ id?: string | undefined;
2690
+ shotName?: string | undefined;
2691
+ filePathBaseline?: string | undefined;
2692
+ filePathCurrent?: string | undefined;
2693
+ filePathDifference?: string | undefined;
2694
+ kind?: string | undefined;
2695
+ story?: string | undefined;
2696
+ parameters?: Record<string, unknown> | undefined;
2697
+ }, {
2698
+ shotMode: "storybook";
2699
+ id?: string | undefined;
2700
+ shotName?: string | undefined;
2701
+ filePathBaseline?: string | undefined;
2702
+ filePathCurrent?: string | undefined;
2703
+ filePathDifference?: string | undefined;
2704
+ kind?: string | undefined;
2705
+ story?: string | undefined;
2706
+ parameters?: Record<string, unknown> | undefined;
2707
+ }>], z.ZodUnknown>, z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>>>;
2708
+ beforeScreenshot: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
2709
+ shotMode: z.ZodEnum<["storybook"]>;
2710
+ id: z.ZodOptional<z.ZodString>;
2711
+ kind: z.ZodOptional<z.ZodString>;
2712
+ story: z.ZodOptional<z.ZodString>;
2713
+ shotName: z.ZodOptional<z.ZodString>;
2714
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2715
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2716
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2717
+ filePathDifference: z.ZodOptional<z.ZodString>;
2718
+ }, "strip", z.ZodTypeAny, {
2719
+ shotMode: "storybook";
2720
+ id?: string | undefined;
2721
+ shotName?: string | undefined;
2722
+ filePathBaseline?: string | undefined;
2723
+ filePathCurrent?: string | undefined;
2724
+ filePathDifference?: string | undefined;
2725
+ kind?: string | undefined;
2726
+ story?: string | undefined;
2727
+ parameters?: Record<string, unknown> | undefined;
2728
+ }, {
2729
+ shotMode: "storybook";
2730
+ id?: string | undefined;
2731
+ shotName?: string | undefined;
2732
+ filePathBaseline?: string | undefined;
2733
+ filePathCurrent?: string | undefined;
2734
+ filePathDifference?: string | undefined;
2735
+ kind?: string | undefined;
2736
+ story?: string | undefined;
2737
+ parameters?: Record<string, unknown> | undefined;
2738
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>>;
2739
+ afterScreenshot: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
2740
+ shotMode: z.ZodEnum<["storybook"]>;
2741
+ id: z.ZodOptional<z.ZodString>;
2742
+ kind: z.ZodOptional<z.ZodString>;
2743
+ story: z.ZodOptional<z.ZodString>;
2744
+ shotName: z.ZodOptional<z.ZodString>;
2745
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2746
+ filePathBaseline: z.ZodOptional<z.ZodString>;
2747
+ filePathCurrent: z.ZodOptional<z.ZodString>;
2748
+ filePathDifference: z.ZodOptional<z.ZodString>;
2749
+ }, "strip", z.ZodTypeAny, {
2750
+ shotMode: "storybook";
2751
+ id?: string | undefined;
2752
+ shotName?: string | undefined;
2753
+ filePathBaseline?: string | undefined;
2754
+ filePathCurrent?: string | undefined;
2755
+ filePathDifference?: string | undefined;
2756
+ kind?: string | undefined;
2757
+ story?: string | undefined;
2758
+ parameters?: Record<string, unknown> | undefined;
2759
+ }, {
2760
+ shotMode: "storybook";
2761
+ id?: string | undefined;
2762
+ shotName?: string | undefined;
2763
+ filePathBaseline?: string | undefined;
2764
+ filePathCurrent?: string | undefined;
2765
+ filePathDifference?: string | undefined;
2766
+ kind?: string | undefined;
2767
+ story?: string | undefined;
2768
+ parameters?: Record<string, unknown> | undefined;
2769
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>>;
2770
+ browserLaunchOptions: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2771
+ chromium: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
2772
+ firefox: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
2773
+ webkit: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
2774
+ }, "strip", z.ZodTypeAny, {
2775
+ chromium?: LaunchOptions | undefined;
2776
+ firefox?: LaunchOptions | undefined;
2777
+ webkit?: LaunchOptions | undefined;
2778
+ }, {
2779
+ chromium?: LaunchOptions | undefined;
2780
+ firefox?: LaunchOptions | undefined;
2781
+ webkit?: LaunchOptions | undefined;
2782
+ }>>>;
2783
+ lostPixelPlatform: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2784
+ apiKey: z.ZodOptional<z.ZodString>;
2785
+ lostPixelProjectId: z.ZodOptional<z.ZodString>;
2786
+ ciBuildId: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2787
+ ciBuildNumber: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2788
+ repository: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2789
+ commitRefName: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2790
+ commitHash: z.ZodOptional<z.ZodDefault<z.ZodString>>;
2791
+ eventFilePath: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2792
+ setPendingStatusCheck: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2793
+ uploadOnly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2794
+ timeouts: z.ZodOptional<z.ZodObject<{
2795
+ fetchStories: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2796
+ loadState: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2797
+ networkRequests: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2798
+ }, "strip", z.ZodTypeAny, {
2799
+ fetchStories?: number | undefined;
2800
+ loadState?: number | undefined;
2801
+ networkRequests?: number | undefined;
2802
+ }, {
2803
+ fetchStories?: number | undefined;
2804
+ loadState?: number | undefined;
2805
+ networkRequests?: number | undefined;
2806
+ }>>;
2807
+ }, "strip", z.ZodTypeAny, {
2808
+ threshold?: number | undefined;
2809
+ waitBeforeScreenshot?: number | undefined;
2810
+ stabilizeBeforeScreenshot?: boolean | undefined;
2811
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
2812
+ breakpoints?: number[] | undefined;
2813
+ storybookShots?: {
2814
+ storybookUrl: string;
2815
+ mask?: {
2816
+ selector: string;
2817
+ }[] | undefined;
2818
+ elementLocator?: string | undefined;
2819
+ waitForSelector?: string | undefined;
2820
+ breakpoints?: number[] | undefined;
2821
+ } | undefined;
2822
+ imagePathCurrent?: string | undefined;
2823
+ shotConcurrency?: number | undefined;
2824
+ timeouts?: {
2825
+ fetchStories?: number | undefined;
2826
+ loadState?: number | undefined;
2827
+ networkRequests?: number | undefined;
2828
+ } | undefined;
2829
+ waitForFirstRequest?: number | undefined;
2830
+ waitForLastRequest?: number | undefined;
2831
+ flakynessRetries?: number | undefined;
2832
+ waitBetweenFlakynessRetries?: number | undefined;
2833
+ filterShot?: ((args_0: {
2834
+ shotMode: "storybook";
2835
+ id?: string | undefined;
2836
+ shotName?: string | undefined;
2837
+ filePathBaseline?: string | undefined;
2838
+ filePathCurrent?: string | undefined;
2839
+ filePathDifference?: string | undefined;
2840
+ kind?: string | undefined;
2841
+ story?: string | undefined;
2842
+ parameters?: Record<string, unknown> | undefined;
2843
+ }, ...args: unknown[]) => boolean) | undefined;
2844
+ shotNameGenerator?: ((args_0: {
2845
+ shotMode: "storybook";
2846
+ id?: string | undefined;
2847
+ shotName?: string | undefined;
2848
+ filePathBaseline?: string | undefined;
2849
+ filePathCurrent?: string | undefined;
2850
+ filePathDifference?: string | undefined;
2851
+ kind?: string | undefined;
2852
+ story?: string | undefined;
2853
+ parameters?: Record<string, unknown> | undefined;
2854
+ }, ...args: unknown[]) => string) | undefined;
2855
+ configureBrowser?: ((args_0: {
2856
+ shotMode: "storybook";
2857
+ id?: string | undefined;
2858
+ shotName?: string | undefined;
2859
+ filePathBaseline?: string | undefined;
2860
+ filePathCurrent?: string | undefined;
2861
+ filePathDifference?: string | undefined;
2862
+ kind?: string | undefined;
2863
+ story?: string | undefined;
2864
+ parameters?: Record<string, unknown> | undefined;
2865
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
2866
+ beforeScreenshot?: ((args_0: Page, args_1: {
2867
+ shotMode: "storybook";
2868
+ id?: string | undefined;
2869
+ shotName?: string | undefined;
2870
+ filePathBaseline?: string | undefined;
2871
+ filePathCurrent?: string | undefined;
2872
+ filePathDifference?: string | undefined;
2873
+ kind?: string | undefined;
2874
+ story?: string | undefined;
2875
+ parameters?: Record<string, unknown> | undefined;
2876
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2877
+ afterScreenshot?: ((args_0: Page, args_1: {
2878
+ shotMode: "storybook";
2879
+ id?: string | undefined;
2880
+ shotName?: string | undefined;
2881
+ filePathBaseline?: string | undefined;
2882
+ filePathCurrent?: string | undefined;
2883
+ filePathDifference?: string | undefined;
2884
+ kind?: string | undefined;
2885
+ story?: string | undefined;
2886
+ parameters?: Record<string, unknown> | undefined;
2887
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2888
+ browserLaunchOptions?: {
2889
+ chromium?: LaunchOptions | undefined;
2890
+ firefox?: LaunchOptions | undefined;
2891
+ webkit?: LaunchOptions | undefined;
2892
+ } | undefined;
2893
+ lostPixelPlatform?: string | undefined;
2894
+ apiKey?: string | undefined;
2895
+ lostPixelProjectId?: string | undefined;
2896
+ ciBuildId?: string | undefined;
2897
+ ciBuildNumber?: string | undefined;
2898
+ repository?: string | undefined;
2899
+ commitRefName?: string | undefined;
2900
+ commitHash?: string | undefined;
2901
+ eventFilePath?: string | undefined;
2902
+ setPendingStatusCheck?: boolean | undefined;
2903
+ uploadOnly?: boolean | undefined;
2904
+ }, {
2905
+ threshold?: number | undefined;
2906
+ waitBeforeScreenshot?: number | undefined;
2907
+ stabilizeBeforeScreenshot?: boolean | undefined;
2908
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
2909
+ breakpoints?: number[] | undefined;
2910
+ storybookShots?: {
2911
+ storybookUrl: string;
2912
+ mask?: {
2913
+ selector: string;
2914
+ }[] | undefined;
2915
+ elementLocator?: string | undefined;
2916
+ waitForSelector?: string | undefined;
2917
+ breakpoints?: number[] | undefined;
2918
+ } | undefined;
2919
+ imagePathCurrent?: string | undefined;
2920
+ shotConcurrency?: number | undefined;
2921
+ timeouts?: {
2922
+ fetchStories?: number | undefined;
2923
+ loadState?: number | undefined;
2924
+ networkRequests?: number | undefined;
2925
+ } | undefined;
2926
+ waitForFirstRequest?: number | undefined;
2927
+ waitForLastRequest?: number | undefined;
2928
+ flakynessRetries?: number | undefined;
2929
+ waitBetweenFlakynessRetries?: number | undefined;
2930
+ filterShot?: ((args_0: {
2931
+ shotMode: "storybook";
2932
+ id?: string | undefined;
2933
+ shotName?: string | undefined;
2934
+ filePathBaseline?: string | undefined;
2935
+ filePathCurrent?: string | undefined;
2936
+ filePathDifference?: string | undefined;
2937
+ kind?: string | undefined;
2938
+ story?: string | undefined;
2939
+ parameters?: Record<string, unknown> | undefined;
2940
+ }, ...args: unknown[]) => boolean) | undefined;
2941
+ shotNameGenerator?: ((args_0: {
2942
+ shotMode: "storybook";
2943
+ id?: string | undefined;
2944
+ shotName?: string | undefined;
2945
+ filePathBaseline?: string | undefined;
2946
+ filePathCurrent?: string | undefined;
2947
+ filePathDifference?: string | undefined;
2948
+ kind?: string | undefined;
2949
+ story?: string | undefined;
2950
+ parameters?: Record<string, unknown> | undefined;
2951
+ }, ...args: unknown[]) => string) | undefined;
2952
+ configureBrowser?: ((args_0: {
2953
+ shotMode: "storybook";
2954
+ id?: string | undefined;
2955
+ shotName?: string | undefined;
2956
+ filePathBaseline?: string | undefined;
2957
+ filePathCurrent?: string | undefined;
2958
+ filePathDifference?: string | undefined;
2959
+ kind?: string | undefined;
2960
+ story?: string | undefined;
2961
+ parameters?: Record<string, unknown> | undefined;
2962
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
2963
+ beforeScreenshot?: ((args_0: Page, args_1: {
2964
+ shotMode: "storybook";
2965
+ id?: string | undefined;
2966
+ shotName?: string | undefined;
2967
+ filePathBaseline?: string | undefined;
2968
+ filePathCurrent?: string | undefined;
2969
+ filePathDifference?: string | undefined;
2970
+ kind?: string | undefined;
2971
+ story?: string | undefined;
2972
+ parameters?: Record<string, unknown> | undefined;
2973
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2974
+ afterScreenshot?: ((args_0: Page, args_1: {
2975
+ shotMode: "storybook";
2976
+ id?: string | undefined;
2977
+ shotName?: string | undefined;
2978
+ filePathBaseline?: string | undefined;
2979
+ filePathCurrent?: string | undefined;
2980
+ filePathDifference?: string | undefined;
2981
+ kind?: string | undefined;
2982
+ story?: string | undefined;
2983
+ parameters?: Record<string, unknown> | undefined;
2984
+ }, ...args: unknown[]) => Promise<void>) | undefined;
2985
+ browserLaunchOptions?: {
2986
+ chromium?: LaunchOptions | undefined;
2987
+ firefox?: LaunchOptions | undefined;
2988
+ webkit?: LaunchOptions | undefined;
2989
+ } | undefined;
2990
+ lostPixelPlatform?: string | undefined;
2991
+ apiKey?: string | undefined;
2992
+ lostPixelProjectId?: string | undefined;
2993
+ ciBuildId?: string | undefined;
2994
+ ciBuildNumber?: string | undefined;
2995
+ repository?: string | undefined;
2996
+ commitRefName?: string | undefined;
2997
+ commitHash?: string | undefined;
2998
+ eventFilePath?: string | undefined;
2999
+ setPendingStatusCheck?: boolean | undefined;
3000
+ uploadOnly?: boolean | undefined;
3001
+ }>, z.ZodObject<{
3002
+ browser: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["chromium", "firefox", "webkit"]>, z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>]>>>;
3003
+ storybookShots: z.ZodOptional<z.ZodOptional<z.ZodObject<{
3004
+ /**
3005
+ * URL of the Storybook instance or local folder
3006
+ * @default 'storybook-static'
3007
+ */
3008
+ storybookUrl: z.ZodString;
3009
+ /**
3010
+ * Define areas for all stories where differences will be ignored
3011
+ */
3012
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
3013
+ selector: z.ZodString;
3014
+ }, "strip", z.ZodTypeAny, {
3015
+ selector: string;
3016
+ }, {
3017
+ selector: string;
3018
+ }>, "many">>;
3019
+ /**
3020
+ * Define custom breakpoints for all Storybook shots as width in pixels
3021
+ * @default []
3022
+ * @example
3023
+ * [ 320, 768, 1280 ]
3024
+ */
3025
+ breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
3026
+ /**
3027
+ * Target specific element on page with a selector
3028
+ */
3029
+ elementLocator: z.ZodOptional<z.ZodString>;
3030
+ /**
3031
+ * Wait for a specific selector before taking a screenshot
3032
+ * @example '[data-storyloaded]'
3033
+ */
3034
+ waitForSelector: z.ZodOptional<z.ZodString>;
3035
+ }, "strip", z.ZodTypeAny, {
3036
+ storybookUrl: string;
3037
+ mask?: {
3038
+ selector: string;
3039
+ }[] | undefined;
3040
+ elementLocator?: string | undefined;
3041
+ waitForSelector?: string | undefined;
3042
+ breakpoints?: number[] | undefined;
3043
+ }, {
3044
+ storybookUrl: string;
3045
+ mask?: {
3046
+ selector: string;
3047
+ }[] | undefined;
3048
+ elementLocator?: string | undefined;
3049
+ waitForSelector?: string | undefined;
3050
+ breakpoints?: number[] | undefined;
3051
+ }>>>;
3052
+ imagePathCurrent: z.ZodOptional<z.ZodDefault<z.ZodString>>;
3053
+ breakpoints: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
3054
+ shotConcurrency: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>>;
3055
+ waitBeforeScreenshot: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3056
+ stabilizeBeforeScreenshot: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
3057
+ waitForFirstRequest: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3058
+ waitForLastRequest: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3059
+ threshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3060
+ flakynessRetries: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3061
+ waitBetweenFlakynessRetries: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3062
+ filterShot: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
3063
+ shotMode: z.ZodEnum<["storybook"]>;
3064
+ id: z.ZodOptional<z.ZodString>;
3065
+ kind: z.ZodOptional<z.ZodString>;
3066
+ story: z.ZodOptional<z.ZodString>;
3067
+ shotName: z.ZodOptional<z.ZodString>;
3068
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3069
+ filePathBaseline: z.ZodOptional<z.ZodString>;
3070
+ filePathCurrent: z.ZodOptional<z.ZodString>;
3071
+ filePathDifference: z.ZodOptional<z.ZodString>;
3072
+ }, "strip", z.ZodTypeAny, {
3073
+ shotMode: "storybook";
3074
+ id?: string | undefined;
3075
+ shotName?: string | undefined;
3076
+ filePathBaseline?: string | undefined;
3077
+ filePathCurrent?: string | undefined;
3078
+ filePathDifference?: string | undefined;
3079
+ kind?: string | undefined;
3080
+ story?: string | undefined;
3081
+ parameters?: Record<string, unknown> | undefined;
3082
+ }, {
3083
+ shotMode: "storybook";
3084
+ id?: string | undefined;
3085
+ shotName?: string | undefined;
3086
+ filePathBaseline?: string | undefined;
3087
+ filePathCurrent?: string | undefined;
3088
+ filePathDifference?: string | undefined;
3089
+ kind?: string | undefined;
3090
+ story?: string | undefined;
3091
+ parameters?: Record<string, unknown> | undefined;
3092
+ }>], z.ZodUnknown>, z.ZodBoolean>>>;
3093
+ shotNameGenerator: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
3094
+ shotMode: z.ZodEnum<["storybook"]>;
3095
+ id: z.ZodOptional<z.ZodString>;
3096
+ kind: z.ZodOptional<z.ZodString>;
3097
+ story: z.ZodOptional<z.ZodString>;
3098
+ shotName: z.ZodOptional<z.ZodString>;
3099
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3100
+ filePathBaseline: z.ZodOptional<z.ZodString>;
3101
+ filePathCurrent: z.ZodOptional<z.ZodString>;
3102
+ filePathDifference: z.ZodOptional<z.ZodString>;
3103
+ }, "strip", z.ZodTypeAny, {
3104
+ shotMode: "storybook";
3105
+ id?: string | undefined;
3106
+ shotName?: string | undefined;
3107
+ filePathBaseline?: string | undefined;
3108
+ filePathCurrent?: string | undefined;
3109
+ filePathDifference?: string | undefined;
3110
+ kind?: string | undefined;
3111
+ story?: string | undefined;
3112
+ parameters?: Record<string, unknown> | undefined;
3113
+ }, {
3114
+ shotMode: "storybook";
3115
+ id?: string | undefined;
3116
+ shotName?: string | undefined;
3117
+ filePathBaseline?: string | undefined;
3118
+ filePathCurrent?: string | undefined;
3119
+ filePathDifference?: string | undefined;
3120
+ kind?: string | undefined;
3121
+ story?: string | undefined;
3122
+ parameters?: Record<string, unknown> | undefined;
3123
+ }>], z.ZodUnknown>, z.ZodString>>>;
3124
+ configureBrowser: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
3125
+ shotMode: z.ZodEnum<["storybook"]>;
3126
+ id: z.ZodOptional<z.ZodString>;
3127
+ kind: z.ZodOptional<z.ZodString>;
3128
+ story: z.ZodOptional<z.ZodString>;
3129
+ shotName: z.ZodOptional<z.ZodString>;
3130
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3131
+ filePathBaseline: z.ZodOptional<z.ZodString>;
3132
+ filePathCurrent: z.ZodOptional<z.ZodString>;
3133
+ filePathDifference: z.ZodOptional<z.ZodString>;
3134
+ }, "strip", z.ZodTypeAny, {
3135
+ shotMode: "storybook";
3136
+ id?: string | undefined;
3137
+ shotName?: string | undefined;
3138
+ filePathBaseline?: string | undefined;
3139
+ filePathCurrent?: string | undefined;
3140
+ filePathDifference?: string | undefined;
3141
+ kind?: string | undefined;
3142
+ story?: string | undefined;
3143
+ parameters?: Record<string, unknown> | undefined;
3144
+ }, {
3145
+ shotMode: "storybook";
3146
+ id?: string | undefined;
3147
+ shotName?: string | undefined;
3148
+ filePathBaseline?: string | undefined;
3149
+ filePathCurrent?: string | undefined;
3150
+ filePathDifference?: string | undefined;
3151
+ kind?: string | undefined;
3152
+ story?: string | undefined;
3153
+ parameters?: Record<string, unknown> | undefined;
3154
+ }>], z.ZodUnknown>, z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>>>;
3155
+ beforeScreenshot: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
3156
+ shotMode: z.ZodEnum<["storybook"]>;
3157
+ id: z.ZodOptional<z.ZodString>;
3158
+ kind: z.ZodOptional<z.ZodString>;
3159
+ story: z.ZodOptional<z.ZodString>;
3160
+ shotName: z.ZodOptional<z.ZodString>;
3161
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3162
+ filePathBaseline: z.ZodOptional<z.ZodString>;
3163
+ filePathCurrent: z.ZodOptional<z.ZodString>;
3164
+ filePathDifference: z.ZodOptional<z.ZodString>;
3165
+ }, "strip", z.ZodTypeAny, {
3166
+ shotMode: "storybook";
3167
+ id?: string | undefined;
3168
+ shotName?: string | undefined;
3169
+ filePathBaseline?: string | undefined;
3170
+ filePathCurrent?: string | undefined;
3171
+ filePathDifference?: string | undefined;
3172
+ kind?: string | undefined;
3173
+ story?: string | undefined;
3174
+ parameters?: Record<string, unknown> | undefined;
3175
+ }, {
3176
+ shotMode: "storybook";
3177
+ id?: string | undefined;
3178
+ shotName?: string | undefined;
3179
+ filePathBaseline?: string | undefined;
3180
+ filePathCurrent?: string | undefined;
3181
+ filePathDifference?: string | undefined;
3182
+ kind?: string | undefined;
3183
+ story?: string | undefined;
3184
+ parameters?: Record<string, unknown> | undefined;
3185
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>>;
3186
+ afterScreenshot: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Page, z.ZodTypeDef, Page>, z.ZodObject<{
3187
+ shotMode: z.ZodEnum<["storybook"]>;
3188
+ id: z.ZodOptional<z.ZodString>;
3189
+ kind: z.ZodOptional<z.ZodString>;
3190
+ story: z.ZodOptional<z.ZodString>;
3191
+ shotName: z.ZodOptional<z.ZodString>;
3192
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3193
+ filePathBaseline: z.ZodOptional<z.ZodString>;
3194
+ filePathCurrent: z.ZodOptional<z.ZodString>;
3195
+ filePathDifference: z.ZodOptional<z.ZodString>;
3196
+ }, "strip", z.ZodTypeAny, {
3197
+ shotMode: "storybook";
3198
+ id?: string | undefined;
3199
+ shotName?: string | undefined;
3200
+ filePathBaseline?: string | undefined;
3201
+ filePathCurrent?: string | undefined;
3202
+ filePathDifference?: string | undefined;
3203
+ kind?: string | undefined;
3204
+ story?: string | undefined;
3205
+ parameters?: Record<string, unknown> | undefined;
3206
+ }, {
3207
+ shotMode: "storybook";
3208
+ id?: string | undefined;
3209
+ shotName?: string | undefined;
3210
+ filePathBaseline?: string | undefined;
3211
+ filePathCurrent?: string | undefined;
3212
+ filePathDifference?: string | undefined;
3213
+ kind?: string | undefined;
3214
+ story?: string | undefined;
3215
+ parameters?: Record<string, unknown> | undefined;
3216
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>>;
3217
+ browserLaunchOptions: z.ZodOptional<z.ZodOptional<z.ZodObject<{
3218
+ chromium: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
3219
+ firefox: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
3220
+ webkit: z.ZodOptional<z.ZodType<LaunchOptions, z.ZodTypeDef, LaunchOptions>>;
3221
+ }, "strip", z.ZodTypeAny, {
3222
+ chromium?: LaunchOptions | undefined;
3223
+ firefox?: LaunchOptions | undefined;
3224
+ webkit?: LaunchOptions | undefined;
3225
+ }, {
3226
+ chromium?: LaunchOptions | undefined;
3227
+ firefox?: LaunchOptions | undefined;
3228
+ webkit?: LaunchOptions | undefined;
3229
+ }>>>;
3230
+ generateOnly: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
3231
+ uploadOnly: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
3232
+ failOnDifference: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
3233
+ imagePathBaseline: z.ZodOptional<z.ZodDefault<z.ZodString>>;
3234
+ imagePathDifference: z.ZodOptional<z.ZodDefault<z.ZodString>>;
3235
+ compareConcurrency: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3236
+ compareEngine: z.ZodOptional<z.ZodDefault<z.ZodEnum<["pixelmatch", "odiff"]>>>;
3237
+ filterItemsToCheck: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
3238
+ shotMode: z.ZodEnum<["storybook"]>;
3239
+ id: z.ZodString;
3240
+ shotName: z.ZodString;
3241
+ url: z.ZodString;
3242
+ filePathBaseline: z.ZodString;
3243
+ filePathCurrent: z.ZodString;
3244
+ filePathDifference: z.ZodString;
3245
+ browserConfig: z.ZodOptional<z.ZodType<BrowserContextOptions, z.ZodTypeDef, BrowserContextOptions>>;
3246
+ threshold: z.ZodNumber;
3247
+ waitBeforeScreenshot: z.ZodOptional<z.ZodNumber>;
3248
+ stabilizeBeforeScreenshot: z.ZodOptional<z.ZodBoolean>;
3249
+ importPath: z.ZodOptional<z.ZodString>;
3250
+ mask: z.ZodOptional<z.ZodArray<z.ZodObject<{
3251
+ selector: z.ZodString;
3252
+ }, "strip", z.ZodTypeAny, {
3253
+ selector: string;
3254
+ }, {
3255
+ selector: string;
3256
+ }>, "many">>;
3257
+ viewport: z.ZodOptional<z.ZodObject<{
3258
+ width: z.ZodNumber;
3259
+ height: z.ZodOptional<z.ZodNumber>;
3260
+ }, "strip", z.ZodTypeAny, {
3261
+ width: number;
3262
+ height?: number | undefined;
3263
+ }, {
3264
+ width: number;
3265
+ height?: number | undefined;
3266
+ }>>;
3267
+ breakpoint: z.ZodOptional<z.ZodNumber>;
3268
+ breakpointGroup: z.ZodOptional<z.ZodString>;
3269
+ elementLocator: z.ZodOptional<z.ZodString>;
3270
+ waitForSelector: z.ZodOptional<z.ZodString>;
3271
+ }, "strip", z.ZodTypeAny, {
3272
+ shotMode: "storybook";
3273
+ id: string;
3274
+ shotName: string;
3275
+ url: string;
3276
+ filePathBaseline: string;
3277
+ filePathCurrent: string;
3278
+ filePathDifference: string;
3279
+ threshold: number;
3280
+ browserConfig?: BrowserContextOptions | undefined;
3281
+ waitBeforeScreenshot?: number | undefined;
3282
+ stabilizeBeforeScreenshot?: boolean | undefined;
3283
+ importPath?: string | undefined;
3284
+ mask?: {
3285
+ selector: string;
3286
+ }[] | undefined;
3287
+ viewport?: {
3288
+ width: number;
3289
+ height?: number | undefined;
3290
+ } | undefined;
3291
+ breakpoint?: number | undefined;
3292
+ breakpointGroup?: string | undefined;
3293
+ elementLocator?: string | undefined;
3294
+ waitForSelector?: string | undefined;
3295
+ }, {
3296
+ shotMode: "storybook";
3297
+ id: string;
3298
+ shotName: string;
3299
+ url: string;
3300
+ filePathBaseline: string;
3301
+ filePathCurrent: string;
3302
+ filePathDifference: string;
3303
+ threshold: number;
3304
+ browserConfig?: BrowserContextOptions | undefined;
3305
+ waitBeforeScreenshot?: number | undefined;
3306
+ stabilizeBeforeScreenshot?: boolean | undefined;
3307
+ importPath?: string | undefined;
3308
+ mask?: {
3309
+ selector: string;
3310
+ }[] | undefined;
3311
+ viewport?: {
3312
+ width: number;
3313
+ height?: number | undefined;
3314
+ } | undefined;
3315
+ breakpoint?: number | undefined;
3316
+ breakpointGroup?: string | undefined;
3317
+ elementLocator?: string | undefined;
3318
+ waitForSelector?: string | undefined;
3319
+ }>], z.ZodUnknown>, z.ZodBoolean>>>;
3320
+ timeouts: z.ZodOptional<z.ZodObject<{
3321
+ fetchStories: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3322
+ loadState: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3323
+ networkRequests: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3324
+ }, "strip", z.ZodTypeAny, {
3325
+ fetchStories?: number | undefined;
3326
+ loadState?: number | undefined;
3327
+ networkRequests?: number | undefined;
3328
+ }, {
3329
+ fetchStories?: number | undefined;
3330
+ loadState?: number | undefined;
3331
+ networkRequests?: number | undefined;
3332
+ }>>;
3333
+ }, "strip", z.ZodTypeAny, {
3334
+ threshold?: number | undefined;
3335
+ waitBeforeScreenshot?: number | undefined;
3336
+ stabilizeBeforeScreenshot?: boolean | undefined;
3337
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
3338
+ breakpoints?: number[] | undefined;
3339
+ storybookShots?: {
3340
+ storybookUrl: string;
3341
+ mask?: {
3342
+ selector: string;
3343
+ }[] | undefined;
3344
+ elementLocator?: string | undefined;
3345
+ waitForSelector?: string | undefined;
3346
+ breakpoints?: number[] | undefined;
3347
+ } | undefined;
3348
+ imagePathCurrent?: string | undefined;
3349
+ shotConcurrency?: number | undefined;
3350
+ timeouts?: {
3351
+ fetchStories?: number | undefined;
3352
+ loadState?: number | undefined;
3353
+ networkRequests?: number | undefined;
3354
+ } | undefined;
3355
+ waitForFirstRequest?: number | undefined;
3356
+ waitForLastRequest?: number | undefined;
3357
+ flakynessRetries?: number | undefined;
3358
+ waitBetweenFlakynessRetries?: number | undefined;
3359
+ filterShot?: ((args_0: {
3360
+ shotMode: "storybook";
3361
+ id?: string | undefined;
3362
+ shotName?: string | undefined;
3363
+ filePathBaseline?: string | undefined;
3364
+ filePathCurrent?: string | undefined;
3365
+ filePathDifference?: string | undefined;
3366
+ kind?: string | undefined;
3367
+ story?: string | undefined;
3368
+ parameters?: Record<string, unknown> | undefined;
3369
+ }, ...args: unknown[]) => boolean) | undefined;
3370
+ shotNameGenerator?: ((args_0: {
3371
+ shotMode: "storybook";
3372
+ id?: string | undefined;
3373
+ shotName?: string | undefined;
3374
+ filePathBaseline?: string | undefined;
3375
+ filePathCurrent?: string | undefined;
3376
+ filePathDifference?: string | undefined;
3377
+ kind?: string | undefined;
3378
+ story?: string | undefined;
3379
+ parameters?: Record<string, unknown> | undefined;
3380
+ }, ...args: unknown[]) => string) | undefined;
3381
+ configureBrowser?: ((args_0: {
3382
+ shotMode: "storybook";
3383
+ id?: string | undefined;
3384
+ shotName?: string | undefined;
3385
+ filePathBaseline?: string | undefined;
3386
+ filePathCurrent?: string | undefined;
3387
+ filePathDifference?: string | undefined;
3388
+ kind?: string | undefined;
3389
+ story?: string | undefined;
3390
+ parameters?: Record<string, unknown> | undefined;
3391
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
3392
+ beforeScreenshot?: ((args_0: Page, args_1: {
3393
+ shotMode: "storybook";
3394
+ id?: string | undefined;
3395
+ shotName?: string | undefined;
3396
+ filePathBaseline?: string | undefined;
3397
+ filePathCurrent?: string | undefined;
3398
+ filePathDifference?: string | undefined;
3399
+ kind?: string | undefined;
3400
+ story?: string | undefined;
3401
+ parameters?: Record<string, unknown> | undefined;
3402
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3403
+ afterScreenshot?: ((args_0: Page, args_1: {
3404
+ shotMode: "storybook";
3405
+ id?: string | undefined;
3406
+ shotName?: string | undefined;
3407
+ filePathBaseline?: string | undefined;
3408
+ filePathCurrent?: string | undefined;
3409
+ filePathDifference?: string | undefined;
3410
+ kind?: string | undefined;
3411
+ story?: string | undefined;
3412
+ parameters?: Record<string, unknown> | undefined;
3413
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3414
+ browserLaunchOptions?: {
3415
+ chromium?: LaunchOptions | undefined;
3416
+ firefox?: LaunchOptions | undefined;
3417
+ webkit?: LaunchOptions | undefined;
3418
+ } | undefined;
3419
+ uploadOnly?: boolean | undefined;
3420
+ generateOnly?: boolean | undefined;
3421
+ failOnDifference?: boolean | undefined;
3422
+ imagePathBaseline?: string | undefined;
3423
+ imagePathDifference?: string | undefined;
3424
+ compareConcurrency?: number | undefined;
3425
+ compareEngine?: "pixelmatch" | "odiff" | undefined;
3426
+ filterItemsToCheck?: ((args_0: {
3427
+ shotMode: "storybook";
3428
+ id: string;
3429
+ shotName: string;
3430
+ url: string;
3431
+ filePathBaseline: string;
3432
+ filePathCurrent: string;
3433
+ filePathDifference: string;
3434
+ threshold: number;
3435
+ browserConfig?: BrowserContextOptions | undefined;
3436
+ waitBeforeScreenshot?: number | undefined;
3437
+ stabilizeBeforeScreenshot?: boolean | undefined;
3438
+ importPath?: string | undefined;
3439
+ mask?: {
3440
+ selector: string;
3441
+ }[] | undefined;
3442
+ viewport?: {
3443
+ width: number;
3444
+ height?: number | undefined;
3445
+ } | undefined;
3446
+ breakpoint?: number | undefined;
3447
+ breakpointGroup?: string | undefined;
3448
+ elementLocator?: string | undefined;
3449
+ waitForSelector?: string | undefined;
3450
+ }, ...args: unknown[]) => boolean) | undefined;
3451
+ }, {
3452
+ threshold?: number | undefined;
3453
+ waitBeforeScreenshot?: number | undefined;
3454
+ stabilizeBeforeScreenshot?: boolean | undefined;
3455
+ browser?: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[] | undefined;
3456
+ breakpoints?: number[] | undefined;
3457
+ storybookShots?: {
3458
+ storybookUrl: string;
3459
+ mask?: {
3460
+ selector: string;
3461
+ }[] | undefined;
3462
+ elementLocator?: string | undefined;
3463
+ waitForSelector?: string | undefined;
3464
+ breakpoints?: number[] | undefined;
3465
+ } | undefined;
3466
+ imagePathCurrent?: string | undefined;
3467
+ shotConcurrency?: number | undefined;
3468
+ timeouts?: {
3469
+ fetchStories?: number | undefined;
3470
+ loadState?: number | undefined;
3471
+ networkRequests?: number | undefined;
3472
+ } | undefined;
3473
+ waitForFirstRequest?: number | undefined;
3474
+ waitForLastRequest?: number | undefined;
3475
+ flakynessRetries?: number | undefined;
3476
+ waitBetweenFlakynessRetries?: number | undefined;
3477
+ filterShot?: ((args_0: {
3478
+ shotMode: "storybook";
3479
+ id?: string | undefined;
3480
+ shotName?: string | undefined;
3481
+ filePathBaseline?: string | undefined;
3482
+ filePathCurrent?: string | undefined;
3483
+ filePathDifference?: string | undefined;
3484
+ kind?: string | undefined;
3485
+ story?: string | undefined;
3486
+ parameters?: Record<string, unknown> | undefined;
3487
+ }, ...args: unknown[]) => boolean) | undefined;
3488
+ shotNameGenerator?: ((args_0: {
3489
+ shotMode: "storybook";
3490
+ id?: string | undefined;
3491
+ shotName?: string | undefined;
3492
+ filePathBaseline?: string | undefined;
3493
+ filePathCurrent?: string | undefined;
3494
+ filePathDifference?: string | undefined;
3495
+ kind?: string | undefined;
3496
+ story?: string | undefined;
3497
+ parameters?: Record<string, unknown> | undefined;
3498
+ }, ...args: unknown[]) => string) | undefined;
3499
+ configureBrowser?: ((args_0: {
3500
+ shotMode: "storybook";
3501
+ id?: string | undefined;
3502
+ shotName?: string | undefined;
3503
+ filePathBaseline?: string | undefined;
3504
+ filePathCurrent?: string | undefined;
3505
+ filePathDifference?: string | undefined;
3506
+ kind?: string | undefined;
3507
+ story?: string | undefined;
3508
+ parameters?: Record<string, unknown> | undefined;
3509
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
3510
+ beforeScreenshot?: ((args_0: Page, args_1: {
3511
+ shotMode: "storybook";
3512
+ id?: string | undefined;
3513
+ shotName?: string | undefined;
3514
+ filePathBaseline?: string | undefined;
3515
+ filePathCurrent?: string | undefined;
3516
+ filePathDifference?: string | undefined;
3517
+ kind?: string | undefined;
3518
+ story?: string | undefined;
3519
+ parameters?: Record<string, unknown> | undefined;
3520
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3521
+ afterScreenshot?: ((args_0: Page, args_1: {
3522
+ shotMode: "storybook";
3523
+ id?: string | undefined;
3524
+ shotName?: string | undefined;
3525
+ filePathBaseline?: string | undefined;
3526
+ filePathCurrent?: string | undefined;
3527
+ filePathDifference?: string | undefined;
3528
+ kind?: string | undefined;
3529
+ story?: string | undefined;
3530
+ parameters?: Record<string, unknown> | undefined;
3531
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3532
+ browserLaunchOptions?: {
3533
+ chromium?: LaunchOptions | undefined;
3534
+ firefox?: LaunchOptions | undefined;
3535
+ webkit?: LaunchOptions | undefined;
3536
+ } | undefined;
3537
+ uploadOnly?: boolean | undefined;
3538
+ generateOnly?: boolean | undefined;
3539
+ failOnDifference?: boolean | undefined;
3540
+ imagePathBaseline?: string | undefined;
3541
+ imagePathDifference?: string | undefined;
3542
+ compareConcurrency?: number | undefined;
3543
+ compareEngine?: "pixelmatch" | "odiff" | undefined;
3544
+ filterItemsToCheck?: ((args_0: {
3545
+ shotMode: "storybook";
3546
+ id: string;
3547
+ shotName: string;
3548
+ url: string;
3549
+ filePathBaseline: string;
3550
+ filePathCurrent: string;
3551
+ filePathDifference: string;
3552
+ threshold: number;
3553
+ browserConfig?: BrowserContextOptions | undefined;
3554
+ waitBeforeScreenshot?: number | undefined;
3555
+ stabilizeBeforeScreenshot?: boolean | undefined;
3556
+ importPath?: string | undefined;
3557
+ mask?: {
3558
+ selector: string;
3559
+ }[] | undefined;
3560
+ viewport?: {
3561
+ width: number;
3562
+ height?: number | undefined;
3563
+ } | undefined;
3564
+ breakpoint?: number | undefined;
3565
+ breakpointGroup?: string | undefined;
3566
+ elementLocator?: string | undefined;
3567
+ waitForSelector?: string | undefined;
3568
+ }, ...args: unknown[]) => boolean) | undefined;
3569
+ }>]>;
3570
+ export type PlatformModeConfig = z.infer<typeof PlatformModeConfigSchema>;
3571
+ export type GenerateOnlyModeConfig = z.infer<typeof GenerateOnlyModeConfigSchema>;
3572
+ export type Config = z.infer<typeof ConfigSchema>;
3573
+ export type CustomProjectConfig = z.infer<typeof FlexibleConfigSchema>;
3574
+ export declare let config: Config;
3575
+ export declare const isPlatformModeConfig: (userConfig: PlatformModeConfig | GenerateOnlyModeConfig) => userConfig is PlatformModeConfig;
3576
+ export declare const parseConfig: (userConfig: Config) => {
3577
+ threshold: number;
3578
+ waitBeforeScreenshot: number;
3579
+ stabilizeBeforeScreenshot: boolean;
3580
+ browser: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[];
3581
+ imagePathCurrent: string;
3582
+ shotConcurrency: number;
3583
+ timeouts: {
3584
+ fetchStories: number;
3585
+ loadState: number;
3586
+ networkRequests: number;
3587
+ };
3588
+ waitForFirstRequest: number;
3589
+ waitForLastRequest: number;
3590
+ flakynessRetries: number;
3591
+ waitBetweenFlakynessRetries: number;
3592
+ lostPixelPlatform: string;
3593
+ apiKey: string;
3594
+ lostPixelProjectId: string;
3595
+ ciBuildId: string;
3596
+ ciBuildNumber: string;
3597
+ repository: string;
3598
+ commitRefName: string;
3599
+ commitHash: string;
3600
+ setPendingStatusCheck: boolean;
3601
+ uploadOnly: boolean;
3602
+ breakpoints?: number[] | undefined;
3603
+ storybookShots?: {
3604
+ storybookUrl: string;
3605
+ mask?: {
3606
+ selector: string;
3607
+ }[] | undefined;
3608
+ elementLocator?: string | undefined;
3609
+ waitForSelector?: string | undefined;
3610
+ breakpoints?: number[] | undefined;
3611
+ } | undefined;
3612
+ filterShot?: ((args_0: {
3613
+ shotMode: "storybook";
3614
+ id?: string | undefined;
3615
+ shotName?: string | undefined;
3616
+ filePathBaseline?: string | undefined;
3617
+ filePathCurrent?: string | undefined;
3618
+ filePathDifference?: string | undefined;
3619
+ kind?: string | undefined;
3620
+ story?: string | undefined;
3621
+ parameters?: Record<string, unknown> | undefined;
3622
+ }, ...args: unknown[]) => boolean) | undefined;
3623
+ shotNameGenerator?: ((args_0: {
3624
+ shotMode: "storybook";
3625
+ id?: string | undefined;
3626
+ shotName?: string | undefined;
3627
+ filePathBaseline?: string | undefined;
3628
+ filePathCurrent?: string | undefined;
3629
+ filePathDifference?: string | undefined;
3630
+ kind?: string | undefined;
3631
+ story?: string | undefined;
3632
+ parameters?: Record<string, unknown> | undefined;
3633
+ }, ...args: unknown[]) => string) | undefined;
3634
+ configureBrowser?: ((args_0: {
3635
+ shotMode: "storybook";
3636
+ id?: string | undefined;
3637
+ shotName?: string | undefined;
3638
+ filePathBaseline?: string | undefined;
3639
+ filePathCurrent?: string | undefined;
3640
+ filePathDifference?: string | undefined;
3641
+ kind?: string | undefined;
3642
+ story?: string | undefined;
3643
+ parameters?: Record<string, unknown> | undefined;
3644
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
3645
+ beforeScreenshot?: ((args_0: Page, args_1: {
3646
+ shotMode: "storybook";
3647
+ id?: string | undefined;
3648
+ shotName?: string | undefined;
3649
+ filePathBaseline?: string | undefined;
3650
+ filePathCurrent?: string | undefined;
3651
+ filePathDifference?: string | undefined;
3652
+ kind?: string | undefined;
3653
+ story?: string | undefined;
3654
+ parameters?: Record<string, unknown> | undefined;
3655
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3656
+ afterScreenshot?: ((args_0: Page, args_1: {
3657
+ shotMode: "storybook";
3658
+ id?: string | undefined;
3659
+ shotName?: string | undefined;
3660
+ filePathBaseline?: string | undefined;
3661
+ filePathCurrent?: string | undefined;
3662
+ filePathDifference?: string | undefined;
3663
+ kind?: string | undefined;
3664
+ story?: string | undefined;
3665
+ parameters?: Record<string, unknown> | undefined;
3666
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3667
+ browserLaunchOptions?: {
3668
+ chromium?: LaunchOptions | undefined;
3669
+ firefox?: LaunchOptions | undefined;
3670
+ webkit?: LaunchOptions | undefined;
3671
+ } | undefined;
3672
+ eventFilePath?: string | undefined;
3673
+ } | {
3674
+ threshold: number;
3675
+ waitBeforeScreenshot: number;
3676
+ stabilizeBeforeScreenshot: boolean;
3677
+ browser: "chromium" | "firefox" | "webkit" | ("chromium" | "firefox" | "webkit")[];
3678
+ imagePathCurrent: string;
3679
+ shotConcurrency: number;
3680
+ timeouts: {
3681
+ fetchStories: number;
3682
+ loadState: number;
3683
+ networkRequests: number;
3684
+ };
3685
+ waitForFirstRequest: number;
3686
+ waitForLastRequest: number;
3687
+ flakynessRetries: number;
3688
+ waitBetweenFlakynessRetries: number;
3689
+ imagePathBaseline: string;
3690
+ imagePathDifference: string;
3691
+ compareConcurrency: number;
3692
+ compareEngine: "pixelmatch" | "odiff";
3693
+ breakpoints?: number[] | undefined;
3694
+ storybookShots?: {
3695
+ storybookUrl: string;
3696
+ mask?: {
3697
+ selector: string;
3698
+ }[] | undefined;
3699
+ elementLocator?: string | undefined;
3700
+ waitForSelector?: string | undefined;
3701
+ breakpoints?: number[] | undefined;
3702
+ } | undefined;
3703
+ filterShot?: ((args_0: {
3704
+ shotMode: "storybook";
3705
+ id?: string | undefined;
3706
+ shotName?: string | undefined;
3707
+ filePathBaseline?: string | undefined;
3708
+ filePathCurrent?: string | undefined;
3709
+ filePathDifference?: string | undefined;
3710
+ kind?: string | undefined;
3711
+ story?: string | undefined;
3712
+ parameters?: Record<string, unknown> | undefined;
3713
+ }, ...args: unknown[]) => boolean) | undefined;
3714
+ shotNameGenerator?: ((args_0: {
3715
+ shotMode: "storybook";
3716
+ id?: string | undefined;
3717
+ shotName?: string | undefined;
3718
+ filePathBaseline?: string | undefined;
3719
+ filePathCurrent?: string | undefined;
3720
+ filePathDifference?: string | undefined;
3721
+ kind?: string | undefined;
3722
+ story?: string | undefined;
3723
+ parameters?: Record<string, unknown> | undefined;
3724
+ }, ...args: unknown[]) => string) | undefined;
3725
+ configureBrowser?: ((args_0: {
3726
+ shotMode: "storybook";
3727
+ id?: string | undefined;
3728
+ shotName?: string | undefined;
3729
+ filePathBaseline?: string | undefined;
3730
+ filePathCurrent?: string | undefined;
3731
+ filePathDifference?: string | undefined;
3732
+ kind?: string | undefined;
3733
+ story?: string | undefined;
3734
+ parameters?: Record<string, unknown> | undefined;
3735
+ }, ...args: unknown[]) => BrowserContextOptions) | undefined;
3736
+ beforeScreenshot?: ((args_0: Page, args_1: {
3737
+ shotMode: "storybook";
3738
+ id?: string | undefined;
3739
+ shotName?: string | undefined;
3740
+ filePathBaseline?: string | undefined;
3741
+ filePathCurrent?: string | undefined;
3742
+ filePathDifference?: string | undefined;
3743
+ kind?: string | undefined;
3744
+ story?: string | undefined;
3745
+ parameters?: Record<string, unknown> | undefined;
3746
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3747
+ afterScreenshot?: ((args_0: Page, args_1: {
3748
+ shotMode: "storybook";
3749
+ id?: string | undefined;
3750
+ shotName?: string | undefined;
3751
+ filePathBaseline?: string | undefined;
3752
+ filePathCurrent?: string | undefined;
3753
+ filePathDifference?: string | undefined;
3754
+ kind?: string | undefined;
3755
+ story?: string | undefined;
3756
+ parameters?: Record<string, unknown> | undefined;
3757
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3758
+ browserLaunchOptions?: {
3759
+ chromium?: LaunchOptions | undefined;
3760
+ firefox?: LaunchOptions | undefined;
3761
+ webkit?: LaunchOptions | undefined;
3762
+ } | undefined;
3763
+ uploadOnly?: boolean | undefined;
3764
+ generateOnly?: boolean | undefined;
3765
+ failOnDifference?: boolean | undefined;
3766
+ filterItemsToCheck?: ((args_0: {
3767
+ shotMode: "storybook";
3768
+ id: string;
3769
+ shotName: string;
3770
+ url: string;
3771
+ filePathBaseline: string;
3772
+ filePathCurrent: string;
3773
+ filePathDifference: string;
3774
+ threshold: number;
3775
+ browserConfig?: BrowserContextOptions | undefined;
3776
+ waitBeforeScreenshot?: number | undefined;
3777
+ stabilizeBeforeScreenshot?: boolean | undefined;
3778
+ importPath?: string | undefined;
3779
+ mask?: {
3780
+ selector: string;
3781
+ }[] | undefined;
3782
+ viewport?: {
3783
+ width: number;
3784
+ height?: number | undefined;
3785
+ } | undefined;
3786
+ breakpoint?: number | undefined;
3787
+ breakpointGroup?: string | undefined;
3788
+ elementLocator?: string | undefined;
3789
+ waitForSelector?: string | undefined;
3790
+ }, ...args: unknown[]) => boolean) | undefined;
3791
+ };
3792
+ export declare const configure: ({ customProjectConfig, localDebugMode, }: {
3793
+ customProjectConfig?: CustomProjectConfig;
3794
+ localDebugMode?: boolean;
3795
+ }) => Promise<void>;