cddl2ts 0.3.0 → 0.4.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.
@@ -0,0 +1,1017 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`webdriver examples > should generate types for local.cddl 1`] = `
4
+ "export type Message = CommandResponse | ErrorResponse | Event;
5
+
6
+ export type CommandResponse = Extensible & {
7
+ type: "success";
8
+ id: JsUint;
9
+ result: ResultData;
10
+ };
11
+
12
+ export type ErrorResponse = Extensible & {
13
+ type: "error";
14
+ id: JsUint | null;
15
+ error: ErrorCode;
16
+ message: string;
17
+ stacktrace?: string;
18
+ };
19
+
20
+ export type ResultData = BrowserResult | BrowsingContextResult | EmulationResult | InputResult | NetworkResult | ScriptResult | SessionResult | StorageResult | WebExtensionResult;
21
+ export type EmptyResult = Extensible;
22
+
23
+ export type Event = EventData & Extensible & {
24
+ type: "event";
25
+ };
26
+
27
+ export type EventData = BrowsingContextEvent | InputEvent | LogEvent | NetworkEvent | ScriptEvent;
28
+ export type Extensible = Record<string, unknown>;
29
+ export type JsInt = number;
30
+ export type JsUint = number;
31
+ export type ErrorCode = "invalid argument" | "invalid selector" | "invalid session id" | "invalid web extension" | "move target out of bounds" | "no such alert" | "no such network collector" | "no such element" | "no such frame" | "no such handle" | "no such history entry" | "no such intercept" | "no such network data" | "no such node" | "no such request" | "no such script" | "no such storage partition" | "no such user context" | "no such web extension" | "session not created" | "unable to capture screen" | "unable to close browser" | "unable to set cookie" | "unable to set file input" | "unavailable network data" | "underspecified storage partition" | "unknown command" | "unknown error" | "unsupported operation";
32
+ export type SessionResult = SessionEndResult | SessionNewResult | SessionStatusResult | SessionSubscribeResult | SessionUnsubscribeResult;
33
+
34
+ export interface SessionCapabilitiesRequest {
35
+ alwaysMatch?: SessionCapabilityRequest;
36
+ firstMatch?: SessionCapabilityRequest[];
37
+ }
38
+
39
+ export type SessionCapabilityRequest = Extensible & {
40
+ acceptInsecureCerts?: boolean;
41
+ browserName?: string;
42
+ browserVersion?: string;
43
+ platformName?: string;
44
+ proxy?: SessionProxyConfiguration;
45
+ unhandledPromptBehavior?: SessionUserPromptHandler;
46
+ };
47
+
48
+ export type SessionProxyConfiguration = SessionAutodetectProxyConfiguration | SessionDirectProxyConfiguration | SessionManualProxyConfiguration | SessionPacProxyConfiguration | SessionSystemProxyConfiguration;
49
+
50
+ export type SessionAutodetectProxyConfiguration = Extensible & {
51
+ proxyType: "autodetect";
52
+ };
53
+
54
+ export type SessionDirectProxyConfiguration = Extensible & {
55
+ proxyType: "direct";
56
+ };
57
+
58
+ export type SessionManualProxyConfiguration = SessionSocksProxyConfiguration & Extensible & {
59
+ proxyType: "manual";
60
+ httpProxy?: string;
61
+ sslProxy?: string;
62
+ noProxy?: string[];
63
+ };
64
+
65
+ export interface SessionSocksProxyConfiguration {
66
+ socksProxy: string;
67
+ socksVersion: number;
68
+ }
69
+
70
+ export type SessionPacProxyConfiguration = Extensible & {
71
+ proxyType: "pac";
72
+ proxyAutoconfigUrl: string;
73
+ };
74
+
75
+ export type SessionSystemProxyConfiguration = Extensible & {
76
+ proxyType: "system";
77
+ };
78
+
79
+ export interface SessionUserPromptHandler {
80
+ alert?: SessionUserPromptHandlerType;
81
+ beforeUnload?: SessionUserPromptHandlerType;
82
+ confirm?: SessionUserPromptHandlerType;
83
+ default?: SessionUserPromptHandlerType;
84
+ file?: SessionUserPromptHandlerType;
85
+ prompt?: SessionUserPromptHandlerType;
86
+ }
87
+
88
+ export type SessionUserPromptHandlerType = "accept" | "dismiss" | "ignore";
89
+ export type SessionSubscription = string;
90
+
91
+ export interface SessionStatusResult {
92
+ ready: boolean;
93
+ message: string;
94
+ }
95
+
96
+ export interface SessionNewResult {
97
+ sessionId: string;
98
+ capabilities: {
99
+ acceptInsecureCerts: boolean;
100
+ browserName: string;
101
+ browserVersion: string;
102
+ platformName: string;
103
+ setWindowRect: boolean;
104
+ userAgent: string;
105
+ proxy?: SessionProxyConfiguration;
106
+ unhandledPromptBehavior?: SessionUserPromptHandler;
107
+ webSocketUrl?: string;
108
+ };
109
+ }
110
+
111
+ export type SessionEndResult = EmptyResult;
112
+
113
+ export interface SessionSubscribeResult {
114
+ subscription: SessionSubscription;
115
+ }
116
+
117
+ export type SessionUnsubscribeResult = EmptyResult;
118
+ export type BrowserResult = BrowserCloseResult | BrowserCreateUserContextResult | BrowserGetClientWindowsResult | BrowserGetUserContextsResult | BrowserRemoveUserContextResult | BrowserSetClientWindowStateResult | BrowserSetDownloadBehaviorResult;
119
+ export type BrowserClientWindow = string;
120
+
121
+ export interface BrowserClientWindowInfo {
122
+ active: boolean;
123
+ clientWindow: BrowserClientWindow;
124
+ height: JsUint;
125
+ state: "fullscreen" | "maximized" | "minimized" | "normal";
126
+ width: JsUint;
127
+ x: JsInt;
128
+ y: JsInt;
129
+ }
130
+
131
+ export type BrowserUserContext = string;
132
+
133
+ export interface BrowserUserContextInfo {
134
+ userContext: BrowserUserContext;
135
+ }
136
+
137
+ export type BrowserCloseResult = EmptyResult;
138
+ export type BrowserCreateUserContextResult = BrowserUserContextInfo;
139
+
140
+ export interface BrowserGetClientWindowsResult {
141
+ clientWindows: BrowserClientWindowInfo[];
142
+ }
143
+
144
+ export interface BrowserGetUserContextsResult {
145
+ userContexts: BrowserUserContextInfo[];
146
+ }
147
+
148
+ export type BrowserRemoveUserContextResult = EmptyResult;
149
+ export type BrowserSetClientWindowStateResult = BrowserClientWindowInfo;
150
+ export type BrowserSetDownloadBehaviorResult = EmptyResult;
151
+ export type BrowsingContextResult = BrowsingContextActivateResult | BrowsingContextCaptureScreenshotResult | BrowsingContextCloseResult | BrowsingContextCreateResult | BrowsingContextGetTreeResult | BrowsingContextHandleUserPromptResult | BrowsingContextLocateNodesResult | BrowsingContextNavigateResult | BrowsingContextPrintResult | BrowsingContextReloadResult | BrowsingContextSetBypassCspResult | BrowsingContextSetViewportResult | BrowsingContextTraverseHistoryResult;
152
+ export type BrowsingContextEvent = BrowsingContextContextCreated | BrowsingContextContextDestroyed | BrowsingContextDomContentLoaded | BrowsingContextDownloadEnd | BrowsingContextDownloadWillBegin | BrowsingContextFragmentNavigated | BrowsingContextHistoryUpdated | BrowsingContextLoad | BrowsingContextNavigationAborted | BrowsingContextNavigationCommitted | BrowsingContextNavigationFailed | BrowsingContextNavigationStarted | BrowsingContextUserPromptClosed | BrowsingContextUserPromptOpened;
153
+ export type BrowsingContextBrowsingContext = string;
154
+ export type BrowsingContextInfoList = BrowsingContextInfo[];
155
+
156
+ export interface BrowsingContextInfo {
157
+ children: BrowsingContextInfoList | null;
158
+ clientWindow: BrowserClientWindow;
159
+ context: BrowsingContextBrowsingContext;
160
+ originalOpener: BrowsingContextBrowsingContext | null;
161
+ url: string;
162
+ userContext: BrowserUserContext;
163
+ parent?: BrowsingContextBrowsingContext | null;
164
+ }
165
+
166
+ export type BrowsingContextLocator = BrowsingContextAccessibilityLocator | BrowsingContextCssLocator | BrowsingContextContextLocator | BrowsingContextInnerTextLocator | BrowsingContextXPathLocator;
167
+
168
+ export interface BrowsingContextAccessibilityLocator {
169
+ type: "accessibility";
170
+ value: {
171
+ name?: string;
172
+ role?: string;
173
+ };
174
+ }
175
+
176
+ export interface BrowsingContextCssLocator {
177
+ type: "css";
178
+ value: string;
179
+ }
180
+
181
+ export interface BrowsingContextContextLocator {
182
+ type: "context";
183
+ value: {
184
+ context: BrowsingContextBrowsingContext;
185
+ };
186
+ }
187
+
188
+ export interface BrowsingContextInnerTextLocator {
189
+ type: "innerText";
190
+ value: string;
191
+ ignoreCase?: boolean;
192
+ matchType?: "full" | "partial";
193
+ maxDepth?: JsUint;
194
+ }
195
+
196
+ export interface BrowsingContextXPathLocator {
197
+ type: "xpath";
198
+ value: string;
199
+ }
200
+
201
+ export type BrowsingContextNavigation = string;
202
+
203
+ export interface BrowsingContextBaseNavigationInfo {
204
+ context: BrowsingContextBrowsingContext;
205
+ navigation: BrowsingContextNavigation | null;
206
+ timestamp: JsUint;
207
+ url: string;
208
+ userContext?: BrowserUserContext;
209
+ }
210
+
211
+ export type BrowsingContextNavigationInfo = BrowsingContextBaseNavigationInfo;
212
+ export type BrowsingContextUserPromptType = "alert" | "beforeunload" | "confirm" | "prompt";
213
+ export type BrowsingContextActivateResult = EmptyResult;
214
+
215
+ export interface BrowsingContextCaptureScreenshotResult {
216
+ data: string;
217
+ }
218
+
219
+ export type BrowsingContextCloseResult = EmptyResult;
220
+
221
+ export interface BrowsingContextCreateResult {
222
+ context: BrowsingContextBrowsingContext;
223
+ userContext?: BrowserUserContext;
224
+ }
225
+
226
+ export interface BrowsingContextGetTreeResult {
227
+ contexts: BrowsingContextInfoList;
228
+ }
229
+
230
+ export type BrowsingContextHandleUserPromptResult = EmptyResult;
231
+
232
+ export interface BrowsingContextLocateNodesResult {
233
+ nodes: ScriptNodeRemoteValue[];
234
+ }
235
+
236
+ export interface BrowsingContextNavigateResult {
237
+ navigation: BrowsingContextNavigation | null;
238
+ url: string;
239
+ }
240
+
241
+ export interface BrowsingContextPrintResult {
242
+ data: string;
243
+ }
244
+
245
+ export type BrowsingContextReloadResult = BrowsingContextNavigateResult;
246
+ export type BrowsingContextSetBypassCspResult = EmptyResult;
247
+ export type BrowsingContextSetViewportResult = EmptyResult;
248
+ export type BrowsingContextTraverseHistoryResult = EmptyResult;
249
+
250
+ export interface BrowsingContextContextCreated {
251
+ method: "browsingContext.contextCreated";
252
+ params: BrowsingContextInfo;
253
+ }
254
+
255
+ export interface BrowsingContextContextDestroyed {
256
+ method: "browsingContext.contextDestroyed";
257
+ params: BrowsingContextInfo;
258
+ }
259
+
260
+ export interface BrowsingContextNavigationStarted {
261
+ method: "browsingContext.navigationStarted";
262
+ params: BrowsingContextNavigationInfo;
263
+ }
264
+
265
+ export interface BrowsingContextFragmentNavigated {
266
+ method: "browsingContext.fragmentNavigated";
267
+ params: BrowsingContextNavigationInfo;
268
+ }
269
+
270
+ export interface BrowsingContextHistoryUpdated {
271
+ method: "browsingContext.historyUpdated";
272
+ params: BrowsingContextHistoryUpdatedParameters;
273
+ }
274
+
275
+ export interface BrowsingContextHistoryUpdatedParameters {
276
+ context: BrowsingContextBrowsingContext;
277
+ timestamp: JsUint;
278
+ url: string;
279
+ userContext?: BrowserUserContext;
280
+ }
281
+
282
+ export interface BrowsingContextDomContentLoaded {
283
+ method: "browsingContext.domContentLoaded";
284
+ params: BrowsingContextNavigationInfo;
285
+ }
286
+
287
+ export interface BrowsingContextLoad {
288
+ method: "browsingContext.load";
289
+ params: BrowsingContextNavigationInfo;
290
+ }
291
+
292
+ export interface BrowsingContextDownloadWillBegin {
293
+ method: "browsingContext.downloadWillBegin";
294
+ params: BrowsingContextDownloadWillBeginParams;
295
+ }
296
+
297
+ export type BrowsingContextDownloadWillBeginParams = BrowsingContextBaseNavigationInfo & {
298
+ suggestedFilename: string;
299
+ };
300
+
301
+ export interface BrowsingContextDownloadEnd {
302
+ method: "browsingContext.downloadEnd";
303
+ params: BrowsingContextDownloadEndParams;
304
+ }
305
+
306
+ export type BrowsingContextDownloadEndParams = (BrowsingContextDownloadCanceledParams | BrowsingContextDownloadCompleteParams);
307
+
308
+ export type BrowsingContextDownloadCanceledParams = BrowsingContextBaseNavigationInfo & {
309
+ status: "canceled";
310
+ };
311
+
312
+ export type BrowsingContextDownloadCompleteParams = BrowsingContextBaseNavigationInfo & {
313
+ status: "complete";
314
+ filepath: string | null;
315
+ };
316
+
317
+ export interface BrowsingContextNavigationAborted {
318
+ method: "browsingContext.navigationAborted";
319
+ params: BrowsingContextNavigationInfo;
320
+ }
321
+
322
+ export interface BrowsingContextNavigationCommitted {
323
+ method: "browsingContext.navigationCommitted";
324
+ params: BrowsingContextNavigationInfo;
325
+ }
326
+
327
+ export interface BrowsingContextNavigationFailed {
328
+ method: "browsingContext.navigationFailed";
329
+ params: BrowsingContextNavigationInfo;
330
+ }
331
+
332
+ export interface BrowsingContextUserPromptClosed {
333
+ method: "browsingContext.userPromptClosed";
334
+ params: BrowsingContextUserPromptClosedParameters;
335
+ }
336
+
337
+ export interface BrowsingContextUserPromptClosedParameters {
338
+ context: BrowsingContextBrowsingContext;
339
+ accepted: boolean;
340
+ type: BrowsingContextUserPromptType;
341
+ userContext?: BrowserUserContext;
342
+ userText?: string;
343
+ }
344
+
345
+ export interface BrowsingContextUserPromptOpened {
346
+ method: "browsingContext.userPromptOpened";
347
+ params: BrowsingContextUserPromptOpenedParameters;
348
+ }
349
+
350
+ export interface BrowsingContextUserPromptOpenedParameters {
351
+ context: BrowsingContextBrowsingContext;
352
+ handler: SessionUserPromptHandlerType;
353
+ message: string;
354
+ type: BrowsingContextUserPromptType;
355
+ userContext?: BrowserUserContext;
356
+ defaultValue?: string;
357
+ }
358
+
359
+ export type EmulationResult = EmulationSetForcedColorsModeThemeOverrideResult | EmulationSetGeolocationOverrideResult | EmulationSetLocaleOverrideResult | EmulationSetScreenOrientationOverrideResult | EmulationSetScriptingEnabledResult | EmulationSetScrollbarTypeOverrideResult | EmulationSetTimezoneOverrideResult | EmulationSetTouchOverrideResult | EmulationSetUserAgentOverrideResult;
360
+ export type EmulationSetForcedColorsModeThemeOverrideResult = EmptyResult;
361
+ export type EmulationSetGeolocationOverrideResult = EmptyResult;
362
+ export type EmulationSetLocaleOverrideResult = EmptyResult;
363
+ export type EmulationSetNetworkConditionsResult = EmptyResult;
364
+ export type EmulationSetScreenSettingsOverrideResult = EmptyResult;
365
+ export type EmulationSetScreenOrientationOverrideResult = EmptyResult;
366
+ export type EmulationSetUserAgentOverrideResult = EmptyResult;
367
+ export type EmulationSetScriptingEnabledResult = EmptyResult;
368
+ export type EmulationSetScrollbarTypeOverrideResult = EmptyResult;
369
+ export type EmulationSetTimezoneOverrideResult = EmptyResult;
370
+ export type EmulationSetTouchOverrideResult = EmptyResult;
371
+ export type NetworkResult = NetworkAddDataCollectorResult | NetworkAddInterceptResult | NetworkContinueRequestResult | NetworkContinueResponseResult | NetworkContinueWithAuthResult | NetworkDisownDataResult | NetworkFailRequestResult | NetworkGetDataResult | NetworkProvideResponseResult | NetworkRemoveDataCollectorResult | NetworkRemoveInterceptResult | NetworkSetCacheBehaviorResult | NetworkSetExtraHeadersResult;
372
+ export type NetworkEvent = NetworkAuthRequired | NetworkBeforeRequestSent | NetworkFetchError | NetworkResponseCompleted | NetworkResponseStarted;
373
+
374
+ export interface NetworkAuthChallenge {
375
+ scheme: string;
376
+ realm: string;
377
+ }
378
+
379
+ export interface NetworkBaseParameters {
380
+ context: BrowsingContextBrowsingContext | null;
381
+ isBlocked: boolean;
382
+ navigation: BrowsingContextNavigation | null;
383
+ redirectCount: JsUint;
384
+ request: NetworkRequestData;
385
+ timestamp: JsUint;
386
+ userContext?: BrowserUserContext | null;
387
+ intercepts?: NetworkIntercept[];
388
+ }
389
+
390
+ export type NetworkBytesValue = NetworkStringValue | NetworkBase64Value;
391
+
392
+ export interface NetworkStringValue {
393
+ type: "string";
394
+ value: string;
395
+ }
396
+
397
+ export interface NetworkBase64Value {
398
+ type: "base64";
399
+ value: string;
400
+ }
401
+
402
+ export type NetworkCollector = string;
403
+ export type NetworkCollectorType = "blob";
404
+ export type NetworkSameSite = "strict" | "lax" | "none" | "default";
405
+
406
+ export type NetworkCookie = Extensible & {
407
+ name: string;
408
+ value: NetworkBytesValue;
409
+ domain: string;
410
+ path: string;
411
+ size: JsUint;
412
+ httpOnly: boolean;
413
+ secure: boolean;
414
+ sameSite: NetworkSameSite;
415
+ expiry?: JsUint;
416
+ };
417
+
418
+ export type NetworkDataType = "request" | "response";
419
+
420
+ export interface NetworkFetchTimingInfo {
421
+ timeOrigin: number;
422
+ requestTime: number;
423
+ redirectStart: number;
424
+ redirectEnd: number;
425
+ fetchStart: number;
426
+ dnsStart: number;
427
+ dnsEnd: number;
428
+ connectStart: number;
429
+ connectEnd: number;
430
+ tlsStart: number;
431
+ requestStart: number;
432
+ responseStart: number;
433
+ responseEnd: number;
434
+ }
435
+
436
+ export interface NetworkHeader {
437
+ name: string;
438
+ value: NetworkBytesValue;
439
+ }
440
+
441
+ export interface NetworkInitiator {
442
+ columnNumber?: JsUint;
443
+ lineNumber?: JsUint;
444
+ request?: NetworkRequest;
445
+ stackTrace?: ScriptStackTrace;
446
+ type?: "parser" | "script" | "preflight" | "other";
447
+ }
448
+
449
+ export type NetworkIntercept = string;
450
+ export type NetworkRequest = string;
451
+
452
+ export interface NetworkRequestData {
453
+ request: NetworkRequest;
454
+ url: string;
455
+ method: string;
456
+ headers: NetworkHeader[];
457
+ cookies: NetworkCookie[];
458
+ headersSize: JsUint;
459
+ bodySize: JsUint | null;
460
+ destination: string;
461
+ initiatorType: string | null;
462
+ timings: NetworkFetchTimingInfo;
463
+ }
464
+
465
+ export interface NetworkResponseContent {
466
+ size: JsUint;
467
+ }
468
+
469
+ export interface NetworkResponseData {
470
+ url: string;
471
+ protocol: string;
472
+ status: JsUint;
473
+ statusText: string;
474
+ fromCache: boolean;
475
+ headers: NetworkHeader[];
476
+ mimeType: string;
477
+ bytesReceived: JsUint;
478
+ headersSize: JsUint | null;
479
+ bodySize: JsUint | null;
480
+ content: NetworkResponseContent;
481
+ authChallenges?: NetworkAuthChallenge[];
482
+ }
483
+
484
+ export interface NetworkAddDataCollectorResult {
485
+ collector: NetworkCollector;
486
+ }
487
+
488
+ export interface NetworkAddInterceptResult {
489
+ intercept: NetworkIntercept;
490
+ }
491
+
492
+ export type NetworkContinueRequestResult = EmptyResult;
493
+ export type NetworkContinueResponseResult = EmptyResult;
494
+ export type NetworkContinueWithAuthResult = EmptyResult;
495
+ export type NetworkDisownDataResult = EmptyResult;
496
+ export type NetworkFailRequestResult = EmptyResult;
497
+
498
+ export interface NetworkGetDataResult {
499
+ bytes: NetworkBytesValue;
500
+ }
501
+
502
+ export type NetworkProvideResponseResult = EmptyResult;
503
+ export type NetworkRemoveDataCollectorResult = EmptyResult;
504
+ export type NetworkRemoveInterceptResult = EmptyResult;
505
+ export type NetworkSetCacheBehaviorResult = EmptyResult;
506
+ export type NetworkSetExtraHeadersResult = EmptyResult;
507
+
508
+ export interface NetworkAuthRequired {
509
+ method: "network.authRequired";
510
+ params: NetworkAuthRequiredParameters;
511
+ }
512
+
513
+ export type NetworkAuthRequiredParameters = NetworkBaseParameters & {
514
+ response: NetworkResponseData;
515
+ };
516
+
517
+ export interface NetworkBeforeRequestSent {
518
+ method: "network.beforeRequestSent";
519
+ params: NetworkBeforeRequestSentParameters;
520
+ }
521
+
522
+ export type NetworkBeforeRequestSentParameters = NetworkBaseParameters & {
523
+ initiator?: NetworkInitiator;
524
+ };
525
+
526
+ export interface NetworkFetchError {
527
+ method: "network.fetchError";
528
+ params: NetworkFetchErrorParameters;
529
+ }
530
+
531
+ export type NetworkFetchErrorParameters = NetworkBaseParameters & {
532
+ errorText: string;
533
+ };
534
+
535
+ export interface NetworkResponseCompleted {
536
+ method: "network.responseCompleted";
537
+ params: NetworkResponseCompletedParameters;
538
+ }
539
+
540
+ export type NetworkResponseCompletedParameters = NetworkBaseParameters & {
541
+ response: NetworkResponseData;
542
+ };
543
+
544
+ export interface NetworkResponseStarted {
545
+ method: "network.responseStarted";
546
+ params: NetworkResponseStartedParameters;
547
+ }
548
+
549
+ export type NetworkResponseStartedParameters = NetworkBaseParameters & {
550
+ response: NetworkResponseData;
551
+ };
552
+
553
+ export type ScriptResult = ScriptAddPreloadScriptResult | ScriptCallFunctionResult | ScriptDisownResult | ScriptEvaluateResult | ScriptGetRealmsResult | ScriptRemovePreloadScriptResult;
554
+ export type ScriptEvent = ScriptMessage | ScriptRealmCreated | ScriptRealmDestroyed;
555
+ export type ScriptChannel = string;
556
+
557
+ export interface ScriptChannelValue {
558
+ type: "channel";
559
+ value: ScriptChannelProperties;
560
+ }
561
+
562
+ export interface ScriptChannelProperties {
563
+ channel: ScriptChannel;
564
+ serializationOptions?: ScriptSerializationOptions;
565
+ ownership?: ScriptResultOwnership;
566
+ }
567
+
568
+ export type ScriptEvaluateResult = ScriptEvaluateResultSuccess | ScriptEvaluateResultException;
569
+
570
+ export interface ScriptEvaluateResultSuccess {
571
+ type: "success";
572
+ result: ScriptRemoteValue;
573
+ realm: ScriptRealm;
574
+ }
575
+
576
+ export interface ScriptEvaluateResultException {
577
+ type: "exception";
578
+ exceptionDetails: ScriptExceptionDetails;
579
+ realm: ScriptRealm;
580
+ }
581
+
582
+ export interface ScriptExceptionDetails {
583
+ columnNumber: JsUint;
584
+ exception: ScriptRemoteValue;
585
+ lineNumber: JsUint;
586
+ stackTrace: ScriptStackTrace;
587
+ text: string;
588
+ }
589
+
590
+ export type ScriptHandle = string;
591
+ export type ScriptInternalId = string;
592
+ export type ScriptLocalValue = ScriptRemoteReference | ScriptPrimitiveProtocolValue | ScriptChannelValue | ScriptArrayLocalValue | ScriptDateLocalValue | ScriptMapLocalValue | ScriptObjectLocalValue | ScriptRegExpLocalValue | ScriptSetLocalValue;
593
+ export type ScriptListLocalValue = ScriptLocalValue[];
594
+
595
+ export interface ScriptArrayLocalValue {
596
+ type: "array";
597
+ value: ScriptListLocalValue;
598
+ }
599
+
600
+ export interface ScriptDateLocalValue {
601
+ type: "date";
602
+ value: string;
603
+ }
604
+
605
+ export type ScriptMappingLocalValue = (ScriptLocalValue | ScriptLocalValue)[];
606
+
607
+ export interface ScriptMapLocalValue {
608
+ type: "map";
609
+ value: ScriptMappingLocalValue;
610
+ }
611
+
612
+ export interface ScriptObjectLocalValue {
613
+ type: "object";
614
+ value: ScriptMappingLocalValue;
615
+ }
616
+
617
+ export interface ScriptRegExpValue {
618
+ pattern: string;
619
+ flags?: string;
620
+ }
621
+
622
+ export interface ScriptRegExpLocalValue {
623
+ type: "regexp";
624
+ value: ScriptRegExpValue;
625
+ }
626
+
627
+ export interface ScriptSetLocalValue {
628
+ type: "set";
629
+ value: ScriptListLocalValue;
630
+ }
631
+
632
+ export type ScriptPreloadScript = string;
633
+ export type ScriptRealm = string;
634
+ export type ScriptPrimitiveProtocolValue = ScriptUndefinedValue | ScriptNullValue | ScriptStringValue | ScriptNumberValue | ScriptBooleanValue | ScriptBigIntValue;
635
+
636
+ export interface ScriptUndefinedValue {
637
+ type: "undefined";
638
+ }
639
+
640
+ export interface ScriptNullValue {
641
+ type: null;
642
+ }
643
+
644
+ export interface ScriptStringValue {
645
+ type: "string";
646
+ value: string;
647
+ }
648
+
649
+ export type ScriptSpecialNumber = "NaN" | "-0" | "Infinity" | "-Infinity";
650
+
651
+ export interface ScriptNumberValue {
652
+ type: "number";
653
+ value: Number | ScriptSpecialNumber;
654
+ }
655
+
656
+ export interface ScriptBooleanValue {
657
+ type: "boolean";
658
+ value: boolean;
659
+ }
660
+
661
+ export interface ScriptBigIntValue {
662
+ type: "bigint";
663
+ value: string;
664
+ }
665
+
666
+ export type ScriptRealmInfo = ScriptWindowRealmInfo | ScriptDedicatedWorkerRealmInfo | ScriptSharedWorkerRealmInfo | ScriptServiceWorkerRealmInfo | ScriptWorkerRealmInfo | ScriptPaintWorkletRealmInfo | ScriptAudioWorkletRealmInfo | ScriptWorkletRealmInfo;
667
+
668
+ export interface ScriptBaseRealmInfo {
669
+ realm: ScriptRealm;
670
+ origin: string;
671
+ }
672
+
673
+ export type ScriptWindowRealmInfo = ScriptBaseRealmInfo & {
674
+ type: "window";
675
+ context: BrowsingContextBrowsingContext;
676
+ userContext?: BrowserUserContext;
677
+ sandbox?: string;
678
+ };
679
+
680
+ export type ScriptDedicatedWorkerRealmInfo = ScriptBaseRealmInfo & {
681
+ type: "dedicated-worker";
682
+ owners: ScriptRealm[];
683
+ };
684
+
685
+ export type ScriptSharedWorkerRealmInfo = ScriptBaseRealmInfo & {
686
+ type: "shared-worker";
687
+ };
688
+
689
+ export type ScriptServiceWorkerRealmInfo = ScriptBaseRealmInfo & {
690
+ type: "service-worker";
691
+ };
692
+
693
+ export type ScriptWorkerRealmInfo = ScriptBaseRealmInfo & {
694
+ type: "worker";
695
+ };
696
+
697
+ export type ScriptPaintWorkletRealmInfo = ScriptBaseRealmInfo & {
698
+ type: "paint-worklet";
699
+ };
700
+
701
+ export type ScriptAudioWorkletRealmInfo = ScriptBaseRealmInfo & {
702
+ type: "audio-worklet";
703
+ };
704
+
705
+ export type ScriptWorkletRealmInfo = ScriptBaseRealmInfo & {
706
+ type: "worklet";
707
+ };
708
+
709
+ export type ScriptRealmType = "window" | "dedicated-worker" | "shared-worker" | "service-worker" | "worker" | "paint-worklet" | "audio-worklet" | "worklet";
710
+ export type ScriptRemoteReference = ScriptSharedReference | ScriptRemoteObjectReference;
711
+
712
+ export type ScriptSharedReference = Extensible & {
713
+ sharedId: ScriptSharedId;
714
+ handle?: ScriptHandle;
715
+ };
716
+
717
+ export type ScriptRemoteObjectReference = Extensible & {
718
+ handle: ScriptHandle;
719
+ sharedId?: ScriptSharedId;
720
+ };
721
+
722
+ export type ScriptRemoteValue = ScriptPrimitiveProtocolValue | ScriptSymbolRemoteValue | ScriptArrayRemoteValue | ScriptObjectRemoteValue | ScriptFunctionRemoteValue | ScriptRegExpRemoteValue | ScriptDateRemoteValue | ScriptMapRemoteValue | ScriptSetRemoteValue | ScriptWeakMapRemoteValue | ScriptWeakSetRemoteValue | ScriptGeneratorRemoteValue | ScriptErrorRemoteValue | ScriptProxyRemoteValue | ScriptPromiseRemoteValue | ScriptTypedArrayRemoteValue | ScriptArrayBufferRemoteValue | ScriptNodeListRemoteValue | ScriptHtmlCollectionRemoteValue | ScriptNodeRemoteValue | ScriptWindowProxyRemoteValue;
723
+ export type ScriptListRemoteValue = ScriptRemoteValue[];
724
+ export type ScriptMappingRemoteValue = (ScriptRemoteValue | ScriptRemoteValue)[];
725
+
726
+ export interface ScriptSymbolRemoteValue {
727
+ type: "symbol";
728
+ handle?: ScriptHandle;
729
+ internalId?: ScriptInternalId;
730
+ }
731
+
732
+ export interface ScriptArrayRemoteValue {
733
+ type: "array";
734
+ handle?: ScriptHandle;
735
+ internalId?: ScriptInternalId;
736
+ value?: ScriptListRemoteValue;
737
+ }
738
+
739
+ export interface ScriptObjectRemoteValue {
740
+ type: "object";
741
+ handle?: ScriptHandle;
742
+ internalId?: ScriptInternalId;
743
+ value?: ScriptMappingRemoteValue;
744
+ }
745
+
746
+ export interface ScriptFunctionRemoteValue {
747
+ type: "function";
748
+ handle?: ScriptHandle;
749
+ internalId?: ScriptInternalId;
750
+ }
751
+
752
+ export type ScriptRegExpRemoteValue = ScriptRegExpLocalValue & {
753
+ handle?: ScriptHandle;
754
+ internalId?: ScriptInternalId;
755
+ };
756
+
757
+ export type ScriptDateRemoteValue = ScriptDateLocalValue & {
758
+ handle?: ScriptHandle;
759
+ internalId?: ScriptInternalId;
760
+ };
761
+
762
+ export interface ScriptMapRemoteValue {
763
+ type: "map";
764
+ handle?: ScriptHandle;
765
+ internalId?: ScriptInternalId;
766
+ value?: ScriptMappingRemoteValue;
767
+ }
768
+
769
+ export interface ScriptSetRemoteValue {
770
+ type: "set";
771
+ handle?: ScriptHandle;
772
+ internalId?: ScriptInternalId;
773
+ value?: ScriptListRemoteValue;
774
+ }
775
+
776
+ export interface ScriptWeakMapRemoteValue {
777
+ type: "weakmap";
778
+ handle?: ScriptHandle;
779
+ internalId?: ScriptInternalId;
780
+ }
781
+
782
+ export interface ScriptWeakSetRemoteValue {
783
+ type: "weakset";
784
+ handle?: ScriptHandle;
785
+ internalId?: ScriptInternalId;
786
+ }
787
+
788
+ export interface ScriptGeneratorRemoteValue {
789
+ type: "generator";
790
+ handle?: ScriptHandle;
791
+ internalId?: ScriptInternalId;
792
+ }
793
+
794
+ export interface ScriptErrorRemoteValue {
795
+ type: "error";
796
+ handle?: ScriptHandle;
797
+ internalId?: ScriptInternalId;
798
+ }
799
+
800
+ export interface ScriptProxyRemoteValue {
801
+ type: "proxy";
802
+ handle?: ScriptHandle;
803
+ internalId?: ScriptInternalId;
804
+ }
805
+
806
+ export interface ScriptPromiseRemoteValue {
807
+ type: "promise";
808
+ handle?: ScriptHandle;
809
+ internalId?: ScriptInternalId;
810
+ }
811
+
812
+ export interface ScriptTypedArrayRemoteValue {
813
+ type: "typedarray";
814
+ handle?: ScriptHandle;
815
+ internalId?: ScriptInternalId;
816
+ }
817
+
818
+ export interface ScriptArrayBufferRemoteValue {
819
+ type: "arraybuffer";
820
+ handle?: ScriptHandle;
821
+ internalId?: ScriptInternalId;
822
+ }
823
+
824
+ export interface ScriptNodeListRemoteValue {
825
+ type: "nodelist";
826
+ handle?: ScriptHandle;
827
+ internalId?: ScriptInternalId;
828
+ value?: ScriptListRemoteValue;
829
+ }
830
+
831
+ export interface ScriptHtmlCollectionRemoteValue {
832
+ type: "htmlcollection";
833
+ handle?: ScriptHandle;
834
+ internalId?: ScriptInternalId;
835
+ value?: ScriptListRemoteValue;
836
+ }
837
+
838
+ export interface ScriptNodeRemoteValue {
839
+ type: "node";
840
+ sharedId?: ScriptSharedId;
841
+ handle?: ScriptHandle;
842
+ internalId?: ScriptInternalId;
843
+ value?: ScriptNodeProperties;
844
+ }
845
+
846
+ export interface ScriptNodeProperties {
847
+ nodeType: JsUint;
848
+ childNodeCount: JsUint;
849
+ attributes?: Record<string, string>;
850
+ children?: ScriptNodeRemoteValue[];
851
+ localName?: string;
852
+ mode?: "open" | "closed";
853
+ namespaceUri?: string;
854
+ nodeValue?: string;
855
+ shadowRoot?: ScriptNodeRemoteValue | null;
856
+ }
857
+
858
+ export interface ScriptWindowProxyRemoteValue {
859
+ type: "window";
860
+ value: ScriptWindowProxyProperties;
861
+ handle?: ScriptHandle;
862
+ internalId?: ScriptInternalId;
863
+ }
864
+
865
+ export interface ScriptWindowProxyProperties {
866
+ context: BrowsingContextBrowsingContext;
867
+ }
868
+
869
+ export type ScriptResultOwnership = "root" | "none";
870
+
871
+ export interface ScriptSerializationOptions {
872
+ maxDomDepth?: JsUint | null;
873
+ /**
874
+ * @default null
875
+ */
876
+ maxObjectDepth?: JsUint | null;
877
+ /**
878
+ * @default 'none'
879
+ */
880
+ includeShadowTree?: "none" | "open" | "all";
881
+ }
882
+
883
+ export type ScriptSharedId = string;
884
+
885
+ export interface ScriptStackFrame {
886
+ columnNumber: JsUint;
887
+ functionName: string;
888
+ lineNumber: JsUint;
889
+ url: string;
890
+ }
891
+
892
+ export interface ScriptStackTrace {
893
+ callFrames: ScriptStackFrame[];
894
+ }
895
+
896
+ export interface ScriptSource {
897
+ realm: ScriptRealm;
898
+ context?: BrowsingContextBrowsingContext;
899
+ userContext?: BrowserUserContext;
900
+ }
901
+
902
+ export interface ScriptAddPreloadScriptResult {
903
+ script: ScriptPreloadScript;
904
+ }
905
+
906
+ export type ScriptDisownResult = EmptyResult;
907
+ export type ScriptCallFunctionResult = ScriptEvaluateResult;
908
+
909
+ export interface ScriptGetRealmsResult {
910
+ realms: ScriptRealmInfo[];
911
+ }
912
+
913
+ export type ScriptRemovePreloadScriptResult = EmptyResult;
914
+
915
+ export interface ScriptMessage {
916
+ method: "script.message";
917
+ params: ScriptMessageParameters;
918
+ }
919
+
920
+ export interface ScriptMessageParameters {
921
+ channel: ScriptChannel;
922
+ data: ScriptRemoteValue;
923
+ source: ScriptSource;
924
+ }
925
+
926
+ export interface ScriptRealmCreated {
927
+ method: "script.realmCreated";
928
+ params: ScriptRealmInfo;
929
+ }
930
+
931
+ export interface ScriptRealmDestroyed {
932
+ method: "script.realmDestroyed";
933
+ params: ScriptRealmDestroyedParameters;
934
+ }
935
+
936
+ export interface ScriptRealmDestroyedParameters {
937
+ realm: ScriptRealm;
938
+ }
939
+
940
+ export type StorageResult = StorageDeleteCookiesResult | StorageGetCookiesResult | StorageSetCookieResult;
941
+
942
+ export type StoragePartitionKey = Extensible & {
943
+ userContext?: string;
944
+ sourceOrigin?: string;
945
+ };
946
+
947
+ export interface StorageGetCookiesResult {
948
+ cookies: NetworkCookie[];
949
+ partitionKey: StoragePartitionKey;
950
+ }
951
+
952
+ export interface StorageSetCookieResult {
953
+ partitionKey: StoragePartitionKey;
954
+ }
955
+
956
+ export interface StorageDeleteCookiesResult {
957
+ partitionKey: StoragePartitionKey;
958
+ }
959
+
960
+ export type LogEvent = LogEntryAdded;
961
+ export type LogLevel = "debug" | "info" | "warn" | "error";
962
+ export type LogEntry = LogGenericLogEntry | LogConsoleLogEntry | LogJavascriptLogEntry;
963
+
964
+ export interface LogBaseLogEntry {
965
+ level: LogLevel;
966
+ source: ScriptSource;
967
+ text: string | null;
968
+ timestamp: JsUint;
969
+ stackTrace?: ScriptStackTrace;
970
+ }
971
+
972
+ export type LogGenericLogEntry = LogBaseLogEntry & {
973
+ type: string;
974
+ };
975
+
976
+ export type LogConsoleLogEntry = LogBaseLogEntry & {
977
+ type: "console";
978
+ method: string;
979
+ args: ScriptRemoteValue[];
980
+ };
981
+
982
+ export type LogJavascriptLogEntry = LogBaseLogEntry & {
983
+ type: "javascript";
984
+ };
985
+
986
+ export interface LogEntryAdded {
987
+ method: "log.entryAdded";
988
+ params: LogEntry;
989
+ }
990
+
991
+ export type InputResult = InputPerformActionsResult | InputReleaseActionsResult | InputSetFilesResult;
992
+ export type InputEvent = InputFileDialogOpened;
993
+ export type InputPerformActionsResult = EmptyResult;
994
+ export type InputReleaseActionsResult = EmptyResult;
995
+ export type InputSetFilesResult = EmptyResult;
996
+
997
+ export interface InputFileDialogOpened {
998
+ method: "input.fileDialogOpened";
999
+ params: InputFileDialogInfo;
1000
+ }
1001
+
1002
+ export interface InputFileDialogInfo {
1003
+ context: BrowsingContextBrowsingContext;
1004
+ userContext?: BrowserUserContext;
1005
+ element?: ScriptSharedReference;
1006
+ multiple: boolean;
1007
+ }
1008
+
1009
+ export type WebExtensionResult = WebExtensionInstallResult | WebExtensionUninstallResult;
1010
+ export type WebExtensionExtension = string;
1011
+
1012
+ export interface WebExtensionInstallResult {
1013
+ extension: WebExtensionExtension;
1014
+ }
1015
+
1016
+ export type WebExtensionUninstallResult = EmptyResult;"
1017
+ `;