cddl2py 0.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/.release-it.ts +11 -0
- package/bin/cddl2py.js +5 -0
- package/build/cli.d.ts +2 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +34 -0
- package/build/constants.d.ts +5 -0
- package/build/constants.d.ts.map +1 -0
- package/build/constants.js +28 -0
- package/build/index.d.ts +6 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +554 -0
- package/build/utils.d.ts +7 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +12 -0
- package/package.json +39 -0
- package/src/cli.ts +42 -0
- package/src/constants.ts +32 -0
- package/src/index.ts +658 -0
- package/src/utils.ts +12 -0
- package/tests/__snapshots__/complex_types.test.ts.snap +81 -0
- package/tests/__snapshots__/group_choice.test.ts.snap +127 -0
- package/tests/__snapshots__/literals.test.ts.snap +15 -0
- package/tests/__snapshots__/mixin_union.test.ts.snap +65 -0
- package/tests/__snapshots__/mod.test.ts.snap +145 -0
- package/tests/__snapshots__/named_group_choice.test.ts.snap +37 -0
- package/tests/__snapshots__/transform.test.ts.snap +137 -0
- package/tests/__snapshots__/webdriver_local.test.ts.snap +921 -0
- package/tests/__snapshots__/webdriver_remote.test.ts.snap +1249 -0
- package/tests/complex_types.test.ts +92 -0
- package/tests/group_choice.test.ts +88 -0
- package/tests/literals.test.ts +63 -0
- package/tests/mixin_union.test.ts +80 -0
- package/tests/mod.test.ts +106 -0
- package/tests/named_group_choice.test.ts +82 -0
- package/tests/transform.test.ts +149 -0
- package/tests/transform_edge_cases.test.ts +265 -0
- package/tests/unknown.test.ts +72 -0
- package/tests/webdriver_local.test.ts +64 -0
- package/tests/webdriver_remote.test.ts +64 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,1249 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`webdriver remote spec > should generate Python types for remote.cddl 1`] = `
|
|
4
|
+
"# compiled with https://www.npmjs.com/package/cddl2py v0.1.0
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from typing import Any, Literal, Union
|
|
9
|
+
from typing_extensions import NotRequired, TypedDict
|
|
10
|
+
|
|
11
|
+
class Command(CommandData, Extensible):
|
|
12
|
+
id: JsUint
|
|
13
|
+
|
|
14
|
+
CommandData = Union[BrowserCommand, BrowsingContextCommand, EmulationCommand, InputCommand, NetworkCommand, ScriptCommand, SessionCommand, StorageCommand, WebExtensionCommand]
|
|
15
|
+
|
|
16
|
+
class EmptyParams(Extensible):
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
Extensible = dict[str, Any]
|
|
20
|
+
|
|
21
|
+
JsInt = int
|
|
22
|
+
|
|
23
|
+
JsUint = int
|
|
24
|
+
|
|
25
|
+
SessionCommand = Union[SessionEnd, SessionNew, SessionStatus, SessionSubscribe, SessionUnsubscribe]
|
|
26
|
+
|
|
27
|
+
class SessionCapabilitiesRequest(TypedDict):
|
|
28
|
+
always_match: NotRequired[SessionCapabilityRequest]
|
|
29
|
+
first_match: NotRequired[list[SessionCapabilityRequest]]
|
|
30
|
+
|
|
31
|
+
class SessionCapabilityRequest(Extensible):
|
|
32
|
+
accept_insecure_certs: NotRequired[bool]
|
|
33
|
+
browser_name: NotRequired[str]
|
|
34
|
+
browser_version: NotRequired[str]
|
|
35
|
+
platform_name: NotRequired[str]
|
|
36
|
+
proxy: NotRequired[SessionProxyConfiguration]
|
|
37
|
+
unhandled_prompt_behavior: NotRequired[SessionUserPromptHandler]
|
|
38
|
+
|
|
39
|
+
SessionProxyConfiguration = Union[SessionAutodetectProxyConfiguration, SessionDirectProxyConfiguration, SessionManualProxyConfiguration, SessionPacProxyConfiguration, SessionSystemProxyConfiguration]
|
|
40
|
+
|
|
41
|
+
class SessionAutodetectProxyConfiguration(Extensible):
|
|
42
|
+
proxy_type: Literal["autodetect"]
|
|
43
|
+
|
|
44
|
+
class SessionDirectProxyConfiguration(Extensible):
|
|
45
|
+
proxy_type: Literal["direct"]
|
|
46
|
+
|
|
47
|
+
class SessionManualProxyConfiguration(SessionSocksProxyConfiguration, Extensible):
|
|
48
|
+
proxy_type: Literal["manual"]
|
|
49
|
+
http_proxy: NotRequired[str]
|
|
50
|
+
ssl_proxy: NotRequired[str]
|
|
51
|
+
no_proxy: NotRequired[list[str]]
|
|
52
|
+
|
|
53
|
+
class SessionSocksProxyConfiguration(TypedDict):
|
|
54
|
+
socks_proxy: str
|
|
55
|
+
socks_version: int
|
|
56
|
+
|
|
57
|
+
class SessionPacProxyConfiguration(Extensible):
|
|
58
|
+
proxy_type: Literal["pac"]
|
|
59
|
+
proxy_autoconfig_url: str
|
|
60
|
+
|
|
61
|
+
class SessionSystemProxyConfiguration(Extensible):
|
|
62
|
+
proxy_type: Literal["system"]
|
|
63
|
+
|
|
64
|
+
class SessionUserPromptHandler(TypedDict):
|
|
65
|
+
alert: NotRequired[SessionUserPromptHandlerType]
|
|
66
|
+
before_unload: NotRequired[SessionUserPromptHandlerType]
|
|
67
|
+
confirm: NotRequired[SessionUserPromptHandlerType]
|
|
68
|
+
default: NotRequired[SessionUserPromptHandlerType]
|
|
69
|
+
file: NotRequired[SessionUserPromptHandlerType]
|
|
70
|
+
prompt: NotRequired[SessionUserPromptHandlerType]
|
|
71
|
+
|
|
72
|
+
SessionUserPromptHandlerType = Union[Literal["accept"], Literal["dismiss"], Literal["ignore"]]
|
|
73
|
+
|
|
74
|
+
SessionSubscription = str
|
|
75
|
+
|
|
76
|
+
class SessionSubscribeParameters(TypedDict):
|
|
77
|
+
events: list[str]
|
|
78
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
79
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
80
|
+
|
|
81
|
+
class SessionUnsubscribeByIdRequest(TypedDict):
|
|
82
|
+
subscriptions: list[SessionSubscription]
|
|
83
|
+
|
|
84
|
+
class SessionUnsubscribeByAttributesRequest(TypedDict):
|
|
85
|
+
events: list[str]
|
|
86
|
+
|
|
87
|
+
class SessionStatus(TypedDict):
|
|
88
|
+
method: Literal["session.status"]
|
|
89
|
+
params: EmptyParams
|
|
90
|
+
|
|
91
|
+
class SessionNew(TypedDict):
|
|
92
|
+
method: Literal["session.new"]
|
|
93
|
+
params: SessionNewParameters
|
|
94
|
+
|
|
95
|
+
class SessionNewParameters(TypedDict):
|
|
96
|
+
capabilities: SessionCapabilitiesRequest
|
|
97
|
+
|
|
98
|
+
class SessionEnd(TypedDict):
|
|
99
|
+
method: Literal["session.end"]
|
|
100
|
+
params: EmptyParams
|
|
101
|
+
|
|
102
|
+
class SessionSubscribe(TypedDict):
|
|
103
|
+
method: Literal["session.subscribe"]
|
|
104
|
+
params: SessionSubscribeParameters
|
|
105
|
+
|
|
106
|
+
class SessionUnsubscribe(TypedDict):
|
|
107
|
+
method: Literal["session.unsubscribe"]
|
|
108
|
+
params: SessionUnsubscribeParameters
|
|
109
|
+
|
|
110
|
+
SessionUnsubscribeParameters = Union[SessionUnsubscribeByAttributesRequest, SessionUnsubscribeByIdRequest]
|
|
111
|
+
|
|
112
|
+
BrowserCommand = Union[BrowserClose, BrowserCreateUserContext, BrowserGetClientWindows, BrowserGetUserContexts, BrowserRemoveUserContext, BrowserSetClientWindowState, BrowserSetDownloadBehavior]
|
|
113
|
+
|
|
114
|
+
BrowserClientWindow = str
|
|
115
|
+
|
|
116
|
+
class BrowserClientWindowInfo(TypedDict):
|
|
117
|
+
active: bool
|
|
118
|
+
client_window: BrowserClientWindow
|
|
119
|
+
height: JsUint
|
|
120
|
+
state: Union[Literal["fullscreen"], Literal["maximized"], Literal["minimized"], Literal["normal"]]
|
|
121
|
+
width: JsUint
|
|
122
|
+
x: JsInt
|
|
123
|
+
y: JsInt
|
|
124
|
+
|
|
125
|
+
BrowserUserContext = str
|
|
126
|
+
|
|
127
|
+
class BrowserUserContextInfo(TypedDict):
|
|
128
|
+
user_context: BrowserUserContext
|
|
129
|
+
|
|
130
|
+
class BrowserClose(TypedDict):
|
|
131
|
+
method: Literal["browser.close"]
|
|
132
|
+
params: EmptyParams
|
|
133
|
+
|
|
134
|
+
class BrowserCreateUserContext(TypedDict):
|
|
135
|
+
method: Literal["browser.createUserContext"]
|
|
136
|
+
params: BrowserCreateUserContextParameters
|
|
137
|
+
|
|
138
|
+
class BrowserCreateUserContextParameters(TypedDict):
|
|
139
|
+
accept_insecure_certs: NotRequired[bool]
|
|
140
|
+
proxy: NotRequired[SessionProxyConfiguration]
|
|
141
|
+
unhandled_prompt_behavior: NotRequired[SessionUserPromptHandler]
|
|
142
|
+
|
|
143
|
+
class BrowserGetClientWindows(TypedDict):
|
|
144
|
+
method: Literal["browser.getClientWindows"]
|
|
145
|
+
params: EmptyParams
|
|
146
|
+
|
|
147
|
+
class BrowserGetUserContexts(TypedDict):
|
|
148
|
+
method: Literal["browser.getUserContexts"]
|
|
149
|
+
params: EmptyParams
|
|
150
|
+
|
|
151
|
+
class BrowserRemoveUserContext(TypedDict):
|
|
152
|
+
method: Literal["browser.removeUserContext"]
|
|
153
|
+
params: BrowserRemoveUserContextParameters
|
|
154
|
+
|
|
155
|
+
class BrowserRemoveUserContextParameters(TypedDict):
|
|
156
|
+
user_context: BrowserUserContext
|
|
157
|
+
|
|
158
|
+
class BrowserSetClientWindowState(TypedDict):
|
|
159
|
+
method: Literal["browser.setClientWindowState"]
|
|
160
|
+
params: BrowserSetClientWindowStateParameters
|
|
161
|
+
|
|
162
|
+
class BrowserSetClientWindowStateParameters(BrowserClientWindowRectState):
|
|
163
|
+
client_window: BrowserClientWindow
|
|
164
|
+
|
|
165
|
+
class BrowserClientWindowNamedState(TypedDict):
|
|
166
|
+
state: Union[Literal["fullscreen"], Literal["maximized"], Literal["minimized"]]
|
|
167
|
+
|
|
168
|
+
class BrowserClientWindowRectState(TypedDict):
|
|
169
|
+
state: Literal["normal"]
|
|
170
|
+
width: NotRequired[JsUint]
|
|
171
|
+
height: NotRequired[JsUint]
|
|
172
|
+
x: NotRequired[JsInt]
|
|
173
|
+
y: NotRequired[JsInt]
|
|
174
|
+
|
|
175
|
+
class BrowserSetDownloadBehavior(TypedDict):
|
|
176
|
+
method: Literal["browser.setDownloadBehavior"]
|
|
177
|
+
params: BrowserSetDownloadBehaviorParameters
|
|
178
|
+
|
|
179
|
+
class BrowserSetDownloadBehaviorParameters(TypedDict):
|
|
180
|
+
download_behavior: Union[BrowserDownloadBehavior, None]
|
|
181
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
182
|
+
|
|
183
|
+
class BrowserDownloadBehavior(BrowserDownloadBehaviorDenied):
|
|
184
|
+
pass
|
|
185
|
+
|
|
186
|
+
class BrowserDownloadBehaviorAllowed(TypedDict):
|
|
187
|
+
type: Literal["allowed"]
|
|
188
|
+
destination_folder: str
|
|
189
|
+
|
|
190
|
+
class BrowserDownloadBehaviorDenied(TypedDict):
|
|
191
|
+
type: Literal["denied"]
|
|
192
|
+
|
|
193
|
+
BrowsingContextCommand = Union[BrowsingContextActivate, BrowsingContextCaptureScreenshot, BrowsingContextClose, BrowsingContextCreate, BrowsingContextGetTree, BrowsingContextHandleUserPrompt, BrowsingContextLocateNodes, BrowsingContextNavigate, BrowsingContextPrint, BrowsingContextReload, BrowsingContextSetBypassCsp, BrowsingContextSetViewport, BrowsingContextTraverseHistory]
|
|
194
|
+
|
|
195
|
+
BrowsingContextBrowsingContext = str
|
|
196
|
+
|
|
197
|
+
BrowsingContextLocator = Union[BrowsingContextAccessibilityLocator, BrowsingContextCssLocator, BrowsingContextContextLocator, BrowsingContextInnerTextLocator, BrowsingContextXPathLocator]
|
|
198
|
+
|
|
199
|
+
class BrowsingContextAccessibilityLocator(TypedDict):
|
|
200
|
+
type: Literal["accessibility"]
|
|
201
|
+
value: dict[str, Any]
|
|
202
|
+
|
|
203
|
+
class BrowsingContextCssLocator(TypedDict):
|
|
204
|
+
type: Literal["css"]
|
|
205
|
+
value: str
|
|
206
|
+
|
|
207
|
+
class BrowsingContextContextLocator(TypedDict):
|
|
208
|
+
type: Literal["context"]
|
|
209
|
+
value: dict[str, Any]
|
|
210
|
+
|
|
211
|
+
class BrowsingContextInnerTextLocator(TypedDict):
|
|
212
|
+
type: Literal["innerText"]
|
|
213
|
+
value: str
|
|
214
|
+
ignore_case: NotRequired[bool]
|
|
215
|
+
match_type: NotRequired[Union[Literal["full"], Literal["partial"]]]
|
|
216
|
+
max_depth: NotRequired[JsUint]
|
|
217
|
+
|
|
218
|
+
class BrowsingContextXPathLocator(TypedDict):
|
|
219
|
+
type: Literal["xpath"]
|
|
220
|
+
value: str
|
|
221
|
+
|
|
222
|
+
BrowsingContextNavigation = str
|
|
223
|
+
|
|
224
|
+
BrowsingContextReadinessState = Union[Literal["none"], Literal["interactive"], Literal["complete"]]
|
|
225
|
+
|
|
226
|
+
BrowsingContextUserPromptType = Union[Literal["alert"], Literal["beforeunload"], Literal["confirm"], Literal["prompt"]]
|
|
227
|
+
|
|
228
|
+
class BrowsingContextActivate(TypedDict):
|
|
229
|
+
method: Literal["browsingContext.activate"]
|
|
230
|
+
params: BrowsingContextActivateParameters
|
|
231
|
+
|
|
232
|
+
class BrowsingContextActivateParameters(TypedDict):
|
|
233
|
+
context: BrowsingContextBrowsingContext
|
|
234
|
+
|
|
235
|
+
class BrowsingContextCaptureScreenshot(TypedDict):
|
|
236
|
+
method: Literal["browsingContext.captureScreenshot"]
|
|
237
|
+
params: BrowsingContextCaptureScreenshotParameters
|
|
238
|
+
|
|
239
|
+
class BrowsingContextCaptureScreenshotParameters(TypedDict):
|
|
240
|
+
context: BrowsingContextBrowsingContext
|
|
241
|
+
origin: NotRequired[Union[Literal["viewport"], Literal["document"]]]
|
|
242
|
+
format: NotRequired[BrowsingContextImageFormat]
|
|
243
|
+
clip: NotRequired[BrowsingContextClipRectangle]
|
|
244
|
+
|
|
245
|
+
class BrowsingContextImageFormat(TypedDict):
|
|
246
|
+
type: str
|
|
247
|
+
quality: NotRequired[int]
|
|
248
|
+
|
|
249
|
+
BrowsingContextClipRectangle = Union[BrowsingContextBoxClipRectangle, BrowsingContextElementClipRectangle]
|
|
250
|
+
|
|
251
|
+
class BrowsingContextElementClipRectangle(TypedDict):
|
|
252
|
+
type: Literal["element"]
|
|
253
|
+
element: ScriptSharedReference
|
|
254
|
+
|
|
255
|
+
class BrowsingContextBoxClipRectangle(TypedDict):
|
|
256
|
+
type: Literal["box"]
|
|
257
|
+
x: float
|
|
258
|
+
y: float
|
|
259
|
+
width: float
|
|
260
|
+
height: float
|
|
261
|
+
|
|
262
|
+
class BrowsingContextClose(TypedDict):
|
|
263
|
+
method: Literal["browsingContext.close"]
|
|
264
|
+
params: BrowsingContextCloseParameters
|
|
265
|
+
|
|
266
|
+
class BrowsingContextCloseParameters(TypedDict):
|
|
267
|
+
context: BrowsingContextBrowsingContext
|
|
268
|
+
prompt_unload: NotRequired[bool]
|
|
269
|
+
|
|
270
|
+
class BrowsingContextCreate(TypedDict):
|
|
271
|
+
method: Literal["browsingContext.create"]
|
|
272
|
+
params: BrowsingContextCreateParameters
|
|
273
|
+
|
|
274
|
+
BrowsingContextCreateType = Union[Literal["tab"], Literal["window"]]
|
|
275
|
+
|
|
276
|
+
class BrowsingContextCreateParameters(TypedDict):
|
|
277
|
+
type: BrowsingContextCreateType
|
|
278
|
+
reference_context: NotRequired[BrowsingContextBrowsingContext]
|
|
279
|
+
background: NotRequired[bool]
|
|
280
|
+
user_context: NotRequired[BrowserUserContext]
|
|
281
|
+
|
|
282
|
+
class BrowsingContextGetTree(TypedDict):
|
|
283
|
+
method: Literal["browsingContext.getTree"]
|
|
284
|
+
params: BrowsingContextGetTreeParameters
|
|
285
|
+
|
|
286
|
+
class BrowsingContextGetTreeParameters(TypedDict):
|
|
287
|
+
max_depth: NotRequired[JsUint]
|
|
288
|
+
root: NotRequired[BrowsingContextBrowsingContext]
|
|
289
|
+
|
|
290
|
+
class BrowsingContextHandleUserPrompt(TypedDict):
|
|
291
|
+
method: Literal["browsingContext.handleUserPrompt"]
|
|
292
|
+
params: BrowsingContextHandleUserPromptParameters
|
|
293
|
+
|
|
294
|
+
class BrowsingContextHandleUserPromptParameters(TypedDict):
|
|
295
|
+
context: BrowsingContextBrowsingContext
|
|
296
|
+
accept: NotRequired[bool]
|
|
297
|
+
user_text: NotRequired[str]
|
|
298
|
+
|
|
299
|
+
class BrowsingContextLocateNodes(TypedDict):
|
|
300
|
+
method: Literal["browsingContext.locateNodes"]
|
|
301
|
+
params: BrowsingContextLocateNodesParameters
|
|
302
|
+
|
|
303
|
+
class BrowsingContextLocateNodesParameters(TypedDict):
|
|
304
|
+
context: BrowsingContextBrowsingContext
|
|
305
|
+
locator: BrowsingContextLocator
|
|
306
|
+
max_node_count: NotRequired[JsUint]
|
|
307
|
+
serialization_options: NotRequired[ScriptSerializationOptions]
|
|
308
|
+
start_nodes: NotRequired[list[ScriptSharedReference]]
|
|
309
|
+
|
|
310
|
+
class BrowsingContextNavigate(TypedDict):
|
|
311
|
+
method: Literal["browsingContext.navigate"]
|
|
312
|
+
params: BrowsingContextNavigateParameters
|
|
313
|
+
|
|
314
|
+
class BrowsingContextNavigateParameters(TypedDict):
|
|
315
|
+
context: BrowsingContextBrowsingContext
|
|
316
|
+
url: str
|
|
317
|
+
wait: NotRequired[BrowsingContextReadinessState]
|
|
318
|
+
|
|
319
|
+
class BrowsingContextPrint(TypedDict):
|
|
320
|
+
method: Literal["browsingContext.print"]
|
|
321
|
+
params: BrowsingContextPrintParameters
|
|
322
|
+
|
|
323
|
+
class BrowsingContextPrintParameters(TypedDict):
|
|
324
|
+
context: BrowsingContextBrowsingContext
|
|
325
|
+
background: NotRequired[bool]
|
|
326
|
+
margin: NotRequired[BrowsingContextPrintMarginParameters]
|
|
327
|
+
orientation: NotRequired[Union[Literal["portrait"], Literal["landscape"]]]
|
|
328
|
+
page: NotRequired[BrowsingContextPrintPageParameters]
|
|
329
|
+
page_ranges: NotRequired[list[Union[JsUint, str]]]
|
|
330
|
+
scale: NotRequired[int]
|
|
331
|
+
shrink_to_fit: NotRequired[bool]
|
|
332
|
+
|
|
333
|
+
class BrowsingContextPrintMarginParameters(TypedDict):
|
|
334
|
+
bottom: NotRequired[float]
|
|
335
|
+
left: NotRequired[float]
|
|
336
|
+
right: NotRequired[float]
|
|
337
|
+
top: NotRequired[float]
|
|
338
|
+
|
|
339
|
+
class BrowsingContextPrintPageParameters(TypedDict):
|
|
340
|
+
height: NotRequired[float]
|
|
341
|
+
width: NotRequired[float]
|
|
342
|
+
|
|
343
|
+
class BrowsingContextReload(TypedDict):
|
|
344
|
+
method: Literal["browsingContext.reload"]
|
|
345
|
+
params: BrowsingContextReloadParameters
|
|
346
|
+
|
|
347
|
+
class BrowsingContextReloadParameters(TypedDict):
|
|
348
|
+
context: BrowsingContextBrowsingContext
|
|
349
|
+
ignore_cache: NotRequired[bool]
|
|
350
|
+
wait: NotRequired[BrowsingContextReadinessState]
|
|
351
|
+
|
|
352
|
+
class BrowsingContextSetBypassCsp(TypedDict):
|
|
353
|
+
method: Literal["browsingContext.setBypassCSP"]
|
|
354
|
+
params: BrowsingContextSetBypassCspParameters
|
|
355
|
+
|
|
356
|
+
class BrowsingContextSetBypassCspParameters(TypedDict):
|
|
357
|
+
bypass: Union[Literal[True], None]
|
|
358
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
359
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
360
|
+
|
|
361
|
+
class BrowsingContextSetViewport(TypedDict):
|
|
362
|
+
method: Literal["browsingContext.setViewport"]
|
|
363
|
+
params: BrowsingContextSetViewportParameters
|
|
364
|
+
|
|
365
|
+
class BrowsingContextSetViewportParameters(TypedDict):
|
|
366
|
+
context: NotRequired[BrowsingContextBrowsingContext]
|
|
367
|
+
viewport: NotRequired[Union[BrowsingContextViewport, None]]
|
|
368
|
+
device_pixel_ratio: NotRequired[Union[float, None]]
|
|
369
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
370
|
+
|
|
371
|
+
class BrowsingContextViewport(TypedDict):
|
|
372
|
+
width: JsUint
|
|
373
|
+
height: JsUint
|
|
374
|
+
|
|
375
|
+
class BrowsingContextTraverseHistory(TypedDict):
|
|
376
|
+
method: Literal["browsingContext.traverseHistory"]
|
|
377
|
+
params: BrowsingContextTraverseHistoryParameters
|
|
378
|
+
|
|
379
|
+
class BrowsingContextTraverseHistoryParameters(TypedDict):
|
|
380
|
+
context: BrowsingContextBrowsingContext
|
|
381
|
+
delta: JsInt
|
|
382
|
+
|
|
383
|
+
EmulationCommand = Union[EmulationSetForcedColorsModeThemeOverride, EmulationSetGeolocationOverride, EmulationSetLocaleOverride, EmulationSetNetworkConditions, EmulationSetScreenOrientationOverride, EmulationSetScreenSettingsOverride, EmulationSetScriptingEnabled, EmulationSetScrollbarTypeOverride, EmulationSetTimezoneOverride, EmulationSetTouchOverride, EmulationSetUserAgentOverride]
|
|
384
|
+
|
|
385
|
+
class EmulationSetForcedColorsModeThemeOverride(TypedDict):
|
|
386
|
+
method: Literal["emulation.setForcedColorsModeThemeOverride"]
|
|
387
|
+
params: EmulationSetForcedColorsModeThemeOverrideParameters
|
|
388
|
+
|
|
389
|
+
class EmulationSetForcedColorsModeThemeOverrideParameters(TypedDict):
|
|
390
|
+
theme: Union[EmulationForcedColorsModeTheme, None]
|
|
391
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
392
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
393
|
+
|
|
394
|
+
EmulationForcedColorsModeTheme = Union[Literal["light"], Literal["dark"]]
|
|
395
|
+
|
|
396
|
+
class EmulationSetGeolocationOverride(TypedDict):
|
|
397
|
+
method: Literal["emulation.setGeolocationOverride"]
|
|
398
|
+
params: EmulationSetGeolocationOverrideParameters
|
|
399
|
+
|
|
400
|
+
class EmulationSetGeolocationOverrideParameters(TypedDict):
|
|
401
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
402
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
403
|
+
|
|
404
|
+
class EmulationGeolocationCoordinates(TypedDict):
|
|
405
|
+
latitude: int
|
|
406
|
+
longitude: int
|
|
407
|
+
accuracy: NotRequired[float]
|
|
408
|
+
altitude: NotRequired[Union[float, None]]
|
|
409
|
+
altitude_accuracy: NotRequired[Union[float, None]]
|
|
410
|
+
heading: NotRequired[Union[int, None]]
|
|
411
|
+
speed: NotRequired[Union[float, None]]
|
|
412
|
+
|
|
413
|
+
class EmulationGeolocationPositionError(TypedDict):
|
|
414
|
+
type: Literal["positionUnavailable"]
|
|
415
|
+
|
|
416
|
+
class EmulationSetLocaleOverride(TypedDict):
|
|
417
|
+
method: Literal["emulation.setLocaleOverride"]
|
|
418
|
+
params: EmulationSetLocaleOverrideParameters
|
|
419
|
+
|
|
420
|
+
class EmulationSetLocaleOverrideParameters(TypedDict):
|
|
421
|
+
locale: Union[str, None]
|
|
422
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
423
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
424
|
+
|
|
425
|
+
class EmulationSetNetworkConditions(TypedDict):
|
|
426
|
+
method: Literal["emulation.setNetworkConditions"]
|
|
427
|
+
params: EmulationSetNetworkConditionsParameters
|
|
428
|
+
|
|
429
|
+
class EmulationSetNetworkConditionsParameters(TypedDict):
|
|
430
|
+
network_conditions: Union[EmulationNetworkConditions, None]
|
|
431
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
432
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
433
|
+
|
|
434
|
+
EmulationNetworkConditions = EmulationNetworkConditionsOffline
|
|
435
|
+
|
|
436
|
+
class EmulationNetworkConditionsOffline(TypedDict):
|
|
437
|
+
type: Literal["offline"]
|
|
438
|
+
|
|
439
|
+
class EmulationSetScreenSettingsOverride(TypedDict):
|
|
440
|
+
method: Literal["emulation.setScreenSettingsOverride"]
|
|
441
|
+
params: EmulationSetScreenSettingsOverrideParameters
|
|
442
|
+
|
|
443
|
+
class EmulationScreenArea(TypedDict):
|
|
444
|
+
width: JsUint
|
|
445
|
+
height: JsUint
|
|
446
|
+
|
|
447
|
+
class EmulationSetScreenSettingsOverrideParameters(TypedDict):
|
|
448
|
+
screen_area: Union[EmulationScreenArea, None]
|
|
449
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
450
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
451
|
+
|
|
452
|
+
class EmulationSetScreenOrientationOverride(TypedDict):
|
|
453
|
+
method: Literal["emulation.setScreenOrientationOverride"]
|
|
454
|
+
params: EmulationSetScreenOrientationOverrideParameters
|
|
455
|
+
|
|
456
|
+
EmulationScreenOrientationNatural = Union[Literal["portrait"], Literal["landscape"]]
|
|
457
|
+
|
|
458
|
+
EmulationScreenOrientationType = Union[Literal["portrait-primary"], Literal["portrait-secondary"], Literal["landscape-primary"], Literal["landscape-secondary"]]
|
|
459
|
+
|
|
460
|
+
class EmulationScreenOrientation(TypedDict):
|
|
461
|
+
natural: EmulationScreenOrientationNatural
|
|
462
|
+
type: EmulationScreenOrientationType
|
|
463
|
+
|
|
464
|
+
class EmulationSetScreenOrientationOverrideParameters(TypedDict):
|
|
465
|
+
screen_orientation: Union[EmulationScreenOrientation, None]
|
|
466
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
467
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
468
|
+
|
|
469
|
+
class EmulationSetUserAgentOverride(TypedDict):
|
|
470
|
+
method: Literal["emulation.setUserAgentOverride"]
|
|
471
|
+
params: EmulationSetUserAgentOverrideParameters
|
|
472
|
+
|
|
473
|
+
class EmulationSetUserAgentOverrideParameters(TypedDict):
|
|
474
|
+
user_agent: Union[str, None]
|
|
475
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
476
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
477
|
+
|
|
478
|
+
class EmulationSetScriptingEnabled(TypedDict):
|
|
479
|
+
method: Literal["emulation.setScriptingEnabled"]
|
|
480
|
+
params: EmulationSetScriptingEnabledParameters
|
|
481
|
+
|
|
482
|
+
class EmulationSetScriptingEnabledParameters(TypedDict):
|
|
483
|
+
enabled: Union[Literal[False], None]
|
|
484
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
485
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
486
|
+
|
|
487
|
+
class EmulationSetScrollbarTypeOverride(TypedDict):
|
|
488
|
+
method: Literal["emulation.setScrollbarTypeOverride"]
|
|
489
|
+
params: EmulationSetScrollbarTypeOverrideParameters
|
|
490
|
+
|
|
491
|
+
class EmulationSetScrollbarTypeOverrideParameters(TypedDict):
|
|
492
|
+
scrollbar_type: Union[Literal["classic"], Literal["overlay"], None]
|
|
493
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
494
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
495
|
+
|
|
496
|
+
class EmulationSetTimezoneOverride(TypedDict):
|
|
497
|
+
method: Literal["emulation.setTimezoneOverride"]
|
|
498
|
+
params: EmulationSetTimezoneOverrideParameters
|
|
499
|
+
|
|
500
|
+
class EmulationSetTimezoneOverrideParameters(TypedDict):
|
|
501
|
+
timezone: Union[str, None]
|
|
502
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
503
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
504
|
+
|
|
505
|
+
class EmulationSetTouchOverride(TypedDict):
|
|
506
|
+
method: Literal["emulation.setTouchOverride"]
|
|
507
|
+
params: EmulationSetTouchOverrideParameters
|
|
508
|
+
|
|
509
|
+
class EmulationSetTouchOverrideParameters(TypedDict):
|
|
510
|
+
max_touch_points: Union[JsUint, None]
|
|
511
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
512
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
513
|
+
|
|
514
|
+
NetworkCommand = Union[NetworkAddDataCollector, NetworkAddIntercept, NetworkContinueRequest, NetworkContinueResponse, NetworkContinueWithAuth, NetworkDisownData, NetworkFailRequest, NetworkGetData, NetworkProvideResponse, NetworkRemoveDataCollector, NetworkRemoveIntercept, NetworkSetCacheBehavior, NetworkSetExtraHeaders]
|
|
515
|
+
|
|
516
|
+
class NetworkAuthCredentials(TypedDict):
|
|
517
|
+
type: Literal["password"]
|
|
518
|
+
username: str
|
|
519
|
+
password: str
|
|
520
|
+
|
|
521
|
+
NetworkBytesValue = Union[NetworkStringValue, NetworkBase64Value]
|
|
522
|
+
|
|
523
|
+
class NetworkStringValue(TypedDict):
|
|
524
|
+
type: Literal["string"]
|
|
525
|
+
value: str
|
|
526
|
+
|
|
527
|
+
class NetworkBase64Value(TypedDict):
|
|
528
|
+
type: Literal["base64"]
|
|
529
|
+
value: str
|
|
530
|
+
|
|
531
|
+
NetworkCollector = str
|
|
532
|
+
|
|
533
|
+
NetworkCollectorType = Literal["blob"]
|
|
534
|
+
|
|
535
|
+
NetworkSameSite = Union[Literal["strict"], Literal["lax"], Literal["none"], Literal["default"]]
|
|
536
|
+
|
|
537
|
+
class NetworkCookie(Extensible):
|
|
538
|
+
name: str
|
|
539
|
+
value: NetworkBytesValue
|
|
540
|
+
domain: str
|
|
541
|
+
path: str
|
|
542
|
+
size: JsUint
|
|
543
|
+
http_only: bool
|
|
544
|
+
secure: bool
|
|
545
|
+
same_site: NetworkSameSite
|
|
546
|
+
expiry: NotRequired[JsUint]
|
|
547
|
+
|
|
548
|
+
class NetworkCookieHeader(TypedDict):
|
|
549
|
+
name: str
|
|
550
|
+
value: NetworkBytesValue
|
|
551
|
+
|
|
552
|
+
NetworkDataType = Union[Literal["request"], Literal["response"]]
|
|
553
|
+
|
|
554
|
+
class NetworkHeader(TypedDict):
|
|
555
|
+
name: str
|
|
556
|
+
value: NetworkBytesValue
|
|
557
|
+
|
|
558
|
+
NetworkIntercept = str
|
|
559
|
+
|
|
560
|
+
NetworkRequest = str
|
|
561
|
+
|
|
562
|
+
class NetworkSetCookieHeader(TypedDict):
|
|
563
|
+
name: str
|
|
564
|
+
value: NetworkBytesValue
|
|
565
|
+
domain: NotRequired[str]
|
|
566
|
+
http_only: NotRequired[bool]
|
|
567
|
+
expiry: NotRequired[str]
|
|
568
|
+
max_age: NotRequired[JsInt]
|
|
569
|
+
path: NotRequired[str]
|
|
570
|
+
same_site: NotRequired[NetworkSameSite]
|
|
571
|
+
secure: NotRequired[bool]
|
|
572
|
+
|
|
573
|
+
NetworkUrlPattern = Union[NetworkUrlPatternPattern, NetworkUrlPatternString]
|
|
574
|
+
|
|
575
|
+
class NetworkUrlPatternPattern(TypedDict):
|
|
576
|
+
type: Literal["pattern"]
|
|
577
|
+
protocol: NotRequired[str]
|
|
578
|
+
hostname: NotRequired[str]
|
|
579
|
+
port: NotRequired[str]
|
|
580
|
+
pathname: NotRequired[str]
|
|
581
|
+
search: NotRequired[str]
|
|
582
|
+
|
|
583
|
+
class NetworkUrlPatternString(TypedDict):
|
|
584
|
+
type: Literal["string"]
|
|
585
|
+
pattern: str
|
|
586
|
+
|
|
587
|
+
class NetworkAddDataCollector(TypedDict):
|
|
588
|
+
method: Literal["network.addDataCollector"]
|
|
589
|
+
params: NetworkAddDataCollectorParameters
|
|
590
|
+
|
|
591
|
+
class NetworkAddDataCollectorParameters(TypedDict):
|
|
592
|
+
data_types: list[NetworkDataType]
|
|
593
|
+
max_encoded_data_size: JsUint
|
|
594
|
+
collector_type: NotRequired[NetworkCollectorType]
|
|
595
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
596
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
597
|
+
|
|
598
|
+
class NetworkAddIntercept(TypedDict):
|
|
599
|
+
method: Literal["network.addIntercept"]
|
|
600
|
+
params: NetworkAddInterceptParameters
|
|
601
|
+
|
|
602
|
+
class NetworkAddInterceptParameters(TypedDict):
|
|
603
|
+
phases: list[NetworkInterceptPhase]
|
|
604
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
605
|
+
url_patterns: NotRequired[list[NetworkUrlPattern]]
|
|
606
|
+
|
|
607
|
+
NetworkInterceptPhase = Union[Literal["beforeRequestSent"], Literal["responseStarted"], Literal["authRequired"]]
|
|
608
|
+
|
|
609
|
+
class NetworkContinueRequest(TypedDict):
|
|
610
|
+
method: Literal["network.continueRequest"]
|
|
611
|
+
params: NetworkContinueRequestParameters
|
|
612
|
+
|
|
613
|
+
class NetworkContinueRequestParameters(TypedDict):
|
|
614
|
+
request: NetworkRequest
|
|
615
|
+
body: NotRequired[NetworkBytesValue]
|
|
616
|
+
cookies: NotRequired[list[NetworkCookieHeader]]
|
|
617
|
+
headers: NotRequired[list[NetworkHeader]]
|
|
618
|
+
method: NotRequired[str]
|
|
619
|
+
url: NotRequired[str]
|
|
620
|
+
|
|
621
|
+
class NetworkContinueResponse(TypedDict):
|
|
622
|
+
method: Literal["network.continueResponse"]
|
|
623
|
+
params: NetworkContinueResponseParameters
|
|
624
|
+
|
|
625
|
+
class NetworkContinueResponseParameters(TypedDict):
|
|
626
|
+
request: NetworkRequest
|
|
627
|
+
cookies: NotRequired[list[NetworkSetCookieHeader]]
|
|
628
|
+
credentials: NotRequired[NetworkAuthCredentials]
|
|
629
|
+
headers: NotRequired[list[NetworkHeader]]
|
|
630
|
+
reason_phrase: NotRequired[str]
|
|
631
|
+
status_code: NotRequired[JsUint]
|
|
632
|
+
|
|
633
|
+
class NetworkContinueWithAuth(TypedDict):
|
|
634
|
+
method: Literal["network.continueWithAuth"]
|
|
635
|
+
params: NetworkContinueWithAuthParameters
|
|
636
|
+
|
|
637
|
+
class NetworkContinueWithAuthParameters(NetworkContinueWithAuthNoCredentials):
|
|
638
|
+
request: NetworkRequest
|
|
639
|
+
|
|
640
|
+
class NetworkContinueWithAuthCredentials(TypedDict):
|
|
641
|
+
action: Literal["provideCredentials"]
|
|
642
|
+
credentials: NetworkAuthCredentials
|
|
643
|
+
|
|
644
|
+
class NetworkContinueWithAuthNoCredentials(TypedDict):
|
|
645
|
+
action: Union[Literal["default"], Literal["cancel"]]
|
|
646
|
+
|
|
647
|
+
class NetworkDisownData(TypedDict):
|
|
648
|
+
method: Literal["network.disownData"]
|
|
649
|
+
params: NetworkDisownDataParameters
|
|
650
|
+
|
|
651
|
+
class NetworkDisownDataParameters(TypedDict):
|
|
652
|
+
data_type: NetworkDataType
|
|
653
|
+
collector: NetworkCollector
|
|
654
|
+
request: NetworkRequest
|
|
655
|
+
|
|
656
|
+
class NetworkFailRequest(TypedDict):
|
|
657
|
+
method: Literal["network.failRequest"]
|
|
658
|
+
params: NetworkFailRequestParameters
|
|
659
|
+
|
|
660
|
+
class NetworkFailRequestParameters(TypedDict):
|
|
661
|
+
request: NetworkRequest
|
|
662
|
+
|
|
663
|
+
class NetworkGetData(TypedDict):
|
|
664
|
+
method: Literal["network.getData"]
|
|
665
|
+
params: NetworkGetDataParameters
|
|
666
|
+
|
|
667
|
+
class NetworkGetDataParameters(TypedDict):
|
|
668
|
+
data_type: NetworkDataType
|
|
669
|
+
collector: NotRequired[NetworkCollector]
|
|
670
|
+
disown: NotRequired[bool]
|
|
671
|
+
request: NetworkRequest
|
|
672
|
+
|
|
673
|
+
class NetworkProvideResponse(TypedDict):
|
|
674
|
+
method: Literal["network.provideResponse"]
|
|
675
|
+
params: NetworkProvideResponseParameters
|
|
676
|
+
|
|
677
|
+
class NetworkProvideResponseParameters(TypedDict):
|
|
678
|
+
request: NetworkRequest
|
|
679
|
+
body: NotRequired[NetworkBytesValue]
|
|
680
|
+
cookies: NotRequired[list[NetworkSetCookieHeader]]
|
|
681
|
+
headers: NotRequired[list[NetworkHeader]]
|
|
682
|
+
reason_phrase: NotRequired[str]
|
|
683
|
+
status_code: NotRequired[JsUint]
|
|
684
|
+
|
|
685
|
+
class NetworkRemoveDataCollector(TypedDict):
|
|
686
|
+
method: Literal["network.removeDataCollector"]
|
|
687
|
+
params: NetworkRemoveDataCollectorParameters
|
|
688
|
+
|
|
689
|
+
class NetworkRemoveDataCollectorParameters(TypedDict):
|
|
690
|
+
collector: NetworkCollector
|
|
691
|
+
|
|
692
|
+
class NetworkRemoveIntercept(TypedDict):
|
|
693
|
+
method: Literal["network.removeIntercept"]
|
|
694
|
+
params: NetworkRemoveInterceptParameters
|
|
695
|
+
|
|
696
|
+
class NetworkRemoveInterceptParameters(TypedDict):
|
|
697
|
+
intercept: NetworkIntercept
|
|
698
|
+
|
|
699
|
+
class NetworkSetCacheBehavior(TypedDict):
|
|
700
|
+
method: Literal["network.setCacheBehavior"]
|
|
701
|
+
params: NetworkSetCacheBehaviorParameters
|
|
702
|
+
|
|
703
|
+
class NetworkSetCacheBehaviorParameters(TypedDict):
|
|
704
|
+
cache_behavior: Union[Literal["default"], Literal["bypass"]]
|
|
705
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
706
|
+
|
|
707
|
+
class NetworkSetExtraHeaders(TypedDict):
|
|
708
|
+
method: Literal["network.setExtraHeaders"]
|
|
709
|
+
params: NetworkSetExtraHeadersParameters
|
|
710
|
+
|
|
711
|
+
class NetworkSetExtraHeadersParameters(TypedDict):
|
|
712
|
+
headers: list[NetworkHeader]
|
|
713
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
714
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
715
|
+
|
|
716
|
+
ScriptCommand = Union[ScriptAddPreloadScript, ScriptCallFunction, ScriptDisown, ScriptEvaluate, ScriptGetRealms, ScriptRemovePreloadScript]
|
|
717
|
+
|
|
718
|
+
ScriptChannel = str
|
|
719
|
+
|
|
720
|
+
class ScriptChannelValue(TypedDict):
|
|
721
|
+
type: Literal["channel"]
|
|
722
|
+
value: ScriptChannelProperties
|
|
723
|
+
|
|
724
|
+
class ScriptChannelProperties(TypedDict):
|
|
725
|
+
channel: ScriptChannel
|
|
726
|
+
serialization_options: NotRequired[ScriptSerializationOptions]
|
|
727
|
+
ownership: NotRequired[ScriptResultOwnership]
|
|
728
|
+
|
|
729
|
+
ScriptEvaluateResult = Union[ScriptEvaluateResultSuccess, ScriptEvaluateResultException]
|
|
730
|
+
|
|
731
|
+
class ScriptEvaluateResultSuccess(TypedDict):
|
|
732
|
+
type: Literal["success"]
|
|
733
|
+
result: ScriptRemoteValue
|
|
734
|
+
realm: ScriptRealm
|
|
735
|
+
|
|
736
|
+
class ScriptEvaluateResultException(TypedDict):
|
|
737
|
+
type: Literal["exception"]
|
|
738
|
+
exception_details: ScriptExceptionDetails
|
|
739
|
+
realm: ScriptRealm
|
|
740
|
+
|
|
741
|
+
class ScriptExceptionDetails(TypedDict):
|
|
742
|
+
column_number: JsUint
|
|
743
|
+
exception: ScriptRemoteValue
|
|
744
|
+
line_number: JsUint
|
|
745
|
+
stack_trace: ScriptStackTrace
|
|
746
|
+
text: str
|
|
747
|
+
|
|
748
|
+
ScriptHandle = str
|
|
749
|
+
|
|
750
|
+
ScriptInternalId = str
|
|
751
|
+
|
|
752
|
+
ScriptLocalValue = Union[ScriptRemoteReference, ScriptPrimitiveProtocolValue, ScriptChannelValue, ScriptArrayLocalValue, ScriptDateLocalValue, ScriptMapLocalValue, ScriptObjectLocalValue, ScriptRegExpLocalValue, ScriptSetLocalValue]
|
|
753
|
+
|
|
754
|
+
ScriptListLocalValue = list[ScriptLocalValue]
|
|
755
|
+
|
|
756
|
+
class ScriptArrayLocalValue(TypedDict):
|
|
757
|
+
type: Literal["array"]
|
|
758
|
+
value: ScriptListLocalValue
|
|
759
|
+
|
|
760
|
+
class ScriptDateLocalValue(TypedDict):
|
|
761
|
+
type: Literal["date"]
|
|
762
|
+
value: str
|
|
763
|
+
|
|
764
|
+
ScriptMappingLocalValue = list[Union[ScriptLocalValue, str]]
|
|
765
|
+
|
|
766
|
+
class ScriptMapLocalValue(TypedDict):
|
|
767
|
+
type: Literal["map"]
|
|
768
|
+
value: ScriptMappingLocalValue
|
|
769
|
+
|
|
770
|
+
class ScriptObjectLocalValue(TypedDict):
|
|
771
|
+
type: Literal["object"]
|
|
772
|
+
value: ScriptMappingLocalValue
|
|
773
|
+
|
|
774
|
+
class ScriptRegExpValue(TypedDict):
|
|
775
|
+
pattern: str
|
|
776
|
+
flags: NotRequired[str]
|
|
777
|
+
|
|
778
|
+
class ScriptRegExpLocalValue(TypedDict):
|
|
779
|
+
type: Literal["regexp"]
|
|
780
|
+
value: ScriptRegExpValue
|
|
781
|
+
|
|
782
|
+
class ScriptSetLocalValue(TypedDict):
|
|
783
|
+
type: Literal["set"]
|
|
784
|
+
value: ScriptListLocalValue
|
|
785
|
+
|
|
786
|
+
ScriptPreloadScript = str
|
|
787
|
+
|
|
788
|
+
ScriptRealm = str
|
|
789
|
+
|
|
790
|
+
ScriptPrimitiveProtocolValue = Union[ScriptUndefinedValue, ScriptNullValue, ScriptStringValue, ScriptNumberValue, ScriptBooleanValue, ScriptBigIntValue]
|
|
791
|
+
|
|
792
|
+
class ScriptUndefinedValue(TypedDict):
|
|
793
|
+
type: Literal["undefined"]
|
|
794
|
+
|
|
795
|
+
class ScriptNullValue(TypedDict):
|
|
796
|
+
type: None
|
|
797
|
+
|
|
798
|
+
class ScriptStringValue(TypedDict):
|
|
799
|
+
type: Literal["string"]
|
|
800
|
+
value: str
|
|
801
|
+
|
|
802
|
+
ScriptSpecialNumber = Union[Literal["NaN"], Literal["-0"], Literal["Infinity"], Literal["-Infinity"]]
|
|
803
|
+
|
|
804
|
+
class ScriptNumberValue(TypedDict):
|
|
805
|
+
type: Literal["number"]
|
|
806
|
+
value: Union[Number, ScriptSpecialNumber]
|
|
807
|
+
|
|
808
|
+
class ScriptBooleanValue(TypedDict):
|
|
809
|
+
type: Literal["boolean"]
|
|
810
|
+
value: bool
|
|
811
|
+
|
|
812
|
+
class ScriptBigIntValue(TypedDict):
|
|
813
|
+
type: Literal["bigint"]
|
|
814
|
+
value: str
|
|
815
|
+
|
|
816
|
+
ScriptRealmType = Union[Literal["window"], Literal["dedicated-worker"], Literal["shared-worker"], Literal["service-worker"], Literal["worker"], Literal["paint-worklet"], Literal["audio-worklet"], Literal["worklet"]]
|
|
817
|
+
|
|
818
|
+
ScriptRemoteReference = Union[ScriptSharedReference, ScriptRemoteObjectReference]
|
|
819
|
+
|
|
820
|
+
class ScriptSharedReference(Extensible):
|
|
821
|
+
shared_id: ScriptSharedId
|
|
822
|
+
handle: NotRequired[ScriptHandle]
|
|
823
|
+
|
|
824
|
+
class ScriptRemoteObjectReference(Extensible):
|
|
825
|
+
handle: ScriptHandle
|
|
826
|
+
shared_id: NotRequired[ScriptSharedId]
|
|
827
|
+
|
|
828
|
+
ScriptRemoteValue = Union[ScriptPrimitiveProtocolValue, ScriptSymbolRemoteValue, ScriptArrayRemoteValue, ScriptObjectRemoteValue, ScriptFunctionRemoteValue, ScriptRegExpRemoteValue, ScriptDateRemoteValue, ScriptMapRemoteValue, ScriptSetRemoteValue, ScriptWeakMapRemoteValue, ScriptWeakSetRemoteValue, ScriptGeneratorRemoteValue, ScriptErrorRemoteValue, ScriptProxyRemoteValue, ScriptPromiseRemoteValue, ScriptTypedArrayRemoteValue, ScriptArrayBufferRemoteValue, ScriptNodeListRemoteValue, ScriptHtmlCollectionRemoteValue, ScriptNodeRemoteValue, ScriptWindowProxyRemoteValue]
|
|
829
|
+
|
|
830
|
+
ScriptListRemoteValue = list[ScriptRemoteValue]
|
|
831
|
+
|
|
832
|
+
ScriptMappingRemoteValue = list[Union[ScriptRemoteValue, str]]
|
|
833
|
+
|
|
834
|
+
class ScriptSymbolRemoteValue(TypedDict):
|
|
835
|
+
type: Literal["symbol"]
|
|
836
|
+
handle: NotRequired[ScriptHandle]
|
|
837
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
838
|
+
|
|
839
|
+
class ScriptArrayRemoteValue(TypedDict):
|
|
840
|
+
type: Literal["array"]
|
|
841
|
+
handle: NotRequired[ScriptHandle]
|
|
842
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
843
|
+
value: NotRequired[ScriptListRemoteValue]
|
|
844
|
+
|
|
845
|
+
class ScriptObjectRemoteValue(TypedDict):
|
|
846
|
+
type: Literal["object"]
|
|
847
|
+
handle: NotRequired[ScriptHandle]
|
|
848
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
849
|
+
value: NotRequired[ScriptMappingRemoteValue]
|
|
850
|
+
|
|
851
|
+
class ScriptFunctionRemoteValue(TypedDict):
|
|
852
|
+
type: Literal["function"]
|
|
853
|
+
handle: NotRequired[ScriptHandle]
|
|
854
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
855
|
+
|
|
856
|
+
class ScriptRegExpRemoteValue(ScriptRegExpLocalValue):
|
|
857
|
+
handle: NotRequired[ScriptHandle]
|
|
858
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
859
|
+
|
|
860
|
+
class ScriptDateRemoteValue(ScriptDateLocalValue):
|
|
861
|
+
handle: NotRequired[ScriptHandle]
|
|
862
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
863
|
+
|
|
864
|
+
class ScriptMapRemoteValue(TypedDict):
|
|
865
|
+
type: Literal["map"]
|
|
866
|
+
handle: NotRequired[ScriptHandle]
|
|
867
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
868
|
+
value: NotRequired[ScriptMappingRemoteValue]
|
|
869
|
+
|
|
870
|
+
class ScriptSetRemoteValue(TypedDict):
|
|
871
|
+
type: Literal["set"]
|
|
872
|
+
handle: NotRequired[ScriptHandle]
|
|
873
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
874
|
+
value: NotRequired[ScriptListRemoteValue]
|
|
875
|
+
|
|
876
|
+
class ScriptWeakMapRemoteValue(TypedDict):
|
|
877
|
+
type: Literal["weakmap"]
|
|
878
|
+
handle: NotRequired[ScriptHandle]
|
|
879
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
880
|
+
|
|
881
|
+
class ScriptWeakSetRemoteValue(TypedDict):
|
|
882
|
+
type: Literal["weakset"]
|
|
883
|
+
handle: NotRequired[ScriptHandle]
|
|
884
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
885
|
+
|
|
886
|
+
class ScriptGeneratorRemoteValue(TypedDict):
|
|
887
|
+
type: Literal["generator"]
|
|
888
|
+
handle: NotRequired[ScriptHandle]
|
|
889
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
890
|
+
|
|
891
|
+
class ScriptErrorRemoteValue(TypedDict):
|
|
892
|
+
type: Literal["error"]
|
|
893
|
+
handle: NotRequired[ScriptHandle]
|
|
894
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
895
|
+
|
|
896
|
+
class ScriptProxyRemoteValue(TypedDict):
|
|
897
|
+
type: Literal["proxy"]
|
|
898
|
+
handle: NotRequired[ScriptHandle]
|
|
899
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
900
|
+
|
|
901
|
+
class ScriptPromiseRemoteValue(TypedDict):
|
|
902
|
+
type: Literal["promise"]
|
|
903
|
+
handle: NotRequired[ScriptHandle]
|
|
904
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
905
|
+
|
|
906
|
+
class ScriptTypedArrayRemoteValue(TypedDict):
|
|
907
|
+
type: Literal["typedarray"]
|
|
908
|
+
handle: NotRequired[ScriptHandle]
|
|
909
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
910
|
+
|
|
911
|
+
class ScriptArrayBufferRemoteValue(TypedDict):
|
|
912
|
+
type: Literal["arraybuffer"]
|
|
913
|
+
handle: NotRequired[ScriptHandle]
|
|
914
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
915
|
+
|
|
916
|
+
class ScriptNodeListRemoteValue(TypedDict):
|
|
917
|
+
type: Literal["nodelist"]
|
|
918
|
+
handle: NotRequired[ScriptHandle]
|
|
919
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
920
|
+
value: NotRequired[ScriptListRemoteValue]
|
|
921
|
+
|
|
922
|
+
class ScriptHtmlCollectionRemoteValue(TypedDict):
|
|
923
|
+
type: Literal["htmlcollection"]
|
|
924
|
+
handle: NotRequired[ScriptHandle]
|
|
925
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
926
|
+
value: NotRequired[ScriptListRemoteValue]
|
|
927
|
+
|
|
928
|
+
class ScriptNodeRemoteValue(TypedDict):
|
|
929
|
+
type: Literal["node"]
|
|
930
|
+
shared_id: NotRequired[ScriptSharedId]
|
|
931
|
+
handle: NotRequired[ScriptHandle]
|
|
932
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
933
|
+
value: NotRequired[ScriptNodeProperties]
|
|
934
|
+
|
|
935
|
+
class ScriptNodeProperties(TypedDict):
|
|
936
|
+
node_type: JsUint
|
|
937
|
+
child_node_count: JsUint
|
|
938
|
+
attributes: NotRequired[dict[str, str]]
|
|
939
|
+
children: NotRequired[list[ScriptNodeRemoteValue]]
|
|
940
|
+
local_name: NotRequired[str]
|
|
941
|
+
mode: NotRequired[Union[Literal["open"], Literal["closed"]]]
|
|
942
|
+
namespace_uri: NotRequired[str]
|
|
943
|
+
node_value: NotRequired[str]
|
|
944
|
+
shadow_root: NotRequired[Union[ScriptNodeRemoteValue, None]]
|
|
945
|
+
|
|
946
|
+
class ScriptWindowProxyRemoteValue(TypedDict):
|
|
947
|
+
type: Literal["window"]
|
|
948
|
+
value: ScriptWindowProxyProperties
|
|
949
|
+
handle: NotRequired[ScriptHandle]
|
|
950
|
+
internal_id: NotRequired[ScriptInternalId]
|
|
951
|
+
|
|
952
|
+
class ScriptWindowProxyProperties(TypedDict):
|
|
953
|
+
context: BrowsingContextBrowsingContext
|
|
954
|
+
|
|
955
|
+
ScriptResultOwnership = Union[Literal["root"], Literal["none"]]
|
|
956
|
+
|
|
957
|
+
class ScriptSerializationOptions(TypedDict):
|
|
958
|
+
max_dom_depth: NotRequired[Union[JsUint, None]]
|
|
959
|
+
max_object_depth: NotRequired[Union[JsUint, None]]
|
|
960
|
+
include_shadow_tree: NotRequired[Union[Literal["none"], Literal["open"], Literal["all"]]]
|
|
961
|
+
|
|
962
|
+
ScriptSharedId = str
|
|
963
|
+
|
|
964
|
+
class ScriptStackFrame(TypedDict):
|
|
965
|
+
column_number: JsUint
|
|
966
|
+
function_name: str
|
|
967
|
+
line_number: JsUint
|
|
968
|
+
url: str
|
|
969
|
+
|
|
970
|
+
class ScriptStackTrace(TypedDict):
|
|
971
|
+
call_frames: list[ScriptStackFrame]
|
|
972
|
+
|
|
973
|
+
class ScriptRealmTarget(TypedDict):
|
|
974
|
+
realm: ScriptRealm
|
|
975
|
+
|
|
976
|
+
class ScriptContextTarget(TypedDict):
|
|
977
|
+
context: BrowsingContextBrowsingContext
|
|
978
|
+
sandbox: NotRequired[str]
|
|
979
|
+
|
|
980
|
+
ScriptTarget = Union[ScriptContextTarget, ScriptRealmTarget]
|
|
981
|
+
|
|
982
|
+
class ScriptAddPreloadScript(TypedDict):
|
|
983
|
+
method: Literal["script.addPreloadScript"]
|
|
984
|
+
params: ScriptAddPreloadScriptParameters
|
|
985
|
+
|
|
986
|
+
class ScriptAddPreloadScriptParameters(TypedDict):
|
|
987
|
+
function_declaration: str
|
|
988
|
+
arguments: NotRequired[list[ScriptChannelValue]]
|
|
989
|
+
contexts: NotRequired[list[BrowsingContextBrowsingContext]]
|
|
990
|
+
user_contexts: NotRequired[list[BrowserUserContext]]
|
|
991
|
+
sandbox: NotRequired[str]
|
|
992
|
+
|
|
993
|
+
class ScriptDisown(TypedDict):
|
|
994
|
+
method: Literal["script.disown"]
|
|
995
|
+
params: ScriptDisownParameters
|
|
996
|
+
|
|
997
|
+
class ScriptDisownParameters(TypedDict):
|
|
998
|
+
handles: list[ScriptHandle]
|
|
999
|
+
target: ScriptTarget
|
|
1000
|
+
|
|
1001
|
+
class ScriptCallFunction(TypedDict):
|
|
1002
|
+
method: Literal["script.callFunction"]
|
|
1003
|
+
params: ScriptCallFunctionParameters
|
|
1004
|
+
|
|
1005
|
+
class ScriptCallFunctionParameters(TypedDict):
|
|
1006
|
+
function_declaration: str
|
|
1007
|
+
await_promise: bool
|
|
1008
|
+
target: ScriptTarget
|
|
1009
|
+
arguments: NotRequired[list[ScriptLocalValue]]
|
|
1010
|
+
result_ownership: NotRequired[ScriptResultOwnership]
|
|
1011
|
+
serialization_options: NotRequired[ScriptSerializationOptions]
|
|
1012
|
+
this: NotRequired[ScriptLocalValue]
|
|
1013
|
+
user_activation: NotRequired[bool]
|
|
1014
|
+
|
|
1015
|
+
class ScriptEvaluate(TypedDict):
|
|
1016
|
+
method: Literal["script.evaluate"]
|
|
1017
|
+
params: ScriptEvaluateParameters
|
|
1018
|
+
|
|
1019
|
+
class ScriptEvaluateParameters(TypedDict):
|
|
1020
|
+
expression: str
|
|
1021
|
+
target: ScriptTarget
|
|
1022
|
+
await_promise: bool
|
|
1023
|
+
result_ownership: NotRequired[ScriptResultOwnership]
|
|
1024
|
+
serialization_options: NotRequired[ScriptSerializationOptions]
|
|
1025
|
+
user_activation: NotRequired[bool]
|
|
1026
|
+
|
|
1027
|
+
class ScriptGetRealms(TypedDict):
|
|
1028
|
+
method: Literal["script.getRealms"]
|
|
1029
|
+
params: ScriptGetRealmsParameters
|
|
1030
|
+
|
|
1031
|
+
class ScriptGetRealmsParameters(TypedDict):
|
|
1032
|
+
context: NotRequired[BrowsingContextBrowsingContext]
|
|
1033
|
+
type: NotRequired[ScriptRealmType]
|
|
1034
|
+
|
|
1035
|
+
class ScriptRemovePreloadScript(TypedDict):
|
|
1036
|
+
method: Literal["script.removePreloadScript"]
|
|
1037
|
+
params: ScriptRemovePreloadScriptParameters
|
|
1038
|
+
|
|
1039
|
+
class ScriptRemovePreloadScriptParameters(TypedDict):
|
|
1040
|
+
script: ScriptPreloadScript
|
|
1041
|
+
|
|
1042
|
+
StorageCommand = Union[StorageDeleteCookies, StorageGetCookies, StorageSetCookie]
|
|
1043
|
+
|
|
1044
|
+
class StoragePartitionKey(Extensible):
|
|
1045
|
+
user_context: NotRequired[str]
|
|
1046
|
+
source_origin: NotRequired[str]
|
|
1047
|
+
|
|
1048
|
+
class StorageGetCookies(TypedDict):
|
|
1049
|
+
method: Literal["storage.getCookies"]
|
|
1050
|
+
params: StorageGetCookiesParameters
|
|
1051
|
+
|
|
1052
|
+
class StorageCookieFilter(Extensible):
|
|
1053
|
+
name: NotRequired[str]
|
|
1054
|
+
value: NotRequired[NetworkBytesValue]
|
|
1055
|
+
domain: NotRequired[str]
|
|
1056
|
+
path: NotRequired[str]
|
|
1057
|
+
size: NotRequired[JsUint]
|
|
1058
|
+
http_only: NotRequired[bool]
|
|
1059
|
+
secure: NotRequired[bool]
|
|
1060
|
+
same_site: NotRequired[NetworkSameSite]
|
|
1061
|
+
expiry: NotRequired[JsUint]
|
|
1062
|
+
|
|
1063
|
+
class StorageBrowsingContextPartitionDescriptor(TypedDict):
|
|
1064
|
+
type: Literal["context"]
|
|
1065
|
+
context: BrowsingContextBrowsingContext
|
|
1066
|
+
|
|
1067
|
+
class StorageStorageKeyPartitionDescriptor(Extensible):
|
|
1068
|
+
type: Literal["storageKey"]
|
|
1069
|
+
user_context: NotRequired[str]
|
|
1070
|
+
source_origin: NotRequired[str]
|
|
1071
|
+
|
|
1072
|
+
StoragePartitionDescriptor = Union[StorageBrowsingContextPartitionDescriptor, StorageStorageKeyPartitionDescriptor]
|
|
1073
|
+
|
|
1074
|
+
class StorageGetCookiesParameters(TypedDict):
|
|
1075
|
+
filter: NotRequired[StorageCookieFilter]
|
|
1076
|
+
partition: NotRequired[StoragePartitionDescriptor]
|
|
1077
|
+
|
|
1078
|
+
class StorageSetCookie(TypedDict):
|
|
1079
|
+
method: Literal["storage.setCookie"]
|
|
1080
|
+
params: StorageSetCookieParameters
|
|
1081
|
+
|
|
1082
|
+
class StoragePartialCookie(Extensible):
|
|
1083
|
+
name: str
|
|
1084
|
+
value: NetworkBytesValue
|
|
1085
|
+
domain: str
|
|
1086
|
+
path: NotRequired[str]
|
|
1087
|
+
http_only: NotRequired[bool]
|
|
1088
|
+
secure: NotRequired[bool]
|
|
1089
|
+
same_site: NotRequired[NetworkSameSite]
|
|
1090
|
+
expiry: NotRequired[JsUint]
|
|
1091
|
+
|
|
1092
|
+
class StorageSetCookieParameters(TypedDict):
|
|
1093
|
+
cookie: StoragePartialCookie
|
|
1094
|
+
partition: NotRequired[StoragePartitionDescriptor]
|
|
1095
|
+
|
|
1096
|
+
class StorageDeleteCookies(TypedDict):
|
|
1097
|
+
method: Literal["storage.deleteCookies"]
|
|
1098
|
+
params: StorageDeleteCookiesParameters
|
|
1099
|
+
|
|
1100
|
+
class StorageDeleteCookiesParameters(TypedDict):
|
|
1101
|
+
filter: NotRequired[StorageCookieFilter]
|
|
1102
|
+
partition: NotRequired[StoragePartitionDescriptor]
|
|
1103
|
+
|
|
1104
|
+
InputCommand = Union[InputPerformActions, InputReleaseActions, InputSetFiles]
|
|
1105
|
+
|
|
1106
|
+
class InputElementOrigin(TypedDict):
|
|
1107
|
+
type: Literal["element"]
|
|
1108
|
+
element: ScriptSharedReference
|
|
1109
|
+
|
|
1110
|
+
class InputPerformActions(TypedDict):
|
|
1111
|
+
method: Literal["input.performActions"]
|
|
1112
|
+
params: InputPerformActionsParameters
|
|
1113
|
+
|
|
1114
|
+
class InputPerformActionsParameters(TypedDict):
|
|
1115
|
+
context: BrowsingContextBrowsingContext
|
|
1116
|
+
actions: list[InputSourceActions]
|
|
1117
|
+
|
|
1118
|
+
InputSourceActions = Union[InputNoneSourceActions, InputKeySourceActions, InputPointerSourceActions, InputWheelSourceActions]
|
|
1119
|
+
|
|
1120
|
+
class InputNoneSourceActions(TypedDict):
|
|
1121
|
+
type: Literal["none"]
|
|
1122
|
+
id: str
|
|
1123
|
+
actions: list[InputNoneSourceAction]
|
|
1124
|
+
|
|
1125
|
+
InputNoneSourceAction = InputPauseAction
|
|
1126
|
+
|
|
1127
|
+
class InputKeySourceActions(TypedDict):
|
|
1128
|
+
type: Literal["key"]
|
|
1129
|
+
id: str
|
|
1130
|
+
actions: list[InputKeySourceAction]
|
|
1131
|
+
|
|
1132
|
+
InputKeySourceAction = Union[InputPauseAction, InputKeyDownAction, InputKeyUpAction]
|
|
1133
|
+
|
|
1134
|
+
class InputPointerSourceActions(TypedDict):
|
|
1135
|
+
type: Literal["pointer"]
|
|
1136
|
+
id: str
|
|
1137
|
+
parameters: NotRequired[InputPointerParameters]
|
|
1138
|
+
actions: list[InputPointerSourceAction]
|
|
1139
|
+
|
|
1140
|
+
InputPointerType = Union[Literal["mouse"], Literal["pen"], Literal["touch"]]
|
|
1141
|
+
|
|
1142
|
+
class InputPointerParameters(TypedDict):
|
|
1143
|
+
pointer_type: NotRequired[InputPointerType]
|
|
1144
|
+
|
|
1145
|
+
InputPointerSourceAction = Union[InputPauseAction, InputPointerDownAction, InputPointerUpAction, InputPointerMoveAction]
|
|
1146
|
+
|
|
1147
|
+
class InputWheelSourceActions(TypedDict):
|
|
1148
|
+
type: Literal["wheel"]
|
|
1149
|
+
id: str
|
|
1150
|
+
actions: list[InputWheelSourceAction]
|
|
1151
|
+
|
|
1152
|
+
InputWheelSourceAction = Union[InputPauseAction, InputWheelScrollAction]
|
|
1153
|
+
|
|
1154
|
+
class InputPauseAction(TypedDict):
|
|
1155
|
+
type: Literal["pause"]
|
|
1156
|
+
duration: NotRequired[JsUint]
|
|
1157
|
+
|
|
1158
|
+
class InputKeyDownAction(TypedDict):
|
|
1159
|
+
type: Literal["keyDown"]
|
|
1160
|
+
value: str
|
|
1161
|
+
|
|
1162
|
+
class InputKeyUpAction(TypedDict):
|
|
1163
|
+
type: Literal["keyUp"]
|
|
1164
|
+
value: str
|
|
1165
|
+
|
|
1166
|
+
class InputPointerUpAction(TypedDict):
|
|
1167
|
+
type: Literal["pointerUp"]
|
|
1168
|
+
button: JsUint
|
|
1169
|
+
|
|
1170
|
+
class InputPointerDownAction(InputPointerCommonProperties):
|
|
1171
|
+
type: Literal["pointerDown"]
|
|
1172
|
+
button: JsUint
|
|
1173
|
+
|
|
1174
|
+
class InputPointerMoveAction(InputPointerCommonProperties):
|
|
1175
|
+
type: Literal["pointerMove"]
|
|
1176
|
+
x: float
|
|
1177
|
+
y: float
|
|
1178
|
+
duration: NotRequired[JsUint]
|
|
1179
|
+
origin: NotRequired[InputOrigin]
|
|
1180
|
+
|
|
1181
|
+
class InputWheelScrollAction(TypedDict):
|
|
1182
|
+
type: Literal["scroll"]
|
|
1183
|
+
x: JsInt
|
|
1184
|
+
y: JsInt
|
|
1185
|
+
delta_x: JsInt
|
|
1186
|
+
delta_y: JsInt
|
|
1187
|
+
duration: NotRequired[JsUint]
|
|
1188
|
+
origin: NotRequired[InputOrigin]
|
|
1189
|
+
|
|
1190
|
+
class InputPointerCommonProperties(TypedDict):
|
|
1191
|
+
width: NotRequired[JsUint]
|
|
1192
|
+
height: NotRequired[JsUint]
|
|
1193
|
+
pressure: NotRequired[int]
|
|
1194
|
+
tangential_pressure: NotRequired[int]
|
|
1195
|
+
twist: NotRequired[int] # 0 .. Math.PI / 2
|
|
1196
|
+
altitude_angle: NotRequired[int] # 0 .. 2 * Math.PI
|
|
1197
|
+
azimuth_angle: NotRequired[int]
|
|
1198
|
+
|
|
1199
|
+
InputOrigin = Union[Literal["viewport"], Literal["pointer"], InputElementOrigin]
|
|
1200
|
+
|
|
1201
|
+
class InputReleaseActions(TypedDict):
|
|
1202
|
+
method: Literal["input.releaseActions"]
|
|
1203
|
+
params: InputReleaseActionsParameters
|
|
1204
|
+
|
|
1205
|
+
class InputReleaseActionsParameters(TypedDict):
|
|
1206
|
+
context: BrowsingContextBrowsingContext
|
|
1207
|
+
|
|
1208
|
+
class InputSetFiles(TypedDict):
|
|
1209
|
+
method: Literal["input.setFiles"]
|
|
1210
|
+
params: InputSetFilesParameters
|
|
1211
|
+
|
|
1212
|
+
class InputSetFilesParameters(TypedDict):
|
|
1213
|
+
context: BrowsingContextBrowsingContext
|
|
1214
|
+
element: ScriptSharedReference
|
|
1215
|
+
files: list[str]
|
|
1216
|
+
|
|
1217
|
+
WebExtensionCommand = Union[WebExtensionInstall, WebExtensionUninstall]
|
|
1218
|
+
|
|
1219
|
+
WebExtensionExtension = str
|
|
1220
|
+
|
|
1221
|
+
class WebExtensionInstall(TypedDict):
|
|
1222
|
+
method: Literal["webExtension.install"]
|
|
1223
|
+
params: WebExtensionInstallParameters
|
|
1224
|
+
|
|
1225
|
+
class WebExtensionInstallParameters(TypedDict):
|
|
1226
|
+
extension_data: WebExtensionExtensionData
|
|
1227
|
+
|
|
1228
|
+
WebExtensionExtensionData = Union[WebExtensionExtensionArchivePath, WebExtensionExtensionBase64Encoded, WebExtensionExtensionPath]
|
|
1229
|
+
|
|
1230
|
+
class WebExtensionExtensionPath(TypedDict):
|
|
1231
|
+
type: Literal["path"]
|
|
1232
|
+
path: str
|
|
1233
|
+
|
|
1234
|
+
class WebExtensionExtensionArchivePath(TypedDict):
|
|
1235
|
+
type: Literal["archivePath"]
|
|
1236
|
+
path: str
|
|
1237
|
+
|
|
1238
|
+
class WebExtensionExtensionBase64Encoded(TypedDict):
|
|
1239
|
+
type: Literal["base64"]
|
|
1240
|
+
value: str
|
|
1241
|
+
|
|
1242
|
+
class WebExtensionUninstall(TypedDict):
|
|
1243
|
+
method: Literal["webExtension.uninstall"]
|
|
1244
|
+
params: WebExtensionUninstallParameters
|
|
1245
|
+
|
|
1246
|
+
class WebExtensionUninstallParameters(TypedDict):
|
|
1247
|
+
extension: WebExtensionExtension
|
|
1248
|
+
"
|
|
1249
|
+
`;
|