@appium/types 0.26.0 → 1.0.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.
package/lib/driver.ts CHANGED
@@ -35,8 +35,8 @@ export interface ITimeoutCommands {
35
35
  * @param implicit - the number in ms for the implicit wait timeout, used for the W3C command
36
36
  */
37
37
  timeouts(
38
- type: string,
39
- ms: number | string,
38
+ type?: string,
39
+ ms?: number | string,
40
40
  script?: number,
41
41
  pageLoad?: number,
42
42
  implicit?: number | string,
@@ -49,16 +49,6 @@ export interface ITimeoutCommands {
49
49
  */
50
50
  setNewCommandTimeout(ms: number): void;
51
51
 
52
- /**
53
- * Set the implicit wait timeout
54
- *
55
- * @param ms - the timeout in ms
56
- *
57
- * @deprecated Use `timeouts` instead
58
- *
59
- */
60
- implicitWait(ms: number | string): Promise<void>;
61
-
62
52
  /**
63
53
  * A helper method (not a command) used to set the implicit wait value
64
54
  *
@@ -90,14 +80,6 @@ export interface ITimeoutCommands {
90
80
  */
91
81
  implicitWaitW3C(ms: number): Promise<void>;
92
82
 
93
- /**
94
- * Set the implicit wait value that was sent in via the JSONWP
95
- *
96
- * @param ms - the timeout in ms
97
- * @deprecated
98
- */
99
- implicitWaitMJSONWP(ms: number): Promise<void>;
100
-
101
83
  /**
102
84
  * Set the page load timeout value that was sent in via the W3C protocol
103
85
  *
@@ -105,14 +87,6 @@ export interface ITimeoutCommands {
105
87
  */
106
88
  pageLoadTimeoutW3C(ms: number): Promise<void>;
107
89
 
108
- /**
109
- * Set the page load timeout value that was sent in via the JSONWP
110
- *
111
- * @param ms - the timeout in ms
112
- * @deprecated
113
- */
114
- pageLoadTimeoutMJSONWP(ms: number): Promise<void>;
115
-
116
90
  /**
117
91
  * Set the script timeout value that was sent in via the W3C protocol
118
92
  *
@@ -120,14 +94,6 @@ export interface ITimeoutCommands {
120
94
  */
121
95
  scriptTimeoutW3C(ms: number): Promise<void>;
122
96
 
123
- /**
124
- * Set the script timeout value that was sent in via the JSONWP
125
- *
126
- * @param ms - the timeout in ms
127
- * @deprecated
128
- */
129
- scriptTimeoutMJSONWP(ms: number): Promise<void>;
130
-
131
97
  /**
132
98
  * Set Appium's new command timeout
133
99
  *
@@ -183,16 +149,6 @@ export interface IExecuteCommands {
183
149
  ): Promise<TReturn>;
184
150
  }
185
151
 
186
- /**
187
- * Data returned by {@linkcode ISessionHandler.getSessions}.
188
- *
189
- * @typeParam C - The driver's constraints
190
- */
191
- export interface MultiSessionData<C extends Constraints = Constraints> {
192
- id: string;
193
- capabilities: DriverCaps<C>;
194
- }
195
-
196
152
  /**
197
153
  * Data returned by `AppiumDriver.getAppiumSessions`
198
154
  *
@@ -485,13 +441,6 @@ export interface ISessionHandler<
485
441
  */
486
442
  deleteSession(sessionId?: string, driverData?: DriverData[]): Promise<DeleteResult | void>;
487
443
 
488
- /**
489
- * Get data for all sessions running on an Appium server
490
- *
491
- * @returns A list of session data objects
492
- */
493
- getSessions(): Promise<MultiSessionData[]>;
494
-
495
444
  /**
496
445
  * Get the data for the current session
497
446
  *
@@ -646,10 +595,6 @@ export interface Core<C extends Constraints, Settings extends StringRecord = Str
646
595
  isCommandsQueueEnabled: boolean;
647
596
  eventHistory: EventHistory;
648
597
  bidiEventSubs: Record<string, string[]>;
649
- /**
650
- * @deprecated Drivers no longer need to opt into BiDi support explicitly
651
- */
652
- doesSupportBidi?: boolean;
653
598
  updateBidiCommands(cmds: BidiModuleMap): void;
654
599
  onUnexpectedShutdown(handler: () => any): void;
655
600
  /**
@@ -747,6 +692,19 @@ export interface Driver<
747
692
  */
748
693
  executeCommand(cmd: string, ...args: any[]): Promise<any>;
749
694
 
695
+
696
+ /**
697
+ * A helper method to modify the command name before it's logged.
698
+ *
699
+ * Useful for resolving generic commands like 'execute' to a more specific
700
+ * name based on arguments (e.g., identifying custom extensions).
701
+ *
702
+ * @param cmd - The original command name
703
+ * @param args - Arguments passed to the command
704
+ * @returns A potentially updated command name
705
+ */
706
+ clarifyCommandName?(cmd: string, args: string[]): string;
707
+
750
708
  /** Execute a driver (WebDriver Bidi protocol) command by its name as defined in the bidi commands file
751
709
  * @param bidiCmd - the name of the command in the bidi spec
752
710
  * @param args - arguments to pass to the command
@@ -767,14 +725,6 @@ export interface Driver<
767
725
  */
768
726
  startNewCommandTimeout(): Promise<void>;
769
727
 
770
- /**
771
- * Reset the current session (run the delete session and create session subroutines)
772
- *
773
- * @deprecated Use explicit session management commands instead
774
- * @privateRemarks This is implemented by `BaseDriver` and is used within `@appium/driver-test-support`
775
- */
776
- reset(): Promise<void>;
777
-
778
728
  /**
779
729
  * The processed capabilities used to start the session represented by the current driver instance
780
730
  */
@@ -1284,163 +1234,6 @@ export interface ExternalDriver<
1284
1234
  */
1285
1235
  getDeviceTime?(format?: string): Promise<string>;
1286
1236
 
1287
- /**
1288
- * List the performance data types supported by this driver, which can be used in a call to get
1289
- * the performance data by type.
1290
- *
1291
- * @returns The list of types
1292
- *
1293
- * @deprecated
1294
- */
1295
- getPerformanceDataTypes?(): Promise<string[]>;
1296
-
1297
- /**
1298
- * Get the list of performance data associated with a given type
1299
- *
1300
- * @param packageName - the package name / id of the app to retrieve data for
1301
- * @param dataType - the performance data type; one of those retrieved in a call to
1302
- * getPerformanceDataTypes
1303
- * @param dataReadTimeout - how long to wait for data before timing out
1304
- *
1305
- * @returns A list of performance data strings
1306
- *
1307
- * @deprecated
1308
- */
1309
- getPerformanceData?(
1310
- packageName: string,
1311
- dataType: string,
1312
- dataReadTimeout?: number,
1313
- ): Promise<any>;
1314
-
1315
- /**
1316
- * Press a device hardware key by its code for the default duration
1317
- *
1318
- * @param keycode - the keycode
1319
- * @param metastate - the code denoting the simultaneous pressing of any meta keys (shift etc)
1320
- * @param flags - the code denoting the combination of extra flags
1321
- *
1322
- * @deprecated
1323
- */
1324
- pressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
1325
-
1326
- /**
1327
- * Press a device hardware key by its code for a longer duration
1328
- *
1329
- * @param keycode - the keycode
1330
- * @param metastate - the code denoting the simultaneous pressing of any meta keys (shift etc)
1331
- * @param flags - the code denoting the combination of extra flags
1332
- *
1333
- * @deprecated
1334
- *
1335
- */
1336
- longPressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
1337
-
1338
- /**
1339
- * Apply a synthetic fingerprint to the fingerprint detector of the device
1340
- *
1341
- * @param fingerprintId - the numeric ID of the fingerprint to use
1342
- *
1343
- * @deprecated
1344
- */
1345
- fingerprint?(fingerprintId: number): Promise<void>;
1346
-
1347
- /**
1348
- * Simulate sending an SMS message from a certain phone number to the device
1349
- *
1350
- * @param phoneNumber - the number to pretend the message is from
1351
- * @param message - the SMS text
1352
- *
1353
- * @deprecated
1354
- */
1355
- sendSMS?(phoneNumber: string, message: string): Promise<void>;
1356
-
1357
- /**
1358
- * Simulate triggering a phone call from a phone number and having the device take an action in
1359
- * response
1360
- *
1361
- * @param phoneNumber - the number to pretend the call is from
1362
- * @param action - the action to take in response (accept, reject, etc...)
1363
- *
1364
- * @deprecated
1365
- */
1366
- gsmCall?(phoneNumber: string, action: string): Promise<void>;
1367
-
1368
- /**
1369
- * Simulate setting the GSM signal strength for a cell phone
1370
- *
1371
- * @param singalStrength - the strength in a driver-appropriate string
1372
- *
1373
- * @deprecated
1374
- */
1375
- gsmSignal?(signalStrength: string | number): Promise<void>;
1376
-
1377
- /**
1378
- * Do something with GSM voice (unclear; this should not be implemented anywhere)
1379
- *
1380
- * @param state - the state
1381
- *
1382
- * @deprecated
1383
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1384
- */
1385
- gsmVoice?(state: string): Promise<void>;
1386
-
1387
- /**
1388
- * Set the simulated power capacity of the device
1389
- *
1390
- * @param percent - how full the battery should become
1391
- *
1392
- * @deprecated
1393
- */
1394
- powerCapacity?(percent: number): Promise<void>;
1395
-
1396
- /**
1397
- * Set the AC-connected power state of the device
1398
- *
1399
- * @param state - whether the device is connected to power or not
1400
- *
1401
- * @deprecated
1402
- */
1403
- powerAC?(state: string): Promise<void>;
1404
-
1405
- /**
1406
- * Set the network speed of the device
1407
- *
1408
- * @param netspeed - the speed as a string, like '3G'
1409
- *
1410
- * @deprecated
1411
- */
1412
- networkSpeed?(netspeed: string): Promise<void>;
1413
-
1414
- /**
1415
- * Simulate a keyevent on the device
1416
- *
1417
- * @param keycode - the manufacturer defined keycode
1418
- * @param metastate - the combination of meta startUnexpectedShutdown
1419
- *
1420
- * @deprecated
1421
- */
1422
- keyevent?(keycode: string | number, metastate?: string | number): Promise<void>;
1423
-
1424
- /**
1425
- * Get the current activity name
1426
- *
1427
- * @returns The activity name
1428
- *
1429
- * @deprecated
1430
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1431
- */
1432
- getCurrentActivity?(): Promise<string>;
1433
-
1434
- /**
1435
- * Get the current active app package name/id
1436
- *
1437
- * @returns The package name
1438
- *
1439
- * @deprecated
1440
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1441
- */
1442
- getCurrentPackage?(): Promise<string>;
1443
-
1444
1237
  /**
1445
1238
  * Install an app on a device
1446
1239
  *
@@ -1543,174 +1336,6 @@ export interface ExternalDriver<
1543
1336
  */
1544
1337
  pullFolder?(path: string): Promise<string>;
1545
1338
 
1546
- /**
1547
- * Toggle airplane/flight mode for the device
1548
- *
1549
- * @deprecated
1550
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1551
- */
1552
- toggleFlightMode?(): Promise<void>;
1553
-
1554
- /**
1555
- * Toggle cell network data
1556
- *
1557
- * @deprecated
1558
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1559
- */
1560
- toggleData?(): Promise<void>;
1561
-
1562
- /**
1563
- * Toggle WiFi radio status
1564
- *
1565
- * @deprecated
1566
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1567
- */
1568
- toggleWiFi?(): Promise<void>;
1569
-
1570
- /**
1571
- * Toggle location services for the device
1572
- *
1573
- * @deprecated
1574
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1575
- */
1576
- toggleLocationServices?(): Promise<void>;
1577
-
1578
- /**
1579
- * Open the notifications shade/screen
1580
- *
1581
- * @deprecated
1582
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1583
- */
1584
- openNotifications?(): Promise<void>;
1585
-
1586
- /**
1587
- * Start an Android activity within an app
1588
- *
1589
- * @param appPackage - the app package id
1590
- * @param appActivity - the activity name
1591
- * @param appWaitPackage - the package id to wait for if different from the app package
1592
- * @param appWaitActivity - the activity name to wait for being active if different from
1593
- * appActivity
1594
- * @param intentAction - the action for the intent to use to start the activity
1595
- * @param intentCategory - the category for the intent
1596
- * @param flags - the flags for the intent
1597
- * @param optionalIntentArguments - additional arguments to be passed to launching the intent
1598
- * @param dontStopAppOnReset - set to true to not stop the current app before launching the
1599
- * activity
1600
- *
1601
- * @deprecated
1602
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1603
- */
1604
- startActivity?(
1605
- appPackage: string,
1606
- appActivity: string,
1607
- appWaitPackage?: string,
1608
- appWaitActivity?: string,
1609
- intentAction?: string,
1610
- intentCategory?: string,
1611
- intentFlags?: string,
1612
- optionalIntentArguments?: string,
1613
- dontStopAppOnReset?: boolean,
1614
- ): Promise<void>;
1615
-
1616
- /**
1617
- * Get information from the system bars of a device
1618
- *
1619
- * @returns An array of information objects of driver-specific shape
1620
- *
1621
- * @deprecated
1622
- */
1623
- getSystemBars?(): Promise<unknown>;
1624
-
1625
- /**
1626
- * Get the display's pixel density
1627
- *
1628
- * @returns The density
1629
- *
1630
- * @deprecated
1631
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1632
- */
1633
- getDisplayDensity?(): Promise<number>;
1634
-
1635
- /**
1636
- * End platform-specific code coverage tracing
1637
- *
1638
- * @param intent - the Android intent for the coverage activity
1639
- * @param path - the path to place the results
1640
- *
1641
- * @deprecated
1642
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1643
- */
1644
- endCoverage?(intent: string, path: string): Promise<void>;
1645
-
1646
- /**
1647
- * Set the value of a text field but ensure the current value is replace and not appended
1648
- *
1649
- * @param value - the text to set
1650
- * @param elementId - the element to set it in
1651
- *
1652
- * @deprecated
1653
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1654
- */
1655
- replaceValue?(value: string, elementId: string): Promise<void>;
1656
-
1657
- // JSONWP
1658
- /**
1659
- * Check whether two elements are identical
1660
- *
1661
- * @param elementId - the first element's ID
1662
- * @param otherElementId - the second element's ID
1663
- *
1664
- * @returns True if the elements are equal, false otherwise
1665
- *
1666
- * @deprecated
1667
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1668
- */
1669
- equalsElement?(elementId: string, otherElementId: string): Promise<boolean>;
1670
- /**
1671
- * Get the list of IME engines
1672
- *
1673
- * @returns The list of IME engines
1674
- *
1675
- * @deprecated
1676
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1677
- */
1678
- availableIMEEngines?(): Promise<string[]>;
1679
-
1680
- /**
1681
- * Get the active IME engine
1682
- *
1683
- * @returns The name of the active engine
1684
- *
1685
- * @deprecated
1686
- */
1687
- getActiveIMEEngine?(): Promise<string>;
1688
-
1689
- /**
1690
- * Determine whether an IME is active
1691
- *
1692
- * @returns True if the IME is activated
1693
- *
1694
- * @deprecated
1695
- */
1696
- isIMEActivated?(): Promise<boolean>;
1697
-
1698
- /**
1699
- * Deactivate an IME engine
1700
- *
1701
- * @deprecated
1702
- */
1703
- deactivateIMEEngine?(): Promise<void>;
1704
-
1705
- /**
1706
- * Activate an IME engine
1707
- *
1708
- * @param engine - the name of the engine
1709
- *
1710
- * @deprecated
1711
- */
1712
- activateIMEEngine?(engine: string): Promise<void>;
1713
-
1714
1339
  /**
1715
1340
  * Get the device orientation
1716
1341
  *
@@ -1725,105 +1350,6 @@ export interface ExternalDriver<
1725
1350
  */
1726
1351
  setOrientation?(orientation: string): Promise<void>;
1727
1352
 
1728
- /**
1729
- * Trigger a mouse button down
1730
- *
1731
- * @param button - the button ID
1732
- *
1733
- * @deprecated Use the Actions API instead
1734
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1735
- */
1736
- buttonDown?(button?: number): Promise<void>;
1737
-
1738
- /**
1739
- * Trigger a mouse button up
1740
- *
1741
- * @param button - the button ID
1742
- *
1743
- * @deprecated Use the Actions API instead
1744
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1745
- */
1746
- buttonUp?(button?: number): Promise<void>;
1747
-
1748
- /**
1749
- * Click the current mouse location
1750
- *
1751
- * @param button - the button ID
1752
- *
1753
- * @deprecated Use the Actions API instead
1754
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1755
- */
1756
- clickCurrent?(button?: number): Promise<void>;
1757
-
1758
- /**
1759
- * Double-click the current mouse location
1760
- *
1761
- * @deprecated Use the Actions API instead
1762
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1763
- */
1764
- doubleClick?(): Promise<void>;
1765
-
1766
- /**
1767
- * Perform a touch down event at the location specified
1768
- *
1769
- * @param x - the x coordinate
1770
- * @param y - the y coordinate
1771
- *
1772
- * @deprecated Use the Actions API instead
1773
- */
1774
- touchDown?(element: string, x: number, y: number): Promise<void>;
1775
-
1776
- /**
1777
- * Perform a touch up event at the location specified
1778
- *
1779
- * @param x - the x coordinate
1780
- * @param y - the y coordinate
1781
- *
1782
- * @deprecated Use the Actions API instead
1783
- */
1784
- touchUp?(element: string, x: number, y: number): Promise<void>;
1785
-
1786
- /**
1787
- * Perform a touch move event at the location specified
1788
- *
1789
- * @param x - the x coordinate
1790
- * @param y - the y coordinate
1791
- *
1792
- * @deprecated Use the Actions API instead
1793
- */
1794
- touchMove?(element: string, x: number, y: number): Promise<void>;
1795
-
1796
- /**
1797
- * Perform a long touch down event at the location specified
1798
- *
1799
- * @param elementId - the id of the element to long touch
1800
- *
1801
- * @deprecated Use the Actions API instead
1802
- */
1803
- touchLongClick?(element: string, x: number, y: number, duration: number): Promise<void>;
1804
-
1805
- /**
1806
- * Perform a flick event at the location specified
1807
- *
1808
- * @param element - the element to make coordinates relative to
1809
- * @param xSpeed - the horizontal flick speed (in driver-specific units)
1810
- * @param ySpeed - the vertical flick speed (in driver-specific units)
1811
- * @param xOffset - the x coordinate
1812
- * @param yOffset - the y coordinate
1813
- * @param speed - the speed (unclear how this relates to xSpeed and ySpeed)
1814
- *
1815
- * @deprecated Use the Actions API instead
1816
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1817
- */
1818
- flick?(
1819
- element?: string,
1820
- xSpeed?: number,
1821
- ySpeed?: number,
1822
- xOffset?: number,
1823
- yOffset?: number,
1824
- speed?: number,
1825
- ): Promise<void>;
1826
-
1827
1353
  /**
1828
1354
  * Get the virtual or real geographical location of a device
1829
1355
  *
@@ -1865,18 +1391,6 @@ export interface ExternalDriver<
1865
1391
  */
1866
1392
  getContexts?(): Promise<Ctx[]>;
1867
1393
 
1868
- /**
1869
- * Get the index of an element on the page
1870
- *
1871
- * @param elementId - the element id
1872
- *
1873
- * @returns The page index
1874
- *
1875
- * @deprecated
1876
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1877
- */
1878
- getPageIndex?(elementId: string): Promise<string>;
1879
-
1880
1394
  /**
1881
1395
  * Get the network connection state of a device
1882
1396
  * @see {@link https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes}
package/lib/server.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type {Express} from 'express';
2
2
  import type {Server as WSServer} from 'ws';
3
3
  import type {Server as HTTPServer} from 'node:http';
4
- import type {Socket} from 'node:net';
5
4
  import {ServerArgs} from './config';
6
5
 
7
6
  /**
@@ -49,13 +48,6 @@ export interface AppiumServerExtension {
49
48
  isSecure(): boolean;
50
49
  }
51
50
 
52
- /**
53
- * @deprecated This interface will be removed
54
- */
55
- export interface AppiumServerSocket extends Socket {
56
- _openReqCount: number;
57
- }
58
-
59
51
  export {WSServer};
60
52
 
61
53
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appium/types",
3
- "version": "0.26.0",
3
+ "version": "1.0.0",
4
4
  "description": "Various type declarations used across Appium",
5
5
  "keywords": [
6
6
  "automation",
@@ -38,17 +38,17 @@
38
38
  "test:types": "tsd"
39
39
  },
40
40
  "dependencies": {
41
- "@appium/logger": "^1.7.1",
42
- "@appium/schema": "^0.8.1",
43
- "@appium/tsconfig": "^0.3.5",
41
+ "@appium/logger": "^2.0.0",
42
+ "@appium/schema": "^1.0.0",
43
+ "@appium/tsconfig": "^1.0.0",
44
44
  "type-fest": "4.41.0"
45
45
  },
46
46
  "engines": {
47
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0",
48
- "npm": ">=8"
47
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
48
+ "npm": ">=10"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "c8fe4412525f7e1fa237813cf83fe7d98f0125eb"
53
+ "gitHead": "284da50353921343fa5a7f82574e64ce0c146db7"
54
54
  }