askui 0.6.1 → 0.7.0

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 (37) 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 +194 -127
  5. package/dist/cjs/execution/dsl.js +194 -160
  6. package/dist/cjs/execution/ui-controller-client-interface.d.ts +1 -1
  7. package/dist/esm/core/annotation/template.html +11390 -1
  8. package/dist/esm/core/model/annotation-result/detected-element.d.ts +3 -3
  9. package/dist/esm/core/model/annotation-result/detected-element.js +4 -4
  10. package/dist/esm/execution/dsl.d.ts +194 -127
  11. package/dist/esm/execution/dsl.js +194 -160
  12. package/dist/esm/execution/ui-controller-client-interface.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/dist/cjs/core/annotation/annotation-json.d.ts +0 -5
  15. package/dist/cjs/core/annotation/annotation-json.js +0 -2
  16. package/dist/cjs/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  17. package/dist/cjs/core/model/test-case-dto/custom-element.spec.js +0 -53
  18. package/dist/cjs/execution/dsl.spec.d.ts +0 -1
  19. package/dist/cjs/execution/dsl.spec.js +0 -75
  20. package/dist/cjs/execution/read-environment-credentials.spec.d.ts +0 -1
  21. package/dist/cjs/execution/read-environment-credentials.spec.js +0 -11
  22. package/dist/cjs/lib/ui-controller-args.spec.d.ts +0 -1
  23. package/dist/cjs/lib/ui-controller-args.spec.js +0 -23
  24. package/dist/cjs/utils/http/credentials.spec.d.ts +0 -1
  25. package/dist/cjs/utils/http/credentials.spec.js +0 -11
  26. package/dist/esm/core/annotation/annotation-json.d.ts +0 -5
  27. package/dist/esm/core/annotation/annotation-json.js +0 -1
  28. package/dist/esm/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  29. package/dist/esm/core/model/test-case-dto/custom-element.spec.js +0 -51
  30. package/dist/esm/execution/dsl.spec.d.ts +0 -1
  31. package/dist/esm/execution/dsl.spec.js +0 -73
  32. package/dist/esm/execution/read-environment-credentials.spec.d.ts +0 -1
  33. package/dist/esm/execution/read-environment-credentials.spec.js +0 -9
  34. package/dist/esm/lib/ui-controller-args.spec.d.ts +0 -1
  35. package/dist/esm/lib/ui-controller-args.spec.js +0 -21
  36. package/dist/esm/utils/http/credentials.spec.d.ts +0 -1
  37. 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,61 +1766,19 @@ 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
  *
1674
1779
  * @return {Exec}
1675
1780
  */
1676
1781
  execOnShell(shell_command: string): Exec;
1677
- /**
1678
- * Clicks with left mouse key.
1679
- *
1680
- * @return {Exec}
1681
- */
1682
- mouseLeftClick(): Exec;
1683
- /**
1684
- * Clicks with right mouse key.
1685
- *
1686
- * @return {Exec}
1687
- */
1688
- mouseRightClick(): Exec;
1689
- /**
1690
- * Clicks with middle mouse key.
1691
- *
1692
- * @return {Exec}
1693
- */
1694
- mouseMiddleClick(): Exec;
1695
- /**
1696
- * Double-clicks with left mouse key.
1697
- *
1698
- * @return {Exec}
1699
- */
1700
- mouseDoubleLeftClick(): Exec;
1701
- /**
1702
- * Double-clicks with right mouse key.
1703
- *
1704
- * @return {Exec}
1705
- */
1706
- mouseDoubleRightClick(): Exec;
1707
- /**
1708
- * Double-clicks with middle mouse key.
1709
- *
1710
- * @return {Exec}
1711
- */
1712
- mouseDoubleMiddleClick(): Exec;
1713
- /**
1714
- * Toggles mouse down.
1715
- *
1716
- * @return {Exec}
1717
- */
1718
- mouseToggleDown(): Exec;
1719
- /**
1720
- * Toggles mouse up.
1721
- *
1722
- * @return {Exec}
1723
- */
1724
- mouseToggleUp(): Exec;
1725
1782
  /**
1726
1783
  * Press three keys like `CTRL+ALT+DEL`
1727
1784
  *
@@ -2172,6 +2229,11 @@ export declare class FluentFiltersGetter extends FluentBase {
2172
2229
  /**
2173
2230
  * Filters for an UI element 'button'.
2174
2231
  *
2232
+ * **Examples:**
2233
+ * ```typescript
2234
+ * await aui.moveMouseTo().button().exec()
2235
+ * ```
2236
+ *
2175
2237
  * @return {FluentFiltersOrRelationsGetter}
2176
2238
  */
2177
2239
  button(): FluentFiltersOrRelationsGetter;
