askui 0.6.1 → 0.7.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 (50) hide show
  1. package/dist/cjs/core/annotation/template.html +11390 -1
  2. package/dist/cjs/core/model/annotation-result/detected-element.d.ts +3 -3
  3. package/dist/cjs/core/model/annotation-result/detected-element.js +4 -4
  4. package/dist/cjs/execution/dsl.d.ts +196 -81
  5. package/dist/cjs/execution/dsl.js +196 -90
  6. package/dist/cjs/execution/ui-controller-client-interface.d.ts +1 -1
  7. package/dist/cjs/lib/download-binaries.d.ts +1 -1
  8. package/dist/cjs/lib/download-binaries.js +42 -29
  9. package/dist/cjs/lib/ui-controller-darwin.js +3 -3
  10. package/dist/cjs/lib/ui-controller-facade.d.ts +1 -2
  11. package/dist/cjs/lib/ui-controller-facade.js +6 -11
  12. package/dist/cjs/lib/ui-controller-linux.js +1 -1
  13. package/dist/esm/core/annotation/template.html +11390 -1
  14. package/dist/esm/core/model/annotation-result/detected-element.d.ts +3 -3
  15. package/dist/esm/core/model/annotation-result/detected-element.js +4 -4
  16. package/dist/esm/execution/dsl.d.ts +196 -81
  17. package/dist/esm/execution/dsl.js +196 -90
  18. package/dist/esm/execution/ui-controller-client-interface.d.ts +1 -1
  19. package/dist/esm/lib/download-binaries.d.ts +1 -1
  20. package/dist/esm/lib/download-binaries.js +40 -27
  21. package/dist/esm/lib/ui-controller-darwin.js +3 -3
  22. package/dist/esm/lib/ui-controller-facade.d.ts +1 -2
  23. package/dist/esm/lib/ui-controller-facade.js +7 -12
  24. package/dist/esm/lib/ui-controller-linux.js +1 -1
  25. package/dist/example_projects_templates/typescript_jest/test/my-first-askui-test-suite.test.ts +5 -6
  26. package/package.json +1 -1
  27. package/dist/cjs/core/annotation/annotation-json.d.ts +0 -5
  28. package/dist/cjs/core/annotation/annotation-json.js +0 -2
  29. package/dist/cjs/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  30. package/dist/cjs/core/model/test-case-dto/custom-element.spec.js +0 -53
  31. package/dist/cjs/execution/dsl.spec.d.ts +0 -1
  32. package/dist/cjs/execution/dsl.spec.js +0 -75
  33. package/dist/cjs/execution/read-environment-credentials.spec.d.ts +0 -1
  34. package/dist/cjs/execution/read-environment-credentials.spec.js +0 -11
  35. package/dist/cjs/lib/ui-controller-args.spec.d.ts +0 -1
  36. package/dist/cjs/lib/ui-controller-args.spec.js +0 -23
  37. package/dist/cjs/utils/http/credentials.spec.d.ts +0 -1
  38. package/dist/cjs/utils/http/credentials.spec.js +0 -11
  39. package/dist/esm/core/annotation/annotation-json.d.ts +0 -5
  40. package/dist/esm/core/annotation/annotation-json.js +0 -1
  41. package/dist/esm/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  42. package/dist/esm/core/model/test-case-dto/custom-element.spec.js +0 -51
  43. package/dist/esm/execution/dsl.spec.d.ts +0 -1
  44. package/dist/esm/execution/dsl.spec.js +0 -73
  45. package/dist/esm/execution/read-environment-credentials.spec.d.ts +0 -1
  46. package/dist/esm/execution/read-environment-credentials.spec.js +0 -9
  47. package/dist/esm/lib/ui-controller-args.spec.d.ts +0 -1
  48. package/dist/esm/lib/ui-controller-args.spec.js +0 -21
  49. package/dist/esm/utils/http/credentials.spec.d.ts +0 -1
  50. package/dist/esm/utils/http/credentials.spec.js +0 -9
