@appium/images-plugin 4.0.4 → 4.1.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.
Files changed (46) hide show
  1. package/build/lib/compare.d.ts +8 -22
  2. package/build/lib/compare.d.ts.map +1 -1
  3. package/build/lib/compare.js +17 -23
  4. package/build/lib/compare.js.map +1 -1
  5. package/build/lib/constants.d.ts +13 -12
  6. package/build/lib/constants.d.ts.map +1 -1
  7. package/build/lib/constants.js +0 -31
  8. package/build/lib/constants.js.map +1 -1
  9. package/build/lib/finder.d.ts +22 -121
  10. package/build/lib/finder.d.ts.map +1 -1
  11. package/build/lib/finder.js +60 -100
  12. package/build/lib/finder.js.map +1 -1
  13. package/build/lib/image-element.d.ts +36 -108
  14. package/build/lib/image-element.d.ts.map +1 -1
  15. package/build/lib/image-element.js +45 -60
  16. package/build/lib/image-element.js.map +1 -1
  17. package/build/lib/index.d.ts +8 -0
  18. package/build/lib/index.d.ts.map +1 -0
  19. package/build/lib/index.js +30 -0
  20. package/build/lib/index.js.map +1 -0
  21. package/build/lib/logger.d.ts +1 -2
  22. package/build/lib/logger.d.ts.map +1 -1
  23. package/build/lib/logger.js +2 -2
  24. package/build/lib/logger.js.map +1 -1
  25. package/build/lib/plugin.d.ts +15 -34
  26. package/build/lib/plugin.d.ts.map +1 -1
  27. package/build/lib/plugin.js +12 -25
  28. package/build/lib/plugin.js.map +1 -1
  29. package/build/lib/types.d.ts +127 -0
  30. package/build/lib/types.d.ts.map +1 -0
  31. package/build/lib/types.js +3 -0
  32. package/build/lib/types.js.map +1 -0
  33. package/lib/compare.ts +100 -0
  34. package/lib/constants.ts +31 -0
  35. package/lib/{finder.js → finder.ts} +109 -136
  36. package/lib/{image-element.js → image-element.ts} +67 -85
  37. package/lib/index.ts +7 -0
  38. package/lib/logger.ts +3 -0
  39. package/lib/{plugin.js → plugin.ts} +42 -38
  40. package/lib/types.ts +187 -0
  41. package/package.json +14 -14
  42. package/tsconfig.json +3 -2
  43. package/index.js +0 -1
  44. package/lib/compare.js +0 -96
  45. package/lib/constants.js +0 -70
  46. package/lib/logger.js +0 -5
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ImageElementFinder = void 0;
6
7
  const lodash_1 = __importDefault(require("lodash"));
7
8
  const lru_cache_1 = require("lru-cache");
8
9
  const driver_1 = require("appium/driver");
9
10
  const image_element_1 = require("./image-element");
10
11
  const compare_1 = require("./compare");
11
- const logger_1 = __importDefault(require("./logger"));
12
+ const logger_1 = require("./logger");
12
13
  const constants_1 = require("./constants");
13
14
  const sharp_1 = __importDefault(require("sharp"));
14
15
  // Used to compare ratio and screen width
@@ -19,23 +20,20 @@ const MAX_CACHE_AGE_MS = 24 * 60 * 60 * 1000;
19
20
  /**
20
21
  * Checks if one rect fully contains another
21
22
  *
22
- * @param {import('@appium/types').Rect} templateRect The bounding rect
23
- * @param {import('@appium/types').Rect} rect The rect to be checked for containment
24
- * @returns {boolean} True if templateRect contains rect
23
+ * @param templateRect The bounding rect
24
+ * @param rect The rect to be checked for containment
25
+ * @returns True if templateRect contains rect
25
26
  */
26
27
  function containsRect(templateRect, rect) {
27
- return templateRect.x <= rect.x && templateRect.y <= rect.y
28
- && rect.width <= templateRect.x + templateRect.width - rect.x
29
- && rect.height <= templateRect.y + templateRect.height - rect.y;
28
+ return (templateRect.x <= rect.x &&
29
+ templateRect.y <= rect.y &&
30
+ rect.width <= templateRect.x + templateRect.width - rect.x &&
31
+ rect.height <= templateRect.y + templateRect.height - rect.y);
30
32
  }
