@appium/types 0.1.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright JS Foundation and other contributors, https://js.foundation
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @appium/types
2
+
3
+ > A collection of TypeScript type declarations used across various [Appium](https://github.com/appium/appium) packages.
4
+
5
+ **Warning: This is a work-in-progress; expect breaking changes!**
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @appium/types -D
11
+ ```
12
+
13
+ ## Notes
14
+
15
+ - The sources are `.ts` files, _not_ `.d.ts` files. This allows other packages in the root TypeScript "project" to define a dependency upon this one, and enables incremental builds an "watch" mode.
16
+ - If there is a way to switch to `.d.ts` files and configure this package to work in our "project" context _without_ needing to actually "emit" anything, then we should do that instead. Help accepted!
17
+ - `lib/appium-config.ts` is generated by this package from `@appium/schema`, but is under version control to avoid chicken-or-egg build problems.
18
+
19
+ ## License
20
+
21
+ Apache-2.0
@@ -0,0 +1,175 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * IP address to listen on
8
+ */
9
+ export declare type AddressConfig = string;
10
+ /**
11
+ * Whether the Appium server should allow web browser connections from any host
12
+ */
13
+ export declare type AllowCorsConfig = boolean;
14
+ /**
15
+ * Set which insecure features are allowed to run in this server's sessions. Features are defined on a driver level; see documentation for more details. Note that features defined via "deny-insecure" will be disabled, even if also listed here. If string, a path to a text file containing policy or a comma-delimited list.
16
+ */
17
+ export declare type AllowInsecureConfig = string[];
18
+ /**
19
+ * Base path to use as the prefix for all webdriver routes running on the server
20
+ */
21
+ export declare type BasePathConfig = string;
22
+ /**
23
+ * Callback IP address (default: same as "address")
24
+ */
25
+ export declare type CallbackAddressConfig = string;
26
+ /**
27
+ * Callback port (default: same as "port")
28
+ */
29
+ export declare type CallbackPortConfig = number;
30
+ /**
31
+ * Add exaggerated spacing in logs to help with visual inspection
32
+ */
33
+ export declare type DebugLogSpacingConfig = boolean;
34
+ /**
35
+ * Set which insecure features are not allowed to run in this server's sessions. Features are defined on a driver level; see documentation for more details. Features listed here will not be enabled even if also listed in "allow-insecure", and even if "relaxed-security" is enabled. If string, a path to a text file containing policy or a comma-delimited list.
36
+ */
37
+ export declare type DenyInsecureConfig = string[];
38
+ /**
39
+ * Number of seconds the Appium server should apply as both the keep-alive timeout and the connection timeout for all requests. A value of 0 disables the timeout.
40
+ */
41
+ export declare type KeepAliveTimeoutConfig = number;
42
+ /**
43
+ * Use local timezone for timestamps
44
+ */
45
+ export declare type LocalTimezoneConfig = boolean;
46
+ /**
47
+ * Also send log output to this file
48
+ */
49
+ export declare type LogConfig = string;
50
+ /**
51
+ * One or more log filtering rules
52
+ */
53
+ export declare type LogFiltersConfig = string[];
54
+ /**
55
+ * Log level (console[:file])
56
+ */
57
+ export declare type LogLevelConfig = "info" | "info:debug" | "info:info" | "info:warn" | "info:error" | "warn" | "warn:debug" | "warn:info" | "warn:warn" | "warn:error" | "error" | "error:debug" | "error:info" | "error:warn" | "error:error" | "debug" | "debug:debug" | "debug:info" | "debug:warn" | "debug:error";
58
+ /**
59
+ * Do not use color in console output
60
+ */
61
+ export declare type LogNoColorsConfig = boolean;
62
+ /**
63
+ * Show timestamps in console output
64
+ */
65
+ export declare type LogTimestampConfig = boolean;
66
+ /**
67
+ * Add long stack traces to log entries. Recommended for debugging only.
68
+ */
69
+ export declare type LongStacktraceConfig = boolean;
70
+ /**
71
+ * Do not check that needed files are readable and/or writable
72
+ */
73
+ export declare type NoPermsCheckConfig = boolean;
74
+ /**
75
+ * Port to listen on
76
+ */
77
+ export declare type PortConfig = number;
78
+ /**
79
+ * Disable additional security checks, so it is possible to use some advanced features, provided by drivers supporting this option. Only enable it if all the clients are in the trusted network and it's not the case if a client could potentially break out of the session sandbox. Specific features can be overridden by using "deny-insecure"
80
+ */
81
+ export declare type RelaxedSecurityConfig = boolean;
82
+ /**
83
+ * Enables session override (clobbering)
84
+ */
85
+ export declare type SessionOverrideConfig = boolean;
86
+ /**
87
+ * Cause sessions to fail if desired caps are sent in that Appium does not recognize as valid for the selected device
88
+ */
89
+ export declare type StrictCapsConfig = boolean;
90
+ /**
91
+ * Absolute path to directory Appium can use to manage temp files. Defaults to C:\Windows\Temp on Windows and /tmp otherwise.
92
+ */
93
+ export declare type TmpConfig = string;
94
+ /**
95
+ * Absolute path to directory Appium can use to save iOS instrument traces; defaults to <tmp>/appium-instruments
96
+ */
97
+ export declare type TraceDirConfig = string;
98
+ /**
99
+ * A list of drivers to activate. By default, all installed drivers will be activated.
100
+ */
101
+ export declare type UseDriversConfig = string[];
102
+ /**
103
+ * A list of plugins to activate. To activate all plugins, the value should be an array with a single item "all".
104
+ */
105
+ export declare type UsePluginsConfig = string[];
106
+ /**
107
+ * Also send log output to this http listener
108
+ */
109
+ export declare type WebhookConfig = string;
110
+ /**
111
+ * A schema for Appium configuration files
112
+ */
113
+ export interface AppiumConfiguration {
114
+ server?: ServerConfig;
115
+ }
116
+ /**
117
+ * Configuration when running Appium as a server
118
+ */
119
+ export interface ServerConfig {
120
+ address?: AddressConfig;
121
+ "allow-cors"?: AllowCorsConfig;
122
+ "allow-insecure"?: AllowInsecureConfig;
123
+ "base-path"?: BasePathConfig;
124
+ "callback-address"?: CallbackAddressConfig;
125
+ "callback-port"?: CallbackPortConfig;
126
+ "debug-log-spacing"?: DebugLogSpacingConfig;
127
+ "default-capabilities"?: DefaultCapabilitiesConfig;
128
+ "deny-insecure"?: DenyInsecureConfig;
129
+ driver?: DriverConfig;
130
+ "keep-alive-timeout"?: KeepAliveTimeoutConfig;
131
+ "local-timezone"?: LocalTimezoneConfig;
132
+ log?: LogConfig;
133
+ "log-filters"?: LogFiltersConfig;
134
+ "log-level"?: LogLevelConfig;
135
+ "log-no-colors"?: LogNoColorsConfig;
136
+ "log-timestamp"?: LogTimestampConfig;
137
+ "long-stacktrace"?: LongStacktraceConfig;
138
+ "no-perms-check"?: NoPermsCheckConfig;
139
+ nodeconfig?: NodeconfigConfig;
140
+ plugin?: PluginConfig;
141
+ port?: PortConfig;
142
+ "relaxed-security"?: RelaxedSecurityConfig;
143
+ "session-override"?: SessionOverrideConfig;
144
+ "strict-caps"?: StrictCapsConfig;
145
+ tmp?: TmpConfig;
146
+ "trace-dir"?: TraceDirConfig;
147
+ "use-drivers"?: UseDriversConfig;
148
+ "use-plugins"?: UsePluginsConfig;
149
+ webhook?: WebhookConfig;
150
+ }
151
+ /**
152
+ * Set the default desired capabilities, which will be set on each session unless overridden by received capabilities. If a string, a path to a JSON file containing the capabilities, or raw JSON.
153
+ */
154
+ export interface DefaultCapabilitiesConfig {
155
+ [k: string]: unknown;
156
+ }
157
+ /**
158
+ * Driver-specific configuration. Keys should correspond to driver package names
159
+ */
160
+ export interface DriverConfig {
161
+ [k: string]: unknown;
162
+ }
163
+ /**
164
+ * Path to configuration JSON file to register Appium as a node with Selenium Grid 3; otherwise the configuration itself
165
+ */
166
+ export interface NodeconfigConfig {
167
+ [k: string]: unknown;
168
+ }
169
+ /**
170
+ * Plugin-specific configuration. Keys should correspond to plugin package names
171
+ */
172
+ export interface PluginConfig {
173
+ [k: string]: unknown;
174
+ }
175
+ //# sourceMappingURL=appium-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appium-config.d.ts","sourceRoot":"","sources":["../lib/appium-config.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,aAAa,GAAG,MAAM,CAAC;AACnC;;GAEG;AACH,oBAAY,eAAe,GAAG,OAAO,CAAC;AACtC;;GAEG;AACH,oBAAY,mBAAmB,GAAG,MAAM,EAAE,CAAC;AAC3C;;GAEG;AACH,oBAAY,cAAc,GAAG,MAAM,CAAC;AACpC;;GAEG;A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AAG,CAAC,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AACD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AACD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AACD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AACD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB"}
@@ -0,0 +1,47 @@
1
+ import type { Capabilities as WdioCaps } from '@wdio/types';
2
+ /**
3
+ * The mask of a W3C-style namespaced capability proped name.
4
+ */
5
+ declare type Namespaced = `${string}:${string}`;
6
+ /**
7
+ * An object with keys conforming to {@linkcode Namespaced}.
8
+ */
9
+ declare type NamespacedRecord = Record<Namespaced, any>;
10
+ /**
11
+ * An object with keys for strings.
12
+ */
13
+ declare type StringRecord = Record<string, any>;
14
+ /**
15
+ * All known capabilities derived from wdio's {@linkcode WdioCaps.Capabilities Capabilities} type, accepting additional optional caps.
16
+ * All properties are optional.
17
+ */
18
+ declare type BaseCapabilities<OptionalCaps extends StringRecord = StringRecord> = Partial<WdioCaps.Capabilities & OptionalCaps>;
19
+ /**
20
+ * All known capabilities derived from wdio's {@linkcode WdioCaps.Capabilities Capabilities} type and wdio's {@linkcode WdioCaps.AppiumCapabilities} type, accepting additional optional caps.
21
+ *
22
+ * In practice, the properties `platformName` and `automationName` are required by Appium.
23
+ */
24
+ export declare type Capabilities<OptionalCaps extends StringRecord = StringRecord> = BaseCapabilities<WdioCaps.AppiumCapabilities & OptionalCaps>;
25
+ /**
26
+ * All known capabilities derived from wdio's {@linkcode WdioCaps.Capabilities Capabilities} type and wdio's {@linkcode WdioCaps.AppiumW3CCapabilities} type, accepting additional optional _namespaced_ caps.
27
+ */
28
+ export declare type AppiumW3CCapabilities<OptionalNamespacedCaps extends NamespacedRecord = NamespacedRecord> = BaseCapabilities<WdioCaps.AppiumW3CCapabilities & OptionalNamespacedCaps>;
29
+ /**
30
+ * All known capabilities derived from wdio's {@linkcode WdioCaps.Capabilities Capabilities} type and wdio's {@linkcode WdioCaps.AppiumW3Capabilities} type, accepting additional optional _namespaced_ caps, in W3C-compatible format (`alwaysMatch`/`firstMatch`).
31
+ * In practice, the properties `appium:platformName` and `appium:automationName` are required by Appium _somewhere_ in this object; this cannot be expressed in TypeScript.
32
+ */
33
+ export declare type W3CCapabilities<OptionalNamespacedCaps extends NamespacedRecord = NamespacedRecord> = {
34
+ alwaysMatch: AppiumW3CCapabilities<OptionalNamespacedCaps>;
35
+ firstMatch: AppiumW3CCapabilities<OptionalNamespacedCaps>[];
36
+ };
37
+ /**
38
+ * These may (or should) be reused by drivers.
39
+ */
40
+ export declare type AppiumAndroidCapabilities = WdioCaps.AppiumAndroidCapabilities;
41
+ export declare type AppiumIOSCapabilities = WdioCaps.AppiumIOSCapabilities;
42
+ export declare type AppiumXCUICommandTimeouts = WdioCaps.AppiumXCUICommandTimeouts;
43
+ export declare type AppiumXCUIProcessArguments = WdioCaps.AppiumXCUIProcessArguments;
44
+ export declare type AppiumXCUISafariGlobalPreferences = WdioCaps.AppiumXCUISafariGlobalPreferences;
45
+ export declare type AppiumXCUITestCapabilities = WdioCaps.AppiumXCUITestCapabilities;
46
+ export {};
47
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../lib/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,a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1,80 @@
1
+ import type { AppiumConfigJsonSchema } from '@appium/schema';
2
+ import { AppiumConfiguration, ServerConfig } from './appium-config';
3
+ /**
4
+ * The Appium configuration as it would be in a user-provided configuration file.
5
+ */
6
+ export declare type AppiumConfig = Partial<AppiumConfiguration>;
7
+ /**
8
+ * Derive the "constant" type of the server properties from the schema.
9
+ */
10
+ declare type AppiumServerJsonSchema = typeof AppiumConfigJsonSchema['properties']['server']['properties'];
11
+ /**
12
+ * This type associates the types generated from the schema ({@linkcode AppiumConfiguration})
13
+ * with the schema itself (beginning with the `server` prop).
14
+ */
15
+ declare type ServerConfigMapping = Associated<ServerConfig, AppiumServerJsonSchema>;
16
+ /**
17
+ * Camel-cased server config. _Not_ flattened.
18
+ */
19
+ export declare type NormalizedServerConfig = {
20
+ [Prop in keyof ServerConfigMapping as AppiumServerJsonSchema[Prop] extends WithDest ? AppiumServerJsonSchema[Prop]['appiumCliDest'] : KebabToCamel<Prop>]: ServerConfig[Prop];
21
+ };
22
+ /**
23
+ * "Normalized" config, which is camel-cased (instead of kebab-case, like the schema). It is _not_ flattened.
24
+ */
25
+ export declare type NormalizedAppiumConfig = {
26
+ server: NormalizedServerConfig;
27
+ };
28
+ /**
29
+ * This type checks if `appiumCliDest` is present in the object via
30
+ * {@linkcode WithDest}, and uses the _value_ of that property for the key name;
31
+ * otherwise uses the camel-cased value of the key name.
32
+ */
33
+ declare type SetKeyForProp<Prop extends keyof ServerConfigMapping> = AppiumServerJsonSchema[Prop] extends WithDest ? AppiumServerJsonSchema[Prop]['appiumCliDest'] : KebabToCamel<Prop>;
34
+ /**
35
+ * Checks for the existence of default values, and ensures those properties will
36
+ * always be defined (eliminates `| undefined` from the type).
37
+ * If no default value, just a type.
38
+ */
39
+ declare type KeyOrDefaultForProp<Prop extends keyof ServerConfigMapping> = AppiumServerJsonSchema[Prop] extends WithDefault ? NonNullable<ServerConfig[Prop]> : ServerConfig[Prop];
40
+ /**
41
+ * The final shape of the parsed CLI arguments.
42
+ *
43
+ * These will be camel-cased unless overridden by `appiumCliDest` field in schema(s).
44
+ */
45
+ export declare type DriverOpts = {
46
+ [Prop in keyof ServerConfigMapping as SetKeyForProp<Prop>]: KeyOrDefaultForProp<Prop>;
47
+ };
48
+ /**
49
+ * Converts a kebab-cased string into a camel-cased string.
50
+ */
51
+ declare type KebabToCamel<S extends string> = S extends `${infer P1}-${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${KebabToCamel<P3>}` : Lowercase<S>;
52
+ /**
53
+ * Object `B` has all the keys as object `A` (even if those keys in `A` are otherwise optional).
54
+ */
55
+ declare type Associated<A extends object, B extends {
56
+ [key in keyof Required<A>]: unknown;
57
+ }> = {
58
+ [Prop in keyof Required<A>]: B[Prop];
59
+ };
60
+ /**
61
+ * Certain properties have an `appiumCliDest` prop, which affects the shape of
62
+ * `ParsedArgs`. This type helps recognize these properties.
63
+ *
64
+ * See `appium/lib/schema/keywords` for definition of `appiumCliDest`.
65
+ */
66
+ interface WithDest {
67
+ appiumCliDest: string;
68
+ }
69
+ /**
70
+ * Some properties have a `default` prop, which means practically they will not
71
+ * be `undefined` upon parsing.
72
+ *
73
+ * We use this to ensure that the `ParsedArgs` makes guarantees
74
+ * about the presence of properties.
75
+ */
76
+ interface WithDefault<T = any> {
77
+ default: T;
78
+ }
79
+ export {};
80
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpE;;GAEG;AACH,oBAAY,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAExD;;GAEG;AACF,aAAK,sBAAsB,GAC3B,OAAO,sBAAsB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,YAAY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