@appium/types 0.2.4 → 0.3.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.
- package/build/driver.d.ts +1 -1
- package/build/index.d.ts +24 -13
- package/build/index.d.ts.map +1 -1
- package/lib/driver.ts +1 -1
- package/lib/index.ts +41 -13
- package/package.json +10 -5
package/build/driver.d.ts
CHANGED
|
@@ -228,7 +228,7 @@ export interface Core {
|
|
|
228
228
|
isW3CProtocol(): boolean;
|
|
229
229
|
isMjsonwpProtocol(): boolean;
|
|
230
230
|
isFeatureEnabled(name: string): boolean;
|
|
231
|
-
|
|
231
|
+
assertFeatureEnabled(name: string): void;
|
|
232
232
|
validateLocatorStrategy(strategy: string, webContext?: boolean): void;
|
|
233
233
|
proxyActive(sessionId?: string): boolean;
|
|
234
234
|
getProxyAvoidList(sessionId?: string): [string, RegExp][];
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Server as WSServer } from 'ws';
|
|
4
|
+
import type { Socket } from 'net';
|
|
3
5
|
import type { Server } from 'http';
|
|
4
6
|
import type { Class as _Class, ConditionalPick, MultidimensionalReadonlyArray } from 'type-fest';
|
|
5
7
|
import { ServerArgs } from './config';
|
|
@@ -41,21 +43,30 @@ export interface AppiumLogger {
|
|
|
41
43
|
* Log prefix, if applicable.
|
|
42
44
|
*/
|
|
43
45
|
prefix?: AppiumLoggerPrefix;
|
|
44
|
-
debug
|
|
45
|
-
info
|
|
46
|
-
warn
|
|
47
|
-
error
|
|
48
|
-
verbose
|
|
49
|
-
silly
|
|
50
|
-
http
|
|
51
|
-
errorAndThrow
|
|
46
|
+
debug(...args: any[]): void;
|
|
47
|
+
info(...args: any[]): void;
|
|
48
|
+
warn(...args: any[]): void;
|
|
49
|
+
error(...args: any[]): void;
|
|
50
|
+
verbose(...args: any[]): void;
|
|
51
|
+
silly(...args: any[]): void;
|
|
52
|
+
http(...args: any[]): void;
|
|
53
|
+
errorAndThrow(...args: any[]): never;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* Appium's slightly-modified {@linkcode Server http.Server}.
|
|
55
57
|
*/
|
|
56
|
-
export declare type AppiumServer = Omit<Server, 'close'> &
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
export declare type AppiumServer = Omit<Server, 'close'> & AppiumServerExtension;
|
|
59
|
+
export interface AppiumServerExtension {
|
|
60
|
+
close(): Promise<void>;
|
|
61
|
+
addWebSocketHandler(handlerPathname: string, handlerServer: WSServer): Promise<void>;
|
|
62
|
+
removeWebSocketHandler(handlerPathname: string): Promise<boolean>;
|
|
63
|
+
removeAllWebSocketHandlers(): Promise<boolean>;
|
|
64
|
+
getWebSocketHandlers(keysFilter: string | null | undefined): Promise<Record<string, WSServer>>;
|
|
65
|
+
webSocketsMapping: Record<string, WSServer>;
|
|
66
|
+
}
|
|
67
|
+
export interface AppiumServerSocket extends Socket {
|
|
68
|
+
_openReqCount: number;
|
|
69
|
+
}
|
|
59
70
|
/**
|
|
60
71
|
* The definition of an extension method, which will be provided via Appium's API.
|
|
61
72
|
*
|
|
@@ -132,5 +143,5 @@ export declare type UpdateServerCallback = (expressApp: Express, httpServer: App
|
|
|
132
143
|
*
|
|
133
144
|
* @see https://npm.im/axios
|
|
134
145
|
*/
|
|
135
|
-
export declare type HTTPMethod =
|
|
146
|
+
export declare type HTTPMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
136
147
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"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,OAAO,EAAE,GAAG,GAAG,EAAE,IAC5B,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,aAAa,CAAC;AAExC;;GAEG;AACH,oBAAY,UAAU,GAAG,QAAQ,CAAC;AAElC;;;GAGG;AACH,oBAAY,UAAU,GAAG,QAAQ,CAAC;AAElC;;GAEG;AACH,oBAAY,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,oBAAY,oBAAoB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpG;;;;GAIG;AACH,oBAAY,UAAU,GAClB,KAAK,GAAG,KAAK,GACb,QAAQ,GAAG,QAAQ,GACnB,MAAM,GAAG,MAAM,GACf,SAAS,GAAG,SAAS,GACrB,MAAM,GAAG,MAAM,GACf,KAAK,GAAG,KAAK,GACb,OAAO,GAAG,OAAO,GACjB,OAAO,GAAG,OAAO,GACjB,MAAM,GAAG,MAAM,GACf,QAAQ,GAAG,QAAQ,CAAC"}
|
package/lib/driver.ts
CHANGED
|
@@ -303,7 +303,7 @@ export interface Core {
|
|
|
303
303
|
isW3CProtocol(): boolean;
|
|
304
304
|
isMjsonwpProtocol(): boolean;
|
|
305
305
|
isFeatureEnabled(name: string): boolean;
|
|
306
|
-
|
|
306
|
+
assertFeatureEnabled(name: string): void;
|
|
307
307
|
validateLocatorStrategy(strategy: string, webContext?: boolean): void;
|
|
308
308
|
proxyActive(sessionId?: string): boolean;
|
|
309
309
|
getProxyAvoidList(sessionId?: string): [string, RegExp][];
|
package/lib/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {Server as WSServer} from 'ws';
|
|
2
|
+
import type {Socket} from 'net';
|
|
2
3
|
import type {Server} from 'http';
|
|
3
4
|
import type {Class as _Class, ConditionalPick, MultidimensionalReadonlyArray} from 'type-fest';
|
|
4
5
|
import {ServerArgs} from './config';
|
|
@@ -44,22 +45,38 @@ export interface AppiumLogger {
|
|
|
44
45
|
* Log prefix, if applicable.
|
|
45
46
|
*/
|
|
46
47
|
prefix?: AppiumLoggerPrefix;
|
|
47
|
-
debug
|
|
48
|
-
info
|
|
49
|
-
warn
|
|
50
|
-
error
|
|
51
|
-
verbose
|
|
52
|
-
silly
|
|
53
|
-
http
|
|
54
|
-
errorAndThrow
|
|
48
|
+
debug(...args: any[]): void;
|
|
49
|
+
info(...args: any[]): void;
|
|
50
|
+
warn(...args: any[]): void;
|
|
51
|
+
error(...args: any[]): void;
|
|
52
|
+
verbose(...args: any[]): void;
|
|
53
|
+
silly(...args: any[]): void;
|
|
54
|
+
http(...args: any[]): void;
|
|
55
|
+
errorAndThrow(...args: any[]): never;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* Appium's slightly-modified {@linkcode Server http.Server}.
|
|
59
60
|
*/
|
|
60
|
-
export type AppiumServer = Omit<Server, 'close'> &
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
export type AppiumServer = Omit<Server, 'close'> & AppiumServerExtension;
|
|
62
|
+
|
|
63
|
+
export interface AppiumServerExtension {
|
|
64
|
+
close(): Promise<void>;
|
|
65
|
+
addWebSocketHandler(
|
|
66
|
+
handlerPathname: string,
|
|
67
|
+
handlerServer: WSServer
|
|
68
|
+
): Promise<void>;
|
|
69
|
+
removeWebSocketHandler(handlerPathname: string): Promise<boolean>;
|
|
70
|
+
removeAllWebSocketHandlers(): Promise<boolean>;
|
|
71
|
+
getWebSocketHandlers(
|
|
72
|
+
keysFilter: string | null | undefined
|
|
73
|
+
): Promise<Record<string, WSServer>>;
|
|
74
|
+
webSocketsMapping: Record<string, WSServer>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface AppiumServerSocket extends Socket {
|
|
78
|
+
_openReqCount: number;
|
|
79
|
+
}
|
|
63
80
|
|
|
64
81
|
/**
|
|
65
82
|
* The definition of an extension method, which will be provided via Appium's API.
|
|
@@ -152,4 +169,15 @@ export type UpdateServerCallback = (expressApp: Express, httpServer: AppiumServe
|
|
|
152
169
|
*
|
|
153
170
|
* @see https://npm.im/axios
|
|
154
171
|
*/
|
|
155
|
-
export type HTTPMethod =
|
|
172
|
+
export type HTTPMethod =
|
|
173
|
+
| 'get' | 'GET'
|
|
174
|
+
| 'delete' | 'DELETE'
|
|
175
|
+
| 'head' | 'HEAD'
|
|
176
|
+
| 'options' | 'OPTIONS'
|
|
177
|
+
| 'post' | 'POST'
|
|
178
|
+
| 'put' | 'PUT'
|
|
179
|
+
| 'patch' | 'PATCH'
|
|
180
|
+
| 'purge' | 'PURGE'
|
|
181
|
+
| 'link' | 'LINK'
|
|
182
|
+
| 'unlink' | 'UNLINK';
|
|
183
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Various type declarations used across Appium",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"appium",
|
|
@@ -28,17 +28,22 @@
|
|
|
28
28
|
"dev": "npm run build -- --watch",
|
|
29
29
|
"fix": "npm run lint -- --fix",
|
|
30
30
|
"lint": "eslint -c ../../.eslintrc --ignore-path ../../.eslintignore .",
|
|
31
|
-
"prepare": "npm run build"
|
|
31
|
+
"prepare": "npm run build",
|
|
32
|
+
"test:smoke": "echo 'No smoke test for this package'"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@appium/schema": "^0.0.
|
|
35
|
+
"@appium/schema": "^0.0.9",
|
|
36
|
+
"@types/express": "4.17.13",
|
|
37
|
+
"@types/npmlog": "4.1.4",
|
|
38
|
+
"@wdio/types": "7.20.7",
|
|
39
|
+
"type-fest": "2.18.0"
|
|
35
40
|
},
|
|
36
41
|
"engines": {
|
|
37
42
|
"node": ">=14",
|
|
38
|
-
"npm": ">=
|
|
43
|
+
"npm": ">=8"
|
|
39
44
|
},
|
|
40
45
|
"publishConfig": {
|
|
41
46
|
"access": "public"
|
|
42
47
|
},
|
|
43
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "500c08f3929b1dd531d119872d11cea59d417eb7"
|
|
44
49
|
}
|