@@ -413,6 +413,11 @@ export declare class FluentFilters extends FluentBase {
413
413
  /**
414
414
  * Filters for an UI element 'button'.
415
415
  *
416
+ * **Examples:**
417
+ * ```typescript
418
+ * await aui.moveMouseTo().button().exec()
419
+ * ```
420
+ *
416
421
  * @return {FluentFiltersOrRelations}
417
422
  */
418
423
  button(): FluentFiltersOrRelations;
@@ -467,8 +472,17 @@ export declare class FluentFilters extends FluentBase {
467
472
  * ```typescript
468
473
  * 'text' === withText('text') => true
469
474
  * 'test' === withText('text') => true
475
+ * 'Test' === withText('text') => true
476
+ * 'Text' === withText('text') => true
477
+ * 'TEXT' === withText('text') => true
478
+ * 'texst' === withText('text') => true
479
+ * 'texts' === withText('text') => true
480
+ *
481
+ * // usually false
482
+ * 'atebxtc' === withText('text') => false
470
483
  * 'other' === withText('text') => false
471
484
  * ```
485
+ * ![](https://docs.askui.com/img/gif/withText.gif)
472
486
  *
473
487
  * @param {string} text - A text to be matched.
474
488
  *
@@ -484,9 +498,11 @@ export declare class FluentFilters extends FluentBase {
484
498
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
485
499
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
486
500
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
501
+ *
502
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
487
503
  * ```
488
504
  *
489
- * @param {string} regex_pattern - An regex pattern
505
+ * @param {string} regex_pattern - A regex pattern
490
506
  *
491
507
  * @return {FluentFiltersOrRelations}
492
508
  */
@@ -503,6 +519,8 @@ export declare class FluentFilters extends FluentBase {
503
519
  * 'text' === withExactText('text') => true
504
520
  * 'test' === withExactText('text') => false
505
521
  * 'other' === withExactText('text') => false
522
+ *
523
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
506
524
  * ```
507
525
  *
508
526
  * @param {string} text - A text to be matched.
@@ -519,20 +537,13 @@ export declare class FluentFilters extends FluentBase {
519
537
  * 'This is an text' === containsText('other text') => false
520
538
  * 'This is an text' === containsText('other') => false
521
539
  * ```
540
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
522
541
  *
523
542
  * @param {string} text - A text to be matched.
524
543
  *
525
544
  * @return {FluentFiltersOrRelations}
526
545
  */
527
546
  containsText(text: string): FluentFiltersOrRelations;
528
- /**
529
- * Filters for elements having a specific color.
530
- *
531
- * @param {COLOR} color - A color to match
532
- *
533
- * @return {FluentFiltersOrRelations}
534
- */
535
- colored(color: COLOR): FluentFiltersOrRelations;
536
547
  }
537
548
  export declare class FluentFiltersOrRelations extends FluentFilters {
538
549
  /**
@@ -563,7 +574,6 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
563
574
  * DetectedElement {
564
575
  * name: 'BUTTON',
565
576
  * text: 'button',
566
- * colors: [ 'red', 'black', 'red' ],
567
577
  * bndbox: BoundingBox {
568
578
  * xmin: 900,
569
579
  * ymin: 910,
@@ -583,21 +593,19 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
583
593
  * **Examples:**
584
594
  * ```text
585
595
  * example scene:
586
- * -------------------------- --------------------------
587
- * | icon user colored black | | icon user colored red |
588
- * -------------------------- --------------------------
589
- * ```
596
+ * --------------- ----------------
597
+ * | icon user | | icon search |
598
+ * --------------- ---------------n```
590
599
  * ```typescript
591
- * const icons = await aui.get().icon().withText('user').exec();
600
+ * const icons = await aui.get().icon().exec();
592
601
  * console.log(icons);
593
602
  * ```
594
- * Using only the filter withText, the get command will return both icons because they share the same text
603
+ * Using only the filter icon, the get command will return both icons
595
604
  * ```text
596
605
  * console output: [
597
606
  * DetectedElement {
598
607
  * name: 'ICON',
599
608
  * text: 'user',
600
- * colors: [ 'black', 'black', 'black' ],
601
609
  * bndbox: BoundingBox {
602
610
  * xmin: 1000,
603
611
  * ymin: 1010,
@@ -607,8 +615,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
607
615
  * },
608
616
  * DetectedElement {
609
617
  * name: 'ICON',
610
- * text: 'user',
611
- * colors: [ 'red', 'red', 'red' ],
618
+ * text: 'search',
612
619
  * bndbox: BoundingBox {
613
620
  * xmin: 900,
614
621
  * ymin: 910,
@@ -620,16 +627,15 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
620
627
  * ```
621
628
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
622
629
  * ```typescript
623
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
630
+ * const icons = await aui.get().icon().and().withText('user').exec()
624
631
  * console.log(icons)
625
632
  * ```
626
- * The get command returns only the red icon although both icons have the same text
633
+ * The get command returns only the user icon although both elements are icons
627
634
  * ```text
628
635
  * console output: [
629
636
  * DetectedElement {
630
637
  * name: 'ICON',
631
638
  * text: 'user',
632
- * colors: [ 'red', 'red', 'red' ],
633
639
  * bndbox: BoundingBox {
634
640
  * xmin: 900,
635
641
  * ymin: 910,
@@ -661,6 +667,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
661
667
  * // Returns nothing because innerEl is not inside outerEl
662
668
  * ...outerEl().in().innerEl()
663
669
  * ```
670
+ * ![](https://docs.askui.com/img/gif/in.gif)
664
671
  *
665
672
  * @return {FluentFilters}
666
673
  */
@@ -679,6 +686,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
679
686
  * // Returns no element because leftEl is left of rightEl
680
687
  * ...leftEl().rightOf().rightEl()
681
688
  * ```
689
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
682
690
  *
683
691
  * @return {FluentFilters}
684
692
  */
@@ -697,6 +705,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
697
705
  * // Returns no element because rightEl is left of leftEl
698
706
  * ...rightEl().leftOf().leftEl()
699
707
  * ```
708
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
700
709
  *
701
710
  * @return {FluentFilters}
702
711
  */
@@ -718,6 +727,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
718
727
  * // Returns no element because text is above button
719
728
  * ...text().below().button()
720
729
  * ```
730
+ * ![](https://docs.askui.com/img/gif/below.gif)
721
731
  *
722
732
  * @return {FluentFilters}
723
733
  */
@@ -739,6 +749,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
739
749
  * // Returns no element because button is below text
740
750
  * ...button().above().text()
741
751
  * ```
752
+ * ![](https://docs.askui.com/img/gif/above.gif)
742
753
  *
743
754
  * @return {FluentFilters}
744
755
  */
@@ -764,6 +775,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
764
775
  * // Returns button 1 because button 1 is nearer to the text than button 2
765
776
  * ...button().nearestTo().text()
766
777
  * ```
778
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
767
779
  *
768
780
  * @return {FluentFilters}
769
781
  */
@@ -786,6 +798,7 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
786
798
  * // Returns no element because innerEl contains no outerEl
787
799
  * ...innerEl().contains().outerEl()
788
800
  * ```
801
+ * ![](https://docs.askui.com/img/gif/contains.gif)
789
802
  *
790
803
  * @return {FluentFilters}
791
804
  */
@@ -1180,6 +1193,11 @@ export declare class FluentFiltersCondition extends FluentBase {
1180
1193
  /**
1181
1194
  * Filters for an UI element 'button'.
1182
1195
  *
1196
+ * **Examples:**
1197
+ * ```typescript
1198
+ * await aui.moveMouseTo().button().exec()
1199
+ * ```
1200
+ *
1183
1201
  * @return {FluentFiltersOrRelationsCondition}
1184
1202
  */
1185
1203
  button(): FluentFiltersOrRelationsCondition;
@@ -1234,8 +1252,17 @@ export declare class FluentFiltersCondition extends FluentBase {
1234
1252
  * ```typescript
1235
1253
  * 'text' === withText('text') => true
1236
1254
  * 'test' === withText('text') => true
1255
+ * 'Test' === withText('text') => true
1256
+ * 'Text' === withText('text') => true
1257
+ * 'TEXT' === withText('text') => true
1258
+ * 'texst' === withText('text') => true
1259
+ * 'texts' === withText('text') => true
1260
+ *
1261
+ * // usually false
1262
+ * 'atebxtc' === withText('text') => false
1237
1263
  * 'other' === withText('text') => false
1238
1264
  * ```
1265
+ * ![](https://docs.askui.com/img/gif/withText.gif)
1239
1266
  *
1240
1267
  * @param {string} text - A text to be matched.
1241
1268
  *
@@ -1251,9 +1278,11 @@ export declare class FluentFiltersCondition extends FluentBase {
1251
1278
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
1252
1279
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
1253
1280
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
1281
+ *
1282
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
1254
1283
  * ```
1255
1284
  *
1256
- * @param {string} regex_pattern - An regex pattern
1285
+ * @param {string} regex_pattern - A regex pattern
1257
1286
  *
1258
1287
  * @return {FluentFiltersOrRelationsCondition}
1259
1288
  */
@@ -1270,6 +1299,8 @@ export declare class FluentFiltersCondition extends FluentBase {
1270
1299
  * 'text' === withExactText('text') => true
1271
1300
  * 'test' === withExactText('text') => false
1272
1301
  * 'other' === withExactText('text') => false
1302
+ *
1303
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
1273
1304
  * ```
1274
1305
  *
1275
1306
  * @param {string} text - A text to be matched.
@@ -1286,20 +1317,13 @@ export declare class FluentFiltersCondition extends FluentBase {
1286
1317
  * 'This is an text' === containsText('other text') => false
1287
1318
  * 'This is an text' === containsText('other') => false
1288
1319
  * ```
1320
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
1289
1321
  *
1290
1322
  * @param {string} text - A text to be matched.
1291
1323
  *
1292
1324
  * @return {FluentFiltersOrRelationsCondition}
1293
1325
  */
1294
1326
  containsText(text: string): FluentFiltersOrRelationsCondition;
1295
- /**
1296
- * Filters for elements having a specific color.
1297
- *
1298
- * @param {COLOR} color - A color to match
1299
- *
1300
- * @return {FluentFiltersOrRelationsCondition}
1301
- */
1302
- colored(color: COLOR): FluentFiltersOrRelationsCondition;
1303
1327
  }
1304
1328
  export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1305
1329
  /**
@@ -1330,7 +1354,6 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1330
1354
  * DetectedElement {
1331
1355
  * name: 'BUTTON',
1332
1356
  * text: 'button',
1333
- * colors: [ 'red', 'black', 'red' ],
1334
1357
  * bndbox: BoundingBox {
1335
1358
  * xmin: 900,
1336
1359
  * ymin: 910,
@@ -1350,21 +1373,19 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1350
1373
  * **Examples:**
1351
1374
  * ```text
1352
1375
  * example scene:
1353
- * -------------------------- --------------------------
1354
- * | icon user colored black | | icon user colored red |
1355
- * -------------------------- --------------------------
1356
- * ```
1376
+ * --------------- ----------------
1377
+ * | icon user | | icon search |
1378
+ * --------------- ---------------n```
1357
1379
  * ```typescript
1358
- * const icons = await aui.get().icon().withText('user').exec();
1380
+ * const icons = await aui.get().icon().exec();
1359
1381
  * console.log(icons);
1360
1382
  * ```
1361
- * Using only the filter withText, the get command will return both icons because they share the same text
1383
+ * Using only the filter icon, the get command will return both icons
1362
1384
  * ```text
1363
1385
  * console output: [
1364
1386
  * DetectedElement {
1365
1387
  * name: 'ICON',
1366
1388
  * text: 'user',
1367
- * colors: [ 'black', 'black', 'black' ],
1368
1389
  * bndbox: BoundingBox {
1369
1390
  * xmin: 1000,
1370
1391
  * ymin: 1010,
@@ -1374,8 +1395,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1374
1395
  * },
1375
1396
  * DetectedElement {
1376
1397
  * name: 'ICON',
1377
- * text: 'user',
1378
- * colors: [ 'red', 'red', 'red' ],
1398
+ * text: 'search',
1379
1399
  * bndbox: BoundingBox {
1380
1400
  * xmin: 900,
1381
1401
  * ymin: 910,
@@ -1387,16 +1407,15 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1387
1407
  * ```
1388
1408
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
1389
1409
  * ```typescript
1390
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
1410
+ * const icons = await aui.get().icon().and().withText('user').exec()
1391
1411
  * console.log(icons)
1392
1412
  * ```
1393
- * The get command returns only the red icon although both icons have the same text
1413
+ * The get command returns only the user icon although both elements are icons
1394
1414
  * ```text
1395
1415
  * console output: [
1396
1416
  * DetectedElement {
1397
1417
  * name: 'ICON',
1398
1418
  * text: 'user',
1399
- * colors: [ 'red', 'red', 'red' ],
1400
1419
  * bndbox: BoundingBox {
1401
1420
  * xmin: 900,
1402
1421
  * ymin: 910,
@@ -1428,6 +1447,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1428
1447
  * // Returns nothing because innerEl is not inside outerEl
1429
1448
  * ...outerEl().in().innerEl()
1430
1449
  * ```
1450
+ * ![](https://docs.askui.com/img/gif/in.gif)
1431
1451
  *
1432
1452
  * @return {FluentFiltersCondition}
1433
1453
  */
@@ -1446,6 +1466,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1446
1466
  * // Returns no element because leftEl is left of rightEl
1447
1467
  * ...leftEl().rightOf().rightEl()
1448
1468
  * ```
1469
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
1449
1470
  *
1450
1471
  * @return {FluentFiltersCondition}
1451
1472
  */
@@ -1464,6 +1485,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1464
1485
  * // Returns no element because rightEl is left of leftEl
1465
1486
  * ...rightEl().leftOf().leftEl()
1466
1487
  * ```
1488
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
1467
1489
  *
1468
1490
  * @return {FluentFiltersCondition}
1469
1491
  */
@@ -1485,6 +1507,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1485
1507
  * // Returns no element because text is above button
1486
1508
  * ...text().below().button()
1487
1509
  * ```
1510
+ * ![](https://docs.askui.com/img/gif/below.gif)
1488
1511
  *
1489
1512
  * @return {FluentFiltersCondition}
1490
1513
  */
@@ -1506,6 +1529,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1506
1529
  * // Returns no element because button is below text
1507
1530
  * ...button().above().text()
1508
1531
  * ```
1532
+ * ![](https://docs.askui.com/img/gif/above.gif)
1509
1533
  *
1510
1534
  * @return {FluentFiltersCondition}
1511
1535
  */
@@ -1531,6 +1555,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1531
1555
  * // Returns button 1 because button 1 is nearer to the text than button 2
1532
1556
  * ...button().nearestTo().text()
1533
1557
  * ```
1558
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
1534
1559
  *
1535
1560
  * @return {FluentFiltersCondition}
1536
1561
  */
@@ -1553,6 +1578,7 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1553
1578
  * // Returns no element because innerEl contains no outerEl
1554
1579
  * ...innerEl().contains().outerEl()
1555
1580
  * ```
1581
+ * ![](https://docs.askui.com/img/gif/contains.gif)
1556
1582
  *
1557
1583
  * @return {FluentFiltersCondition}
1558
1584
  */
@@ -1560,12 +1586,22 @@ export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCond
1560
1586
  /**
1561
1587
  * Expects that filtered element exists.
1562
1588
  *
1589
+ * **Examples:**
1590
+ * ```typescript
1591
+ * await aui.expect().text().withText('Login').exists().exec()
1592
+ * ```
1593
+ *
1563
1594
  * @return {ExecCondition}
1564
1595
  */
1565
1596
  exists(): ExecCondition;
1566
1597
  /**
1567
1598
  * Expects that filtered element does not exist.
1568
1599
  *
1600
+ * **Examples:**
1601
+ * ```typescript
1602
+ * await aui.expect().text().withText('Login').notExists().exec()
1603
+ * ```
1604
+ *
1569
1605
  * @return {ExecCondition}
1570
1606
  */
1571
1607
  notExists(): ExecCondition;
@@ -1575,8 +1611,13 @@ declare class ExecCondition extends Exec {
1575
1611
  export declare abstract class FluentCommand extends FluentBase {
1576
1612
  constructor();
1577
1613
  /**
1578
- * Expects a condition, e.g., `exists()` or `notExits()`,
1579
- * e.g., `...expect().text().withText('Login').exists()`.
1614
+ * Expects a condition, e.g., `exists()` or `notExits()`.
1615
+ *
1616
+ * **Examples:**
1617
+ * ```typescript
1618
+ * await aui.expect().text().withText('Login').exists().exec()
1619
+ * await aui.expect().text().withText('Login').notExists().exec()
1620
+ * ```
1580
1621
  *
1581
1622
  * @return {FluentFiltersCondition}
1582
1623
  */
@@ -1584,17 +1625,36 @@ export declare abstract class FluentCommand extends FluentBase {
1584
1625
  /**
1585
1626
  * Clicks on the filtered element.
1586
1627
  *
1628
+ * **Example:**
1629
+ * ```typescript
1630
+ * await aui.click().button().withText('Submit').exec()
1631
+ * ```
1632
+ *
1587
1633
  * @return {FluentFilters}
1588
1634
  */
1589
1635
  click(): FluentFilters;
1590
1636
  /**
1591
1637
  * Move mouse over the filtered element.
1592
1638
  *
1639
+ * **Example:**
1640
+ * ```typescript
1641
+ * await aui.moveMouseTo().button().withText('Submit').exec()
1642
+ * ```
1643
+ *
1593
1644
  * @return {FluentFilters}
1594
1645
  */
1595
1646
  moveMouseTo(): FluentFilters;
1596
1647
  /**
1597
- * Types a text inside the filtered element.
1648
+ * Puts the focus on the filtered element and types in the text.
1649
+ *
1650
+ * **Examples:**
1651
+ * ```typescript
1652
+ * await aui.typeIn('Type some text').textfield().exec()
1653
+ *
1654
+ * // mask the text so it is not send to the askui-inference server
1655
+ * await aui.typeIn('Type some text', { isSecret: true, secretMask: '**' }).textfield().exec()
1656
+ * ```
1657
+ * ![](https://docs.askui.com/img/gif/typeIn.gif)
1598
1658
  *
1599
1659
  * @param {string} text - A text to type
1600
1660
  *
@@ -1604,6 +1664,13 @@ export declare abstract class FluentCommand extends FluentBase {
1604
1664
  /**
1605
1665
  * Moves mouse to the filtered element and scrolls in the x and y direction.
1606
1666
  *
1667
+ * **macOS**: May not work as expected!
1668
+ *
1669
+ * **Example:**
1670
+ * ```typescript
1671
+ * await aui.scroll(0, 10).textarea().exec()
1672
+ * ```
1673
+ *
1607
1674
  * @param {number} x_offset - A (positive/negative) x direction.
1608
1675
  * @param {number} y_offset - A (positive/negative) y direction.
1609
1676
  *
@@ -1612,7 +1679,14 @@ export declare abstract class FluentCommand extends FluentBase {
1612
1679
  scrollInside(x_offset: number, y_offset: number): FluentFilters;
1613
1680
  /**
1614
1681
  * Moves the mouse relatively to an element in the direction.
1615
- * This can be used when the mouse should not hover over on an element anymore.
1682
+ * This can be used when the mouse should not hover over an element anymore.
1683
+ *
1684
+ * **Examples:**
1685
+ * ```typescript
1686
+ * // Move mouse 30 pixels below button
1687
+ * await aui.moveMouseRelativelyTo(0, 30).button().withText('Submit').exec()
1688
+ * ```
1689
+ * ![](https://docs.askui.com/img/gif/moveMouseRelativelyTo.gif)
1616
1690
  *
1617
1691
  * @param {number} x_offset - A (positive/negative) x direction.
1618
1692
  * @param {number} y_offset - A (positive/negative) y direction.
@@ -1621,16 +1695,33 @@ export declare abstract class FluentCommand extends FluentBase {
1621
1695
  */
1622
1696
  moveMouseRelativelyTo(x_offset: number, y_offset: number): FluentFilters;
1623
1697
  /**
1624
- * Swipe an element in the x and y direction
1698
+ * Swipe an element in the x and y direction.
1699
+ * Holds the left mouse button down on Windows, Linux and macOS and drags the element.
1700
+ * On touch devices it taps the element and then drags it.
1701
+ *
1702
+ * **Example:**
1703
+ * ```typescript
1704
+ * // Swipe the element 500 to the right
1705
+ * await aui.swipe(500, 0).image().exec()
1706
+ * ```
1707
+ * ![](https://docs.askui.com/img/gif/swipe.gif)
1625
1708
  *
1626
- * @param {number} x_offset - A x direction. positive an negative values are accepted
1627
- * @param {number} y_offset - A y direction. positive an negative values are accepted
1709
+ * @param {number} x_offset - A x direction. positive and negative values are accepted
1710
+ * @param {number} y_offset - A y direction. positive and negative values are accepted
1628
1711
  *
1629
1712
  * @return {FluentFilters}
1630
1713
  */
1631
1714
  swipe(x_offset: number, y_offset: number): FluentFilters;
1632
1715
  /**
1633
1716
  * Types a text at the current position.
1717
+ * If you need to focus the element first, use typeIn()
1718
+ *
1719
+ * **Examples:**
1720
+ * ```typescript
1721
+ * await aui.type('Type some text').exec()
1722
+ *
1723
+ * // mask the text so it is not send to the askui-inference serverawait aui.type('Type some text', { isSecret: true, secretMask: '**' }).exec()
1724
+ * ```
1634
1725
  *
1635
1726
  * @param {string} text - A text to type
1636
1727
  *
@@ -1660,6 +1751,14 @@ export declare abstract class FluentCommand extends FluentBase {
1660
1751
  *
1661
1752
  * **Important**: Mouse must be positioned in a scrollable area.
1662
1753
  *
1754
+ * **macOS**: May not work as expected!
1755
+ *
1756
+ * **Example:**
1757
+ * ```typescript
1758
+ * // Scroll 10 up in y direction
1759
+ * await aui.scroll(0, 10).exec()
1760
+ * ```
1761
+ *
1663
1762
  * @param {number} x_offset - A (positive/negative) x direction.
1664
1763
  * @param {number} y_offset - A (positive/negative) y direction.
1665
1764
  *
@@ -1667,7 +1766,13 @@ export declare abstract class FluentCommand extends FluentBase {
1667
1766
  */
1668
1767
  scroll(x_offset: number, y_offset: number): Exec;
1669
1768
  /**
1670
- * Executes a shell command.
1769
+ * Executes a shell command on the device.
1770
+ *
1771
+ * **Example:**
1772
+ * ```typescript
1773
+ * // Open the lastpass app
1774
+ * await aui.execOnShell('monkey -p com.lastpass.authenticator 1').exec()
1775
+ * ```
1671
1776
  *
1672
1777
  * @param {string} shell_command - A shell command which is executed.
1673
1778
  *
@@ -1711,13 +1816,13 @@ export declare abstract class FluentCommand extends FluentBase {
1711
1816
  */
1712
1817
  mouseDoubleMiddleClick(): Exec;
1713
1818
  /**
1714
- * Toggles mouse down.
1819
+ * Toggles mouse down (Left mouse key).
1715
1820
  *
1716
1821
  * @return {Exec}
1717
1822
  */
1718
1823
  mouseToggleDown(): Exec;
1719
1824
  /**
1720
- * Toggles mouse up.
1825
+ * Toggles mouse up (Left mouse key).
1721
1826
  *
1722
1827
  * @return {Exec}
1723
1828
  */
@@ -2172,6 +2277,11 @@ export declare class FluentFiltersGetter extends FluentBase {
2172
2277
  /**
2173
2278
  * Filters for an UI element 'button'.
2174
2279
  *
2280
+ * **Examples:**
2281
+ * ```typescript
2282
+ * await aui.moveMouseTo().button().exec()
2283
+ * ```
2284
+ *
2175
2285
  * @return {FluentFiltersOrRelationsGetter}
2176
2286
  */
2177
2287
  button(): FluentFiltersOrRelationsGetter;
@@ -2226,8 +2336,17 @@ export declare class FluentFiltersGetter extends FluentBase {
2226
2336
  * ```typescript
2227
2337
  * 'text' === withText('text') => true
2228
2338
  * 'test' === withText('text') => true
2339
+ * 'Test' === withText('text') => true
2340
+ * 'Text' === withText('text') => true
2341
+ * 'TEXT' === withText('text') => true
2342
+ * 'texst' === withText('text') => true
2343
+ * 'texts' === withText('text') => true
2344
+ *
2345
+ * // usually false
2346
+ * 'atebxtc' === withText('text') => false
2229
2347
  * 'other' === withText('text') => false
2230
2348
  * ```
2349
+ * ![](https://docs.askui.com/img/gif/withText.gif)
2231
2350
  *
2232
2351
  * @param {string} text - A text to be matched.
2233
2352
  *
@@ -2243,9 +2362,11 @@ export declare class FluentFiltersGetter extends FluentBase {
2243
2362
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
2244
2363
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
2245
2364
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
2365
+ *
2366
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
2246
2367
  * ```
2247
2368
  *
2248
- * @param {string} regex_pattern - An regex pattern
2369
+ * @param {string} regex_pattern - A regex pattern
2249
2370
  *
2250
2371
  * @return {FluentFiltersOrRelationsGetter}
2251
2372
  */
@@ -2262,6 +2383,8 @@ export declare class FluentFiltersGetter extends FluentBase {
2262
2383
  * 'text' === withExactText('text') => true
2263
2384
  * 'test' === withExactText('text') => false
2264
2385
  * 'other' === withExactText('text') => false
2386
+ *
2387
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
2265
2388
  * ```
2266
2389
  *
2267
2390
  * @param {string} text - A text to be matched.
@@ -2278,20 +2401,13 @@ export declare class FluentFiltersGetter extends FluentBase {
2278
2401
  * 'This is an text' === containsText('other text') => false
2279
2402
  * 'This is an text' === containsText('other') => false
2280
2403
  * ```
2404
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
2281
2405
  *
2282
2406
  * @param {string} text - A text to be matched.
2283
2407
  *
2284
2408
  * @return {FluentFiltersOrRelationsGetter}
2285
2409
  */
2286
2410
  containsText(text: string): FluentFiltersOrRelationsGetter;
2287
- /**
2288
- * Filters for elements having a specific color.
2289
- *
2290
- * @param {COLOR} color - A color to match
2291
- *
2292
- * @return {FluentFiltersOrRelationsGetter}
2293
- */
2294
- colored(color: COLOR): FluentFiltersOrRelationsGetter;
2295
2411
  }
2296
2412
  export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
2297
2413
  /**
@@ -2322,7 +2438,6 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2322
2438
  * DetectedElement {
2323
2439
  * name: 'BUTTON',
2324
2440
  * text: 'button',
2325
- * colors: [ 'red', 'black', 'red' ],
2326
2441
  * bndbox: BoundingBox {
2327
2442
  * xmin: 900,
2328
2443
  * ymin: 910,
@@ -2342,21 +2457,19 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2342
2457
  * **Examples:**
2343
2458
  * ```text
2344
2459
  * example scene:
2345
- * -------------------------- --------------------------
2346
- * | icon user colored black | | icon user colored red |
2347
- * -------------------------- --------------------------
2348
- * ```
2460
+ * --------------- ----------------
2461
+ * | icon user | | icon search |
2462
+ * --------------- ---------------n```
2349
2463
  * ```typescript
2350
- * const icons = await aui.get().icon().withText('user').exec();
2464
+ * const icons = await aui.get().icon().exec();
2351
2465
  * console.log(icons);
2352
2466
  * ```
2353
- * Using only the filter withText, the get command will return both icons because they share the same text
2467
+ * Using only the filter icon, the get command will return both icons
2354
2468
  * ```text
2355
2469
  * console output: [
2356
2470
  * DetectedElement {
2357
2471
  * name: 'ICON',
2358
2472
  * text: 'user',
2359
- * colors: [ 'black', 'black', 'black' ],
2360
2473
  * bndbox: BoundingBox {
2361
2474
  * xmin: 1000,
2362
2475
  * ymin: 1010,
@@ -2366,8 +2479,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2366
2479
  * },
2367
2480
  * DetectedElement {
2368
2481
  * name: 'ICON',
2369
- * text: 'user',
2370
- * colors: [ 'red', 'red', 'red' ],
2482
+ * text: 'search',
2371
2483
  * bndbox: BoundingBox {
2372
2484
  * xmin: 900,
2373
2485
  * ymin: 910,
@@ -2379,16 +2491,15 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2379
2491
  * ```
2380
2492
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
2381
2493
  * ```typescript
2382
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
2494
+ * const icons = await aui.get().icon().and().withText('user').exec()
2383
2495
  * console.log(icons)
2384
2496
  * ```
2385
- * The get command returns only the red icon although both icons have the same text
2497
+ * The get command returns only the user icon although both elements are icons
2386
2498
  * ```text
2387
2499
  * console output: [
2388
2500
  * DetectedElement {
2389
2501
  * name: 'ICON',
2390
2502
  * text: 'user',
2391
- * colors: [ 'red', 'red', 'red' ],
2392
2503
  * bndbox: BoundingBox {
2393
2504
  * xmin: 900,
2394
2505
  * ymin: 910,
@@ -2420,6 +2531,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2420
2531
  * // Returns nothing because innerEl is not inside outerEl
2421
2532
  * ...outerEl().in().innerEl()
2422
2533
  * ```
2534
+ * ![](https://docs.askui.com/img/gif/in.gif)
2423
2535
  *
2424
2536
  * @return {FluentFiltersGetter}
2425
2537
  */
@@ -2438,6 +2550,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2438
2550
  * // Returns no element because leftEl is left of rightEl
2439
2551
  * ...leftEl().rightOf().rightEl()
2440
2552
  * ```
2553
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
2441
2554
  *
2442
2555
  * @return {FluentFiltersGetter}
2443
2556
  */
@@ -2456,6 +2569,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2456
2569
  * // Returns no element because rightEl is left of leftEl
2457
2570
  * ...rightEl().leftOf().leftEl()
2458
2571
  * ```
2572
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
2459
2573
  *
2460
2574
  * @return {FluentFiltersGetter}
2461
2575
  */
@@ -2477,6 +2591,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2477
2591
  * // Returns no element because text is above button
2478
2592
  * ...text().below().button()
2479
2593
  * ```
2594
+ * ![](https://docs.askui.com/img/gif/below.gif)
2480
2595
  *
2481
2596
  * @return {FluentFiltersGetter}
2482
2597
  */
@@ -2498,6 +2613,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2498
2613
  * // Returns no element because button is below text
2499
2614
  * ...button().above().text()
2500
2615
  * ```
2616
+ * ![](https://docs.askui.com/img/gif/above.gif)
2501
2617
  *
2502
2618
  * @return {FluentFiltersGetter}
2503
2619
  */
@@ -2523,6 +2639,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2523
2639
  * // Returns button 1 because button 1 is nearer to the text than button 2
2524
2640
  * ...button().nearestTo().text()
2525
2641
  * ```
2642
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
2526
2643
  *
2527
2644
  * @return {FluentFiltersGetter}
2528
2645
  */
@@ -2545,6 +2662,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2545
2662
  * // Returns no element because innerEl contains no outerEl
2546
2663
  * ...innerEl().contains().outerEl()
2547
2664
  * ```
2665
+ * ![](https://docs.askui.com/img/gif/contains.gif)
2548
2666
  *
2549
2667
  * @return {FluentFiltersGetter}
2550
2668
  */
@@ -2562,8 +2680,8 @@ export declare abstract class Getter extends FluentCommand {
2562
2680
  * A detected element has the following properties:
2563
2681
  * - `name` of the element
2564
2682
  * - `text` content of element
2565
- * - `colors` of element
2566
2683
  * - `bndbox`: location of element described with coordinates of a bounding box
2684
+ *
2567
2685
  * **Examples:**
2568
2686
  * ```typescript
2569
2687
  * const text = await aui.get().text().withText('Sign').exec();
@@ -2574,7 +2692,6 @@ export declare abstract class Getter extends FluentCommand {
2574
2692
  * DetectedElement {
2575
2693
  * name: 'TEXT',
2576
2694
  * text: 'Sign In',
2577
- * colors: [ 'black', 'gray', 'gray' ],
2578
2695
  * bndbox: BoundingBox {
2579
2696
  * xmin: 1128.2720982142857,
2580
2697
  * ymin: 160.21332310267857,
@@ -2593,8 +2710,8 @@ export declare abstract class Getter extends FluentCommand {
2593
2710
  * A detected element has the following properties:
2594
2711
  * - `name` of the element
2595
2712
  * - `text` content of element
2596
- * - `colors` of element
2597
2713
  * - `bndbox`: location of element described with coordinates of a bounding box
2714
+ *
2598
2715
  * **Examples:**
2599
2716
  * ```typescript
2600
2717
  * const detectedElements = await aui.getAll().exec();
@@ -2605,7 +2722,6 @@ export declare abstract class Getter extends FluentCommand {
2605
2722
  * DetectedElement {
2606
2723
  * name: 'TEXT',
2607
2724
  * text: 'Sign In',
2608
- * colors: [ 'black', 'gray', 'gray' ],
2609
2725
  * bndbox: BoundingBox {
2610
2726
  * xmin: 1128.2720982142857,
2611
2727
  * ymin: 160.21332310267857,
@@ -2615,7 +2731,6 @@ export declare abstract class Getter extends FluentCommand {
2615
2731
  * DetectedElement {
2616
2732
  * name: 'ICON',
2617
2733
  * text: 'search',
2618
- * colors: [ 'black', 'red', 'gray' ],
2619
2734
  * bndbox: BoundingBox {
2620
2735
  * xmin: 250.8204241071428,
2621
2736
  * ymin: 300.21332310267857,