UNPKG

1.41 kBTypeScriptView Raw
1// Use interface augmentation to add chromatic parameter to addParameter() types.
2declare module '@storybook/addons/dist/types' {
3 interface Parameters {
4 chromatic?: ChromaticParameters;
5 }
6}
7
8export interface ChromaticParameters {
9 /**
10 * To set a viewport, specify one or more screen widths to the `chromatic.viewports` parameter.
11 */
12 viewports?: number[];
13
14 /**
15 * You can omit stories entirely from Chromatic testing using the disable story parameter.
16 */
17 disable?: boolean;
18
19 /**
20 * Chromatic will pause CSS animations and reset them to their beginning state.
21 *
22 * Some animations are used to "animate in" visible elements. To specify that Chromatic should pause the
23 * animation at the end, use the `pauseAnimationAtEnd` story parameter.
24 */
25 pauseAnimationAtEnd?: boolean;
26
27 /**
28 * Use story-level delay to ensure a minimum amount of time (in milliseconds) has passed before Chromatic takes a
29 * screenshot.
30 */
31 delay?: number;
32
33 /**
34 * The diffThreshold parameter allows you to fine tune the threshold for visual change between snapshots before
35 * they’re flagged by Chromatic. Sometimes you need assurance to the sub-pixel and other times you want to skip
36 * visual noise generated by non-deterministic rendering such as anti-aliasing.
37 *
38 * 0 is the most accurate. 1 is the least accurate.
39 *
40 * @default 0.063
41 */
42 diffThreshold?: number;
43}