@appium/base-driver 8.1.0 → 8.1.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 (2) hide show
  1. package/index.d.ts +121 -0
  2. package/package.json +3 -2
package/index.d.ts ADDED
@@ -0,0 +1,121 @@
1
+ import { W3C_ELEMENT_KEY } from './lib/protocol/helpers'
2
+
3
+ declare class BaseDriver {
4
+ // class variables
5
+ static baseVersion: string;
6
+ static get argsConstraints(): {};
7
+
8
+ constructor(opts?: {}, shouldValidateCaps?: boolean);
9
+
10
+ // fields
11
+ sessionId: string;
12
+ opts: DriverOpts;
13
+ initialOpts: DriverOpts;
14
+ caps?: {};
15
+ originalCaps?: {};
16
+ helpers: DriverHelpers;
17
+ basePath: string;
18
+ relaxedSecurityEnabled: boolean;
19
+ allowInsecure: string[];
20
+ denyInsecure: string[];
21
+ newCommandTimeoutMs: number;
22
+ implicitWaitMs: number;
23
+ locatorStrategies: string[];
24
+ webLocatorStrategies: string[];
25
+ settings: DeviceSettings;
26
+ protocol?: string;
27
+ supportedLogTypes: {[type: string]: LogType};
28
+
29
+ // getters/setters
30
+ get driverData(): {};
31
+ get isCommandsQueueEnabled(): boolean;
32
+ get eventHistory(): {};
33
+ get desiredCapConstraints(): {};
34
+
35
+ set desiredCapConstraints(constraints: {});
36
+
37
+ // non-command methods
38
+ onUnexpectedShutdown(handler: () => any): void;
39
+ logEvent(eventName: string): void;
40
+ getStatus(): Promise<{}>;
41
+ sessionExists(sessionId: string): boolean;
42
+ logExtraCaps(caps: {}): void;
43
+ validateDesiredCaps(caps: {}): boolean;
44
+ isFeatureEnabled(name: string): boolean;
45
+ ensureFeatureEnabled(name: string): void;
46
+ executeCommand(cmd: string, ...args: any[]): Promise<any>;
47
+ startUnexpectedShutdown(err?: Error): Promise<void>;
48
+ validateLocatorStrategy(strategy: string, webContext?: boolean): void;
49
+ reset(): Promise<void>;
50
+ proxyActive(): boolean;
51
+ getProxyAvoidList(): [string, RegExp][];
52
+ canProxy(): boolean;
53
+ proxyRouteIsAvoided(sessionId: string, method: string, url: string): boolean;
54
+ addManagedDriver(driver: BaseDriver): void;
55
+ getManagedDrivers(): BaseDriver[];
56
+ clearNewCommandTimeout(): Promise<void>;
57
+ startNewCommandTimeout(): Promise<void>;
58
+ implicitWaitForCondition(condition: () => Promise<any>): Promise<any>;
59
+
60
+ // commands
61
+ createSession(jwpCaps: {}, jwpReqCaps: {}, w3cCaps: {}): Promise<[string, {}]>;
62
+ getSessions(): Promise<{id: string, capabilities: {}}>
63
+ getSession(): Promise<{}>
64
+ deleteSession(): Promise<void>;
65
+ getSettings(): Promise<DeviceSettings>;
66
+ updateSettings(newSettings: {}): Promise<DeviceSettings>;
67
+ logCustomEvent(vendor: string, event: string): void;
68
+ getLogEvents(type?: string | string[]): {};
69
+ executeDriverScript(script: string, scriptType: string, timeout: number): Promise<{}>;
70
+ findElement(strategy: string, selector: string): Promise<Element>;
71
+ findElements(strategy: string, selector: string): Promise<Element[]>;
72
+
73
+ findElementFromElement(strategy: string, selector: string, elementId: string): Promise<Element>;
74
+ findElementsFromElement(strategy: string, selector: string, elementId: string): Promise<Element[]>;
75
+ findElOrEls(strategy: string, selector: string, mult: boolean, context: string): Promise<Element>;
76
+ getLogTypes(): Promise<string[]>
77
+ getLog(logType: string): Promise<{}[]>
78
+ timeouts(type: string, ms: number, script: number, pageLoad: number, implicit: number): Promise<void>;
79
+ getTimeouts(): Promise<{command: number, implicit: number}>;
80
+ implicitWait(ms: number): Promise<void>;
81
+ newCommandTimeout(ms: number): Promise<void>;
82
+ }
83
+
84
+ declare type DriverOpts = {
85
+ tmpDir: string
86
+ [key: string]: any
87
+ }
88
+
89
+ declare type Element = {
90
+ 'element-6066-11e4-a52e-4f735466cecf': string
91
+ }
92
+
93
+ declare interface DriverHelpers {
94
+ configureApp: (
95
+ app: string,
96
+ supportedAppExtensions: string[]
97
+ ) => Promise<string>;
98
+ isPackageOrBundle: (app: string) => boolean;
99
+ duplicateKeys: <T>(
100
+ input: T,
101
+ firstKey: string,
102
+ secondKey: string
103
+ ) => T;
104
+ parseCapsArray: (cap: string|string[]) => string[]
105
+ }
106
+
107
+ declare type SettingsUpdater = (prop: string, newValue: {}, curValue: {}) => Promise<void>;
108
+
109
+ declare class DeviceSettings {
110
+ constructor(defaultSettings: {}, onSettingsUpdate: SettingsUpdater);
111
+ update(newSettings: {}): Promise<void>;
112
+ getSettings(): DeviceSettings;
113
+ }
114
+
115
+ declare type LogType = {
116
+ description: string
117
+ getter: (driver: BaseDriver) => Promise<{}[]>
118
+ }
119
+
120
+ export { BaseDriver, DriverHelpers, DriverOpts, Element, LogType };
121
+ export default BaseDriver;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "firefoxos",
12
12
  "testing"
13
13
  ],
14
- "version": "8.1.0",
14
+ "version": "8.1.1",
15
15
  "author": "https://github.com/appium",
16
16
  "license": "Apache-2.0",
17
17
  "repository": {
@@ -31,6 +31,7 @@
31
31
  },
32
32
  "files": [
33
33
  "index.js",
34
+ "index.d.ts",
34
35
  "lib",
35
36
  "static",
36
37
  "test/basedriver",
@@ -70,5 +71,5 @@
70
71
  "access": "public"
71
72
  },
72
73
  "homepage": "https://appium.io",
73
- "gitHead": "4f89d398a49a32c9451be48a90b7ce950a7ec9dc"
74
+ "gitHead": "01dd42ee1778509664d422a0c26e7061bae8402e"
74
75
  }