@applitools/eyes 1.33.3 → 1.33.4

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 (141) hide show
  1. package/dist/BatchClose.js +84 -0
  2. package/dist/Eyes.js +750 -0
  3. package/dist/Logger.js +122 -0
  4. package/dist/Runners.js +130 -0
  5. package/dist/SDK.js +45 -0
  6. package/dist/SessionEventHandlers.js +193 -0
  7. package/dist/cli/cli.js +56 -0
  8. package/dist/cli/load-config.js +73 -0
  9. package/dist/enums/AccessibilityGuidelinesVersion.js +9 -0
  10. package/dist/enums/AccessibilityLevel.js +9 -0
  11. package/dist/enums/AccessibilityRegionType.js +12 -0
  12. package/dist/enums/AccessibilityStatus.js +9 -0
  13. package/dist/enums/BrowserType.js +23 -0
  14. package/dist/enums/CorsIframeHandle.js +10 -0
  15. package/dist/enums/DeviceName.js +105 -0
  16. package/dist/enums/DynamicTextType.js +13 -0
  17. package/dist/enums/FailureReport.js +8 -0
  18. package/dist/enums/IosDeviceName.js +47 -0
  19. package/dist/enums/IosMultiDeviceTarget.js +30 -0
  20. package/dist/enums/IosVersion.js +10 -0
  21. package/dist/enums/MatchLevel.js +15 -0
  22. package/dist/enums/ScreenOrientation.js +8 -0
  23. package/dist/enums/SessionType.js +8 -0
  24. package/dist/enums/StitchMode.js +11 -0
  25. package/dist/enums/TestResultsStatus.js +9 -0
  26. package/dist/errors/DiffsFoundError.js +38 -0
  27. package/dist/errors/EyesError.js +6 -0
  28. package/dist/errors/NewTestError.js +38 -0
  29. package/dist/errors/TestFailedError.js +47 -0
  30. package/dist/index.js +128 -0
  31. package/dist/input/AUTProxySettings.js +2 -0
  32. package/dist/input/AccessibilityMatchSettings.js +109 -0
  33. package/dist/input/AccessibilitySettings.js +2 -0
  34. package/dist/input/BatchInfo.js +153 -0
  35. package/dist/input/CheckSettings.js +663 -0
  36. package/dist/input/Configuration.js +1179 -0
  37. package/dist/input/CutProvider.js +132 -0
  38. package/dist/input/DebugScreenshotProvider.js +2 -0
  39. package/dist/input/DensityMetrics.js +2 -0
  40. package/dist/input/ExactMatchSettings.js +102 -0
  41. package/dist/input/EyesSelector.js +2 -0
  42. package/dist/input/FloatingMatchSettings.js +152 -0
  43. package/dist/input/Image.js +2 -0
  44. package/dist/input/ImageMatchSettings.js +271 -0
  45. package/dist/input/ImageRotation.js +59 -0
  46. package/dist/input/LatestCommitInfo.js +2 -0
  47. package/dist/input/LazyLoadOptions.js +2 -0
  48. package/dist/input/Location.js +74 -0
  49. package/dist/input/LogHandler.js +90 -0
  50. package/dist/input/OCRRegion.js +2 -0
  51. package/dist/input/OCRSettings.js +2 -0
  52. package/dist/input/PropertyData.js +76 -0
  53. package/dist/input/ProxySettings.js +77 -0
  54. package/dist/input/RectangleSize.js +74 -0
  55. package/dist/input/Region.js +135 -0
  56. package/dist/input/RenderInfo.js +2 -0
  57. package/dist/input/RunnerOptions.js +56 -0
  58. package/dist/input/VisualLocatorSettings.js +2 -0
  59. package/dist/output/ApiUrls.js +102 -0
  60. package/dist/output/AppUrls.js +66 -0
  61. package/dist/output/MatchResult.js +66 -0
  62. package/dist/output/SessionUrls.js +66 -0
  63. package/dist/output/StepInfo.js +118 -0
  64. package/dist/output/TestAccessibilityStatus.js +2 -0
  65. package/dist/output/TestResultContainer.js +49 -0
  66. package/dist/output/TestResults.js +378 -0
  67. package/dist/output/TestResultsSummary.js +49 -0
  68. package/dist/output/TextRegion.js +2 -0
  69. package/dist/output/ValidationInfo.js +60 -0
  70. package/dist/output/ValidationResult.js +53 -0
  71. package/package.json +1 -1
  72. package/types/BatchClose.d.ts +23 -0
  73. package/types/Eyes.d.ts +255 -0
  74. package/types/Logger.d.ts +30 -0
  75. package/types/Runners.d.ts +41 -0
  76. package/types/SDK.d.ts +20 -0
  77. package/types/SessionEventHandlers.d.ts +78 -0
  78. package/types/cli/cli.d.ts +2 -0
  79. package/types/cli/load-config.d.ts +1 -0
  80. package/types/enums/AccessibilityGuidelinesVersion.d.ts +5 -0
  81. package/types/enums/AccessibilityLevel.d.ts +5 -0
  82. package/types/enums/AccessibilityRegionType.d.ts +8 -0
  83. package/types/enums/AccessibilityStatus.d.ts +5 -0
  84. package/types/enums/BrowserType.d.ts +20 -0
  85. package/types/enums/CorsIframeHandle.d.ts +7 -0
  86. package/types/enums/DeviceName.d.ts +101 -0
  87. package/types/enums/DynamicTextType.d.ts +9 -0
  88. package/types/enums/FailureReport.d.ts +5 -0
  89. package/types/enums/IosDeviceName.d.ts +43 -0
  90. package/types/enums/IosMultiDeviceTarget.d.ts +26 -0
  91. package/types/enums/IosVersion.d.ts +7 -0
  92. package/types/enums/MatchLevel.d.ts +12 -0
  93. package/types/enums/ScreenOrientation.d.ts +5 -0
  94. package/types/enums/SessionType.d.ts +5 -0
  95. package/types/enums/StitchMode.d.ts +8 -0
  96. package/types/enums/TestResultsStatus.d.ts +6 -0
  97. package/types/errors/DiffsFoundError.d.ts +6 -0
  98. package/types/errors/EyesError.d.ts +2 -0
  99. package/types/errors/NewTestError.d.ts +6 -0
  100. package/types/errors/TestFailedError.d.ts +9 -0
  101. package/types/index.d.ts +60 -0
  102. package/types/input/AUTProxySettings.d.ts +5 -0
  103. package/types/input/AccessibilityMatchSettings.d.ts +34 -0
  104. package/types/input/AccessibilitySettings.d.ts +6 -0
  105. package/types/input/BatchInfo.d.ts +47 -0
  106. package/types/input/CheckSettings.d.ts +266 -0
  107. package/types/input/Configuration.d.ts +437 -0
  108. package/types/input/CutProvider.d.ts +44 -0
  109. package/types/input/DebugScreenshotProvider.d.ts +5 -0
  110. package/types/input/DensityMetrics.d.ts +5 -0
  111. package/types/input/ExactMatchSettings.d.ts +34 -0
  112. package/types/input/EyesSelector.d.ts +6 -0
  113. package/types/input/FloatingMatchSettings.d.ts +50 -0
  114. package/types/input/Image.d.ts +11 -0
  115. package/types/input/ImageMatchSettings.d.ts +95 -0
  116. package/types/input/ImageRotation.d.ts +15 -0
  117. package/types/input/LatestCommitInfo.d.ts +4 -0
  118. package/types/input/LazyLoadOptions.d.ts +5 -0
  119. package/types/input/Location.d.ts +23 -0
  120. package/types/input/LogHandler.d.ts +45 -0
  121. package/types/input/OCRRegion.d.ts +9 -0
  122. package/types/input/OCRSettings.d.ts +6 -0
  123. package/types/input/PropertyData.d.ts +23 -0
  124. package/types/input/ProxySettings.d.ts +25 -0
  125. package/types/input/RectangleSize.d.ts +23 -0
  126. package/types/input/Region.d.ts +46 -0
  127. package/types/input/RenderInfo.d.ts +47 -0
  128. package/types/input/RunnerOptions.d.ts +21 -0
  129. package/types/input/VisualLocatorSettings.d.ts +4 -0
  130. package/types/output/ApiUrls.d.ts +41 -0
  131. package/types/output/AppUrls.d.ts +23 -0
  132. package/types/output/MatchResult.d.ts +23 -0
  133. package/types/output/SessionUrls.d.ts +23 -0
  134. package/types/output/StepInfo.d.ts +50 -0
  135. package/types/output/TestAccessibilityStatus.d.ts +8 -0
  136. package/types/output/TestResultContainer.d.ts +31 -0
  137. package/types/output/TestResults.d.ts +186 -0
  138. package/types/output/TestResultsSummary.d.ts +18 -0
  139. package/types/output/TextRegion.d.ts +7 -0
  140. package/types/output/ValidationInfo.d.ts +21 -0
  141. package/types/output/ValidationResult.d.ts +18 -0
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.NullCutProviderData = exports.UnscaledFixedCutProviderData = exports.FixedCutProviderData = exports.CutProviderData = void 0;
27
+ const utils = __importStar(require("@applitools/utils"));
28
+ class CutProviderData {
29
+ constructor(rectOrRegionOrTop, bottom, left, right) {
30
+ if (utils.types.isNumber(rectOrRegionOrTop)) {
31
+ this._rect = { top: rectOrRegionOrTop, bottom: bottom, left: left, right: right };
32
+ }
33
+ else if (utils.types.has(rectOrRegionOrTop, ['top', 'right', 'bottom', 'left'])) {
34
+ this._rect = rectOrRegionOrTop;
35
+ }
36
+ else if (utils.types.has(rectOrRegionOrTop, ['width', 'height', 'x', 'y'])) {
37
+ this._region = rectOrRegionOrTop;
38
+ }
39
+ }
40
+ get top() {
41
+ if (!this._rect)
42
+ return undefined;
43
+ return this._rect.top;
44
+ }
45
+ get right() {
46
+ if (!this._rect)
47
+ return undefined;
48
+ return this._rect.right;
49
+ }
50
+ get bottom() {
51
+ if (!this._rect)
52
+ return undefined;
53
+ return this._rect.bottom;
54
+ }
55
+ get left() {
56
+ if (!this._rect)
57
+ return undefined;
58
+ return this._rect.left;
59
+ }
60
+ get width() {
61
+ if (!this._region)
62
+ return undefined;
63
+ return this._region.width;
64
+ }
65
+ get height() {
66
+ if (!this._region)
67
+ return undefined;
68
+ return this._region.height;
69
+ }
70
+ get x() {
71
+ if (!this._region)
72
+ return undefined;
73
+ return this._region.x;
74
+ }
75
+ get y() {
76
+ if (!this._region)
77
+ return undefined;
78
+ return this._region.y;
79
+ }
80
+ scale(scaleRatio) {
81
+ if (this._rect) {
82
+ return new CutProviderData({
83
+ top: this._rect.top * scaleRatio,
84
+ right: this._rect.right * scaleRatio,
85
+ bottom: this._rect.bottom * scaleRatio,
86
+ left: this._rect.left * scaleRatio,
87
+ });
88
+ }
89
+ else if (this._region) {
90
+ return new CutProviderData({
91
+ width: this._region.width * scaleRatio,
92
+ height: this._region.height * scaleRatio,
93
+ x: this._region.x * scaleRatio,
94
+ y: this._region.y * scaleRatio,
95
+ });
96
+ }
97
+ else {
98
+ return new CutProviderData({ top: 0, right: 0, bottom: 0, left: 0 });
99
+ }
100
+ }
101
+ /** @internal */
102
+ toObject() {
103
+ var _a;
104
+ return ((_a = this._region) !== null && _a !== void 0 ? _a : this._rect);
105
+ }
106
+ /** @internal */
107
+ toJSON() {
108
+ var _a;
109
+ return utils.general.toJSON(((_a = this._region) !== null && _a !== void 0 ? _a : this._rect));
110
+ }
111
+ /** @internal */
112
+ toString() {
113
+ return utils.general.toString(this);
114
+ }
115
+ }
116
+ exports.CutProviderData = CutProviderData;
117
+ class FixedCutProviderData extends CutProviderData {
118
+ }
119
+ exports.FixedCutProviderData = FixedCutProviderData;
120
+ /** @undocumented */
121
+ class UnscaledFixedCutProviderData extends CutProviderData {
122
+ scale() {
123
+ return new UnscaledFixedCutProviderData(this);
124
+ }
125
+ }
126
+ exports.UnscaledFixedCutProviderData = UnscaledFixedCutProviderData;
127
+ class NullCutProviderData extends CutProviderData {
128
+ constructor() {
129
+ super({ top: 0, right: 0, bottom: 0, left: 0 });
130
+ }
131
+ }
132
+ exports.NullCutProviderData = NullCutProviderData;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ExactMatchSettingsData = void 0;
27
+ const utils = __importStar(require("@applitools/utils"));
28
+ /** @undocumented */
29
+ class ExactMatchSettingsData {
30
+ constructor(settings) {
31
+ this._settings = {};
32
+ this.minDiffIntensity = settings.minDiffIntensity;
33
+ this.minDiffWidth = settings.minDiffWidth;
34
+ this.minDiffHeight = settings.minDiffHeight;
35
+ this.matchThreshold = settings.matchThreshold;
36
+ }
37
+ get minDiffIntensity() {
38
+ return this._settings.minDiffIntensity;
39
+ }
40
+ set minDiffIntensity(minDiffIntensity) {
41
+ utils.guard.isNumber(minDiffIntensity, { name: 'minDiffIntensity', strict: false });
42
+ this._settings.minDiffIntensity = minDiffIntensity;
43
+ }
44
+ getMinDiffIntensity() {
45
+ return this.minDiffIntensity;
46
+ }
47
+ setMinDiffIntensity(value) {
48
+ this.minDiffIntensity = value;
49
+ }
50
+ get minDiffWidth() {
51
+ return this._settings.minDiffWidth;
52
+ }
53
+ set minDiffWidth(minDiffWidth) {
54
+ utils.guard.isNumber(minDiffWidth, { name: 'minDiffWidth', strict: false });
55
+ this._settings.minDiffWidth = minDiffWidth;
56
+ }
57
+ getMinDiffWidth() {
58
+ return this.minDiffWidth;
59
+ }
60
+ setMinDiffWidth(value) {
61
+ this.minDiffWidth = value;
62
+ }
63
+ get minDiffHeight() {
64
+ return this._settings.minDiffHeight;
65
+ }
66
+ set minDiffHeight(minDiffHeight) {
67
+ utils.guard.isNumber(minDiffHeight, { name: 'minDiffHeight', strict: false });
68
+ this._settings.minDiffHeight = minDiffHeight;
69
+ }
70
+ getMinDiffHeight() {
71
+ return this.minDiffHeight;
72
+ }
73
+ setMinDiffHeight(value) {
74
+ this.minDiffHeight = value;
75
+ }
76
+ get matchThreshold() {
77
+ return this._settings.matchThreshold;
78
+ }
79
+ set matchThreshold(matchThreshold) {
80
+ utils.guard.isNumber(matchThreshold, { name: 'matchThreshold', strict: false });
81
+ this._settings.matchThreshold = matchThreshold;
82
+ }
83
+ getMatchThreshold() {
84
+ return this.matchThreshold;
85
+ }
86
+ setMatchThreshold(value) {
87
+ this.matchThreshold = value;
88
+ }
89
+ /** @internal */
90
+ toObject() {
91
+ return this._settings;
92
+ }
93
+ /** @internal */
94
+ toJSON() {
95
+ return utils.general.toJSON(this._settings);
96
+ }
97
+ /** @internal */
98
+ toString() {
99
+ return utils.general.toString(this);
100
+ }
101
+ }
102
+ exports.ExactMatchSettingsData = ExactMatchSettingsData;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.FloatingMatchSettingsData = void 0;
27
+ const utils = __importStar(require("@applitools/utils"));
28
+ const Region_1 = require("./Region");
29
+ /** @undocumented */
30
+ class FloatingMatchSettingsData {
31
+ constructor(settingsOrRegionOrX, y, width, height, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset) {
32
+ let settings;
33
+ if (utils.types.isNumber(settingsOrRegionOrX)) {
34
+ settings = {
35
+ region: { x: settingsOrRegionOrX, y: y, width: width, height: height },
36
+ maxUpOffset,
37
+ maxDownOffset,
38
+ maxLeftOffset,
39
+ maxRightOffset,
40
+ };
41
+ }
42
+ else if (!utils.types.has(settingsOrRegionOrX, 'region')) {
43
+ settings = { region: settingsOrRegionOrX };
44
+ }
45
+ else {
46
+ settings = settingsOrRegionOrX;
47
+ }
48
+ this._settings = settings;
49
+ }
50
+ get region() {
51
+ return this._settings.region;
52
+ }
53
+ set region(region) {
54
+ utils.guard.isObject(region, { name: 'region' });
55
+ this._settings.region = new Region_1.RegionData(region);
56
+ }
57
+ getRegion() {
58
+ return new Region_1.RegionData(this.region);
59
+ }
60
+ setRegion(region) {
61
+ this.region = region;
62
+ }
63
+ getLeft() {
64
+ return this.region.x;
65
+ }
66
+ setLeft(left) {
67
+ this.region.x = left;
68
+ }
69
+ getTop() {
70
+ return this.region.y;
71
+ }
72
+ setTop(top) {
73
+ this.region.y = top;
74
+ }
75
+ getWidth() {
76
+ return this.region.width;
77
+ }
78
+ setWidth(width) {
79
+ this.region.width = width;
80
+ }
81
+ getHeight() {
82
+ return this.region.height;
83
+ }
84
+ setHeight(height) {
85
+ this.region.height = height;
86
+ }
87
+ get maxUpOffset() {
88
+ return this._settings.maxUpOffset;
89
+ }
90
+ set maxUpOffset(maxUpOffset) {
91
+ utils.guard.isNumber(maxUpOffset, { name: 'maxUpOffset' });
92
+ this._settings.maxUpOffset = maxUpOffset;
93
+ }
94
+ getMaxUpOffset() {
95
+ return this.maxUpOffset;
96
+ }
97
+ setMaxUpOffset(maxUpOffset) {
98
+ this.maxUpOffset = maxUpOffset;
99
+ }
100
+ get maxDownOffset() {
101
+ return this._settings.maxDownOffset;
102
+ }
103
+ set maxDownOffset(maxDownOffset) {
104
+ utils.guard.isNumber(maxDownOffset, { name: 'maxDownOffset' });
105
+ this._settings.maxDownOffset = maxDownOffset;
106
+ }
107
+ getMaxDownOffset() {
108
+ return this.maxDownOffset;
109
+ }
110
+ setMaxDownOffset(maxDownOffset) {
111
+ this.maxDownOffset = maxDownOffset;
112
+ }
113
+ get maxLeftOffset() {
114
+ return this._settings.maxLeftOffset;
115
+ }
116
+ set maxLeftOffset(maxLeftOffset) {
117
+ utils.guard.isNumber(maxLeftOffset, { name: 'maxLeftOffset' });
118
+ this._settings.maxLeftOffset = maxLeftOffset;
119
+ }
120
+ getMaxLeftOffset() {
121
+ return this.maxLeftOffset;
122
+ }
123
+ setMaxLeftOffset(maxLeftOffset) {
124
+ this.maxLeftOffset = maxLeftOffset;
125
+ }
126
+ get maxRightOffset() {
127
+ return this._settings.maxRightOffset;
128
+ }
129
+ set maxRightOffset(maxRightOffset) {
130
+ utils.guard.isNumber(maxRightOffset, { name: 'maxRightOffset' });
131
+ this._settings.maxRightOffset = maxRightOffset;
132
+ }
133
+ getMaxRightOffset() {
134
+ return this.maxRightOffset;
135
+ }
136
+ setMaxRightOffset(maxRightOffset) {
137
+ this.maxRightOffset = maxRightOffset;
138
+ }
139
+ /** @internal */
140
+ toObject() {
141
+ return this._settings;
142
+ }
143
+ /** @internal */
144
+ toJSON() {
145
+ return utils.general.toJSON(this._settings);
146
+ }
147
+ /** @internal */
148
+ toString() {
149
+ return utils.general.toString(this);
150
+ }
151
+ }
152
+ exports.FloatingMatchSettingsData = FloatingMatchSettingsData;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,271 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ImageMatchSettingsData = void 0;
27
+ const utils = __importStar(require("@applitools/utils"));
28
+ const MatchLevel_1 = require("../enums/MatchLevel");
29
+ const AccessibilityLevel_1 = require("../enums/AccessibilityLevel");
30
+ const AccessibilityGuidelinesVersion_1 = require("../enums/AccessibilityGuidelinesVersion");
31
+ const ExactMatchSettings_1 = require("./ExactMatchSettings");
32
+ const FloatingMatchSettings_1 = require("./FloatingMatchSettings");
33
+ const AccessibilityMatchSettings_1 = require("./AccessibilityMatchSettings");
34
+ const Region_1 = require("./Region");
35
+ /** @undocumented */
36
+ class ImageMatchSettingsData {
37
+ constructor(settings) {
38
+ this._settings = {};
39
+ if (!settings)
40
+ return this;
41
+ if (settings instanceof ImageMatchSettingsData)
42
+ settings = settings.toJSON();
43
+ for (const [key, value] of Object.entries(settings)) {
44
+ ;
45
+ this[key] = value;
46
+ }
47
+ }
48
+ get exact() {
49
+ return this._settings.exact;
50
+ }
51
+ set exact(exact) {
52
+ this._settings.exact = exact;
53
+ }
54
+ getExact() {
55
+ return new ExactMatchSettings_1.ExactMatchSettingsData(this.exact);
56
+ }
57
+ setExact(exact) {
58
+ this.exact = exact;
59
+ }
60
+ get matchLevel() {
61
+ return this._settings.matchLevel;
62
+ }
63
+ set matchLevel(matchLevel) {
64
+ utils.guard.isEnumValue(matchLevel, MatchLevel_1.MatchLevelEnum, { name: 'matchLevel' });
65
+ this._settings.matchLevel = matchLevel;
66
+ }
67
+ getMatchLevel() {
68
+ return this.matchLevel;
69
+ }
70
+ setMatchLevel(matchLevel) {
71
+ this.matchLevel = matchLevel;
72
+ }
73
+ get ignoreCaret() {
74
+ return this._settings.ignoreCaret;
75
+ }
76
+ set ignoreCaret(ignoreCaret) {
77
+ utils.guard.isBoolean(ignoreCaret, { name: 'ignoreCaret', strict: false });
78
+ this._settings.ignoreCaret = ignoreCaret;
79
+ }
80
+ getIgnoreCaret() {
81
+ return this.ignoreCaret;
82
+ }
83
+ setIgnoreCaret(ignoreCaret) {
84
+ this.ignoreCaret = ignoreCaret;
85
+ }
86
+ get useDom() {
87
+ return this._settings.useDom;
88
+ }
89
+ set useDom(useDom) {
90
+ utils.guard.isBoolean(useDom, { name: 'useDom', strict: false });
91
+ this._settings.useDom = useDom;
92
+ }
93
+ getUseDom() {
94
+ return this.useDom;
95
+ }
96
+ setUseDom(useDom) {
97
+ this.useDom = useDom;
98
+ }
99
+ get enablePatterns() {
100
+ return this._settings.enablePatterns;
101
+ }
102
+ set enablePatterns(enablePatterns) {
103
+ utils.guard.isBoolean(enablePatterns, { name: 'enablePatterns', strict: false });
104
+ this._settings.enablePatterns = enablePatterns;
105
+ }
106
+ getEnablePatterns() {
107
+ return this.enablePatterns;
108
+ }
109
+ setEnablePatterns(enablePatterns) {
110
+ this.enablePatterns = enablePatterns;
111
+ }
112
+ get ignoreDisplacements() {
113
+ return this._settings.ignoreDisplacements;
114
+ }
115
+ set ignoreDisplacements(ignoreDisplacements) {
116
+ utils.guard.isBoolean(ignoreDisplacements, { name: 'ignoreDisplacements', strict: false });
117
+ this._settings.ignoreDisplacements = ignoreDisplacements;
118
+ }
119
+ getIgnoreDisplacements() {
120
+ return this.ignoreDisplacements;
121
+ }
122
+ setIgnoreDisplacements(ignoreDisplacements) {
123
+ this.ignoreDisplacements = ignoreDisplacements;
124
+ }
125
+ get ignoreRegions() {
126
+ return this._settings.ignoreRegions;
127
+ }
128
+ set ignoreRegions(ignoreRegions) {
129
+ utils.guard.isArray(ignoreRegions, { name: 'ignoreRegions', strict: false });
130
+ this._settings.ignoreRegions = ignoreRegions !== null && ignoreRegions !== void 0 ? ignoreRegions : [];
131
+ }
132
+ getIgnoreRegions() {
133
+ var _a, _b;
134
+ return (_b = (_a = this.ignoreRegions) === null || _a === void 0 ? void 0 : _a.map(region => new Region_1.RegionData(region))) !== null && _b !== void 0 ? _b : [];
135
+ }
136
+ setIgnoreRegions(ignoreRegions) {
137
+ this.ignoreRegions = ignoreRegions;
138
+ }
139
+ get layoutRegions() {
140
+ return this._settings.layoutRegions;
141
+ }
142
+ set layoutRegions(layoutRegions) {
143
+ utils.guard.isArray(layoutRegions, { name: 'layoutRegions', strict: false });
144
+ this._settings.layoutRegions = layoutRegions !== null && layoutRegions !== void 0 ? layoutRegions : [];
145
+ }
146
+ get layout() {
147
+ return this.layoutRegions;
148
+ }
149
+ set layout(layoutRegions) {
150
+ this.layoutRegions = layoutRegions;
151
+ }
152
+ getLayoutRegions() {
153
+ var _a, _b;
154
+ return (_b = (_a = this.layoutRegions) === null || _a === void 0 ? void 0 : _a.map(region => new Region_1.RegionData(region))) !== null && _b !== void 0 ? _b : [];
155
+ }
156
+ setLayoutRegions(layoutRegions) {
157
+ this.layoutRegions = layoutRegions;
158
+ }
159
+ get strictRegions() {
160
+ return this._settings.strictRegions;
161
+ }
162
+ set strictRegions(strictRegions) {
163
+ utils.guard.isArray(strictRegions, { name: 'strictRegions', strict: false });
164
+ this._settings.strictRegions = strictRegions !== null && strictRegions !== void 0 ? strictRegions : [];
165
+ }
166
+ get strict() {
167
+ return this.strictRegions;
168
+ }
169
+ set strict(strictRegions) {
170
+ this.strictRegions = strictRegions;
171
+ }
172
+ getStrictRegions() {
173
+ var _a, _b;
174
+ return (_b = (_a = this.strictRegions) === null || _a === void 0 ? void 0 : _a.map(region => new Region_1.RegionData(region))) !== null && _b !== void 0 ? _b : [];
175
+ }
176
+ setStrictRegions(strictRegions) {
177
+ this.strictRegions = strictRegions;
178
+ }
179
+ get contentRegions() {
180
+ return this._settings.contentRegions;
181
+ }
182
+ set contentRegions(contentRegions) {
183
+ utils.guard.isArray(contentRegions, { name: 'contentRegions', strict: false });
184
+ this._settings.contentRegions = contentRegions !== null && contentRegions !== void 0 ? contentRegions : [];
185
+ }
186
+ get content() {
187
+ return this.contentRegions;
188
+ }
189
+ set content(contentRegions) {
190
+ this.contentRegions = contentRegions;
191
+ }
192
+ getContentRegions() {
193
+ var _a, _b;
194
+ return (_b = (_a = this.contentRegions) === null || _a === void 0 ? void 0 : _a.map(region => new Region_1.RegionData(region))) !== null && _b !== void 0 ? _b : [];
195
+ }
196
+ setContentRegions(contentRegions) {
197
+ this.contentRegions = contentRegions;
198
+ }
199
+ get floatingRegions() {
200
+ return this._settings.floatingRegions;
201
+ }
202
+ set floatingRegions(floatingRegions) {
203
+ utils.guard.isArray(floatingRegions, { name: 'floatingRegions', strict: false });
204
+ this._settings.floatingRegions = floatingRegions !== null && floatingRegions !== void 0 ? floatingRegions : [];
205
+ }
206
+ get floating() {
207
+ return this.floatingRegions;
208
+ }
209
+ set floating(floatingRegions) {
210
+ this.floatingRegions = floatingRegions;
211
+ }
212
+ getFloatingRegions() {
213
+ var _a, _b;
214
+ return (_b = (_a = this.floatingRegions) === null || _a === void 0 ? void 0 : _a.map(region => new FloatingMatchSettings_1.FloatingMatchSettingsData(region))) !== null && _b !== void 0 ? _b : [];
215
+ }
216
+ setFloatingRegions(floatingRegions) {
217
+ this.floatingRegions = floatingRegions;
218
+ }
219
+ get accessibilityRegions() {
220
+ return this._settings.accessibilityRegions;
221
+ }
222
+ set accessibilityRegions(accessibilityRegions) {
223
+ utils.guard.isArray(accessibilityRegions, { name: 'accessibilityRegions', strict: false });
224
+ this._settings.accessibilityRegions = accessibilityRegions !== null && accessibilityRegions !== void 0 ? accessibilityRegions : [];
225
+ }
226
+ get accessibility() {
227
+ return this.accessibilityRegions;
228
+ }
229
+ set accessibility(accessibilityRegions) {
230
+ this.accessibilityRegions = accessibilityRegions;
231
+ }
232
+ getAccessibilityRegions() {
233
+ var _a, _b;
234
+ return ((_b = (_a = this.accessibilityRegions) === null || _a === void 0 ? void 0 : _a.map(region => new AccessibilityMatchSettings_1.AccessibilityMatchSettingsData(region))) !== null && _b !== void 0 ? _b : []);
235
+ }
236
+ setAccessibilityRegions(accessibilityRegions) {
237
+ this.accessibilityRegions = accessibilityRegions;
238
+ }
239
+ get accessibilitySettings() {
240
+ return this._settings.accessibilitySettings;
241
+ }
242
+ set accessibilitySettings(accessibilitySettings) {
243
+ if (accessibilitySettings) {
244
+ const { level, guidelinesVersion } = accessibilitySettings;
245
+ utils.guard.isEnumValue(level, AccessibilityLevel_1.AccessibilityLevelEnum, { name: 'accessibilitySettings.level' });
246
+ utils.guard.isEnumValue(guidelinesVersion, AccessibilityGuidelinesVersion_1.AccessibilityGuidelinesVersionEnum, {
247
+ name: 'accessibilitySettings.guidelinesVersion',
248
+ });
249
+ }
250
+ this._settings.accessibilitySettings = accessibilitySettings;
251
+ }
252
+ getAccessibilitySettings() {
253
+ return this.accessibilitySettings;
254
+ }
255
+ setAccessibilitySettings(accessibilitySettings) {
256
+ this.accessibilitySettings = accessibilitySettings;
257
+ }
258
+ /** @internal */
259
+ toObject() {
260
+ return this._settings;
261
+ }
262
+ /** @internal */
263
+ toJSON() {
264
+ return utils.general.toJSON(this._settings);
265
+ }
266
+ /** @internal */
267
+ toString() {
268
+ return utils.general.toString(this);
269
+ }
270
+ }
271
+ exports.ImageMatchSettingsData = ImageMatchSettingsData;