@@ -2226,8 +2288,17 @@ export declare class FluentFiltersGetter extends FluentBase {
2226
2288
  * ```typescript
2227
2289
  * 'text' === withText('text') => true
2228
2290
  * 'test' === withText('text') => true
2291
+ * 'Test' === withText('text') => true
2292
+ * 'Text' === withText('text') => true
2293
+ * 'TEXT' === withText('text') => true
2294
+ * 'texst' === withText('text') => true
2295
+ * 'texts' === withText('text') => true
2296
+ *
2297
+ * // usually false
2298
+ * 'atebxtc' === withText('text') => false
2229
2299
  * 'other' === withText('text') => false
2230
2300
  * ```
2301
+ * ![](https://docs.askui.com/img/gif/withText.gif)
2231
2302
  *
2232
2303
  * @param {string} text - A text to be matched.
2233
2304
  *
@@ -2243,9 +2314,11 @@ export declare class FluentFiltersGetter extends FluentBase {
2243
2314
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
2244
2315
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
2245
2316
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
2317
+ *
2318
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
2246
2319
  * ```
2247
2320
  *
2248
- * @param {string} regex_pattern - An regex pattern
2321
+ * @param {string} regex_pattern - A regex pattern
2249
2322
  *
2250
2323
  * @return {FluentFiltersOrRelationsGetter}
2251
2324
  */
@@ -2262,6 +2335,8 @@ export declare class FluentFiltersGetter extends FluentBase {
2262
2335
  * 'text' === withExactText('text') => true
2263
2336
  * 'test' === withExactText('text') => false
2264
2337
  * 'other' === withExactText('text') => false
2338
+ *
2339
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
2265
2340
  * ```
2266
2341
  *
2267
2342
  * @param {string} text - A text to be matched.
@@ -2278,20 +2353,13 @@ export declare class FluentFiltersGetter extends FluentBase {
2278
2353
  * 'This is an text' === containsText('other text') => false
2279
2354
  * 'This is an text' === containsText('other') => false
2280
2355
  * ```
2356
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
2281
2357
  *
2282
2358
  * @param {string} text - A text to be matched.
2283
2359
  *
2284
2360
  * @return {FluentFiltersOrRelationsGetter}
2285
2361
  */
2286
2362
  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
2363
  }
2296
2364
  export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
2297
2365
  /**
@@ -2322,7 +2390,6 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2322
2390
  * DetectedElement {
2323
2391
  * name: 'BUTTON',
2324
2392
  * text: 'button',
2325
- * colors: [ 'red', 'black', 'red' ],
2326
2393
  * bndbox: BoundingBox {
2327
2394
  * xmin: 900,
2328
2395
  * ymin: 910,
@@ -2342,21 +2409,19 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2342
2409
  * **Examples:**
2343
2410
  * ```text
2344
2411
  * example scene:
2345
- * -------------------------- --------------------------
2346
- * | icon user colored black | | icon user colored red |
2347
- * -------------------------- --------------------------
2348
- * ```
2412
+ * --------------- ----------------
2413
+ * | icon user | | icon search |
2414
+ * --------------- ---------------n```
2349
2415
  * ```typescript
2350
- * const icons = await aui.get().icon().withText('user').exec();
2416
+ * const icons = await aui.get().icon().exec();
2351
2417
  * console.log(icons);
2352
2418
  * ```
2353
- * Using only the filter withText, the get command will return both icons because they share the same text
2419
+ * Using only the filter icon, the get command will return both icons
2354
2420
  * ```text
2355
2421
  * console output: [
2356
2422
  * DetectedElement {
2357
2423
  * name: 'ICON',
2358
2424
  * text: 'user',
2359
- * colors: [ 'black', 'black', 'black' ],
2360
2425
  * bndbox: BoundingBox {
2361
2426
  * xmin: 1000,
2362
2427
  * ymin: 1010,
@@ -2366,8 +2431,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2366
2431
  * },
2367
2432
  * DetectedElement {
2368
2433
  * name: 'ICON',
2369
- * text: 'user',
2370
- * colors: [ 'red', 'red', 'red' ],
2434
+ * text: 'search',
2371
2435
  * bndbox: BoundingBox {
2372
2436
  * xmin: 900,
2373
2437
  * ymin: 910,
@@ -2379,16 +2443,15 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2379
2443
  * ```
2380
2444
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
2381
2445
  * ```typescript
2382
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
2446
+ * const icons = await aui.get().icon().and().withText('user').exec()
2383
2447
  * console.log(icons)
2384
2448
  * ```
2385
- * The get command returns only the red icon although both icons have the same text
2449
+ * The get command returns only the user icon although both elements are icons
2386
2450
  * ```text
2387
2451
  * console output: [
2388
2452
  * DetectedElement {
2389
2453
  * name: 'ICON',
2390
2454
  * text: 'user',
2391
- * colors: [ 'red', 'red', 'red' ],
2392
2455
  * bndbox: BoundingBox {
2393
2456
  * xmin: 900,
2394
2457
  * ymin: 910,
@@ -2420,6 +2483,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2420
2483
  * // Returns nothing because innerEl is not inside outerEl
2421
2484
  * ...outerEl().in().innerEl()
2422
2485
  * ```
2486
+ * ![](https://docs.askui.com/img/gif/in.gif)
2423
2487
  *
2424
2488
  * @return {FluentFiltersGetter}
2425
2489
  */
@@ -2438,6 +2502,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2438
2502
  * // Returns no element because leftEl is left of rightEl
2439
2503
  * ...leftEl().rightOf().rightEl()
2440
2504
  * ```
2505
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
2441
2506
  *
2442
2507
  * @return {FluentFiltersGetter}
2443
2508
  */
@@ -2456,6 +2521,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2456
2521
  * // Returns no element because rightEl is left of leftEl
2457
2522
  * ...rightEl().leftOf().leftEl()
2458
2523
  * ```
2524
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
2459
2525
  *
2460
2526
  * @return {FluentFiltersGetter}
2461
2527
  */
@@ -2477,6 +2543,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2477
2543
  * // Returns no element because text is above button
2478
2544
  * ...text().below().button()
2479
2545
  * ```
2546
+ * ![](https://docs.askui.com/img/gif/below.gif)
2480
2547
  *
2481
2548
  * @return {FluentFiltersGetter}
2482
2549
  */
@@ -2498,6 +2565,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2498
2565
  * // Returns no element because button is below text
2499
2566
  * ...button().above().text()
2500
2567
  * ```
2568
+ * ![](https://docs.askui.com/img/gif/above.gif)
2501
2569
  *
2502
2570
  * @return {FluentFiltersGetter}
2503
2571
  */
@@ -2523,6 +2591,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2523
2591
  * // Returns button 1 because button 1 is nearer to the text than button 2
2524
2592
  * ...button().nearestTo().text()
2525
2593
  * ```
2594
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
2526
2595
  *
2527
2596
  * @return {FluentFiltersGetter}
2528
2597
  */
@@ -2545,6 +2614,7 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2545
2614
  * // Returns no element because innerEl contains no outerEl
2546
2615
  * ...innerEl().contains().outerEl()
2547
2616
  * ```
2617
+ * ![](https://docs.askui.com/img/gif/contains.gif)
2548
2618
  *
2549
2619
  * @return {FluentFiltersGetter}
2550
2620
  */
@@ -2562,8 +2632,8 @@ export declare abstract class Getter extends FluentCommand {
2562
2632
  * A detected element has the following properties:
2563
2633
  * - `name` of the element
2564
2634
  * - `text` content of element
2565
- * - `colors` of element
2566
2635
  * - `bndbox`: location of element described with coordinates of a bounding box
2636
+ *
2567
2637
  * **Examples:**
2568
2638
  * ```typescript
2569
2639
  * const text = await aui.get().text().withText('Sign').exec();
@@ -2574,7 +2644,6 @@ export declare abstract class Getter extends FluentCommand {
2574
2644
  * DetectedElement {
2575
2645
  * name: 'TEXT',
2576
2646
  * text: 'Sign In',
2577
- * colors: [ 'black', 'gray', 'gray' ],
2578
2647
  * bndbox: BoundingBox {
2579
2648
  * xmin: 1128.2720982142857,
2580
2649
  * ymin: 160.21332310267857,
@@ -2593,8 +2662,8 @@ export declare abstract class Getter extends FluentCommand {
2593
2662
  * A detected element has the following properties:
2594
2663
  * - `name` of the element
2595
2664
  * - `text` content of element
2596
- * - `colors` of element
2597
2665
  * - `bndbox`: location of element described with coordinates of a bounding box
2666
+ *
2598
2667
  * **Examples:**
2599
2668
  * ```typescript
2600
2669
  * const detectedElements = await aui.getAll().exec();
@@ -2605,7 +2674,6 @@ export declare abstract class Getter extends FluentCommand {
2605
2674
  * DetectedElement {
2606
2675
  * name: 'TEXT',
2607
2676
  * text: 'Sign In',
2608
- * colors: [ 'black', 'gray', 'gray' ],
2609
2677
  * bndbox: BoundingBox {
2610
2678
  * xmin: 1128.2720982142857,
2611
2679
  * ymin: 160.21332310267857,
@@ -2615,7 +2683,6 @@ export declare abstract class Getter extends FluentCommand {
2615
2683
  * DetectedElement {
2616
2684
  * name: 'ICON',
2617
2685
  * text: 'search',
2618
- * colors: [ 'black', 'red', 'gray' ],
2619
2686
  * bndbox: BoundingBox {
2620
2687
  * xmin: 250.8204241071428,
2621
2688
  * ymin: 300.21332310267857,