@cappa/core 0.1.2 → 0.2.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.
package/src/types.ts CHANGED
@@ -66,6 +66,14 @@ export type UserConfig = {
66
66
  * Configuration for the comparison of images
67
67
  */
68
68
  diff?: DiffConfig;
69
+ /**
70
+ * The number of times to retry a screenshot if it fails
71
+ */
72
+ retries?: number;
73
+ /**
74
+ * The number of parallel browser contexts to use for taking screenshots
75
+ */
76
+ concurrency?: number;
69
77
  /**
70
78
  * An array of Cappa plugins used for generation.
71
79
  * Each plugin may have additional configurable options (defined within the plugin itself).
@@ -73,12 +81,26 @@ export type UserConfig = {
73
81
  plugins?: Array<Plugin | PluginDef>;
74
82
  };
75
83
 
76
- export type ScreenshotOptions = {
84
+ export type Viewport = { width: number; height: number };
85
+
86
+ export type ScreenshotSettings = {
77
87
  fullPage?: boolean;
78
88
  delay?: number;
79
89
  skip?: boolean;
80
90
  mask?: Locator[];
81
91
  omitBackground?: boolean;
92
+ viewport?: Viewport;
93
+ };
94
+
95
+ export type ScreenshotVariant = {
96
+ id: string;
97
+ label?: string;
98
+ filename?: string;
99
+ options?: ScreenshotSettings;
100
+ };
101
+
102
+ export type ScreenshotOptions = ScreenshotSettings & {
103
+ variants?: ScreenshotVariant[];
82
104
  };
83
105
 
84
106
  export interface Screenshot {