31
33
  const NO_OCCURRENCES_PATTERN = /Cannot find any occurrences/;
32
34
  const CONDITION_UNMET_PATTERN = /Condition unmet/;
33
35
  class ImageElementFinder {
34
- /** @type {LRUCache<string,ImageElement>} */
35
36
  _imgElCache;
36
- /**
37
- * @param {number} max
38
- */
39
37
  constructor(max = MAX_CACHE_ITEMS) {
40
38
  this._imgElCache = new lru_cache_1.LRUCache({
41
39
  ttl: MAX_CACHE_AGE_MS,
@@ -43,51 +41,30 @@ class ImageElementFinder {
43
41
  max,
44
42
  });
45
43
  }
46
- /**
47
- * @param {ImageElement} imgEl
48
- * @returns {Element}
49
- */
50
44
  registerImageElement(imgEl) {
51
45
  this._imgElCache.set(imgEl.id, imgEl);
52
46
  return imgEl.asElement();
53
47
  }
54
- /**
55
- * @param {string} imgElId
56
- * @returns {ImageElement|undefined}
57
- */
58
48
  getImageElement(imgElId) {
59
49
  return this._imgElCache.get(imgElId);
60
50
  }
61
51
  clearImageElements() {
62
52
  this._imgElCache.clear();
63
53
  }
64
- /**
65
- * @typedef FindByImageOptions
66
- * @property {boolean} [shouldCheckStaleness=false] - whether this call to find an
67
- * image is merely to check staleness. If so we can bypass a lot of logic
68
- * @property {boolean} [multiple=false] - Whether we are finding one element or
69
- * multiple
70
- * @property {boolean} [ignoreDefaultImageTemplateScale=false] - Whether we
71
- * ignore defaultImageTemplateScale. It can be used when you would like to
72
- * scale template with defaultImageTemplateScale setting.
73
- * @property {import('@appium/types').Rect?} [containerRect=null] - The bounding
74
- * rectangle to limit the search in
75
- */
76
54
  /**
77
55
  * Find a screen rect represented by an ImageElement corresponding to an image
78
56
  * template sent in by the client
79
57
  *
80
- * @param {Buffer} template - image used as a template to be
81
- * matched in the screenshot
82
- * @param {ExternalDriver} driver
83
- * @param {FindByImageOptions} opts - additional options
58
+ * @param template - image used as a template to be matched in the screenshot
59
+ * @param driver
60
+ * @param opts - additional options
84
61
  *
85
- * @returns {Promise<Element|Element[]|ImageElement>} - WebDriver element with a special id prefix
62
+ * @returns WebDriver element with a special id prefix
86
63
  */
87
- async findByImage(template, driver, { shouldCheckStaleness = false, multiple = false, ignoreDefaultImageTemplateScale = false, containerRect = null }) {
64
+ async findByImage(template, driver, { shouldCheckStaleness = false, multiple = false, ignoreDefaultImageTemplateScale = false, containerRect = null, } = {}) {
88
65
  const settings = { ...constants_1.DEFAULT_SETTINGS, ...driver.settings.getSettings() };
89
66
  const { imageMatchThreshold: threshold, imageMatchMethod, fixImageTemplateSize, fixImageTemplateScale, defaultImageTemplateScale, getMatchedImageResult: visualize, } = settings;
90
- logger_1.default.info(`Finding image element with match threshold ${threshold}`);
67
+ logger_1.log.info(`Finding image element with match threshold ${threshold}`);
91
68
  if (!driver.getWindowRect && !lodash_1.default.has(driver, 'getWindowSize')) {
92
69
  throw new Error("This driver does not support the required 'getWindowRect' command");
93
70
  }
@@ -100,7 +77,8 @@ class ImageElementFinder {
100
77
  };
101
78
  }
102
79
  else {
103
- // @ts-ignore TODO: Drop the deprecated endpoint
80
+ // TODO: Drop the deprecated endpoint
81
+ // @ts-expect-error - deprecated getWindowSize method
104
82
  screenSize = await driver.getWindowSize();
105
83
  }
106
84
  // someone might have sent in a template that's larger than the screen
@@ -138,12 +116,17 @@ class ImageElementFinder {
138
116
  comparisonOpts.method = imageMatchMethod;
139
117
  }
140
118
  const pushIfOk = (el) => {
141
- if (containerRect && !containsRect(containerRect, el.rect)) {
142
- logger_1.default.debug(`The matched element rectangle ${JSON.stringify(el.rect)} is not located ` +
119
+ const result = {
120
+ rect: el.rect,
121
+ score: el.score,
122
+ visualization: el.visualization,
123
+ };
124
+ if (containerRect && !containsRect(containerRect, result.rect)) {
125
+ logger_1.log.debug(`The matched element rectangle ${JSON.stringify(result.rect)} is not located ` +
143
126
  `inside of the bounding rectangle ${JSON.stringify(containerRect)}, thus rejected`);
144
127
  return false;
145
128
  }
146
- results.push(el);
129
+ results.push(result);
147
130
  return true;
148
131
  };
149
132
  const elOrEls = await (0, compare_1.compareImages)(constants_1.MATCH_TEMPLATE_MODE, screenshot, template, comparisonOpts);
@@ -181,7 +164,7 @@ class ImageElementFinder {
181
164
  throw new driver_1.errors.NoSuchElementError();
182
165
  }
183
166
  const elements = results.map(({ rect, score, visualization }) => {
184
- logger_1.default.info(`Image template matched: ${JSON.stringify(rect)}`);
167
+ logger_1.log.info(`Image template matched: ${JSON.stringify(rect)}`);
185
168
  return new image_element_1.ImageElement({
186
169
  template,
187
170
  rect,
@@ -203,10 +186,10 @@ class ImageElementFinder {
203
186
  /**
204
187
  * Ensure that the image template sent in for a find is of a suitable size
205
188
  *
206
- * @param {Buffer} template - template image
207
- * @param {import('@appium/types').Size} maxSize - size of the bounding rectangle
189
+ * @param template - template image
190
+ * @param maxSize - size of the bounding rectangle
208
191
  *
209
- * @returns {Promise<Buffer>} image, potentially resized
192
+ * @returns image, potentially resized
210
193
  */
211
194
  async ensureTemplateSize(template, maxSize) {
212
195
  const imgObj = (0, sharp_1.default)(template);
@@ -214,16 +197,17 @@ class ImageElementFinder {
214
197
  if (lodash_1.default.isNil(tplWidth) || lodash_1.default.isNil(tplHeight)) {
215
198
  throw new Error(`Template width/height cannot be determined. Is it a valid image?`);
216
199
  }
217
- logger_1.default.info(`Template image is ${tplWidth}x${tplHeight}. Bounding rectangle size is ${maxSize.width}x${maxSize.height}`);
200
+ logger_1.log.info(`Template image is ${tplWidth}x${tplHeight}. Bounding rectangle size is ${maxSize.width}x${maxSize.height}`);
218
201
  // if the template fits inside the screen dimensions, we're good
219
202
  if (tplWidth <= maxSize.width && tplHeight <= maxSize.height) {
220
203
  return template;
221
204
  }
222
- logger_1.default.info(`Scaling template image from ${tplWidth}x${tplHeight} to match ` +
205
+ logger_1.log.info(`Scaling template image from ${tplWidth}x${tplHeight} to match ` +
223
206
  `the bounding rectangle at ${maxSize.width}x${maxSize.height}`);
224
207
  // otherwise, scale it to fit inside the bounding rectangle dimensions:
225
208
  // https://sharp.pixelplumbing.com/api-resize
226
- return await imgObj.resize({
209
+ return await imgObj
210
+ .resize({
227
211
  width: Math.trunc(maxSize.width),
228
212
  height: Math.trunc(maxSize.height),
229
213
  fit: 'inside',
@@ -234,10 +218,10 @@ class ImageElementFinder {
234
218
  * Get the screenshot image that will be used for find by element, potentially
235
219
  * altering it in various ways based on user-requested settings
236
220
  *
237
- * @param {ExternalDriver} driver
238
- * @param {import('@appium/types').Size} screenSize - The original size of the screen
221
+ * @param driver
222
+ * @param screenSize - The original size of the screen
239
223
  *
240
- * @returns {Promise<Screenshot & {scale?: ScreenshotScale}>} PNG screenshot and ScreenshotScale
224
+ * @returns PNG screenshot and ScreenshotScale
241
225
  */
242
226
  async getScreenshotForImageFind(driver, screenSize) {
243
227
  if (!driver.getScreenshot) {
@@ -249,28 +233,28 @@ class ImageElementFinder {
249
233
  // if the user has requested not to correct for aspect or size differences
250
234
  // between the screenshot and the screen, just return the screenshot now
251
235
  if (!fixImageFindScreenshotDims) {
252
- logger_1.default.info(`Not verifying screenshot dimensions match screen`);
236
+ logger_1.log.info(`Not verifying screenshot dimensions match screen`);
253
237
  return { screenshot };
254
238
  }
255
239
  if (screenSize.width < 1 || screenSize.height < 1) {
256
- logger_1.default.warn(`The retrieved screen size ${screenSize.width}x${screenSize.height} does ` +
240
+ logger_1.log.warn(`The retrieved screen size ${screenSize.width}x${screenSize.height} does ` +
257
241
  `not seem to be valid. No changes will be applied to the screenshot`);
258
242
  return { screenshot };
259
243
  }
260
244
  // otherwise, do some verification on the screenshot to make sure it matches
261
245
  // the screen size and aspect ratio
262
- logger_1.default.info('Verifying screenshot size and aspect ratio');
246
+ logger_1.log.info('Verifying screenshot size and aspect ratio');
263
247
  let imgObj = (0, sharp_1.default)(screenshot);
264
248
  let { width: shotWidth, height: shotHeight } = await imgObj.metadata();
265
249
  if (!shotWidth || shotWidth < 1 || !shotHeight || shotHeight < 1) {
266
- logger_1.default.warn(`The retrieved screenshot size ${shotWidth}x${shotHeight} does ` +
250
+ logger_1.log.warn(`The retrieved screenshot size ${shotWidth}x${shotHeight} does ` +
267
251
  `not seem to be valid. No changes will be applied to the screenshot`);
268
252
  return { screenshot };
269
253
  }
270
254
  if (screenSize.width === shotWidth && screenSize.height === shotHeight) {
271
255
  // the height and width of the screenshot and the device screen match, which
272
256
  // means we should be safe when doing template matches
273
- logger_1.default.info('Screenshot size matched screen size');
257
+ logger_1.log.info('Screenshot size matched screen size');
274
258
  return { screenshot };
275
259
  }
276
260
  // otherwise, if they don't match, it could spell problems for the accuracy
@@ -282,11 +266,11 @@ class ImageElementFinder {
282
266
  const screenAR = screenSize.width / screenSize.height;
283
267
  const shotAR = shotWidth / shotHeight;
284
268
  if (Math.round(screenAR * FLOAT_PRECISION) === Math.round(shotAR * FLOAT_PRECISION)) {
285
- logger_1.default.info(`Screenshot aspect ratio '${shotAR}' (${shotWidth}x${shotHeight}) matched ` +
269
+ logger_1.log.info(`Screenshot aspect ratio '${shotAR}' (${shotWidth}x${shotHeight}) matched ` +
286
270
  `screen aspect ratio '${screenAR}' (${screenSize.width}x${screenSize.height})`);
287
271
  }
288
272
  else {
289
- logger_1.default.warn(`When trying to find an element, determined that the screen ` +
273
+ logger_1.log.warn(`When trying to find an element, determined that the screen ` +
290
274
  `aspect ratio and screenshot aspect ratio are different. Screen ` +
291
275
  `is ${screenSize.width}x${screenSize.height} whereas screenshot is ` +
292
276
  `${shotWidth}x${shotHeight}.`);
@@ -304,9 +288,8 @@ class ImageElementFinder {
304
288
  const xScale = (1.0 * shotWidth) / screenSize.width;
305
289
  const yScale = (1.0 * shotHeight) / screenSize.height;
306
290
  const scaleFactor = Math.min(xScale, yScale);
307
- const [newWidth, newHeight] = [shotWidth * scaleFactor, shotHeight * scaleFactor]
308
- .map(Math.trunc);
309
- logger_1.default.warn(`Resizing screenshot to ${newWidth}x${newHeight} to match ` +
291
+ const [newWidth, newHeight] = [shotWidth * scaleFactor, shotHeight * scaleFactor].map(Math.trunc);
292
+ logger_1.log.warn(`Resizing screenshot to ${newWidth}x${newHeight} to match ` +
310
293
  `screen aspect ratio so that image element coordinates have a ` +
311
294
  `greater chance of being correct.`);
312
295
  imgObj = imgObj.resize({
@@ -316,14 +299,15 @@ class ImageElementFinder {
316
299
  });
317
300
  scale.xScale *= scaleFactor;
318
301
  scale.yScale *= scaleFactor;
319
- [shotWidth, shotHeight] = [newWidth, newHeight];
302
+ shotWidth = newWidth;
303
+ shotHeight = newHeight;
320
304
  }
321
305
  // Resize based on the screen dimensions only if both width and height are mismatched
322
306
  // since except for that, it might be a situation which is different window rect and
323
307
  // screenshot size like `@driver.window_rect #=>x=0, y=0, width=1080, height=1794` and
324
308
  // `"deviceScreenSize"=>"1080x1920"`
325
309
  if (screenSize.width !== shotWidth && screenSize.height !== shotHeight) {
326
- logger_1.default.info(`Scaling screenshot from ${shotWidth}x${shotHeight} to match ` +
310
+ logger_1.log.info(`Scaling screenshot from ${shotWidth}x${shotHeight} to match ` +
327
311
  `screen at ${screenSize.width}x${screenSize.height}`);
328
312
  imgObj = imgObj.resize({
329
313
  width: Math.trunc(screenSize.width),
@@ -338,32 +322,23 @@ class ImageElementFinder {
338
322
  scale,
339
323
  };
340
324
  }
341
- /**
342
- * @typedef ImageTemplateSettings
343
- * @property {boolean} [fixImageTemplateScale=false] - fixImageTemplateScale in device-settings
344
- * @property {number} [defaultImageTemplateScale=DEFAULT_TEMPLATE_IMAGE_SCALE] - defaultImageTemplateScale in device-settings
345
- * @property {boolean} [ignoreDefaultImageTemplateScale=false] - Ignore defaultImageTemplateScale if it has true.
346
- * If the template has been scaled to defaultImageTemplateScale or should ignore the scale,
347
- * this parameter should be true. e.g. click in image-element module
348
- * @property {number} [xScale=DEFAULT_FIX_IMAGE_TEMPLATE_SCALE] - Scale ratio for width
349
- * @property {number} [yScale=DEFAULT_FIX_IMAGE_TEMPLATE_SCALE] - Scale ratio for height
350
-
351
- */
352
325
  /**
353
326
  * Get a image that will be used for template matching.
354
327
  * Returns scaled image if scale ratio is provided.
355
328
  *
356
- * @param {Buffer} template - image used as a template to be
357
- * matched in the screenshot
358
- * @param {ImageTemplateSettings} opts - Image template scale related options
329
+ * @param template - image used as a template to be matched in the screenshot
330
+ * @param opts - Image template scale related options
359
331
  *
360
- * @returns {Promise<Buffer>} scaled template screenshot
332
+ * @returns scaled template screenshot
361
333
  */
362
334
  async fixImageTemplateScale(template, opts) {
363
335
  if (!opts) {
364
336
  return template;
365
337
  }
366
- let { fixImageTemplateScale: fixTplScale = false, defaultImageTemplateScale = constants_1.DEFAULT_TEMPLATE_IMAGE_SCALE, ignoreDefaultImageTemplateScale = false, xScale = constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE, yScale = constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE, } = opts;
338
+ const { fixImageTemplateScale: fixTplScale = false, defaultImageTemplateScale: initialDefaultImageTemplateScale = constants_1.DEFAULT_TEMPLATE_IMAGE_SCALE, ignoreDefaultImageTemplateScale = false, xScale: initialXScale = constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE, yScale: initialYScale = constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE, } = opts;
339
+ let defaultImageTemplateScale = initialDefaultImageTemplateScale;
340
+ let xScale = initialXScale;
341
+ let yScale = initialYScale;
367
342
  if (ignoreDefaultImageTemplateScale) {
368
343
  defaultImageTemplateScale = constants_1.DEFAULT_TEMPLATE_IMAGE_SCALE;
369
344
  }
@@ -384,10 +359,8 @@ class ImageElementFinder {
384
359
  return template;
385
360
  }
386
361
  // Return if the scale is default, 1, value
387
- if (Math.round(xScale * FLOAT_PRECISION) ===
388
- Math.round(constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE * FLOAT_PRECISION) &&
389
- Math.round(Number(yScale * FLOAT_PRECISION ===
390
- Math.round(constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE * FLOAT_PRECISION)))) {
362
+ if (Math.round(xScale * FLOAT_PRECISION) === Math.round(constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE * FLOAT_PRECISION) &&
363
+ Math.round(Number(yScale * FLOAT_PRECISION === Math.round(constants_1.DEFAULT_FIX_IMAGE_TEMPLATE_SCALE * FLOAT_PRECISION)))) {
391
364
  return template;
392
365
  }
393
366
  let imgObj = (0, sharp_1.default)(template);
@@ -397,8 +370,8 @@ class ImageElementFinder {
397
370
  }
398
371
  const scaledWidth = baseTempWidth * xScale;
399
372
  const scaledHeight = baseTempHeigh * yScale;
400
- logger_1.default.info(`Scaling template image from ${baseTempWidth}x${baseTempHeigh} to ${scaledWidth}x${scaledHeight}`);
401
- logger_1.default.info(`The ratio is ${xScale} and ${yScale}`);
373
+ logger_1.log.info(`Scaling template image from ${baseTempWidth}x${baseTempHeigh} to ${scaledWidth}x${scaledHeight}`);
374
+ logger_1.log.info(`The ratio is ${xScale} and ${yScale}`);
402
375
  imgObj = imgObj.resize({
403
376
  width: Math.trunc(scaledWidth),
404
377
  height: Math.trunc(scaledHeight),
@@ -407,18 +380,5 @@ class ImageElementFinder {
407
380
  return await imgObj.toBuffer();
408
381
  }
409
382
  }
410
- exports.default = ImageElementFinder;
411
- /**
412
- * @typedef {import('@appium/types').ExternalDriver} ExternalDriver
413
- * @typedef {import('@appium/types').Element} Element
414
- */
415
- /**
416
- * @typedef Screenshot
417
- * @property {Buffer} screenshot - screenshot image as PNG
418
- */
419
- /**
420
- * @typedef ScreenshotScale
421
- * @property {number} xScale - Scale ratio for width
422
- * @property {number} yScale - Scale ratio for height
423
- */
383
+ exports.ImageElementFinder = ImageElementFinder;
424
384
  //# sourceMappingURL=finder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"finder.js","sourceRoot":"","sources":["../../lib/finder.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,yCAAmC;AACnC,0CAAqC;AACrC,mDAA6C;AAC7C,uCAAwC;AACxC,sDAA2B;AAC3B,2CAGqB;AACrB,kDAA0B;AAE1B,yCAAyC;AACzC,iFAAiF;AACjF,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE7C;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,YAAY,EAAE,IAAI;IACtC,OAAO,YAAY,CAAC,CAAC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;QAC5C,YAAG,CAAC,IAAI,CACN,+BAA+B,aAAa,IAAI,aAAa,OAAO,WAAW,IAAI,YAAY,EAAE,CAClG,CAAC;QACF,YAAG,CAAC,IAAI,CAAC,gBAAgB,MAAM,QAAQ,MAAM,EAAE,CAAC,CAAC;QACjD,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;YAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;YAChC,GAAG,EAAE,MAAM;SACZ,CAAC,CAAC;QACH,OAAO,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;CACF;AAzbD,gDAybC"}
@@ -1,148 +1,76 @@
1
- /**
2
- * @typedef Dimension
3
- * @property {number} width - width of rect
4
- * @property {number} height - height of rect
5
- */
6
- /**
7
- * @typedef Position
8
- * @property {number} x - x coordinate
9
- * @property {number} y - y coordinate
10
- */
11
- /**
12
- * @typedef ImageElementOpts
13
- * @property {Buffer} template - the image which was used to find this ImageElement
14
- * @property {Rect} rect - bounds of matched image element
15
- * @property {number} score The similarity score as a float number in range [0.0, 1.0].
16
- * 1.0 is the highest score (means both images are totally equal).
17
- * @property {Buffer?} match - the image which has matched marks. Defaults to null.
18
- * @property {import('./finder').default?} finder - the finder we can use to re-check stale elements
19
- * @property {import('@appium/types').Rect?} containerRect - The bounding
20
- * rectangle to limit the search in
21
- */
1
+ import type { Rect, Element, ExternalDriver } from '@appium/types';
2
+ import type { ImageElementFinder } from './finder';
3
+ import type { Dimension, Position, ImageElementOpts } from './types';
22
4
  /**
23
5
  * Representation of an "image element", which is simply a set of coordinates
24
6
  * and methods that can be used on that set of coordinates via the driver
25
7
  */
26
- export default class ImageElement {
27
- /**
28
- * Handle various Appium commands that involve an image element
29
- *
30
- * @param {import('appium/driver').BaseDriver} driver - the driver to use for commands
31
- * @param {string} cmd - the name of the driver command
32
- * @param {any} imgEl - image element object
33
- * @param {string[]} args - Rest of arguments for executeScripts
34
- *
35
- * @returns {Promise<any>} - the result of running a command
36
- */
37
- static execute(driver: import("appium/driver").BaseDriver<any, import("@appium/types").StringRecord, import("@appium/types").StringRecord, import("@appium/types").DefaultCreateSessionResult<any>, void, import("@appium/types").StringRecord>, imgEl: any, cmd: string, ...args: string[]): Promise<any>;
38
- /**
39
- * @param {ImageElementOpts} options
40
- */
8
+ export declare class ImageElement {
9
+ readonly template: Buffer;
10
+ rect: Rect;
11
+ readonly id: string;
12
+ readonly match: Buffer | null;
13
+ readonly score: number;
14
+ readonly finder: ImageElementFinder | null;
15
+ readonly containerRect: Rect | null;
41
16
  constructor({ template, rect, score, match, finder, containerRect, }: ImageElementOpts);
42
- template: Buffer<ArrayBufferLike>;
43
- rect: import("@appium/types").Rect;
44
- id: string;
45
- match: Buffer<ArrayBufferLike> | null;
46
- score: number;
47
- finder: import("./finder").default | null;
48
- containerRect: import("@appium/types").Rect | null;
49
17
  /**
50
- * @returns {Dimension} - dimension of element
18
+ * @returns dimension of element
51
19
  */
52
20
  get size(): Dimension;
53
21
  /**
54
- * @returns {Position} - coordinates of top-left corner of element
22
+ * @returns coordinates of top-left corner of element
55
23
  */
56
24
  get location(): Position;
57
25
  /**
58
- * @returns {Position} - coordinates of center of element
26
+ * @returns coordinates of center of element
59
27
  */
60
28
  get center(): Position;
61
29
  /**
62
- * @returns {string} - the base64-encoded original image used for matching
30
+ * @returns the base64-encoded original image used for matching
63
31
  */
64
32
  get originalImage(): string;
65
33
  /**
66
- * @returns {string|null} - the base64-encoded image which has matched marks
34
+ * @returns the base64-encoded image which has matched marks
67
35
  */
68
36
  get matchedImage(): string | null;
69
37
  /**
70
38
  *
71
- * @returns {Element} - this image element as a WebElement
39
+ * @returns this image element as a WebElement
72
40
  */
73
41
  asElement(): Element;
74
42
  /**
75
- * @param {ImageElement} other - an ImageElement to compare with this one
43
+ * @param other - an ImageElement to compare with this one
76
44
  *
77
- * @returns {boolean} - whether the other element and this one have the same
78
- * properties
45
+ * @returns whether the other element and this one have the same properties
79
46
  */
80
47
  equals(other: ImageElement): boolean;
81
48
  /**
82
49
  * Use a driver to tap the screen at the center of this ImageElement's
83
50
  * position
84
51
  *
85
- * @param {import('appium/driver').BaseDriver} driver - driver for calling actions with
52
+ * @param driver - driver for calling actions with
86
53
  */
87
- click(driver: import("appium/driver").BaseDriver<any, import("@appium/types").StringRecord, import("@appium/types").StringRecord, import("@appium/types").DefaultCreateSessionResult<any>, void, import("@appium/types").StringRecord>): Promise<any>;
54
+ click(driver: ExternalDriver): Promise<void>;
88
55
  /**
89
56
  * Perform lookup of image element(s) inside of the current element
90
57
  *
91
- * @param {boolean} multiple - Whether to lookup multiple elements
92
- * @param {import('appium/driver').BaseDriver} driver - The driver to use for commands
93
- * @param {string[]} args = Rest of arguments for executeScripts
94
- * @returns {Promise<Element|Element[]|ImageElement>} - WebDriver element with a special id prefix
95
- */
96
- find(multiple: boolean, driver: import("appium/driver").BaseDriver<any, import("@appium/types").StringRecord, import("@appium/types").StringRecord, import("@appium/types").DefaultCreateSessionResult<any>, void, import("@appium/types").StringRecord>, ...args: string[]): Promise<Element | Element[] | ImageElement>;
97
- }
98
- export type Dimension = {
99
- /**
100
- * - width of rect
101
- */
102
- width: number;
103
- /**
104
- * - height of rect
58
+ * @param multiple - Whether to lookup multiple elements
59
+ * @param driver - The driver to use for commands
60
+ * @param args - Rest of arguments for executeScripts
61
+ * @returns WebDriver element with a special id prefix
105
62
  */
106
- height: number;
107
- };
108
- export type Position = {
63
+ find(multiple: boolean, driver: ExternalDriver, ...args: any[]): Promise<Element | Element[] | ImageElement>;
109
64
  /**
110
- * - x coordinate
111
- */
112
- x: number;
113
- /**
114
- * - y coordinate
115
- */
116
- y: number;
117
- };
118
- export type ImageElementOpts = {
119
- /**
120
- * - the image which was used to find this ImageElement
121
- */
122
- template: Buffer;
123
- /**
124
- * - bounds of matched image element
125
- */
126
- rect: Rect;
127
- /**
128
- * The similarity score as a float number in range [0.0, 1.0].
129
- * 1.0 is the highest score (means both images are totally equal).
130
- */
131
- score: number;
132
- /**
133
- * - the image which has matched marks. Defaults to null.
134
- */
135
- match: Buffer | null;
136
- /**
137
- * - the finder we can use to re-check stale elements
138
- */
139
- finder: import("./finder").default | null;
140
- /**
141
- * - The bounding
142
- * rectangle to limit the search in
65
+ * Handle various Appium commands that involve an image element
66
+ *
67
+ * @param driver - the driver to use for commands
68
+ * @param cmd - the name of the driver command
69
+ * @param imgEl - image element object
70
+ * @param args - Rest of arguments for executeScripts
71
+ *
72
+ * @returns the result of running a command
143
73
  */
144
- containerRect: import("@appium/types").Rect | null;
145
- };
146
- export type Rect = import("@appium/types").Rect;
147
- export type Element = import("@appium/types").Element;
74
+ static execute(driver: ExternalDriver, imgEl: ImageElement, cmd: string, ...args: any[]): Promise<any>;
75
+ }
148
76
  //# sourceMappingURL=image-element.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-element.d.ts","sourceRoot":"","sources":["../../lib/image-element.js"],"names":[],"mappings":"AAWA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAmNE;;;;;;;;;OASG;IACH,wPALW,GAAG,OADH,MAAM,WAEN,MAAM,EAAE,GAEN,OAAO,CAAC,GAAG,CAAC,CAoCxB;IA9PD;;OAEG;IACH,sEAFW,gBAAgB,EAiB1B;IAPC,kCAAwB;IACxB,mCAAgB;IAChB,WAAmD;IACnD,sCAAkB;IAClB,cAAkB;IAClB,0CAAoB;IACpB,mDAAkC;IAGpC;;OAEG;IACH,YAFa,SAAS,CAIrB;IAED;;OAEG;IACH,gBAFa,QAAQ,CAIpB;IAED;;OAEG;IACH,cAFa,QAAQ,CAOpB;IAED;;OAEG;IACH,qBAFa,MAAM,CAIlB;IAED;;OAEG;IACH,oBAFa,MAAM,GAAC,IAAI,CAIvB;IAED;;;OAGG;IACH,aAFa,OAAO,CAInB;IAED;;;;;OAKG;IACH,cALW,YAAY,GAEV,OAAO,CAUn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