@cappa/core 0.1.3 → 0.2.1

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
@@ -70,6 +70,10 @@ export type UserConfig = {
70
70
  * The number of times to retry a screenshot if it fails
71
71
  */
72
72
  retries?: number;
73
+ /**
74
+ * The number of parallel browser contexts to use for taking screenshots
75
+ */
76
+ concurrency?: number;
73
77
  /**
74
78
  * An array of Cappa plugins used for generation.
75
79
  * Each plugin may have additional configurable options (defined within the plugin itself).
@@ -77,12 +81,34 @@ export type UserConfig = {
77
81
  plugins?: Array<Plugin | PluginDef>;
78
82
  };
79
83
 
80
- export type ScreenshotOptions = {
84
+ export type Viewport = { width: number; height: number };
85
+
86
+ export type ScreenshotSettings = {
81
87
  fullPage?: boolean;
82
88
  delay?: number;
83
89
  skip?: boolean;
84
90
  mask?: Locator[];
85
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 ScreenshotVariantWithUrl = {
103
+ id: string;
104
+ label?: string;
105
+ filename?: string;
106
+ url: string;
107
+ options?: ScreenshotSettings;
108
+ };
109
+
110
+ export type ScreenshotOptions = ScreenshotSettings & {
111
+ variants?: ScreenshotVariant[];
86
112
  };
87
113
 
88
114
  export interface Screenshot {