@appium/types 0.6.0 → 0.8.3

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/plugin.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {MethodMap, UpdateServerCallback, Class, AppiumLogger, PluginType} from '.';
1
+ import {MethodMap, UpdateServerCallback, Class, AppiumLogger} from '.';
2
2
  import {Driver, ExternalDriver} from './driver';
3
3
 
4
4
  /**
@@ -70,19 +70,21 @@ export interface Plugin {
70
70
  * for managing new command timeouts and command logging, for example:
71
71
  * `driver.stopNewCommandTimeout()` -- before running plugin logic
72
72
  * `driver.startNewCommandTimeout()` -- after running plugin logic
73
- * `driver._eventHistory.commands.push({cmd: cmdName, startTime, endTime}) --
73
+ * `driver._eventHistory.commands.push({cmd: cmdName, startTime, endTime})` --
74
74
  * after running plugin logic
75
75
  */
76
76
  export type NextPluginCallback = () => Promise<void>;
77
77
 
78
78
  /**
79
79
  * Implementation of a command within a plugin
80
+ *
81
+ * At minimum, `D` must be `ExternalDriver`, but a plugin can be more narrow about which drivers it supports.
80
82
  */
81
- export type PluginCommand<TArgs = any> = (
82
- next: NextPluginCallback,
83
- driver: ExternalDriver,
84
- ...args: TArgs[]
85
- ) => Promise<void>;
83
+ export type PluginCommand<
84
+ D extends ExternalDriver = ExternalDriver,
85
+ TArgs extends readonly any[] = any[],
86
+ TReturn = any
87
+ > = (next: NextPluginCallback, driver: D, ...args: TArgs) => Promise<TReturn>;
86
88
 
87
89
  /**
88
90
  * Mainly for internal use.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appium/types",
3
- "version": "0.6.0",
3
+ "version": "0.8.3",
4
4
  "description": "Various type declarations used across Appium",
5
5
  "keywords": [
6
6
  "automation",
@@ -27,7 +27,8 @@
27
27
  "files": [
28
28
  "build",
29
29
  "lib",
30
- "index.js"
30
+ "index.js",
31
+ "tsconfig.json"
31
32
  ],
32
33
  "scripts": {
33
34
  "build": "node ./scripts/generate-schema-types.js",
@@ -35,12 +36,13 @@
35
36
  "test:smoke": "node ./index.js"
36
37
  },
37
38
  "dependencies": {
38
- "@appium/schema": "^0.1.0",
39
- "@types/express": "4.17.14",
39
+ "@appium/schema": "^0.2.3",
40
+ "@appium/tsconfig": "^0.2.3",
41
+ "@types/express": "4.17.15",
40
42
  "@types/npmlog": "4.1.4",
41
- "@types/ws": "8.5.3",
43
+ "@types/ws": "8.5.4",
42
44
  "@wdio/types": "7.26.0",
43
- "type-fest": "3.3.0"
45
+ "type-fest": "3.5.1"
44
46
  },
45
47
  "engines": {
46
48
  "node": "^14.17.0 || ^16.13.0 || >=18.0.0",
@@ -49,7 +51,7 @@
49
51
  "publishConfig": {
50
52
  "access": "public"
51
53
  },
52
- "gitHead": "0823f0b60e40395cd1dc3b72cfa3c0092bc81302",
54
+ "gitHead": "67c9bdfbceeb049aa134bf1d9b107543ff0a80b0",
53
55
  "typedoc": {
54
56
  "entryPoint": "./lib/index.ts"
55
57
  }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@appium/tsconfig/tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "build",
5
+ "checkJs": true,
6
+ "strict": true,
7
+ "paths": {
8
+ "@appium/schema": ["../schema"]
9
+ }
10
+ },
11
+ "include": ["lib"],
12
+ "references": [{"path": "../schema"}]
13
+ }