From ee82415be5de3181d39033a131ad1cfe91736bfa Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 19:44:13 +0200 Subject: [PATCH 1/9] feat: automatically generate command mapped types --- out/commands.d.ts | 11 + out/commands.js | 21 + out/events.d.ts | 12 + out/events.js | 2 + out/gen/main.d.ts | 4121 +++++++++++----------- out/gen/main.js | 4 +- out/gen/mapping.d.ts | 289 ++ out/gen/mapping.js | 7 + out/gen/permissions.d.ts | 38 +- out/gen/permissions.js | 4 +- out/gen/web-bluetooth.d.ts | 485 ++- out/gen/web-bluetooth.js | 4 +- out/index.d.ts | 276 +- out/index.js | 54 +- package-lock.json | 159 +- package.json | 3 +- src/commands.ts | 24 + src/events.ts | 18 + src/gen/main.ts | 3192 ++++++----------- src/gen/mapping.ts | 432 +++ src/gen/permissions.ts | 30 +- src/gen/web-bluetooth.ts | 356 +- src/index.ts | 291 +- test-d/webdriver-bidi-protocol.test-d.ts | 8 +- tools/build.sh | 5 +- tools/generateCommandMap.ts | 153 + tools/utils.ts | 63 + tsconfig.json | 115 +- 28 files changed, 4728 insertions(+), 5449 deletions(-) create mode 100644 out/commands.d.ts create mode 100644 out/commands.js create mode 100644 out/events.d.ts create mode 100644 out/events.js create mode 100644 out/gen/mapping.d.ts create mode 100644 out/gen/mapping.js create mode 100644 src/commands.ts create mode 100644 src/events.ts create mode 100644 src/gen/mapping.ts create mode 100644 tools/generateCommandMap.ts create mode 100644 tools/utils.ts diff --git a/out/commands.d.ts b/out/commands.d.ts new file mode 100644 index 0000000..43fd41c --- /dev/null +++ b/out/commands.d.ts @@ -0,0 +1,11 @@ +/** + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as Bidi from './gen/main.js'; +export * from './gen/main.js'; +export * from './gen/permissions.js'; +export * from './gen/web-bluetooth.js'; +export type Result = Bidi.ResultData; +export type Command = Bidi.Command; diff --git a/out/commands.js b/out/commands.js new file mode 100644 index 0000000..82beef8 --- /dev/null +++ b/out/commands.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./gen/main.js"), exports); +__exportStar(require("./gen/permissions.js"), exports); +__exportStar(require("./gen/web-bluetooth.js"), exports); +// | ExternalSpecCommand +// | ExternalSpecCommand; diff --git a/out/events.d.ts b/out/events.d.ts new file mode 100644 index 0000000..0114e24 --- /dev/null +++ b/out/events.d.ts @@ -0,0 +1,12 @@ +/** + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as Bidi from './gen/main.js'; +import * as BidiBluetooth from './gen/web-bluetooth.js'; +type ExternalSpecEvent = { + type: 'event'; +} & T & Bidi.Extensible; +export type Event = Bidi.Event | ExternalSpecEvent; +export {}; diff --git a/out/events.js b/out/events.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/out/events.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/out/gen/main.d.ts b/out/gen/main.d.ts index 35b4520..b7e831c 100644 --- a/out/gen/main.d.ts +++ b/out/gen/main.d.ts @@ -1,2724 +1,2643 @@ -export type Command = { - id: JsUint; -} & CommandData & - Extensible; -export type CommandData = - | BrowserCommand - | BrowsingContextCommand - | EmulationCommand - | InputCommand - | NetworkCommand - | ScriptCommand - | SessionCommand - | StorageCommand - | WebExtensionCommand; -export type EmptyParams = Extensible; -export type Message = CommandResponse | ErrorResponse | Event; -export type CommandResponse = { - type: 'success'; - id: JsUint; - result: ResultData; -} & Extensible; -export type ErrorResponse = { - type: 'error'; - id: JsUint | null; - error: ErrorCode; - message: string; - stacktrace?: string; -} & Extensible; -export type ResultData = - | BrowsingContextResult - | EmptyResult - | NetworkResult - | ScriptResult - | SessionResult - | StorageResult - | WebExtensionResult; -export type EmptyResult = Extensible; -export type Event = { - type: 'event'; -} & EventData & - Extensible; -export type EventData = - | BrowsingContextEvent - | InputEvent - | LogEvent - | NetworkEvent - | ScriptEvent; -export type Extensible = { - [key: string]: any; -}; +export type Event = (({ + "type": ("event"); +} & EventData & Extensible)); +export type Command = (({ + "id": (JsUint); +} & CommandData & Extensible)); +export type CommandResponse = (({ + "type": ("success"); + "id": (JsUint); + "result": (ResultData); +} & Extensible)); +export type EventData = (BrowsingContextEvent | InputEvent | LogEvent | NetworkEvent | ScriptEvent); +export type CommandData = (BrowserCommand | BrowsingContextCommand | EmulationCommand | InputCommand | NetworkCommand | ScriptCommand | SessionCommand | StorageCommand | WebExtensionCommand); +export type ResultData = ((BrowsingContextResult | EmptyResult | NetworkResult | ScriptResult | SessionResult | StorageResult | WebExtensionResult)); +export type EmptyParams = ((Extensible)); +export type Message = ((CommandResponse | ErrorResponse | Event)); +export type ErrorResponse = (({ + "type": ("error"); + "id": (JsUint | null); + "error": (ErrorCode); + "message": (string); + "stacktrace"?: (string); +} & Extensible)); +export type EmptyResult = ((Extensible)); +export type Extensible = ({ + [key: string]: (any); +}); /** * Must be between `-9007199254740991` and `9007199254740991`, inclusive. */ -export type JsInt = number; +export type JsInt = (number); /** * Must be between `0` and `9007199254740991`, inclusive. */ -export type JsUint = number; +export type JsUint = (number); export declare const enum ErrorCode { - InvalidArgument = 'invalid argument', - InvalidSelector = 'invalid selector', - InvalidSessionId = 'invalid session id', - InvalidWebExtension = 'invalid web extension', - MoveTargetOutOfBounds = 'move target out of bounds', - NoSuchAlert = 'no such alert', - NoSuchNetworkCollector = 'no such network collector', - NoSuchElement = 'no such element', - NoSuchFrame = 'no such frame', - NoSuchHandle = 'no such handle', - NoSuchHistoryEntry = 'no such history entry', - NoSuchIntercept = 'no such intercept', - NoSuchNetworkData = 'no such network data', - NoSuchNode = 'no such node', - NoSuchRequest = 'no such request', - NoSuchScript = 'no such script', - NoSuchStoragePartition = 'no such storage partition', - NoSuchUserContext = 'no such user context', - NoSuchWebExtension = 'no such web extension', - SessionNotCreated = 'session not created', - UnableToCaptureScreen = 'unable to capture screen', - UnableToCloseBrowser = 'unable to close browser', - UnableToSetCookie = 'unable to set cookie', - UnableToSetFileInput = 'unable to set file input', - UnavailableNetworkData = 'unavailable network data', - UnderspecifiedStoragePartition = 'underspecified storage partition', - UnknownCommand = 'unknown command', - UnknownError = 'unknown error', - UnsupportedOperation = 'unsupported operation', -} -export type SessionCommand = - | Session.End - | Session.New - | Session.Status - | Session.Subscribe - | Session.Unsubscribe; -export type SessionResult = - | Session.NewResult - | Session.StatusResult - | Session.SubscribeResult; + InvalidArgument = "invalid argument", + InvalidSelector = "invalid selector", + InvalidSessionId = "invalid session id", + InvalidWebExtension = "invalid web extension", + MoveTargetOutOfBounds = "move target out of bounds", + NoSuchAlert = "no such alert", + NoSuchNetworkCollector = "no such network collector", + NoSuchElement = "no such element", + NoSuchFrame = "no such frame", + NoSuchHandle = "no such handle", + NoSuchHistoryEntry = "no such history entry", + NoSuchIntercept = "no such intercept", + NoSuchNetworkData = "no such network data", + NoSuchNode = "no such node", + NoSuchRequest = "no such request", + NoSuchScript = "no such script", + NoSuchStoragePartition = "no such storage partition", + NoSuchUserContext = "no such user context", + NoSuchWebExtension = "no such web extension", + SessionNotCreated = "session not created", + UnableToCaptureScreen = "unable to capture screen", + UnableToCloseBrowser = "unable to close browser", + UnableToSetCookie = "unable to set cookie", + UnableToSetFileInput = "unable to set file input", + UnavailableNetworkData = "unavailable network data", + UnderspecifiedStoragePartition = "underspecified storage partition", + UnknownCommand = "unknown command", + UnknownError = "unknown error", + UnsupportedOperation = "unsupported operation" +} +export type SessionCommand = (Session.End | Session.New | Session.Status | Session.Subscribe | Session.Unsubscribe); export declare namespace Session { - type CapabilitiesRequest = { - alwaysMatch?: Session.CapabilityRequest; - firstMatch?: [...Session.CapabilityRequest[]]; - }; + type ProxyConfiguration = ((Session.AutodetectProxyConfiguration | Session.DirectProxyConfiguration | Session.ManualProxyConfiguration | Session.PacProxyConfiguration | Session.SystemProxyConfiguration)); } +export type SessionResult = ((Session.NewResult | Session.StatusResult | Session.SubscribeResult)); export declare namespace Session { - type CapabilityRequest = { - acceptInsecureCerts?: boolean; - browserName?: string; - browserVersion?: string; - platformName?: string; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - } & Extensible; + type CapabilitiesRequest = (({ + "alwaysMatch"?: (Session.CapabilityRequest); + "firstMatch"?: ([ + ...((Session.CapabilityRequest)[]) + ]); + })); } export declare namespace Session { - type ProxyConfiguration = - | Session.AutodetectProxyConfiguration - | Session.DirectProxyConfiguration - | Session.ManualProxyConfiguration - | Session.PacProxyConfiguration - | Session.SystemProxyConfiguration; + type CapabilityRequest = (({ + "acceptInsecureCerts"?: (boolean); + "browserName"?: (string); + "browserVersion"?: (string); + "platformName"?: (string); + "proxy"?: (Session.ProxyConfiguration); + "unhandledPromptBehavior"?: (Session.UserPromptHandler); + } & Extensible)); } export declare namespace Session { - type AutodetectProxyConfiguration = { - proxyType: 'autodetect'; - } & Extensible; + type AutodetectProxyConfiguration = ({ + "proxyType": ("autodetect"); + } & Extensible); } export declare namespace Session { - type DirectProxyConfiguration = { - proxyType: 'direct'; - } & Extensible; + type DirectProxyConfiguration = ({ + "proxyType": ("direct"); + } & Extensible); } export declare namespace Session { - type ManualProxyConfiguration = { - proxyType: 'manual'; - httpProxy?: string; - sslProxy?: string; - } & ({} | Session.SocksProxyConfiguration) & { - noProxy?: [...string[]]; - } & Extensible; + type ManualProxyConfiguration = ({ + "proxyType": ("manual"); + "httpProxy"?: (string); + "sslProxy"?: (string); + } & ({} | Session.SocksProxyConfiguration) & { + "noProxy"?: ([ + ...((string)[]) + ]); + } & Extensible); } export declare namespace Session { - type SocksProxyConfiguration = { - socksProxy: string; - /** - * Must be between `0` and `255`, inclusive. - */ - socksVersion: number; - }; + type SocksProxyConfiguration = ({ + "socksProxy": (string); + /** + * Must be between `0` and `255`, inclusive. + */ + "socksVersion": (number); + }); } export declare namespace Session { - type PacProxyConfiguration = { - proxyType: 'pac'; - proxyAutoconfigUrl: string; - } & Extensible; + type PacProxyConfiguration = ({ + "proxyType": ("pac"); + "proxyAutoconfigUrl": (string); + } & Extensible); } export declare namespace Session { - type SystemProxyConfiguration = { - proxyType: 'system'; - } & Extensible; + type SystemProxyConfiguration = ({ + "proxyType": ("system"); + } & Extensible); } export declare namespace Session { - type UserPromptHandler = { - alert?: Session.UserPromptHandlerType; - beforeUnload?: Session.UserPromptHandlerType; - confirm?: Session.UserPromptHandlerType; - default?: Session.UserPromptHandlerType; - file?: Session.UserPromptHandlerType; - prompt?: Session.UserPromptHandlerType; - }; + type UserPromptHandler = (({ + "alert"?: (Session.UserPromptHandlerType); + "beforeUnload"?: (Session.UserPromptHandlerType); + "confirm"?: (Session.UserPromptHandlerType); + "default"?: (Session.UserPromptHandlerType); + "file"?: (Session.UserPromptHandlerType); + "prompt"?: (Session.UserPromptHandlerType); + })); } export declare namespace Session { - const enum UserPromptHandlerType { - Accept = 'accept', - Dismiss = 'dismiss', - Ignore = 'ignore', - } + const enum UserPromptHandlerType { + Accept = "accept", + Dismiss = "dismiss", + Ignore = "ignore" + } } export declare namespace Session { - type Subscription = string; + type Subscription = (string); } export declare namespace Session { - type SubscriptionRequest = { - events: [string, ...string[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + type SubscriptionRequest = (({ + "events": ([ + (string), + ...(string)[] + ]); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } export declare namespace Session { - type UnsubscribeByIdRequest = { - subscriptions: [Session.Subscription, ...Session.Subscription[]]; - }; + type UnsubscribeByIdRequest = (({ + "subscriptions": ([ + (Session.Subscription), + ...(Session.Subscription)[] + ]); + })); } export declare namespace Session { - type UnsubscribeByAttributesRequest = { - events: [string, ...string[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - }; + type UnsubscribeByAttributesRequest = (({ + "events": ([ + (string), + ...(string)[] + ]); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + })); } export declare namespace Session { - type Status = { - method: 'session.status'; - params: EmptyParams; - }; + type Status = ({ + "method": ("session.status"); + "params": (EmptyParams); + }); } export declare namespace Session { - type StatusResult = { - ready: boolean; - message: string; - }; + type StatusResult = (({ + "ready": (boolean); + "message": (string); + })); } export declare namespace Session { - type New = { - method: 'session.new'; - params: Session.NewParameters; - }; + type New = ({ + "method": ("session.new"); + "params": (Session.NewParameters); + }); } export declare namespace Session { - type NewParameters = { - capabilities: Session.CapabilitiesRequest; - }; + type NewParameters = (({ + "capabilities": (Session.CapabilitiesRequest); + })); } export declare namespace Session { - type NewResult = { - sessionId: string; - capabilities: { - acceptInsecureCerts: boolean; - browserName: string; - browserVersion: string; - platformName: string; - setWindowRect: boolean; - userAgent: string; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - webSocketUrl?: string; - } & Extensible; - }; + type NewResult = (({ + "sessionId": (string); + "capabilities": (({ + "acceptInsecureCerts": (boolean); + "browserName": (string); + "browserVersion": (string); + "platformName": (string); + "setWindowRect": (boolean); + "userAgent": (string); + "proxy"?: (Session.ProxyConfiguration); + "unhandledPromptBehavior"?: (Session.UserPromptHandler); + "webSocketUrl"?: (string); + } & Extensible)); + })); } export declare namespace Session { - type End = { - method: 'session.end'; - params: EmptyParams; - }; + type End = ({ + "method": ("session.end"); + "params": (EmptyParams); + }); } export declare namespace Session { - type Subscribe = { - method: 'session.subscribe'; - params: Session.SubscriptionRequest; - }; + type Subscribe = ({ + "method": ("session.subscribe"); + "params": (Session.SubscriptionRequest); + }); } export declare namespace Session { - type SubscribeResult = { - subscription: Session.Subscription; - }; + type SubscribeResult = (({ + "subscription": (Session.Subscription); + })); } export declare namespace Session { - type Unsubscribe = { - method: 'session.unsubscribe'; - params: Session.UnsubscribeParameters; - }; + type Unsubscribe = ({ + "method": ("session.unsubscribe"); + "params": (Session.UnsubscribeParameters); + }); } export declare namespace Session { - type UnsubscribeParameters = - | Session.UnsubscribeByAttributesRequest - | Session.UnsubscribeByIdRequest; -} -export type BrowserCommand = - | Browser.Close - | Browser.CreateUserContext - | Browser.GetClientWindows - | Browser.GetUserContexts - | Browser.RemoveUserContext - | Browser.SetClientWindowState; -export type BrowserResult = - | Browser.CreateUserContextResult - | Browser.GetUserContextsResult; + type UnsubscribeParameters = (Session.UnsubscribeByAttributesRequest | Session.UnsubscribeByIdRequest); +} +export type BrowserCommand = (Browser.Close | Browser.CreateUserContext | Browser.GetClientWindows | Browser.GetUserContexts | Browser.RemoveUserContext | Browser.SetClientWindowState); +export type BrowserResult = ((Browser.CreateUserContextResult | Browser.GetUserContextsResult)); export declare namespace Browser { - type ClientWindow = string; + type ClientWindow = (string); } export declare namespace Browser { - type ClientWindowInfo = { - active: boolean; - clientWindow: Browser.ClientWindow; - height: JsUint; - state: 'fullscreen' | 'maximized' | 'minimized' | 'normal'; - width: JsUint; - x: JsInt; - y: JsInt; - }; + type ClientWindowInfo = (({ + "active": (boolean); + "clientWindow": (Browser.ClientWindow); + "height": (JsUint); + "state": ("fullscreen" | "maximized" | "minimized" | "normal"); + "width": (JsUint); + "x": (JsInt); + "y": (JsInt); + })); } export declare namespace Browser { - type UserContext = string; + type UserContext = (string); } export declare namespace Browser { - type UserContextInfo = { - userContext: Browser.UserContext; - }; + type UserContextInfo = (({ + "userContext": (Browser.UserContext); + })); } export declare namespace Browser { - type Close = { - method: 'browser.close'; - params: EmptyParams; - }; + type Close = ({ + "method": ("browser.close"); + "params": (EmptyParams); + }); } export declare namespace Browser { - type CreateUserContext = { - method: 'browser.createUserContext'; - params: Browser.CreateUserContextParameters; - }; + type CreateUserContext = ({ + "method": ("browser.createUserContext"); + "params": (Browser.CreateUserContextParameters); + }); } export declare namespace Browser { - type CreateUserContextParameters = { - acceptInsecureCerts?: boolean; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - }; + type CreateUserContextParameters = (({ + "acceptInsecureCerts"?: (boolean); + "proxy"?: (Session.ProxyConfiguration); + "unhandledPromptBehavior"?: (Session.UserPromptHandler); + })); } export declare namespace Browser { - type CreateUserContextResult = Browser.UserContextInfo; + type CreateUserContextResult = (Browser.UserContextInfo); } export declare namespace Browser { - type GetClientWindows = { - method: 'browser.getClientWindows'; - params: EmptyParams; - }; + type GetClientWindows = ({ + "method": ("browser.getClientWindows"); + "params": (EmptyParams); + }); } export declare namespace Browser { - type GetClientWindowsResult = { - clientWindows: [...Browser.ClientWindowInfo[]]; - }; + type GetClientWindowsResult = (({ + "clientWindows": ([ + ...((Browser.ClientWindowInfo)[]) + ]); + })); } export declare namespace Browser { - type GetUserContexts = { - method: 'browser.getUserContexts'; - params: EmptyParams; - }; + type GetUserContexts = ({ + "method": ("browser.getUserContexts"); + "params": (EmptyParams); + }); } export declare namespace Browser { - type GetUserContextsResult = { - userContexts: [Browser.UserContextInfo, ...Browser.UserContextInfo[]]; - }; + type GetUserContextsResult = (({ + "userContexts": ([ + (Browser.UserContextInfo), + ...(Browser.UserContextInfo)[] + ]); + })); } export declare namespace Browser { - type RemoveUserContext = { - method: 'browser.removeUserContext'; - params: Browser.RemoveUserContextParameters; - }; + type RemoveUserContext = ({ + "method": ("browser.removeUserContext"); + "params": (Browser.RemoveUserContextParameters); + }); } export declare namespace Browser { - type RemoveUserContextParameters = { - userContext: Browser.UserContext; - }; + type RemoveUserContextParameters = (({ + "userContext": (Browser.UserContext); + })); } export declare namespace Browser { - type SetClientWindowState = { - method: 'browser.setClientWindowState'; - params: Browser.SetClientWindowStateParameters; - }; + type SetClientWindowState = ({ + "method": ("browser.setClientWindowState"); + "params": (Browser.SetClientWindowStateParameters); + }); } export declare namespace Browser { - type SetClientWindowStateParameters = { - clientWindow: Browser.ClientWindow; - } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState); + type SetClientWindowStateParameters = (({ + "clientWindow": (Browser.ClientWindow); + } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState))); } export declare namespace Browser { - type ClientWindowNamedState = { - state: 'fullscreen' | 'maximized' | 'minimized'; - }; + type ClientWindowNamedState = ({ + "state": ("fullscreen" | "maximized" | "minimized"); + }); } export declare namespace Browser { - type ClientWindowRectState = { - state: 'normal'; - width?: JsUint; - height?: JsUint; - x?: JsInt; - y?: JsInt; - }; -} -export type BrowsingContextCommand = - | BrowsingContext.Activate - | BrowsingContext.CaptureScreenshot - | BrowsingContext.Close - | BrowsingContext.Create - | BrowsingContext.GetTree - | BrowsingContext.HandleUserPrompt - | BrowsingContext.LocateNodes - | BrowsingContext.Navigate - | BrowsingContext.Print - | BrowsingContext.Reload - | BrowsingContext.SetViewport - | BrowsingContext.TraverseHistory; -export type BrowsingContextResult = - | BrowsingContext.CaptureScreenshotResult - | BrowsingContext.CreateResult - | BrowsingContext.GetTreeResult - | BrowsingContext.LocateNodesResult - | BrowsingContext.NavigateResult - | BrowsingContext.PrintResult - | BrowsingContext.TraverseHistoryResult; -export type BrowsingContextEvent = - | BrowsingContext.ContextCreated - | BrowsingContext.ContextDestroyed - | BrowsingContext.DomContentLoaded - | BrowsingContext.DownloadEnd - | BrowsingContext.DownloadWillBegin - | BrowsingContext.FragmentNavigated - | BrowsingContext.HistoryUpdated - | BrowsingContext.Load - | BrowsingContext.NavigationAborted - | BrowsingContext.NavigationCommitted - | BrowsingContext.NavigationFailed - | BrowsingContext.NavigationStarted - | BrowsingContext.UserPromptClosed - | BrowsingContext.UserPromptOpened; -export declare namespace BrowsingContext { - type BrowsingContext = string; -} -export declare namespace BrowsingContext { - type InfoList = [...BrowsingContext.Info[]]; -} -export declare namespace BrowsingContext { - type Info = { - children: BrowsingContext.InfoList | null; - clientWindow: Browser.ClientWindow; - context: BrowsingContext.BrowsingContext; - originalOpener: BrowsingContext.BrowsingContext | null; - url: string; - userContext: Browser.UserContext; - parent?: BrowsingContext.BrowsingContext | null; - }; -} -export declare namespace BrowsingContext { - type Locator = - | BrowsingContext.AccessibilityLocator - | BrowsingContext.CssLocator - | BrowsingContext.ContextLocator - | BrowsingContext.InnerTextLocator - | BrowsingContext.XPathLocator; -} -export declare namespace BrowsingContext { - type AccessibilityLocator = { - type: 'accessibility'; - value: { - name?: string; - role?: string; - }; - }; -} -export declare namespace BrowsingContext { - type CssLocator = { - type: 'css'; - value: string; - }; -} -export declare namespace BrowsingContext { - type ContextLocator = { - type: 'context'; - value: { - context: BrowsingContext.BrowsingContext; - }; - }; -} -export declare namespace BrowsingContext { - type InnerTextLocator = { - type: 'innerText'; - value: string; - ignoreCase?: boolean; - matchType?: 'full' | 'partial'; - maxDepth?: JsUint; - }; -} -export declare namespace BrowsingContext { - type XPathLocator = { - type: 'xpath'; - value: string; - }; + type ClientWindowRectState = ({ + "state": ("normal"); + "width"?: (JsUint); + "height"?: (JsUint); + "x"?: (JsInt); + "y"?: (JsInt); + }); } +export type BrowsingContextCommand = (BrowsingContext.Activate | BrowsingContext.CaptureScreenshot | BrowsingContext.Close | BrowsingContext.Create | BrowsingContext.GetTree | BrowsingContext.HandleUserPrompt | BrowsingContext.LocateNodes | BrowsingContext.Navigate | BrowsingContext.Print | BrowsingContext.Reload | BrowsingContext.SetViewport | BrowsingContext.TraverseHistory); +export type BrowsingContextEvent = (BrowsingContext.ContextCreated | BrowsingContext.ContextDestroyed | BrowsingContext.DomContentLoaded | BrowsingContext.DownloadEnd | BrowsingContext.DownloadWillBegin | BrowsingContext.FragmentNavigated | BrowsingContext.HistoryUpdated | BrowsingContext.Load | BrowsingContext.NavigationAborted | BrowsingContext.NavigationCommitted | BrowsingContext.NavigationFailed | BrowsingContext.NavigationStarted | BrowsingContext.UserPromptClosed | BrowsingContext.UserPromptOpened); +export type BrowsingContextResult = ((BrowsingContext.CaptureScreenshotResult | BrowsingContext.CreateResult | BrowsingContext.GetTreeResult | BrowsingContext.LocateNodesResult | BrowsingContext.NavigateResult | BrowsingContext.PrintResult | BrowsingContext.TraverseHistoryResult)); export declare namespace BrowsingContext { - type Navigation = string; -} -export declare namespace BrowsingContext { - type BaseNavigationInfo = { - context: BrowsingContext.BrowsingContext; - navigation: BrowsingContext.Navigation | null; - timestamp: JsUint; - url: string; - }; + type BrowsingContext = (string); } export declare namespace BrowsingContext { - type NavigationInfo = BrowsingContext.BaseNavigationInfo; + type InfoList = ([ + ...((BrowsingContext.Info)[]) + ]); } export declare namespace BrowsingContext { - const enum ReadinessState { - None = 'none', - Interactive = 'interactive', - Complete = 'complete', - } + type Info = (({ + "children": (BrowsingContext.InfoList | null); + "clientWindow": (Browser.ClientWindow); + "context": (BrowsingContext.BrowsingContext); + "originalOpener": (BrowsingContext.BrowsingContext | null); + "url": (string); + "userContext": (Browser.UserContext); + "parent"?: (BrowsingContext.BrowsingContext | null); + })); } export declare namespace BrowsingContext { - const enum UserPromptType { - Alert = 'alert', - Beforeunload = 'beforeunload', - Confirm = 'confirm', - Prompt = 'prompt', - } + type Locator = ((BrowsingContext.AccessibilityLocator | BrowsingContext.CssLocator | BrowsingContext.ContextLocator | BrowsingContext.InnerTextLocator | BrowsingContext.XPathLocator)); } export declare namespace BrowsingContext { - type Activate = { - method: 'browsingContext.activate'; - params: BrowsingContext.ActivateParameters; - }; + type AccessibilityLocator = (({ + "type": ("accessibility"); + "value": (({ + "name"?: (string); + "role"?: (string); + })); + })); } export declare namespace BrowsingContext { - type ActivateParameters = { - context: BrowsingContext.BrowsingContext; - }; + type CssLocator = (({ + "type": ("css"); + "value": (string); + })); } export declare namespace BrowsingContext { - type CaptureScreenshot = { - method: 'browsingContext.captureScreenshot'; - params: BrowsingContext.CaptureScreenshotParameters; - }; + type ContextLocator = (({ + "type": ("context"); + "value": (({ + "context": (BrowsingContext.BrowsingContext); + })); + })); } export declare namespace BrowsingContext { - type CaptureScreenshotParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `"viewport"` - */ - origin?: 'viewport' | 'document'; - format?: BrowsingContext.ImageFormat; - clip?: BrowsingContext.ClipRectangle; - }; + type InnerTextLocator = (({ + "type": ("innerText"); + "value": (string); + "ignoreCase"?: (boolean); + "matchType"?: ("full" | "partial"); + "maxDepth"?: (JsUint); + })); } export declare namespace BrowsingContext { - type ImageFormat = { - type: string; - /** - * Must be between `0` and `1`, inclusive. - */ - quality?: number; - }; + type XPathLocator = (({ + "type": ("xpath"); + "value": (string); + })); } export declare namespace BrowsingContext { - type ClipRectangle = - | BrowsingContext.BoxClipRectangle - | BrowsingContext.ElementClipRectangle; + type Navigation = (string); } export declare namespace BrowsingContext { - type ElementClipRectangle = { - type: 'element'; - element: Script.SharedReference; - }; + type BaseNavigationInfo = ({ + "context": (BrowsingContext.BrowsingContext); + "navigation": (BrowsingContext.Navigation | null); + "timestamp": (JsUint); + "url": (string); + }); } export declare namespace BrowsingContext { - type BoxClipRectangle = { - type: 'box'; - x: number; - y: number; - width: number; - height: number; - }; + type NavigationInfo = ((BrowsingContext.BaseNavigationInfo)); } export declare namespace BrowsingContext { - type CaptureScreenshotResult = { - data: string; - }; + const enum ReadinessState { + None = "none", + Interactive = "interactive", + Complete = "complete" + } } export declare namespace BrowsingContext { - type Close = { - method: 'browsingContext.close'; - params: BrowsingContext.CloseParameters; - }; + const enum UserPromptType { + Alert = "alert", + Beforeunload = "beforeunload", + Confirm = "confirm", + Prompt = "prompt" + } } export declare namespace BrowsingContext { - type CloseParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - promptUnload?: boolean; - }; + type Activate = ({ + "method": ("browsingContext.activate"); + "params": (BrowsingContext.ActivateParameters); + }); } export declare namespace BrowsingContext { - type Create = { - method: 'browsingContext.create'; - params: BrowsingContext.CreateParameters; - }; + type ActivateParameters = (({ + "context": (BrowsingContext.BrowsingContext); + })); } export declare namespace BrowsingContext { - const enum CreateType { - Tab = 'tab', - Window = 'window', - } + type CaptureScreenshotParameters = (({ + "context": (BrowsingContext.BrowsingContext); + /** + * @defaultValue `"viewport"` + */ + "origin"?: (("viewport" | "document")); + "format"?: (BrowsingContext.ImageFormat); + "clip"?: (BrowsingContext.ClipRectangle); + })); } export declare namespace BrowsingContext { - type CreateParameters = { - type: BrowsingContext.CreateType; - referenceContext?: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - background?: boolean; - userContext?: Browser.UserContext; - }; + type CaptureScreenshot = ({ + "method": ("browsingContext.captureScreenshot"); + "params": (BrowsingContext.CaptureScreenshotParameters); + }); } export declare namespace BrowsingContext { - type CreateResult = { - context: BrowsingContext.BrowsingContext; - }; + type ImageFormat = (({ + "type": (string); + /** + * Must be between `0` and `1`, inclusive. + */ + "quality"?: (number); + })); } export declare namespace BrowsingContext { - type GetTree = { - method: 'browsingContext.getTree'; - params: BrowsingContext.GetTreeParameters; - }; + type ClipRectangle = ((BrowsingContext.BoxClipRectangle | BrowsingContext.ElementClipRectangle)); } export declare namespace BrowsingContext { - type GetTreeParameters = { - maxDepth?: JsUint; - root?: BrowsingContext.BrowsingContext; - }; + type ElementClipRectangle = (({ + "type": ("element"); + "element": (Script.SharedReference); + })); } export declare namespace BrowsingContext { - type GetTreeResult = { - contexts: BrowsingContext.InfoList; - }; + type BoxClipRectangle = (({ + "type": ("box"); + "x": (number); + "y": (number); + "width": (number); + "height": (number); + })); } export declare namespace BrowsingContext { - type HandleUserPrompt = { - method: 'browsingContext.handleUserPrompt'; - params: BrowsingContext.HandleUserPromptParameters; - }; + type CaptureScreenshotResult = (({ + "data": (string); + })); } -export declare namespace BrowsingContext { - type HandleUserPromptParameters = { - context: BrowsingContext.BrowsingContext; - accept?: boolean; - userText?: string; - }; -} -export declare namespace BrowsingContext { - type LocateNodes = { - method: 'browsingContext.locateNodes'; - params: BrowsingContext.LocateNodesParameters; - }; -} -export declare namespace BrowsingContext { - type LocateNodesParameters = { - context: BrowsingContext.BrowsingContext; - locator: BrowsingContext.Locator; - /** - * Must be greater than or equal to `1`. - */ - maxNodeCount?: JsUint; - serializationOptions?: Script.SerializationOptions; - startNodes?: [Script.SharedReference, ...Script.SharedReference[]]; - }; -} -export declare namespace BrowsingContext { - type LocateNodesResult = { - nodes: [...Script.NodeRemoteValue[]]; - }; -} -export declare namespace BrowsingContext { - type Navigate = { - method: 'browsingContext.navigate'; - params: BrowsingContext.NavigateParameters; - }; -} -export declare namespace BrowsingContext { - type NavigateParameters = { - context: BrowsingContext.BrowsingContext; - url: string; - wait?: BrowsingContext.ReadinessState; - }; -} -export declare namespace BrowsingContext { - type NavigateResult = { - navigation: BrowsingContext.Navigation | null; - url: string; - }; -} -export declare namespace BrowsingContext { - type Print = { - method: 'browsingContext.print'; - params: BrowsingContext.PrintParameters; - }; -} -export declare namespace BrowsingContext { - type PrintParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - background?: boolean; - margin?: BrowsingContext.PrintMarginParameters; - /** - * @defaultValue `"portrait"` - */ - orientation?: 'portrait' | 'landscape'; - page?: BrowsingContext.PrintPageParameters; - pageRanges?: [...(JsUint | string)[]]; - /** - * Must be between `0.1` and `2`, inclusive. - * - * @defaultValue `1` - */ - scale?: number; - /** - * @defaultValue `true` - */ - shrinkToFit?: boolean; - }; -} -export declare namespace BrowsingContext { - type PrintMarginParameters = { - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - bottom?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - left?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - right?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - top?: number; - }; -} -export declare namespace BrowsingContext { - type PrintPageParameters = { - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `27.94` - */ - height?: number; - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `21.59` - */ - width?: number; - }; +export declare namespace BrowsingContext { + type Close = ({ + "method": ("browsingContext.close"); + "params": (BrowsingContext.CloseParameters); + }); } -export declare namespace BrowsingContext { - type PrintResult = { - data: string; - }; -} -export declare namespace BrowsingContext { - type Reload = { - method: 'browsingContext.reload'; - params: BrowsingContext.ReloadParameters; - }; -} -export declare namespace BrowsingContext { - type ReloadParameters = { - context: BrowsingContext.BrowsingContext; - ignoreCache?: boolean; - wait?: BrowsingContext.ReadinessState; - }; +export declare namespace BrowsingContext { + type CloseParameters = (({ + "context": (BrowsingContext.BrowsingContext); + /** + * @defaultValue `false` + */ + "promptUnload"?: (boolean); + })); } -export declare namespace BrowsingContext { - type SetViewport = { - method: 'browsingContext.setViewport'; - params: BrowsingContext.SetViewportParameters; - }; +export declare namespace BrowsingContext { + type Create = ({ + "method": ("browsingContext.create"); + "params": (BrowsingContext.CreateParameters); + }); } -export declare namespace BrowsingContext { - type SetViewportParameters = { - context?: BrowsingContext.BrowsingContext; - viewport?: BrowsingContext.Viewport | null; - /** - * Must be greater than `0`. - */ - devicePixelRatio?: number | null; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export declare namespace BrowsingContext { + const enum CreateType { + Tab = "tab", + Window = "window" + } } export declare namespace BrowsingContext { - type Viewport = { - width: JsUint; - height: JsUint; - }; + type CreateParameters = (({ + "type": (BrowsingContext.CreateType); + "referenceContext"?: (BrowsingContext.BrowsingContext); + /** + * @defaultValue `false` + */ + "background"?: (boolean); + "userContext"?: (Browser.UserContext); + })); } export declare namespace BrowsingContext { - type TraverseHistory = { - method: 'browsingContext.traverseHistory'; - params: BrowsingContext.TraverseHistoryParameters; - }; + type CreateResult = (({ + "context": (BrowsingContext.BrowsingContext); + })); } export declare namespace BrowsingContext { - type TraverseHistoryParameters = { - context: BrowsingContext.BrowsingContext; - delta: JsInt; - }; + type GetTree = ({ + "method": ("browsingContext.getTree"); + "params": (BrowsingContext.GetTreeParameters); + }); } export declare namespace BrowsingContext { - type TraverseHistoryResult = Record; + type GetTreeParameters = (({ + "maxDepth"?: (JsUint); + "root"?: (BrowsingContext.BrowsingContext); + })); } export declare namespace BrowsingContext { - type ContextCreated = { - method: 'browsingContext.contextCreated'; - params: BrowsingContext.Info; - }; + type GetTreeResult = (({ + "contexts": (BrowsingContext.InfoList); + })); } export declare namespace BrowsingContext { - type ContextDestroyed = { - method: 'browsingContext.contextDestroyed'; - params: BrowsingContext.Info; - }; + type HandleUserPrompt = ({ + "method": ("browsingContext.handleUserPrompt"); + "params": (BrowsingContext.HandleUserPromptParameters); + }); } export declare namespace BrowsingContext { - type NavigationStarted = { - method: 'browsingContext.navigationStarted'; - params: BrowsingContext.NavigationInfo; - }; + type HandleUserPromptParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "accept"?: (boolean); + "userText"?: (string); + })); +} +export declare namespace BrowsingContext { + type LocateNodesParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "locator": (BrowsingContext.Locator); + /** + * Must be greater than or equal to `1`. + */ + "maxNodeCount"?: ((JsUint)); + "serializationOptions"?: (Script.SerializationOptions); + "startNodes"?: ([ + (Script.SharedReference), + ...(Script.SharedReference)[] + ]); + })); +} +export declare namespace BrowsingContext { + type LocateNodes = ({ + "method": ("browsingContext.locateNodes"); + "params": (BrowsingContext.LocateNodesParameters); + }); +} +export declare namespace BrowsingContext { + type LocateNodesResult = (({ + "nodes": ([ + ...((Script.NodeRemoteValue)[]) + ]); + })); +} +export declare namespace BrowsingContext { + type Navigate = ({ + "method": ("browsingContext.navigate"); + "params": (BrowsingContext.NavigateParameters); + }); +} +export declare namespace BrowsingContext { + type NavigateParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "url": (string); + "wait"?: (BrowsingContext.ReadinessState); + })); +} +export declare namespace BrowsingContext { + type NavigateResult = (({ + "navigation": (BrowsingContext.Navigation | null); + "url": (string); + })); +} +export declare namespace BrowsingContext { + type Print = ({ + "method": ("browsingContext.print"); + "params": (BrowsingContext.PrintParameters); + }); +} +export declare namespace BrowsingContext { + type PrintParameters = (({ + "context": (BrowsingContext.BrowsingContext); + /** + * @defaultValue `false` + */ + "background"?: (boolean); + "margin"?: (BrowsingContext.PrintMarginParameters); + /** + * @defaultValue `"portrait"` + */ + "orientation"?: (("portrait" | "landscape")); + "page"?: (BrowsingContext.PrintPageParameters); + "pageRanges"?: ([ + ...((JsUint | string)[]) + ]); + /** + * Must be between `0.1` and `2`, inclusive. + * + * @defaultValue `1` + */ + "scale"?: ((number)); + /** + * @defaultValue `true` + */ + "shrinkToFit"?: (boolean); + })); +} +export declare namespace BrowsingContext { + type PrintMarginParameters = (({ + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + "bottom"?: ((number)); + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + "left"?: ((number)); + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + "right"?: ((number)); + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + "top"?: ((number)); + })); +} +export declare namespace BrowsingContext { + type PrintPageParameters = (({ + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `27.94` + */ + "height"?: ((number)); + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `21.59` + */ + "width"?: ((number)); + })); +} +export declare namespace BrowsingContext { + type PrintResult = (({ + "data": (string); + })); +} +export declare namespace BrowsingContext { + type Reload = ({ + "method": ("browsingContext.reload"); + "params": (BrowsingContext.ReloadParameters); + }); +} +export declare namespace BrowsingContext { + type ReloadParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "ignoreCache"?: (boolean); + "wait"?: (BrowsingContext.ReadinessState); + })); +} +export declare namespace BrowsingContext { + type SetViewport = ({ + "method": ("browsingContext.setViewport"); + "params": (BrowsingContext.SetViewportParameters); + }); +} +export declare namespace BrowsingContext { + type SetViewportParameters = (({ + "context"?: (BrowsingContext.BrowsingContext); + "viewport"?: (BrowsingContext.Viewport | null); + /** + * Must be greater than `0`. + */ + "devicePixelRatio"?: ((number) | null); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } export declare namespace BrowsingContext { - type FragmentNavigated = { - method: 'browsingContext.fragmentNavigated'; - params: BrowsingContext.NavigationInfo; - }; + type Viewport = (({ + "width": (JsUint); + "height": (JsUint); + })); } export declare namespace BrowsingContext { - type HistoryUpdated = { - method: 'browsingContext.historyUpdated'; - params: BrowsingContext.HistoryUpdatedParameters; - }; + type TraverseHistory = ({ + "method": ("browsingContext.traverseHistory"); + "params": (BrowsingContext.TraverseHistoryParameters); + }); } export declare namespace BrowsingContext { - type HistoryUpdatedParameters = { - context: BrowsingContext.BrowsingContext; - timestamp: JsUint; - url: string; - }; + type TraverseHistoryParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "delta": (JsInt); + })); } export declare namespace BrowsingContext { - type DomContentLoaded = { - method: 'browsingContext.domContentLoaded'; - params: BrowsingContext.NavigationInfo; - }; + type TraverseHistoryResult = ((Record)); } export declare namespace BrowsingContext { - type Load = { - method: 'browsingContext.load'; - params: BrowsingContext.NavigationInfo; - }; + type ContextCreated = ({ + "method": ("browsingContext.contextCreated"); + "params": (BrowsingContext.Info); + }); } export declare namespace BrowsingContext { - type DownloadWillBegin = { - method: 'browsingContext.downloadWillBegin'; - params: BrowsingContext.DownloadWillBeginParams; - }; + type ContextDestroyed = ({ + "method": ("browsingContext.contextDestroyed"); + "params": (BrowsingContext.Info); + }); } export declare namespace BrowsingContext { - type DownloadWillBeginParams = { - suggestedFilename: string; - } & BrowsingContext.BaseNavigationInfo; + type NavigationStarted = ({ + "method": ("browsingContext.navigationStarted"); + "params": (BrowsingContext.NavigationInfo); + }); } export declare namespace BrowsingContext { - type DownloadEnd = { - method: 'browsingContext.downloadEnd'; - params: BrowsingContext.DownloadEndParams; - }; + type FragmentNavigated = ({ + "method": ("browsingContext.fragmentNavigated"); + "params": (BrowsingContext.NavigationInfo); + }); } export declare namespace BrowsingContext { - type DownloadEndParams = - | BrowsingContext.DownloadCanceledParams - | BrowsingContext.DownloadCompleteParams; + type HistoryUpdated = ({ + "method": ("browsingContext.historyUpdated"); + "params": (BrowsingContext.HistoryUpdatedParameters); + }); } export declare namespace BrowsingContext { - type DownloadCanceledParams = { - status: 'canceled'; - } & BrowsingContext.BaseNavigationInfo; + type HistoryUpdatedParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "timestamp": (JsUint); + "url": (string); + })); } export declare namespace BrowsingContext { - type DownloadCompleteParams = { - status: 'complete'; - filepath: string | null; - } & BrowsingContext.BaseNavigationInfo; + type DomContentLoaded = ({ + "method": ("browsingContext.domContentLoaded"); + "params": (BrowsingContext.NavigationInfo); + }); } export declare namespace BrowsingContext { - type NavigationAborted = { - method: 'browsingContext.navigationAborted'; - params: BrowsingContext.NavigationInfo; - }; + type Load = ({ + "method": ("browsingContext.load"); + "params": (BrowsingContext.NavigationInfo); + }); } export declare namespace BrowsingContext { - type NavigationCommitted = { - method: 'browsingContext.navigationCommitted'; - params: BrowsingContext.NavigationInfo; - }; + type DownloadWillBegin = ({ + "method": ("browsingContext.downloadWillBegin"); + "params": (BrowsingContext.DownloadWillBeginParams); + }); } export declare namespace BrowsingContext { - type NavigationFailed = { - method: 'browsingContext.navigationFailed'; - params: BrowsingContext.NavigationInfo; - }; + type DownloadWillBeginParams = (({ + "suggestedFilename": (string); + } & BrowsingContext.BaseNavigationInfo)); } export declare namespace BrowsingContext { - type UserPromptClosed = { - method: 'browsingContext.userPromptClosed'; - params: BrowsingContext.UserPromptClosedParameters; - }; + type DownloadEnd = ({ + "method": ("browsingContext.downloadEnd"); + "params": (BrowsingContext.DownloadEndParams); + }); } export declare namespace BrowsingContext { - type UserPromptClosedParameters = { - context: BrowsingContext.BrowsingContext; - accepted: boolean; - type: BrowsingContext.UserPromptType; - userText?: string; - }; + type DownloadEndParams = (((BrowsingContext.DownloadCanceledParams | BrowsingContext.DownloadCompleteParams))); } export declare namespace BrowsingContext { - type UserPromptOpened = { - method: 'browsingContext.userPromptOpened'; - params: BrowsingContext.UserPromptOpenedParameters; - }; + type DownloadCanceledParams = ({ + "status": ("canceled"); + } & BrowsingContext.BaseNavigationInfo); } export declare namespace BrowsingContext { - type UserPromptOpenedParameters = { - context: BrowsingContext.BrowsingContext; - handler: Session.UserPromptHandlerType; - message: string; - type: BrowsingContext.UserPromptType; - defaultValue?: string; - }; + type DownloadCompleteParams = ({ + "status": ("complete"); + "filepath": (string | null); + } & BrowsingContext.BaseNavigationInfo); } -export type EmulationCommand = - | Emulation.SetForcedColorsModeThemeOverride - | Emulation.SetGeolocationOverride - | Emulation.SetLocaleOverride - | Emulation.SetScreenOrientationOverride - | Emulation.SetScriptingEnabled - | Emulation.SetTimezoneOverride - | Emulation.SetUserAgentOverride; -export declare namespace Emulation { - type SetForcedColorsModeThemeOverride = { - method: 'emulation.setForcedColorsModeThemeOverride'; - params: Emulation.SetForcedColorsModeThemeOverrideParameters; - }; +export declare namespace BrowsingContext { + type NavigationAborted = ({ + "method": ("browsingContext.navigationAborted"); + "params": (BrowsingContext.NavigationInfo); + }); } -export declare namespace Emulation { - type SetForcedColorsModeThemeOverrideParameters = { - theme: Emulation.ForcedColorsModeTheme | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export declare namespace BrowsingContext { + type NavigationCommitted = ({ + "method": ("browsingContext.navigationCommitted"); + "params": (BrowsingContext.NavigationInfo); + }); } -export declare namespace Emulation { - const enum ForcedColorsModeTheme { - Light = 'light', - Dark = 'dark', - } +export declare namespace BrowsingContext { + type NavigationFailed = ({ + "method": ("browsingContext.navigationFailed"); + "params": (BrowsingContext.NavigationInfo); + }); } -export declare namespace Emulation { - type SetGeolocationOverride = { - method: 'emulation.setGeolocationOverride'; - params: Emulation.SetGeolocationOverrideParameters; - }; +export declare namespace BrowsingContext { + type UserPromptClosed = ({ + "method": ("browsingContext.userPromptClosed"); + "params": (BrowsingContext.UserPromptClosedParameters); + }); } -export declare namespace Emulation { - type SetGeolocationOverrideParameters = ( - | { - coordinates: Emulation.GeolocationCoordinates | null; - } - | { - error: Emulation.GeolocationPositionError; - } - ) & { - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export declare namespace BrowsingContext { + type UserPromptClosedParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "accepted": (boolean); + "type": (BrowsingContext.UserPromptType); + "userText"?: (string); + })); } -export declare namespace Emulation { - type GeolocationCoordinates = { - /** - * Must be between `-90` and `90`, inclusive. - */ - latitude: number; - /** - * Must be between `-180` and `180`, inclusive. - */ - longitude: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - accuracy?: number; - /** - * @defaultValue `null` - */ - altitude?: number | null; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - altitudeAccuracy?: number | null; - /** - * Must be between `0` and `360`. - * - * @defaultValue `null` - */ - heading?: number | null; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - speed?: number | null; - }; +export declare namespace BrowsingContext { + type UserPromptOpened = ({ + "method": ("browsingContext.userPromptOpened"); + "params": (BrowsingContext.UserPromptOpenedParameters); + }); } -export declare namespace Emulation { - type GeolocationPositionError = { - type: 'positionUnavailable'; - }; +export declare namespace BrowsingContext { + type UserPromptOpenedParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "handler": (Session.UserPromptHandlerType); + "message": (string); + "type": (BrowsingContext.UserPromptType); + "defaultValue"?: (string); + })); } +export type EmulationCommand = (Emulation.SetForcedColorsModeThemeOverride | Emulation.SetGeolocationOverride | Emulation.SetLocaleOverride | Emulation.SetScreenOrientationOverride | Emulation.SetScriptingEnabled | Emulation.SetTimezoneOverride | Emulation.SetUserAgentOverride); export declare namespace Emulation { - type SetLocaleOverride = { - method: 'emulation.setLocaleOverride'; - params: Emulation.SetLocaleOverrideParameters; - }; + type SetForcedColorsModeThemeOverride = ({ + "method": ("emulation.setForcedColorsModeThemeOverride"); + "params": (Emulation.SetForcedColorsModeThemeOverrideParameters); + }); } export declare namespace Emulation { - type SetLocaleOverrideParameters = { - locale: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + type SetForcedColorsModeThemeOverrideParameters = (({ + "theme": (Emulation.ForcedColorsModeTheme | null); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } export declare namespace Emulation { - type SetScreenOrientationOverride = { - method: 'emulation.setScreenOrientationOverride'; - params: Emulation.SetScreenOrientationOverrideParameters; - }; + const enum ForcedColorsModeTheme { + Light = "light", + Dark = "dark" + } } export declare namespace Emulation { - const enum ScreenOrientationNatural { - Portrait = 'portrait', - Landscape = 'landscape', - } + type SetGeolocationOverride = ({ + "method": ("emulation.setGeolocationOverride"); + "params": (Emulation.SetGeolocationOverrideParameters); + }); } export declare namespace Emulation { - type ScreenOrientationType = - | 'portrait-primary' - | 'portrait-secondary' - | 'landscape-primary' - | 'landscape-secondary'; + type SetGeolocationOverrideParameters = (((({ + "coordinates": (Emulation.GeolocationCoordinates | null); + }) | ({ + "error": (Emulation.GeolocationPositionError); + })) & { + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } export declare namespace Emulation { - type ScreenOrientation = { - natural: Emulation.ScreenOrientationNatural; - type: Emulation.ScreenOrientationType; - }; + type GeolocationCoordinates = (({ + /** + * Must be between `-90` and `90`, inclusive. + */ + "latitude": (number); + /** + * Must be between `-180` and `180`, inclusive. + */ + "longitude": (number); + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + "accuracy"?: ((number)); + /** + * @defaultValue `null` + */ + "altitude"?: (number | null); + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + "altitudeAccuracy"?: ((number) | null); + /** + * Must be between `0` and `360`. + * + * @defaultValue `null` + */ + "heading"?: ((number) | null); + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + "speed"?: ((number) | null); + })); } export declare namespace Emulation { - type SetScreenOrientationOverrideParameters = { - screenOrientation: Emulation.ScreenOrientation | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + type GeolocationPositionError = (({ + "type": ("positionUnavailable"); + })); } export declare namespace Emulation { - type SetUserAgentOverride = { - method: 'emulation.setUserAgentOverride'; - params: Emulation.SetUserAgentOverrideParameters; - }; + type SetLocaleOverride = ({ + "method": ("emulation.setLocaleOverride"); + "params": (Emulation.SetLocaleOverrideParameters); + }); } export declare namespace Emulation { - type SetUserAgentOverrideParameters = { - userAgent: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + type SetLocaleOverrideParameters = (({ + "locale": (string | null); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } export declare namespace Emulation { - type SetScriptingEnabled = { - method: 'emulation.setScriptingEnabled'; - params: Emulation.SetScriptingEnabledParameters; - }; + type SetScreenOrientationOverride = ({ + "method": ("emulation.setScreenOrientationOverride"); + "params": (Emulation.SetScreenOrientationOverrideParameters); + }); } export declare namespace Emulation { - type SetScriptingEnabledParameters = { - enabled: false | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + const enum ScreenOrientationNatural { + Portrait = "portrait", + Landscape = "landscape" + } } export declare namespace Emulation { - type SetTimezoneOverride = { - method: 'emulation.setTimezoneOverride'; - params: Emulation.SetTimezoneOverrideParameters; - }; + type ScreenOrientationType = ("portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"); } export declare namespace Emulation { - type SetTimezoneOverrideParameters = { - timezone: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; -} -export type NetworkCommand = - | Network.AddDataCollector - | Network.AddIntercept - | Network.ContinueRequest - | Network.ContinueResponse - | Network.ContinueWithAuth - | Network.DisownData - | Network.FailRequest - | Network.GetData - | Network.ProvideResponse - | Network.RemoveDataCollector - | Network.RemoveIntercept - | Network.SetCacheBehavior - | Network.SetExtraHeaders; -export type NetworkResult = Network.AddInterceptResult; -export type NetworkEvent = - | Network.AuthRequired - | Network.BeforeRequestSent - | Network.FetchError - | Network.ResponseCompleted - | Network.ResponseStarted; -export declare namespace Network { - type AuthChallenge = { - scheme: string; - realm: string; - }; -} -export declare namespace Network { - type AuthCredentials = { - type: 'password'; - username: string; - password: string; - }; -} -export declare namespace Network { - type BaseParameters = { - context: BrowsingContext.BrowsingContext | null; - isBlocked: boolean; - navigation: BrowsingContext.Navigation | null; - redirectCount: JsUint; - request: Network.RequestData; - timestamp: JsUint; - intercepts?: [Network.Intercept, ...Network.Intercept[]]; - }; -} -export declare namespace Network { - type BytesValue = Network.StringValue | Network.Base64Value; -} -export declare namespace Network { - type StringValue = { - type: 'string'; - value: string; - }; -} -export declare namespace Network { - type Base64Value = { - type: 'base64'; - value: string; - }; -} -export declare namespace Network { - type Collector = string; -} -export declare namespace Network { - const enum CollectorType { - Blob = 'blob', - } -} -export declare namespace Network { - const enum SameSite { - Strict = 'strict', - Lax = 'lax', - None = 'none', - Default = 'default', - } -} -export declare namespace Network { - type Cookie = { - name: string; - value: Network.BytesValue; - domain: string; - path: string; - size: JsUint; - httpOnly: boolean; - secure: boolean; - sameSite: Network.SameSite; - expiry?: JsUint; - } & Extensible; -} -export declare namespace Network { - type CookieHeader = { - name: string; - value: Network.BytesValue; - }; -} -export declare namespace Network { - const enum DataType { - Response = 'response', - } -} -export declare namespace Network { - type FetchTimingInfo = { - timeOrigin: number; - requestTime: number; - redirectStart: number; - redirectEnd: number; - fetchStart: number; - dnsStart: number; - dnsEnd: number; - connectStart: number; - connectEnd: number; - tlsStart: number; - requestStart: number; - responseStart: number; - responseEnd: number; - }; + type ScreenOrientation = (({ + "natural": (Emulation.ScreenOrientationNatural); + "type": (Emulation.ScreenOrientationType); + })); } -export declare namespace Network { - type Header = { - name: string; - value: Network.BytesValue; - }; -} -export declare namespace Network { - type Initiator = { - columnNumber?: JsUint; - lineNumber?: JsUint; - request?: Network.Request; - stackTrace?: Script.StackTrace; - type?: 'parser' | 'script' | 'preflight' | 'other'; - }; -} -export declare namespace Network { - type Intercept = string; +export declare namespace Emulation { + type SetScreenOrientationOverrideParameters = (({ + "screenOrientation": (Emulation.ScreenOrientation | null); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } -export declare namespace Network { - type Request = string; +export declare namespace Emulation { + type SetUserAgentOverride = ({ + "method": ("emulation.setUserAgentOverride"); + "params": (Emulation.SetUserAgentOverrideParameters); + }); } -export declare namespace Network { - type RequestData = { - request: Network.Request; - url: string; - method: string; - headers: [...Network.Header[]]; - cookies: [...Network.Cookie[]]; - headersSize: JsUint; - bodySize: JsUint | null; - destination: string; - initiatorType: string | null; - timings: Network.FetchTimingInfo; - }; +export declare namespace Emulation { + type SetUserAgentOverrideParameters = (({ + "userAgent": (string | null); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } -export declare namespace Network { - type ResponseContent = { - size: JsUint; - }; +export declare namespace Emulation { + type SetScriptingEnabled = ({ + "method": ("emulation.setScriptingEnabled"); + "params": (Emulation.SetScriptingEnabledParameters); + }); } -export declare namespace Network { - type ResponseData = { - url: string; - protocol: string; - status: JsUint; - statusText: string; - fromCache: boolean; - headers: [...Network.Header[]]; - mimeType: string; - bytesReceived: JsUint; - headersSize: JsUint | null; - bodySize: JsUint | null; - content: Network.ResponseContent; - authChallenges?: [...Network.AuthChallenge[]]; - }; -} -export declare namespace Network { - type SetCookieHeader = { - name: string; - value: Network.BytesValue; - domain?: string; - httpOnly?: boolean; - expiry?: string; - maxAge?: JsInt; - path?: string; - sameSite?: Network.SameSite; - secure?: boolean; - }; +export declare namespace Emulation { + type SetScriptingEnabledParameters = (({ + "enabled": (false | null); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } -export declare namespace Network { - type UrlPattern = Network.UrlPatternPattern | Network.UrlPatternString; +export declare namespace Emulation { + type SetTimezoneOverride = ({ + "method": ("emulation.setTimezoneOverride"); + "params": (Emulation.SetTimezoneOverrideParameters); + }); } -export declare namespace Network { - type UrlPatternPattern = { - type: 'pattern'; - protocol?: string; - hostname?: string; - port?: string; - pathname?: string; - search?: string; - }; +export declare namespace Emulation { + type SetTimezoneOverrideParameters = (({ + "timezone": (string | null); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); +} +export type NetworkCommand = (Network.AddDataCollector | Network.AddIntercept | Network.ContinueRequest | Network.ContinueResponse | Network.ContinueWithAuth | Network.DisownData | Network.FailRequest | Network.GetData | Network.ProvideResponse | Network.RemoveDataCollector | Network.RemoveIntercept | Network.SetCacheBehavior | Network.SetExtraHeaders); +export type NetworkEvent = (Network.AuthRequired | Network.BeforeRequestSent | Network.FetchError | Network.ResponseCompleted | Network.ResponseStarted); +export type NetworkResult = ((Network.AddInterceptResult)); +export declare namespace Network { + type AuthChallenge = (({ + "scheme": (string); + "realm": (string); + })); } export declare namespace Network { - type UrlPatternString = { - type: 'string'; - pattern: string; - }; -} -export declare namespace Network { - type AddDataCollector = { - method: 'network.addDataCollector'; - params: Network.AddDataCollectorParameters; - }; + type AuthCredentials = (({ + "type": ("password"); + "username": (string); + "password": (string); + })); +} +export declare namespace Network { + type BaseParameters = ({ + "context": (BrowsingContext.BrowsingContext | null); + "isBlocked": (boolean); + "navigation": (BrowsingContext.Navigation | null); + "redirectCount": (JsUint); + "request": (Network.RequestData); + "timestamp": (JsUint); + "intercepts"?: ([ + (Network.Intercept), + ...(Network.Intercept)[] + ]); + }); } export declare namespace Network { - type AddDataCollectorParameters = { - dataTypes: [Network.DataType, ...Network.DataType[]]; - maxEncodedDataSize: JsUint; - /** - * @defaultValue `"blob"` - */ - collectorType?: Network.CollectorType; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + type BytesValue = (Network.StringValue | Network.Base64Value); } export declare namespace Network { - type AddDataCollectorResult = { - collector: Network.Collector; - }; -} + type StringValue = (({ + "type": ("string"); + "value": (string); + })); +} +export declare namespace Network { + type Base64Value = (({ + "type": ("base64"); + "value": (string); + })); +} export declare namespace Network { - type AddIntercept = { - method: 'network.addIntercept'; - params: Network.AddInterceptParameters; - }; + type Collector = (string); } export declare namespace Network { - type AddInterceptParameters = { - phases: [Network.InterceptPhase, ...Network.InterceptPhase[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - urlPatterns?: [...Network.UrlPattern[]]; - }; + const enum CollectorType { + Blob = "blob" + } +} +export declare namespace Network { + const enum SameSite { + Strict = "strict", + Lax = "lax", + None = "none", + Default = "default" + } +} +export declare namespace Network { + type Cookie = (({ + "name": (string); + "value": (Network.BytesValue); + "domain": (string); + "path": (string); + "size": (JsUint); + "httpOnly": (boolean); + "secure": (boolean); + "sameSite": (Network.SameSite); + "expiry"?: (JsUint); + } & Extensible)); +} +export declare namespace Network { + type CookieHeader = (({ + "name": (string); + "value": (Network.BytesValue); + })); +} +export declare namespace Network { + const enum DataType { + Response = "response" + } +} +export declare namespace Network { + type FetchTimingInfo = (({ + "timeOrigin": (number); + "requestTime": (number); + "redirectStart": (number); + "redirectEnd": (number); + "fetchStart": (number); + "dnsStart": (number); + "dnsEnd": (number); + "connectStart": (number); + "connectEnd": (number); + "tlsStart": (number); + "requestStart": (number); + "responseStart": (number); + "responseEnd": (number); + })); +} +export declare namespace Network { + type Header = (({ + "name": (string); + "value": (Network.BytesValue); + })); } export declare namespace Network { - const enum InterceptPhase { - BeforeRequestSent = 'beforeRequestSent', - ResponseStarted = 'responseStarted', - AuthRequired = 'authRequired', - } + type Initiator = (({ + "columnNumber"?: (JsUint); + "lineNumber"?: (JsUint); + "request"?: (Network.Request); + "stackTrace"?: (Script.StackTrace); + "type"?: ("parser" | "script" | "preflight" | "other"); + })); +} +export declare namespace Network { + type Intercept = (string); +} +export declare namespace Network { + type Request = (string); +} +export declare namespace Network { + type RequestData = (({ + "request": (Network.Request); + "url": (string); + "method": (string); + "headers": ([ + ...((Network.Header)[]) + ]); + "cookies": ([ + ...((Network.Cookie)[]) + ]); + "headersSize": (JsUint); + "bodySize": (JsUint | null); + "destination": (string); + "initiatorType": (string | null); + "timings": (Network.FetchTimingInfo); + })); +} +export declare namespace Network { + type ResponseContent = (({ + "size": (JsUint); + })); +} +export declare namespace Network { + type ResponseData = (({ + "url": (string); + "protocol": (string); + "status": (JsUint); + "statusText": (string); + "fromCache": (boolean); + "headers": ([ + ...((Network.Header)[]) + ]); + "mimeType": (string); + "bytesReceived": (JsUint); + "headersSize": (JsUint | null); + "bodySize": (JsUint | null); + "content": (Network.ResponseContent); + "authChallenges"?: ([ + ...((Network.AuthChallenge)[]) + ]); + })); +} +export declare namespace Network { + type SetCookieHeader = (({ + "name": (string); + "value": (Network.BytesValue); + "domain"?: (string); + "httpOnly"?: (boolean); + "expiry"?: (string); + "maxAge"?: (JsInt); + "path"?: (string); + "sameSite"?: (Network.SameSite); + "secure"?: (boolean); + })); +} +export declare namespace Network { + type UrlPattern = ((Network.UrlPatternPattern | Network.UrlPatternString)); +} +export declare namespace Network { + type UrlPatternPattern = (({ + "type": ("pattern"); + "protocol"?: (string); + "hostname"?: (string); + "port"?: (string); + "pathname"?: (string); + "search"?: (string); + })); +} +export declare namespace Network { + type UrlPatternString = (({ + "type": ("string"); + "pattern": (string); + })); +} +export declare namespace Network { + type AddDataCollector = ({ + "method": ("network.addDataCollector"); + "params": (Network.AddDataCollectorParameters); + }); +} +export declare namespace Network { + type AddDataCollectorParameters = (({ + "dataTypes": ([ + (Network.DataType), + ...(Network.DataType)[] + ]); + "maxEncodedDataSize": (JsUint); + /** + * @defaultValue `"blob"` + */ + "collectorType"?: (Network.CollectorType); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); +} +export declare namespace Network { + type AddDataCollectorResult = (({ + "collector": (Network.Collector); + })); +} +export declare namespace Network { + type AddInterceptParameters = (({ + "phases": ([ + (Network.InterceptPhase), + ...(Network.InterceptPhase)[] + ]); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "urlPatterns"?: ([ + ...((Network.UrlPattern)[]) + ]); + })); +} +export declare namespace Network { + type AddIntercept = ({ + "method": ("network.addIntercept"); + "params": (Network.AddInterceptParameters); + }); +} +export declare namespace Network { + const enum InterceptPhase { + BeforeRequestSent = "beforeRequestSent", + ResponseStarted = "responseStarted", + AuthRequired = "authRequired" + } } export declare namespace Network { - type AddInterceptResult = { - intercept: Network.Intercept; - }; + type AddInterceptResult = (({ + "intercept": (Network.Intercept); + })); } export declare namespace Network { - type ContinueRequest = { - method: 'network.continueRequest'; - params: Network.ContinueRequestParameters; - }; + type ContinueRequest = ({ + "method": ("network.continueRequest"); + "params": (Network.ContinueRequestParameters); + }); } export declare namespace Network { - type ContinueRequestParameters = { - request: Network.Request; - body?: Network.BytesValue; - cookies?: [...Network.CookieHeader[]]; - headers?: [...Network.Header[]]; - method?: string; - url?: string; - }; + type ContinueRequestParameters = (({ + "request": (Network.Request); + "body"?: (Network.BytesValue); + "cookies"?: ([ + ...((Network.CookieHeader)[]) + ]); + "headers"?: ([ + ...((Network.Header)[]) + ]); + "method"?: (string); + "url"?: (string); + })); } export declare namespace Network { - type ContinueResponse = { - method: 'network.continueResponse'; - params: Network.ContinueResponseParameters; - }; + type ContinueResponse = ({ + "method": ("network.continueResponse"); + "params": (Network.ContinueResponseParameters); + }); } export declare namespace Network { - type ContinueResponseParameters = { - request: Network.Request; - cookies?: [...Network.SetCookieHeader[]]; - credentials?: Network.AuthCredentials; - headers?: [...Network.Header[]]; - reasonPhrase?: string; - statusCode?: JsUint; - }; + type ContinueResponseParameters = (({ + "request": (Network.Request); + "cookies"?: ([ + ...((Network.SetCookieHeader)[]) + ]); + "credentials"?: (Network.AuthCredentials); + "headers"?: ([ + ...((Network.Header)[]) + ]); + "reasonPhrase"?: (string); + "statusCode"?: (JsUint); + })); } export declare namespace Network { - type ContinueWithAuth = { - method: 'network.continueWithAuth'; - params: Network.ContinueWithAuthParameters; - }; + type ContinueWithAuth = ({ + "method": ("network.continueWithAuth"); + "params": (Network.ContinueWithAuthParameters); + }); } export declare namespace Network { - type ContinueWithAuthParameters = { - request: Network.Request; - } & ( - | Network.ContinueWithAuthCredentials - | Network.ContinueWithAuthNoCredentials - ); + type ContinueWithAuthParameters = (({ + "request": (Network.Request); + } & (Network.ContinueWithAuthCredentials | Network.ContinueWithAuthNoCredentials))); } export declare namespace Network { - type ContinueWithAuthCredentials = { - action: 'provideCredentials'; - credentials: Network.AuthCredentials; - }; + type ContinueWithAuthCredentials = ({ + "action": ("provideCredentials"); + "credentials": (Network.AuthCredentials); + }); } export declare namespace Network { - type ContinueWithAuthNoCredentials = { - action: 'default' | 'cancel'; - }; + type ContinueWithAuthNoCredentials = ({ + "action": ("default" | "cancel"); + }); } export declare namespace Network { - type DisownData = { - method: 'network.disownData'; - params: Network.DisownDataParameters; - }; + type DisownData = ({ + "method": ("network.disownData"); + "params": (Network.DisownDataParameters); + }); } export declare namespace Network { - type DisownDataParameters = { - dataType: Network.DataType; - collector: Network.Collector; - request: Network.Request; - }; + type DisownDataParameters = (({ + "dataType": (Network.DataType); + "collector": (Network.Collector); + "request": (Network.Request); + })); } export declare namespace Network { - type FailRequest = { - method: 'network.failRequest'; - params: Network.FailRequestParameters; - }; + type FailRequest = ({ + "method": ("network.failRequest"); + "params": (Network.FailRequestParameters); + }); } export declare namespace Network { - type FailRequestParameters = { - request: Network.Request; - }; + type FailRequestParameters = (({ + "request": (Network.Request); + })); } export declare namespace Network { - type GetData = { - method: 'network.getData'; - params: Network.GetDataParameters; - }; + type GetData = ({ + "method": ("network.getData"); + "params": (Network.GetDataParameters); + }); } export declare namespace Network { - type GetDataParameters = { - dataType: Network.DataType; - collector?: Network.Collector; - /** - * @defaultValue `false` - */ - disown?: boolean; - request: Network.Request; - }; + type GetDataParameters = (({ + "dataType": (Network.DataType); + "collector"?: (Network.Collector); + /** + * @defaultValue `false` + */ + "disown"?: (boolean); + "request": (Network.Request); + })); } export declare namespace Network { - type GetDataResult = { - bytes: Network.BytesValue; - }; + type GetDataResult = (({ + "bytes": (Network.BytesValue); + })); } export declare namespace Network { - type ProvideResponse = { - method: 'network.provideResponse'; - params: Network.ProvideResponseParameters; - }; + type ProvideResponse = ({ + "method": ("network.provideResponse"); + "params": (Network.ProvideResponseParameters); + }); } export declare namespace Network { - type ProvideResponseParameters = { - request: Network.Request; - body?: Network.BytesValue; - cookies?: [...Network.SetCookieHeader[]]; - headers?: [...Network.Header[]]; - reasonPhrase?: string; - statusCode?: JsUint; - }; + type ProvideResponseParameters = (({ + "request": (Network.Request); + "body"?: (Network.BytesValue); + "cookies"?: ([ + ...((Network.SetCookieHeader)[]) + ]); + "headers"?: ([ + ...((Network.Header)[]) + ]); + "reasonPhrase"?: (string); + "statusCode"?: (JsUint); + })); } export declare namespace Network { - type RemoveDataCollector = { - method: 'network.removeDataCollector'; - params: Network.RemoveDataCollectorParameters; - }; + type RemoveDataCollector = ({ + "method": ("network.removeDataCollector"); + "params": (Network.RemoveDataCollectorParameters); + }); } export declare namespace Network { - type RemoveDataCollectorParameters = { - collector: Network.Collector; - }; + type RemoveDataCollectorParameters = (({ + "collector": (Network.Collector); + })); } export declare namespace Network { - type RemoveIntercept = { - method: 'network.removeIntercept'; - params: Network.RemoveInterceptParameters; - }; + type RemoveIntercept = ({ + "method": ("network.removeIntercept"); + "params": (Network.RemoveInterceptParameters); + }); } export declare namespace Network { - type RemoveInterceptParameters = { - intercept: Network.Intercept; - }; + type RemoveInterceptParameters = (({ + "intercept": (Network.Intercept); + })); } export declare namespace Network { - type SetCacheBehavior = { - method: 'network.setCacheBehavior'; - params: Network.SetCacheBehaviorParameters; - }; + type SetCacheBehavior = ({ + "method": ("network.setCacheBehavior"); + "params": (Network.SetCacheBehaviorParameters); + }); } export declare namespace Network { - type SetCacheBehaviorParameters = { - cacheBehavior: 'default' | 'bypass'; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - }; + type SetCacheBehaviorParameters = (({ + "cacheBehavior": ("default" | "bypass"); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + })); } export declare namespace Network { - type SetExtraHeaders = { - method: 'network.setExtraHeaders'; - params: Network.SetExtraHeadersParameters; - }; + type SetExtraHeaders = ({ + "method": ("network.setExtraHeaders"); + "params": (Network.SetExtraHeadersParameters); + }); } export declare namespace Network { - type SetExtraHeadersParameters = { - headers: [...Network.Header[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; + type SetExtraHeadersParameters = (({ + "headers": ([ + ...((Network.Header)[]) + ]); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + })); } +export type ScriptEvent = (Script.Message | Script.RealmCreated | Script.RealmDestroyed); export declare namespace Network { - type AuthRequired = { - method: 'network.authRequired'; - params: Network.AuthRequiredParameters; - }; + type AuthRequiredParameters = ((Network.BaseParameters & { + "response": (Network.ResponseData); + })); } export declare namespace Network { - type AuthRequiredParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; + type BeforeRequestSentParameters = ((Network.BaseParameters & { + "initiator"?: (Network.Initiator); + })); } export declare namespace Network { - type BeforeRequestSent = { - method: 'network.beforeRequestSent'; - params: Network.BeforeRequestSentParameters; - }; + type FetchErrorParameters = ((Network.BaseParameters & { + "errorText": (string); + })); } export declare namespace Network { - type BeforeRequestSentParameters = Network.BaseParameters & { - initiator?: Network.Initiator; - }; + type ResponseCompletedParameters = ((Network.BaseParameters & { + "response": (Network.ResponseData); + })); } export declare namespace Network { - type FetchError = { - method: 'network.fetchError'; - params: Network.FetchErrorParameters; - }; + type ResponseStartedParameters = ((Network.BaseParameters & { + "response": (Network.ResponseData); + })); } +export type ScriptCommand = (Script.AddPreloadScript | Script.CallFunction | Script.Disown | Script.Evaluate | Script.GetRealms | Script.RemovePreloadScript); +export type ScriptResult = ((Script.AddPreloadScriptResult | Script.EvaluateResult | Script.GetRealmsResult)); export declare namespace Network { - type FetchErrorParameters = Network.BaseParameters & { - errorText: string; - }; + type AuthRequired = ({ + "method": ("network.authRequired"); + "params": (Network.AuthRequiredParameters); + }); } export declare namespace Network { - type ResponseCompleted = { - method: 'network.responseCompleted'; - params: Network.ResponseCompletedParameters; - }; + type BeforeRequestSent = ({ + "method": ("network.beforeRequestSent"); + "params": (Network.BeforeRequestSentParameters); + }); } export declare namespace Network { - type ResponseCompletedParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; + type FetchError = ({ + "method": ("network.fetchError"); + "params": (Network.FetchErrorParameters); + }); } export declare namespace Network { - type ResponseStarted = { - method: 'network.responseStarted'; - params: Network.ResponseStartedParameters; - }; + type ResponseCompleted = ({ + "method": ("network.responseCompleted"); + "params": (Network.ResponseCompletedParameters); + }); } export declare namespace Network { - type ResponseStartedParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; + type ResponseStarted = ({ + "method": ("network.responseStarted"); + "params": (Network.ResponseStartedParameters); + }); } -export type ScriptCommand = - | Script.AddPreloadScript - | Script.CallFunction - | Script.Disown - | Script.Evaluate - | Script.GetRealms - | Script.RemovePreloadScript; -export type ScriptResult = - | Script.AddPreloadScriptResult - | Script.EvaluateResult - | Script.GetRealmsResult; -export type ScriptEvent = - | Script.Message - | Script.RealmCreated - | Script.RealmDestroyed; export declare namespace Script { - type Channel = string; + type Channel = (string); } export declare namespace Script { - type ChannelValue = { - type: 'channel'; - value: Script.ChannelProperties; - }; + type EvaluateResultSuccess = (({ + "type": ("success"); + "result": (Script.RemoteValue); + "realm": (Script.Realm); + })); } export declare namespace Script { - type ChannelProperties = { - channel: Script.Channel; - serializationOptions?: Script.SerializationOptions; - ownership?: Script.ResultOwnership; - }; + type ExceptionDetails = (({ + "columnNumber": (JsUint); + "exception": (Script.RemoteValue); + "lineNumber": (JsUint); + "stackTrace": (Script.StackTrace); + "text": (string); + })); } export declare namespace Script { - type EvaluateResult = - | Script.EvaluateResultSuccess - | Script.EvaluateResultException; + type ChannelValue = (({ + "type": ("channel"); + "value": (Script.ChannelProperties); + })); } export declare namespace Script { - type EvaluateResultSuccess = { - type: 'success'; - result: Script.RemoteValue; - realm: Script.Realm; - }; + type ChannelProperties = (({ + "channel": (Script.Channel); + "serializationOptions"?: (Script.SerializationOptions); + "ownership"?: (Script.ResultOwnership); + })); } export declare namespace Script { - type EvaluateResultException = { - type: 'exception'; - exceptionDetails: Script.ExceptionDetails; - realm: Script.Realm; - }; + type EvaluateResult = ((Script.EvaluateResultSuccess | Script.EvaluateResultException)); } export declare namespace Script { - type ExceptionDetails = { - columnNumber: JsUint; - exception: Script.RemoteValue; - lineNumber: JsUint; - stackTrace: Script.StackTrace; - text: string; - }; + type EvaluateResultException = (({ + "type": ("exception"); + "exceptionDetails": (Script.ExceptionDetails); + "realm": (Script.Realm); + })); } export declare namespace Script { - type Handle = string; + type Handle = (string); } export declare namespace Script { - type InternalId = string; + type InternalId = (string); } export declare namespace Script { - type LocalValue = - | Script.RemoteReference - | Script.PrimitiveProtocolValue - | Script.ChannelValue - | Script.ArrayLocalValue - | Script.DateLocalValue - | Script.MapLocalValue - | Script.ObjectLocalValue - | Script.RegExpLocalValue - | Script.SetLocalValue; + type ListLocalValue = ([ + ...((Script.LocalValue)[]) + ]); } export declare namespace Script { - type ListLocalValue = [...Script.LocalValue[]]; + type LocalValue = ((Script.RemoteReference | Script.PrimitiveProtocolValue | Script.ChannelValue | Script.ArrayLocalValue | (Script.DateLocalValue) | Script.MapLocalValue | Script.ObjectLocalValue | (Script.RegExpLocalValue) | Script.SetLocalValue)); } export declare namespace Script { - type ArrayLocalValue = { - type: 'array'; - value: Script.ListLocalValue; - }; + type ArrayLocalValue = (({ + "type": ("array"); + "value": (Script.ListLocalValue); + })); } export declare namespace Script { - type DateLocalValue = { - type: 'date'; - value: string; - }; + type DateLocalValue = ({ + "type": ("date"); + "value": (string); + }); } export declare namespace Script { - type MappingLocalValue = [ - ...[Script.LocalValue | string, Script.LocalValue][], - ]; + type MappingLocalValue = ([ + ...(([ + (Script.LocalValue | string), + (Script.LocalValue) + ])[]) + ]); } export declare namespace Script { - type MapLocalValue = { - type: 'map'; - value: Script.MappingLocalValue; - }; + type MapLocalValue = (({ + "type": ("map"); + "value": (Script.MappingLocalValue); + })); } export declare namespace Script { - type ObjectLocalValue = { - type: 'object'; - value: Script.MappingLocalValue; - }; + type ObjectLocalValue = (({ + "type": ("object"); + "value": (Script.MappingLocalValue); + })); } export declare namespace Script { - type RegExpValue = { - pattern: string; - flags?: string; - }; + type RegExpValue = (({ + "pattern": (string); + "flags"?: (string); + })); } export declare namespace Script { - type RegExpLocalValue = { - type: 'regexp'; - value: Script.RegExpValue; - }; + type RegExpLocalValue = ({ + "type": ("regexp"); + "value": (Script.RegExpValue); + }); } export declare namespace Script { - type SetLocalValue = { - type: 'set'; - value: Script.ListLocalValue; - }; + type SetLocalValue = (({ + "type": ("set"); + "value": (Script.ListLocalValue); + })); } export declare namespace Script { - type PreloadScript = string; + type PreloadScript = (string); } export declare namespace Script { - type Realm = string; + type Realm = (string); } export declare namespace Script { - type PrimitiveProtocolValue = - | Script.UndefinedValue - | Script.NullValue - | Script.StringValue - | Script.NumberValue - | Script.BooleanValue - | Script.BigIntValue; + type PrimitiveProtocolValue = ((Script.UndefinedValue | Script.NullValue | Script.StringValue | Script.NumberValue | Script.BooleanValue | Script.BigIntValue)); } export declare namespace Script { - type UndefinedValue = { - type: 'undefined'; - }; + type UndefinedValue = (({ + "type": ("undefined"); + })); } export declare namespace Script { - type NullValue = { - type: 'null'; - }; + type NullValue = (({ + "type": ("null"); + })); } export declare namespace Script { - type StringValue = { - type: 'string'; - value: string; - }; + type StringValue = (({ + "type": ("string"); + "value": (string); + })); } export declare namespace Script { - type SpecialNumber = 'NaN' | '-0' | 'Infinity' | '-Infinity'; + type SpecialNumber = ("NaN" | "-0" | "Infinity" | "-Infinity"); } export declare namespace Script { - type NumberValue = { - type: 'number'; - value: number | Script.SpecialNumber; - }; + type NumberValue = (({ + "type": ("number"); + "value": (number | Script.SpecialNumber); + })); } export declare namespace Script { - type BooleanValue = { - type: 'boolean'; - value: boolean; - }; + type BooleanValue = (({ + "type": ("boolean"); + "value": (boolean); + })); } export declare namespace Script { - type BigIntValue = { - type: 'bigint'; - value: string; - }; + type BigIntValue = (({ + "type": ("bigint"); + "value": (string); + })); } export declare namespace Script { - type RealmInfo = - | Script.WindowRealmInfo - | Script.DedicatedWorkerRealmInfo - | Script.SharedWorkerRealmInfo - | Script.ServiceWorkerRealmInfo - | Script.WorkerRealmInfo - | Script.PaintWorkletRealmInfo - | Script.AudioWorkletRealmInfo - | Script.WorkletRealmInfo; + type RealmInfo = ((Script.WindowRealmInfo | Script.DedicatedWorkerRealmInfo | Script.SharedWorkerRealmInfo | Script.ServiceWorkerRealmInfo | Script.WorkerRealmInfo | Script.PaintWorkletRealmInfo | Script.AudioWorkletRealmInfo | Script.WorkletRealmInfo)); } export declare namespace Script { - type BaseRealmInfo = { - realm: Script.Realm; - origin: string; - }; + type BaseRealmInfo = ({ + "realm": (Script.Realm); + "origin": (string); + }); } export declare namespace Script { - type WindowRealmInfo = Script.BaseRealmInfo & { - type: 'window'; - context: BrowsingContext.BrowsingContext; - sandbox?: string; - }; + type WindowRealmInfo = ((Script.BaseRealmInfo & { + "type": ("window"); + "context": (BrowsingContext.BrowsingContext); + "sandbox"?: (string); + })); } export declare namespace Script { - type DedicatedWorkerRealmInfo = Script.BaseRealmInfo & { - type: 'dedicated-worker'; - owners: [Script.Realm]; - }; + type DedicatedWorkerRealmInfo = ((Script.BaseRealmInfo & { + "type": ("dedicated-worker"); + "owners": ([ + (Script.Realm) + ]); + })); } export declare namespace Script { - type SharedWorkerRealmInfo = Script.BaseRealmInfo & { - type: 'shared-worker'; - }; + type SharedWorkerRealmInfo = ((Script.BaseRealmInfo & { + "type": ("shared-worker"); + })); } export declare namespace Script { - type ServiceWorkerRealmInfo = Script.BaseRealmInfo & { - type: 'service-worker'; - }; + type ServiceWorkerRealmInfo = ((Script.BaseRealmInfo & { + "type": ("service-worker"); + })); } export declare namespace Script { - type WorkerRealmInfo = Script.BaseRealmInfo & { - type: 'worker'; - }; + type WorkerRealmInfo = ((Script.BaseRealmInfo & { + "type": ("worker"); + })); } export declare namespace Script { - type PaintWorkletRealmInfo = Script.BaseRealmInfo & { - type: 'paint-worklet'; - }; + type PaintWorkletRealmInfo = ((Script.BaseRealmInfo & { + "type": ("paint-worklet"); + })); } export declare namespace Script { - type AudioWorkletRealmInfo = Script.BaseRealmInfo & { - type: 'audio-worklet'; - }; + type AudioWorkletRealmInfo = ((Script.BaseRealmInfo & { + "type": ("audio-worklet"); + })); } export declare namespace Script { - type WorkletRealmInfo = Script.BaseRealmInfo & { - type: 'worklet'; - }; + type WorkletRealmInfo = ((Script.BaseRealmInfo & { + "type": ("worklet"); + })); } export declare namespace Script { - type RealmType = - | 'window' - | 'dedicated-worker' - | 'shared-worker' - | 'service-worker' - | 'worker' - | 'paint-worklet' - | 'audio-worklet' - | 'worklet'; + type RealmType = ("window" | "dedicated-worker" | "shared-worker" | "service-worker" | "worker" | "paint-worklet" | "audio-worklet" | "worklet"); } export declare namespace Script { - type RemoteReference = Script.SharedReference | Script.RemoteObjectReference; + type ListRemoteValue = ([ + ...((Script.RemoteValue)[]) + ]); } export declare namespace Script { - type SharedReference = { - sharedId: Script.SharedId; - handle?: Script.Handle; - } & Extensible; + type MappingRemoteValue = ([ + ...(([ + (Script.RemoteValue | string), + (Script.RemoteValue) + ])[]) + ]); } export declare namespace Script { - type RemoteObjectReference = { - handle: Script.Handle; - sharedId?: Script.SharedId; - } & Extensible; + type RemoteValue = ((Script.PrimitiveProtocolValue | Script.SymbolRemoteValue | Script.ArrayRemoteValue | Script.ObjectRemoteValue | Script.FunctionRemoteValue | Script.RegExpRemoteValue | Script.DateRemoteValue | Script.MapRemoteValue | Script.SetRemoteValue | Script.WeakMapRemoteValue | Script.WeakSetRemoteValue | Script.GeneratorRemoteValue | Script.ErrorRemoteValue | Script.ProxyRemoteValue | Script.PromiseRemoteValue | Script.TypedArrayRemoteValue | Script.ArrayBufferRemoteValue | Script.NodeListRemoteValue | Script.HtmlCollectionRemoteValue | Script.NodeRemoteValue | Script.WindowProxyRemoteValue)); } export declare namespace Script { - type RemoteValue = - | Script.PrimitiveProtocolValue - | Script.SymbolRemoteValue - | Script.ArrayRemoteValue - | Script.ObjectRemoteValue - | Script.FunctionRemoteValue - | Script.RegExpRemoteValue - | Script.DateRemoteValue - | Script.MapRemoteValue - | Script.SetRemoteValue - | Script.WeakMapRemoteValue - | Script.WeakSetRemoteValue - | Script.GeneratorRemoteValue - | Script.ErrorRemoteValue - | Script.ProxyRemoteValue - | Script.PromiseRemoteValue - | Script.TypedArrayRemoteValue - | Script.ArrayBufferRemoteValue - | Script.NodeListRemoteValue - | Script.HtmlCollectionRemoteValue - | Script.NodeRemoteValue - | Script.WindowProxyRemoteValue; + type RemoteReference = ((Script.SharedReference | Script.RemoteObjectReference)); } export declare namespace Script { - type ListRemoteValue = [...Script.RemoteValue[]]; + type SharedReference = (({ + "sharedId": (Script.SharedId); + "handle"?: (Script.Handle); + } & Extensible)); } export declare namespace Script { - type MappingRemoteValue = [ - ...[Script.RemoteValue | string, Script.RemoteValue][], - ]; + type RemoteObjectReference = (({ + "handle": (Script.Handle); + "sharedId"?: (Script.SharedId); + } & Extensible)); } export declare namespace Script { - type SymbolRemoteValue = { - type: 'symbol'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type SymbolRemoteValue = (({ + "type": ("symbol"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type ArrayRemoteValue = { - type: 'array'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; + type ArrayRemoteValue = (({ + "type": ("array"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.ListRemoteValue); + })); } export declare namespace Script { - type ObjectRemoteValue = { - type: 'object'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.MappingRemoteValue; - }; + type ObjectRemoteValue = (({ + "type": ("object"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.MappingRemoteValue); + })); } export declare namespace Script { - type FunctionRemoteValue = { - type: 'function'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type FunctionRemoteValue = (({ + "type": ("function"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type RegExpRemoteValue = Script.RegExpLocalValue & { - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type RegExpRemoteValue = ((Script.RegExpLocalValue & { + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type DateRemoteValue = Script.DateLocalValue & { - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type DateRemoteValue = ((Script.DateLocalValue & { + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type MapRemoteValue = { - type: 'map'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.MappingRemoteValue; - }; + type MapRemoteValue = (({ + "type": ("map"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.MappingRemoteValue); + })); } export declare namespace Script { - type SetRemoteValue = { - type: 'set'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; + type SetRemoteValue = (({ + "type": ("set"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.ListRemoteValue); + })); } export declare namespace Script { - type WeakMapRemoteValue = { - type: 'weakmap'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type WeakMapRemoteValue = (({ + "type": ("weakmap"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type WeakSetRemoteValue = { - type: 'weakset'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type WeakSetRemoteValue = (({ + "type": ("weakset"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type GeneratorRemoteValue = { - type: 'generator'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type GeneratorRemoteValue = (({ + "type": ("generator"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type ErrorRemoteValue = { - type: 'error'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type ErrorRemoteValue = (({ + "type": ("error"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type ProxyRemoteValue = { - type: 'proxy'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type ProxyRemoteValue = (({ + "type": ("proxy"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type PromiseRemoteValue = { - type: 'promise'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type PromiseRemoteValue = (({ + "type": ("promise"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type TypedArrayRemoteValue = { - type: 'typedarray'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type TypedArrayRemoteValue = (({ + "type": ("typedarray"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type ArrayBufferRemoteValue = { - type: 'arraybuffer'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type ArrayBufferRemoteValue = (({ + "type": ("arraybuffer"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type NodeListRemoteValue = { - type: 'nodelist'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; + type NodeListRemoteValue = (({ + "type": ("nodelist"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.ListRemoteValue); + })); } export declare namespace Script { - type HtmlCollectionRemoteValue = { - type: 'htmlcollection'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; + type HtmlCollectionRemoteValue = (({ + "type": ("htmlcollection"); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.ListRemoteValue); + })); } export declare namespace Script { - type NodeRemoteValue = { - type: 'node'; - sharedId?: Script.SharedId; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.NodeProperties; - }; + type NodeRemoteValue = (({ + "type": ("node"); + "sharedId"?: (Script.SharedId); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + "value"?: (Script.NodeProperties); + })); } export declare namespace Script { - type NodeProperties = { - nodeType: JsUint; - childNodeCount: JsUint; - attributes?: { - [key: string]: string; - }; - children?: [...Script.NodeRemoteValue[]]; - localName?: string; - mode?: 'open' | 'closed'; - namespaceURI?: string; - nodeValue?: string; - shadowRoot?: Script.NodeRemoteValue | null; - }; + type NodeProperties = (({ + "nodeType": (JsUint); + "childNodeCount": (JsUint); + "attributes"?: (({ + [key: string]: (string); + })); + "children"?: ([ + ...((Script.NodeRemoteValue)[]) + ]); + "localName"?: (string); + "mode"?: ("open" | "closed"); + "namespaceURI"?: (string); + "nodeValue"?: (string); + "shadowRoot"?: (Script.NodeRemoteValue | null); + })); } export declare namespace Script { - type WindowProxyRemoteValue = { - type: 'window'; - value: Script.WindowProxyProperties; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; + type WindowProxyRemoteValue = (({ + "type": ("window"); + "value": (Script.WindowProxyProperties); + "handle"?: (Script.Handle); + "internalId"?: (Script.InternalId); + })); } export declare namespace Script { - type WindowProxyProperties = { - context: BrowsingContext.BrowsingContext; - }; + type WindowProxyProperties = (({ + "context": (BrowsingContext.BrowsingContext); + })); } export declare namespace Script { - const enum ResultOwnership { - Root = 'root', - None = 'none', - } + const enum ResultOwnership { + Root = "root", + None = "none" + } } export declare namespace Script { - type SerializationOptions = { - /** - * @defaultValue `0` - */ - maxDomDepth?: JsUint | null; - /** - * @defaultValue `null` - */ - maxObjectDepth?: JsUint | null; - /** - * @defaultValue `"none"` - */ - includeShadowTree?: 'none' | 'open' | 'all'; - }; + type SerializationOptions = (({ + /** + * @defaultValue `0` + */ + "maxDomDepth"?: ((JsUint | null)); + /** + * @defaultValue `null` + */ + "maxObjectDepth"?: ((JsUint | null)); + /** + * @defaultValue `"none"` + */ + "includeShadowTree"?: (("none" | "open" | "all")); + })); } export declare namespace Script { - type SharedId = string; + type SharedId = (string); } export declare namespace Script { - type StackFrame = { - columnNumber: JsUint; - functionName: string; - lineNumber: JsUint; - url: string; - }; + type StackFrame = (({ + "columnNumber": (JsUint); + "functionName": (string); + "lineNumber": (JsUint); + "url": (string); + })); } export declare namespace Script { - type StackTrace = { - callFrames: [...Script.StackFrame[]]; - }; + type StackTrace = (({ + "callFrames": ([ + ...((Script.StackFrame)[]) + ]); + })); +} +export declare namespace Script { + type Source = (({ + "realm": (Script.Realm); + "context"?: (BrowsingContext.BrowsingContext); + })); +} +export declare namespace Script { + type RealmTarget = (({ + "realm": (Script.Realm); + })); } export declare namespace Script { - type Source = { - realm: Script.Realm; - context?: BrowsingContext.BrowsingContext; - }; + type ContextTarget = (({ + "context": (BrowsingContext.BrowsingContext); + "sandbox"?: (string); + })); } export declare namespace Script { - type RealmTarget = { - realm: Script.Realm; - }; + type Target = ((Script.ContextTarget | Script.RealmTarget)); } export declare namespace Script { - type ContextTarget = { - context: BrowsingContext.BrowsingContext; - sandbox?: string; - }; + type AddPreloadScript = ({ + "method": ("script.addPreloadScript"); + "params": (Script.AddPreloadScriptParameters); + }); } export declare namespace Script { - type Target = Script.ContextTarget | Script.RealmTarget; + type AddPreloadScriptParameters = (({ + "functionDeclaration": (string); + "arguments"?: ([ + ...((Script.ChannelValue)[]) + ]); + "contexts"?: ([ + (BrowsingContext.BrowsingContext), + ...(BrowsingContext.BrowsingContext)[] + ]); + "userContexts"?: ([ + (Browser.UserContext), + ...(Browser.UserContext)[] + ]); + "sandbox"?: (string); + })); } export declare namespace Script { - type AddPreloadScript = { - method: 'script.addPreloadScript'; - params: Script.AddPreloadScriptParameters; - }; + type AddPreloadScriptResult = (({ + "script": (Script.PreloadScript); + })); } export declare namespace Script { - type AddPreloadScriptParameters = { - functionDeclaration: string; - arguments?: [...Script.ChannelValue[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - sandbox?: string; - }; + type Disown = ({ + "method": ("script.disown"); + "params": (Script.DisownParameters); + }); } export declare namespace Script { - type AddPreloadScriptResult = { - script: Script.PreloadScript; - }; + type DisownParameters = (({ + "handles": ([ + ...((Script.Handle)[]) + ]); + "target": (Script.Target); + })); } export declare namespace Script { - type Disown = { - method: 'script.disown'; - params: Script.DisownParameters; - }; + type CallFunctionParameters = (({ + "functionDeclaration": (string); + "awaitPromise": (boolean); + "target": (Script.Target); + "arguments"?: ([ + ...((Script.LocalValue)[]) + ]); + "resultOwnership"?: (Script.ResultOwnership); + "serializationOptions"?: (Script.SerializationOptions); + "this"?: (Script.LocalValue); + /** + * @defaultValue `false` + */ + "userActivation"?: (boolean); + })); } export declare namespace Script { - type DisownParameters = { - handles: [...Script.Handle[]]; - target: Script.Target; - }; + type CallFunction = ({ + "method": ("script.callFunction"); + "params": (Script.CallFunctionParameters); + }); } export declare namespace Script { - type CallFunction = { - method: 'script.callFunction'; - params: Script.CallFunctionParameters; - }; + type Evaluate = ({ + "method": ("script.evaluate"); + "params": (Script.EvaluateParameters); + }); } export declare namespace Script { - type CallFunctionParameters = { - functionDeclaration: string; - awaitPromise: boolean; - target: Script.Target; - arguments?: [...Script.LocalValue[]]; - resultOwnership?: Script.ResultOwnership; - serializationOptions?: Script.SerializationOptions; - this?: Script.LocalValue; - /** - * @defaultValue `false` - */ - userActivation?: boolean; - }; + type EvaluateParameters = (({ + "expression": (string); + "target": (Script.Target); + "awaitPromise": (boolean); + "resultOwnership"?: (Script.ResultOwnership); + "serializationOptions"?: (Script.SerializationOptions); + /** + * @defaultValue `false` + */ + "userActivation"?: (boolean); + })); } export declare namespace Script { - type Evaluate = { - method: 'script.evaluate'; - params: Script.EvaluateParameters; - }; + type GetRealms = ({ + "method": ("script.getRealms"); + "params": (Script.GetRealmsParameters); + }); } export declare namespace Script { - type EvaluateParameters = { - expression: string; - target: Script.Target; - awaitPromise: boolean; - resultOwnership?: Script.ResultOwnership; - serializationOptions?: Script.SerializationOptions; - /** - * @defaultValue `false` - */ - userActivation?: boolean; - }; + type GetRealmsParameters = (({ + "context"?: (BrowsingContext.BrowsingContext); + "type"?: (Script.RealmType); + })); } export declare namespace Script { - type GetRealms = { - method: 'script.getRealms'; - params: Script.GetRealmsParameters; - }; + type GetRealmsResult = (({ + "realms": ([ + ...((Script.RealmInfo)[]) + ]); + })); } export declare namespace Script { - type GetRealmsParameters = { - context?: BrowsingContext.BrowsingContext; - type?: Script.RealmType; - }; + type RemovePreloadScript = ({ + "method": ("script.removePreloadScript"); + "params": (Script.RemovePreloadScriptParameters); + }); } export declare namespace Script { - type GetRealmsResult = { - realms: [...Script.RealmInfo[]]; - }; + type RemovePreloadScriptParameters = (({ + "script": (Script.PreloadScript); + })); } export declare namespace Script { - type RemovePreloadScript = { - method: 'script.removePreloadScript'; - params: Script.RemovePreloadScriptParameters; - }; + type MessageParameters = (({ + "channel": (Script.Channel); + "data": (Script.RemoteValue); + "source": (Script.Source); + })); } export declare namespace Script { - type RemovePreloadScriptParameters = { - script: Script.PreloadScript; - }; + type RealmCreated = ({ + "method": ("script.realmCreated"); + "params": (Script.RealmInfo); + }); } export declare namespace Script { - type Message = { - method: 'script.message'; - params: Script.MessageParameters; - }; + type Message = ({ + "method": ("script.message"); + "params": (Script.MessageParameters); + }); } export declare namespace Script { - type MessageParameters = { - channel: Script.Channel; - data: Script.RemoteValue; - source: Script.Source; - }; + type RealmDestroyed = ({ + "method": ("script.realmDestroyed"); + "params": (Script.RealmDestroyedParameters); + }); } export declare namespace Script { - type RealmCreated = { - method: 'script.realmCreated'; - params: Script.RealmInfo; - }; + type RealmDestroyedParameters = (({ + "realm": (Script.Realm); + })); } -export declare namespace Script { - type RealmDestroyed = { - method: 'script.realmDestroyed'; - params: Script.RealmDestroyedParameters; - }; -} -export declare namespace Script { - type RealmDestroyedParameters = { - realm: Script.Realm; - }; -} -export type StorageCommand = - | Storage.DeleteCookies - | Storage.GetCookies - | Storage.SetCookie; -export type StorageResult = - | Storage.DeleteCookiesResult - | Storage.GetCookiesResult - | Storage.SetCookieResult; +export type StorageCommand = (Storage.DeleteCookies | Storage.GetCookies | Storage.SetCookie); +export type StorageResult = ((Storage.DeleteCookiesResult | Storage.GetCookiesResult | Storage.SetCookieResult)); export declare namespace Storage { - type PartitionKey = { - userContext?: string; - sourceOrigin?: string; - } & Extensible; + type PartitionKey = (({ + "userContext"?: (string); + "sourceOrigin"?: (string); + } & Extensible)); } export declare namespace Storage { - type GetCookies = { - method: 'storage.getCookies'; - params: Storage.GetCookiesParameters; - }; + type GetCookies = ({ + "method": ("storage.getCookies"); + "params": (Storage.GetCookiesParameters); + }); } export declare namespace Storage { - type CookieFilter = { - name?: string; - value?: Network.BytesValue; - domain?: string; - path?: string; - size?: JsUint; - httpOnly?: boolean; - secure?: boolean; - sameSite?: Network.SameSite; - expiry?: JsUint; - } & Extensible; + type CookieFilter = (({ + "name"?: (string); + "value"?: (Network.BytesValue); + "domain"?: (string); + "path"?: (string); + "size"?: (JsUint); + "httpOnly"?: (boolean); + "secure"?: (boolean); + "sameSite"?: (Network.SameSite); + "expiry"?: (JsUint); + } & Extensible)); } export declare namespace Storage { - type BrowsingContextPartitionDescriptor = { - type: 'context'; - context: BrowsingContext.BrowsingContext; - }; + type BrowsingContextPartitionDescriptor = (({ + "type": ("context"); + "context": (BrowsingContext.BrowsingContext); + })); } export declare namespace Storage { - type StorageKeyPartitionDescriptor = { - type: 'storageKey'; - userContext?: string; - sourceOrigin?: string; - } & Extensible; + type StorageKeyPartitionDescriptor = (({ + "type": ("storageKey"); + "userContext"?: (string); + "sourceOrigin"?: (string); + } & Extensible)); } export declare namespace Storage { - type PartitionDescriptor = - | Storage.BrowsingContextPartitionDescriptor - | Storage.StorageKeyPartitionDescriptor; + type PartitionDescriptor = ((Storage.BrowsingContextPartitionDescriptor | Storage.StorageKeyPartitionDescriptor)); } export declare namespace Storage { - type GetCookiesParameters = { - filter?: Storage.CookieFilter; - partition?: Storage.PartitionDescriptor; - }; + type GetCookiesParameters = (({ + "filter"?: (Storage.CookieFilter); + "partition"?: (Storage.PartitionDescriptor); + })); } export declare namespace Storage { - type GetCookiesResult = { - cookies: [...Network.Cookie[]]; - partitionKey: Storage.PartitionKey; - }; + type GetCookiesResult = (({ + "cookies": ([ + ...((Network.Cookie)[]) + ]); + "partitionKey": (Storage.PartitionKey); + })); } export declare namespace Storage { - type SetCookie = { - method: 'storage.setCookie'; - params: Storage.SetCookieParameters; - }; + type SetCookie = ({ + "method": ("storage.setCookie"); + "params": (Storage.SetCookieParameters); + }); } export declare namespace Storage { - type PartialCookie = { - name: string; - value: Network.BytesValue; - domain: string; - path?: string; - httpOnly?: boolean; - secure?: boolean; - sameSite?: Network.SameSite; - expiry?: JsUint; - } & Extensible; + type PartialCookie = (({ + "name": (string); + "value": (Network.BytesValue); + "domain": (string); + "path"?: (string); + "httpOnly"?: (boolean); + "secure"?: (boolean); + "sameSite"?: (Network.SameSite); + "expiry"?: (JsUint); + } & Extensible)); } export declare namespace Storage { - type SetCookieParameters = { - cookie: Storage.PartialCookie; - partition?: Storage.PartitionDescriptor; - }; + type SetCookieParameters = (({ + "cookie": (Storage.PartialCookie); + "partition"?: (Storage.PartitionDescriptor); + })); } export declare namespace Storage { - type SetCookieResult = { - partitionKey: Storage.PartitionKey; - }; + type SetCookieResult = (({ + "partitionKey": (Storage.PartitionKey); + })); } export declare namespace Storage { - type DeleteCookies = { - method: 'storage.deleteCookies'; - params: Storage.DeleteCookiesParameters; - }; + type DeleteCookies = ({ + "method": ("storage.deleteCookies"); + "params": (Storage.DeleteCookiesParameters); + }); } export declare namespace Storage { - type DeleteCookiesParameters = { - filter?: Storage.CookieFilter; - partition?: Storage.PartitionDescriptor; - }; + type DeleteCookiesParameters = (({ + "filter"?: (Storage.CookieFilter); + "partition"?: (Storage.PartitionDescriptor); + })); } export declare namespace Storage { - type DeleteCookiesResult = { - partitionKey: Storage.PartitionKey; - }; + type DeleteCookiesResult = (({ + "partitionKey": (Storage.PartitionKey); + })); } -export type LogEvent = Log.EntryAdded; +export type LogEvent = (Log.EntryAdded); export declare namespace Log { - const enum Level { - Debug = 'debug', - Info = 'info', - Warn = 'warn', - Error = 'error', - } + const enum Level { + Debug = "debug", + Info = "info", + Warn = "warn", + Error = "error" + } } export declare namespace Log { - type Entry = - | Log.GenericLogEntry - | Log.ConsoleLogEntry - | Log.JavascriptLogEntry; + type Entry = ((Log.GenericLogEntry | Log.ConsoleLogEntry | Log.JavascriptLogEntry)); } export declare namespace Log { - type BaseLogEntry = { - level: Log.Level; - source: Script.Source; - text: string | null; - timestamp: JsUint; - stackTrace?: Script.StackTrace; - }; + type BaseLogEntry = ({ + "level": (Log.Level); + "source": (Script.Source); + "text": (string | null); + "timestamp": (JsUint); + "stackTrace"?: (Script.StackTrace); + }); } export declare namespace Log { - type GenericLogEntry = Log.BaseLogEntry & { - type: string; - }; + type GenericLogEntry = ((Log.BaseLogEntry & { + "type": (string); + })); } export declare namespace Log { - type ConsoleLogEntry = Log.BaseLogEntry & { - type: 'console'; - method: string; - args: [...Script.RemoteValue[]]; - }; + type ConsoleLogEntry = ((Log.BaseLogEntry & { + "type": ("console"); + "method": (string); + "args": ([ + ...((Script.RemoteValue)[]) + ]); + })); } export declare namespace Log { - type JavascriptLogEntry = Log.BaseLogEntry & { - type: 'javascript'; - }; + type JavascriptLogEntry = ((Log.BaseLogEntry & { + "type": ("javascript"); + })); } export declare namespace Log { - type EntryAdded = { - method: 'log.entryAdded'; - params: Log.Entry; - }; -} -export type InputCommand = - | Input.PerformActions - | Input.ReleaseActions - | Input.SetFiles; -export type InputEvent = Input.FileDialogOpened; + type EntryAdded = ({ + "method": ("log.entryAdded"); + "params": (Log.Entry); + }); +} +export type InputCommand = (Input.PerformActions | Input.ReleaseActions | Input.SetFiles); +export type InputEvent = (Input.FileDialogOpened); export declare namespace Input { - type ElementOrigin = { - type: 'element'; - element: Script.SharedReference; - }; + type ElementOrigin = (({ + "type": ("element"); + "element": (Script.SharedReference); + })); } export declare namespace Input { - type PerformActions = { - method: 'input.performActions'; - params: Input.PerformActionsParameters; - }; + type PerformActionsParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "actions": ([ + ...((Input.SourceActions)[]) + ]); + })); } export declare namespace Input { - type PerformActionsParameters = { - context: BrowsingContext.BrowsingContext; - actions: [...Input.SourceActions[]]; - }; + type NoneSourceActions = (({ + "type": ("none"); + "id": (string); + "actions": ([ + ...((Input.NoneSourceAction)[]) + ]); + })); } export declare namespace Input { - type SourceActions = - | Input.NoneSourceActions - | Input.KeySourceActions - | Input.PointerSourceActions - | Input.WheelSourceActions; + type KeySourceActions = (({ + "type": ("key"); + "id": (string); + "actions": ([ + ...((Input.KeySourceAction)[]) + ]); + })); } export declare namespace Input { - type NoneSourceActions = { - type: 'none'; - id: string; - actions: [...Input.NoneSourceAction[]]; - }; + type PointerSourceActions = (({ + "type": ("pointer"); + "id": (string); + "parameters"?: (Input.PointerParameters); + "actions": ([ + ...((Input.PointerSourceAction)[]) + ]); + })); } export declare namespace Input { - type NoneSourceAction = Input.PauseAction; + type PerformActions = ({ + "method": ("input.performActions"); + "params": (Input.PerformActionsParameters); + }); } export declare namespace Input { - type KeySourceActions = { - type: 'key'; - id: string; - actions: [...Input.KeySourceAction[]]; - }; + type SourceActions = ((Input.NoneSourceActions | Input.KeySourceActions | Input.PointerSourceActions | Input.WheelSourceActions)); } export declare namespace Input { - type KeySourceAction = - | Input.PauseAction - | Input.KeyDownAction - | Input.KeyUpAction; + type NoneSourceAction = (Input.PauseAction); } export declare namespace Input { - type PointerSourceActions = { - type: 'pointer'; - id: string; - parameters?: Input.PointerParameters; - actions: [...Input.PointerSourceAction[]]; - }; + type KeySourceAction = ((Input.PauseAction | Input.KeyDownAction | Input.KeyUpAction)); } export declare namespace Input { - const enum PointerType { - Mouse = 'mouse', - Pen = 'pen', - Touch = 'touch', - } + const enum PointerType { + Mouse = "mouse", + Pen = "pen", + Touch = "touch" + } } export declare namespace Input { - type PointerParameters = { - /** - * @defaultValue `"mouse"` - */ - pointerType?: Input.PointerType; - }; + type PointerParameters = (({ + /** + * @defaultValue `"mouse"` + */ + "pointerType"?: (Input.PointerType); + })); } export declare namespace Input { - type PointerSourceAction = - | Input.PauseAction - | Input.PointerDownAction - | Input.PointerUpAction - | Input.PointerMoveAction; + type WheelSourceActions = (({ + "type": ("wheel"); + "id": (string); + "actions": ([ + ...((Input.WheelSourceAction)[]) + ]); + })); } export declare namespace Input { - type WheelSourceActions = { - type: 'wheel'; - id: string; - actions: [...Input.WheelSourceAction[]]; - }; + type PointerSourceAction = ((Input.PauseAction | Input.PointerDownAction | Input.PointerUpAction | Input.PointerMoveAction)); } export declare namespace Input { - type WheelSourceAction = Input.PauseAction | Input.WheelScrollAction; + type WheelSourceAction = ((Input.PauseAction | Input.WheelScrollAction)); } export declare namespace Input { - type PauseAction = { - type: 'pause'; - duration?: JsUint; - }; + type PauseAction = (({ + "type": ("pause"); + "duration"?: (JsUint); + })); } export declare namespace Input { - type KeyDownAction = { - type: 'keyDown'; - value: string; - }; + type KeyDownAction = (({ + "type": ("keyDown"); + "value": (string); + })); } export declare namespace Input { - type KeyUpAction = { - type: 'keyUp'; - value: string; - }; + type KeyUpAction = (({ + "type": ("keyUp"); + "value": (string); + })); } export declare namespace Input { - type PointerUpAction = { - type: 'pointerUp'; - button: JsUint; - }; + type PointerUpAction = (({ + "type": ("pointerUp"); + "button": (JsUint); + })); } export declare namespace Input { - type PointerDownAction = { - type: 'pointerDown'; - button: JsUint; - } & Input.PointerCommonProperties; + type PointerDownAction = (({ + "type": ("pointerDown"); + "button": (JsUint); + } & Input.PointerCommonProperties)); } export declare namespace Input { - type PointerMoveAction = { - type: 'pointerMove'; - x: number; - y: number; - duration?: JsUint; - origin?: Input.Origin; - } & Input.PointerCommonProperties; + type PointerMoveAction = (({ + "type": ("pointerMove"); + "x": (number); + "y": (number); + "duration"?: (JsUint); + "origin"?: (Input.Origin); + } & Input.PointerCommonProperties)); } export declare namespace Input { - type WheelScrollAction = { - type: 'scroll'; - x: JsInt; - y: JsInt; - deltaX: JsInt; - deltaY: JsInt; - duration?: JsUint; - /** - * @defaultValue `"viewport"` - */ - origin?: Input.Origin; - }; + type WheelScrollAction = (({ + "type": ("scroll"); + "x": (JsInt); + "y": (JsInt); + "deltaX": (JsInt); + "deltaY": (JsInt); + "duration"?: (JsUint); + /** + * @defaultValue `"viewport"` + */ + "origin"?: (Input.Origin); + })); } export declare namespace Input { - type PointerCommonProperties = { - /** - * @defaultValue `1` - */ - width?: JsUint; - /** - * @defaultValue `1` - */ - height?: JsUint; - /** - * @defaultValue `0` - */ - pressure?: number; - /** - * @defaultValue `0` - */ - tangentialPressure?: number; - /** - * Must be between `0` and `359`, inclusive. - * - * @defaultValue `0` - */ - twist?: number; - /** - * Must be between `0` and `1.5707963267948966`, inclusive. - * - * @defaultValue `0` - */ - altitudeAngle?: number; - /** - * Must be between `0` and `6.283185307179586`, inclusive. - * - * @defaultValue `0` - */ - azimuthAngle?: number; - }; + type PointerCommonProperties = ({ + /** + * @defaultValue `1` + */ + "width"?: (JsUint); + /** + * @defaultValue `1` + */ + "height"?: (JsUint); + /** + * @defaultValue `0` + */ + "pressure"?: (number); + /** + * @defaultValue `0` + */ + "tangentialPressure"?: (number); + /** + * Must be between `0` and `359`, inclusive. + * + * @defaultValue `0` + */ + "twist"?: ((number)); + /** + * Must be between `0` and `1.5707963267948966`, inclusive. + * + * @defaultValue `0` + */ + "altitudeAngle"?: ((number)); + /** + * Must be between `0` and `6.283185307179586`, inclusive. + * + * @defaultValue `0` + */ + "azimuthAngle"?: ((number)); + }); } export declare namespace Input { - type Origin = 'viewport' | 'pointer' | Input.ElementOrigin; + type Origin = ("viewport" | "pointer" | Input.ElementOrigin); } export declare namespace Input { - type ReleaseActions = { - method: 'input.releaseActions'; - params: Input.ReleaseActionsParameters; - }; + type ReleaseActions = ({ + "method": ("input.releaseActions"); + "params": (Input.ReleaseActionsParameters); + }); } export declare namespace Input { - type ReleaseActionsParameters = { - context: BrowsingContext.BrowsingContext; - }; + type ReleaseActionsParameters = (({ + "context": (BrowsingContext.BrowsingContext); + })); } export declare namespace Input { - type SetFiles = { - method: 'input.setFiles'; - params: Input.SetFilesParameters; - }; + type SetFiles = ({ + "method": ("input.setFiles"); + "params": (Input.SetFilesParameters); + }); } export declare namespace Input { - type SetFilesParameters = { - context: BrowsingContext.BrowsingContext; - element: Script.SharedReference; - files: [...string[]]; - }; + type SetFilesParameters = (({ + "context": (BrowsingContext.BrowsingContext); + "element": (Script.SharedReference); + "files": ([ + ...((string)[]) + ]); + })); } export declare namespace Input { - type FileDialogOpened = { - method: 'input.fileDialogOpened'; - params: Input.FileDialogInfo; - }; + type FileDialogOpened = ({ + "method": ("input.fileDialogOpened"); + "params": (Input.FileDialogInfo); + }); } export declare namespace Input { - type FileDialogInfo = { - context: BrowsingContext.BrowsingContext; - element?: Script.SharedReference; - multiple: boolean; - }; -} -export type WebExtensionCommand = WebExtension.Install | WebExtension.Uninstall; -export type WebExtensionResult = WebExtension.InstallResult; + type FileDialogInfo = (({ + "context": (BrowsingContext.BrowsingContext); + "element"?: (Script.SharedReference); + "multiple": (boolean); + })); +} +export type WebExtensionCommand = (WebExtension.Install | WebExtension.Uninstall); +export type WebExtensionResult = ((WebExtension.InstallResult)); export declare namespace WebExtension { - type Extension = string; + type Extension = (string); } export declare namespace WebExtension { - type Install = { - method: 'webExtension.install'; - params: WebExtension.InstallParameters; - }; + type InstallParameters = (({ + "extensionData": (WebExtension.ExtensionData); + })); } export declare namespace WebExtension { - type InstallParameters = { - extensionData: WebExtension.ExtensionData; - }; + type Install = ({ + "method": ("webExtension.install"); + "params": (WebExtension.InstallParameters); + }); } export declare namespace WebExtension { - type ExtensionData = - | WebExtension.ExtensionArchivePath - | WebExtension.ExtensionBase64Encoded - | WebExtension.ExtensionPath; + type ExtensionData = ((WebExtension.ExtensionArchivePath | WebExtension.ExtensionBase64Encoded | WebExtension.ExtensionPath)); } export declare namespace WebExtension { - type ExtensionPath = { - type: 'path'; - path: string; - }; + type ExtensionPath = (({ + "type": ("path"); + "path": (string); + })); } export declare namespace WebExtension { - type ExtensionArchivePath = { - type: 'archivePath'; - path: string; - }; + type ExtensionArchivePath = (({ + "type": ("archivePath"); + "path": (string); + })); } export declare namespace WebExtension { - type ExtensionBase64Encoded = { - type: 'base64'; - value: string; - }; + type ExtensionBase64Encoded = (({ + "type": ("base64"); + "value": (string); + })); } export declare namespace WebExtension { - type InstallResult = { - extension: WebExtension.Extension; - }; + type InstallResult = (({ + "extension": (WebExtension.Extension); + })); } export declare namespace WebExtension { - type Uninstall = { - method: 'webExtension.uninstall'; - params: WebExtension.UninstallParameters; - }; + type Uninstall = ({ + "method": ("webExtension.uninstall"); + "params": (WebExtension.UninstallParameters); + }); } export declare namespace WebExtension { - type UninstallParameters = { - extension: WebExtension.Extension; - }; + type UninstallParameters = (({ + "extension": (WebExtension.Extension); + })); } diff --git a/out/gen/main.js b/out/gen/main.js index 38813da..c8ad2e5 100644 --- a/out/gen/main.js +++ b/out/gen/main.js @@ -1,2 +1,2 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/out/gen/mapping.d.ts b/out/gen/mapping.d.ts new file mode 100644 index 0000000..dd49275 --- /dev/null +++ b/out/gen/mapping.d.ts @@ -0,0 +1,289 @@ +/** + * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts + * Do not edit this file manually. + */ +import type * as Bidi from "./main.ts"; +import type * as BidiPermissions from "./permissions.ts"; +import type * as BidiBluetooth from "./web-bluetooth.ts"; +export interface CommandMapping { + "bluetooth.disableSimulation": { + params: BidiBluetooth.Bluetooth.DisableSimulationParameters; + returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters; + }; + "bluetooth.handleRequestDevicePrompt": { + params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + }; + "bluetooth.simulateAdapter": { + params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + }; + "bluetooth.simulateAdvertisement": { + params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + }; + "bluetooth.simulateCharacteristic": { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + }; + "bluetooth.simulateCharacteristicResponse": { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + }; + "bluetooth.simulateDescriptor": { + params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + }; + "bluetooth.simulateDescriptorResponse": { + params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + }; + "bluetooth.simulateGattConnectionResponse": { + params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + }; + "bluetooth.simulateGattDisconnection": { + params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + }; + "bluetooth.simulatePreconnectedPeripheral": { + params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + }; + "bluetooth.simulateService": { + params: BidiBluetooth.Bluetooth.SimulateServiceParameters; + returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters; + }; + "browser.close": { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + "browser.createUserContext": { + params: Bidi.Browser.CreateUserContextParameters; + returnType: Bidi.Browser.CreateUserContextParameters; + }; + "browser.getClientWindows": { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + "browser.getUserContexts": { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + "browser.removeUserContext": { + params: Bidi.Browser.RemoveUserContextParameters; + returnType: Bidi.Browser.RemoveUserContextParameters; + }; + "browser.setClientWindowState": { + params: Bidi.Browser.SetClientWindowStateParameters; + returnType: Bidi.Browser.SetClientWindowStateParameters; + }; + "browsingContext.activate": { + params: Bidi.BrowsingContext.ActivateParameters; + returnType: Bidi.BrowsingContext.ActivateParameters; + }; + "browsingContext.captureScreenshot": { + params: Bidi.BrowsingContext.CaptureScreenshotParameters; + returnType: Bidi.BrowsingContext.CaptureScreenshotParameters; + }; + "browsingContext.close": { + params: Bidi.BrowsingContext.CloseParameters; + returnType: Bidi.BrowsingContext.CloseParameters; + }; + "browsingContext.create": { + params: Bidi.BrowsingContext.CreateParameters; + returnType: Bidi.BrowsingContext.CreateParameters; + }; + "browsingContext.getTree": { + params: Bidi.BrowsingContext.GetTreeParameters; + returnType: Bidi.BrowsingContext.GetTreeParameters; + }; + "browsingContext.handleUserPrompt": { + params: Bidi.BrowsingContext.HandleUserPromptParameters; + returnType: Bidi.BrowsingContext.HandleUserPromptParameters; + }; + "browsingContext.locateNodes": { + params: Bidi.BrowsingContext.LocateNodesParameters; + returnType: Bidi.BrowsingContext.LocateNodesParameters; + }; + "browsingContext.navigate": { + params: Bidi.BrowsingContext.NavigateParameters; + returnType: Bidi.BrowsingContext.NavigateParameters; + }; + "browsingContext.print": { + params: Bidi.BrowsingContext.PrintParameters; + returnType: Bidi.BrowsingContext.PrintParameters; + }; + "browsingContext.reload": { + params: Bidi.BrowsingContext.ReloadParameters; + returnType: Bidi.BrowsingContext.ReloadParameters; + }; + "browsingContext.setViewport": { + params: Bidi.BrowsingContext.SetViewportParameters; + returnType: Bidi.BrowsingContext.SetViewportParameters; + }; + "browsingContext.traverseHistory": { + params: Bidi.BrowsingContext.TraverseHistoryParameters; + returnType: Bidi.BrowsingContext.TraverseHistoryParameters; + }; + "emulation.setForcedColorsModeThemeOverride": { + params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + }; + "emulation.setGeolocationOverride": { + params: Bidi.Emulation.SetGeolocationOverrideParameters; + returnType: Bidi.Emulation.SetGeolocationOverrideParameters; + }; + "emulation.setLocaleOverride": { + params: Bidi.Emulation.SetLocaleOverrideParameters; + returnType: Bidi.Emulation.SetLocaleOverrideParameters; + }; + "emulation.setScreenOrientationOverride": { + params: Bidi.Emulation.SetScreenOrientationOverrideParameters; + returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters; + }; + "emulation.setScriptingEnabled": { + params: Bidi.Emulation.SetScriptingEnabledParameters; + returnType: Bidi.Emulation.SetScriptingEnabledParameters; + }; + "emulation.setTimezoneOverride": { + params: Bidi.Emulation.SetTimezoneOverrideParameters; + returnType: Bidi.Emulation.SetTimezoneOverrideParameters; + }; + "emulation.setUserAgentOverride": { + params: Bidi.Emulation.SetUserAgentOverrideParameters; + returnType: Bidi.Emulation.SetUserAgentOverrideParameters; + }; + "input.performActions": { + params: Bidi.Input.PerformActionsParameters; + returnType: Bidi.Input.PerformActionsParameters; + }; + "input.releaseActions": { + params: Bidi.Input.ReleaseActionsParameters; + returnType: Bidi.Input.ReleaseActionsParameters; + }; + "input.setFiles": { + params: Bidi.Input.SetFilesParameters; + returnType: Bidi.Input.SetFilesParameters; + }; + "network.addDataCollector": { + params: Bidi.Network.AddDataCollectorParameters; + returnType: Bidi.Network.AddDataCollectorParameters; + }; + "network.addIntercept": { + params: Bidi.Network.AddInterceptParameters; + returnType: Bidi.Network.AddInterceptParameters; + }; + "network.continueRequest": { + params: Bidi.Network.ContinueRequestParameters; + returnType: Bidi.Network.ContinueRequestParameters; + }; + "network.continueResponse": { + params: Bidi.Network.ContinueResponseParameters; + returnType: Bidi.Network.ContinueResponseParameters; + }; + "network.continueWithAuth": { + params: Bidi.Network.ContinueWithAuthParameters; + returnType: Bidi.Network.ContinueWithAuthParameters; + }; + "network.disownData": { + params: Bidi.Network.DisownDataParameters; + returnType: Bidi.Network.DisownDataParameters; + }; + "network.failRequest": { + params: Bidi.Network.FailRequestParameters; + returnType: Bidi.Network.FailRequestParameters; + }; + "network.getData": { + params: Bidi.Network.GetDataParameters; + returnType: Bidi.Network.GetDataParameters; + }; + "network.provideResponse": { + params: Bidi.Network.ProvideResponseParameters; + returnType: Bidi.Network.ProvideResponseParameters; + }; + "network.removeDataCollector": { + params: Bidi.Network.RemoveDataCollectorParameters; + returnType: Bidi.Network.RemoveDataCollectorParameters; + }; + "network.removeIntercept": { + params: Bidi.Network.RemoveInterceptParameters; + returnType: Bidi.Network.RemoveInterceptParameters; + }; + "network.setCacheBehavior": { + params: Bidi.Network.SetCacheBehaviorParameters; + returnType: Bidi.Network.SetCacheBehaviorParameters; + }; + "network.setExtraHeaders": { + params: Bidi.Network.SetExtraHeadersParameters; + returnType: Bidi.Network.SetExtraHeadersParameters; + }; + "permissions.setPermission": { + params: BidiPermissions.Permissions.SetPermissionParameters; + returnType: BidiPermissions.Permissions.SetPermissionParameters; + }; + "script.addPreloadScript": { + params: Bidi.Script.AddPreloadScriptParameters; + returnType: Bidi.Script.AddPreloadScriptParameters; + }; + "script.callFunction": { + params: Bidi.Script.CallFunctionParameters; + returnType: Bidi.Script.CallFunctionParameters; + }; + "script.disown": { + params: Bidi.Script.DisownParameters; + returnType: Bidi.Script.DisownParameters; + }; + "script.evaluate": { + params: Bidi.Script.EvaluateParameters; + returnType: Bidi.Script.EvaluateParameters; + }; + "script.getRealms": { + params: Bidi.Script.GetRealmsParameters; + returnType: Bidi.Script.GetRealmsParameters; + }; + "script.removePreloadScript": { + params: Bidi.Script.RemovePreloadScriptParameters; + returnType: Bidi.Script.RemovePreloadScriptParameters; + }; + "session.end": { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + "session.new": { + params: Bidi.Session.NewParameters; + returnType: Bidi.Session.NewParameters; + }; + "session.status": { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + "session.subscribe": { + params: Bidi.Session.SubscriptionRequest; + returnType: Bidi.Session.SubscriptionRequest; + }; + "session.unsubscribe": { + params: Bidi.Session.UnsubscribeParameters; + returnType: Bidi.Session.UnsubscribeParameters; + }; + "storage.deleteCookies": { + params: Bidi.Storage.DeleteCookiesParameters; + returnType: Bidi.Storage.DeleteCookiesParameters; + }; + "storage.getCookies": { + params: Bidi.Storage.GetCookiesParameters; + returnType: Bidi.Storage.GetCookiesParameters; + }; + "storage.setCookie": { + params: Bidi.Storage.SetCookieParameters; + returnType: Bidi.Storage.SetCookieParameters; + }; + "webExtension.install": { + params: Bidi.WebExtension.InstallParameters; + returnType: Bidi.WebExtension.InstallParameters; + }; + "webExtension.uninstall": { + params: Bidi.WebExtension.UninstallParameters; + returnType: Bidi.WebExtension.UninstallParameters; + }; +} diff --git a/out/gen/mapping.js b/out/gen/mapping.js new file mode 100644 index 0000000..a643a6d --- /dev/null +++ b/out/gen/mapping.js @@ -0,0 +1,7 @@ +"use strict"; +/* eslint-disable */ +/** + * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts + * Do not edit this file manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/out/gen/permissions.d.ts b/out/gen/permissions.d.ts index 256abf9..b16fe62 100644 --- a/out/gen/permissions.d.ts +++ b/out/gen/permissions.d.ts @@ -1,27 +1,27 @@ -export type PermissionsCommand = Permissions.SetPermission; +export type PermissionsCommand = (Permissions.SetPermission); export declare namespace Permissions { - type PermissionDescriptor = { - name: string; - }; + type PermissionDescriptor = (({ + "name": (string); + })); } export declare namespace Permissions { - const enum PermissionState { - Granted = 'granted', - Denied = 'denied', - Prompt = 'prompt', - } + const enum PermissionState { + Granted = "granted", + Denied = "denied", + Prompt = "prompt" + } } export declare namespace Permissions { - type SetPermission = { - method: 'permissions.setPermission'; - params: Permissions.SetPermissionParameters; - }; + type SetPermission = ({ + "method": ("permissions.setPermission"); + "params": (Permissions.SetPermissionParameters); + }); } export declare namespace Permissions { - type SetPermissionParameters = { - descriptor: Permissions.PermissionDescriptor; - state: Permissions.PermissionState; - origin: string; - userContext?: string; - }; + type SetPermissionParameters = (({ + "descriptor": (Permissions.PermissionDescriptor); + "state": (Permissions.PermissionState); + "origin": (string); + "userContext"?: (string); + })); } diff --git a/out/gen/permissions.js b/out/gen/permissions.js index 38813da..c8ad2e5 100644 --- a/out/gen/permissions.js +++ b/out/gen/permissions.js @@ -1,2 +1,2 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/out/gen/web-bluetooth.d.ts b/out/gen/web-bluetooth.d.ts index 8b40810..58aadc5 100644 --- a/out/gen/web-bluetooth.d.ts +++ b/out/gen/web-bluetooth.d.ts @@ -1,315 +1,306 @@ export declare namespace Bluetooth { - type BluetoothUuid = string; + type BluetoothUuid = (string); } export declare namespace Bluetooth { - type BluetoothManufacturerData = { - key: number; - data: string; - }; + type BluetoothManufacturerData = (({ + "key": (number); + "data": (string); + })); } export declare namespace Bluetooth { - type CharacteristicProperties = { - broadcast?: boolean; - read?: boolean; - writeWithoutResponse?: boolean; - write?: boolean; - notify?: boolean; - indicate?: boolean; - authenticatedSignedWrites?: boolean; - extendedProperties?: boolean; - }; + type CharacteristicProperties = (({ + "broadcast"?: (boolean); + "read"?: (boolean); + "writeWithoutResponse"?: (boolean); + "write"?: (boolean); + "notify"?: (boolean); + "indicate"?: (boolean); + "authenticatedSignedWrites"?: (boolean); + "extendedProperties"?: (boolean); + })); } export declare namespace Bluetooth { - type RequestDevice = string; + type RequestDevice = (string); } export declare namespace Bluetooth { - type RequestDeviceInfo = { - id: Bluetooth.RequestDevice; - name: string | null; - }; + type RequestDeviceInfo = (({ + "id": (Bluetooth.RequestDevice); + "name": (string | null); + })); } export declare namespace Bluetooth { - type RequestDevicePrompt = string; + type RequestDevicePrompt = (string); } export declare namespace Bluetooth { - type ScanRecord = { - name?: string; - uuids?: [...Bluetooth.BluetoothUuid[]]; - appearance?: number; - manufacturerData?: [...Bluetooth.BluetoothManufacturerData[]]; - }; + type ScanRecord = (({ + "name"?: (string); + "uuids"?: ([ + ...((Bluetooth.BluetoothUuid)[]) + ]); + "appearance"?: (number); + "manufacturerData"?: ([ + ...((Bluetooth.BluetoothManufacturerData)[]) + ]); + })); } -export type BluetoothCommand = - | Bluetooth.HandleRequestDevicePrompt - | Bluetooth.SimulateAdapter - | Bluetooth.DisableSimulation - | Bluetooth.SimulatePreconnectedPeripheral - | Bluetooth.SimulateAdvertisement - | Bluetooth.SimulateGattConnectionResponse - | Bluetooth.SimulateGattDisconnection - | Bluetooth.SimulateService - | Bluetooth.SimulateCharacteristic - | Bluetooth.SimulateCharacteristicResponse - | Bluetooth.SimulateDescriptor - | Bluetooth.SimulateDescriptorResponse - | Record; +export type BluetoothCommand = (Bluetooth.HandleRequestDevicePrompt | Bluetooth.SimulateAdapter | Bluetooth.DisableSimulation | Bluetooth.SimulatePreconnectedPeripheral | Bluetooth.SimulateAdvertisement | Bluetooth.SimulateGattConnectionResponse | Bluetooth.SimulateGattDisconnection | Bluetooth.SimulateService | Bluetooth.SimulateCharacteristic | Bluetooth.SimulateCharacteristicResponse | Bluetooth.SimulateDescriptor | Bluetooth.SimulateDescriptorResponse | Record); export declare namespace Bluetooth { - type HandleRequestDevicePrompt = { - method: 'bluetooth.handleRequestDevicePrompt'; - params: Bluetooth.HandleRequestDevicePromptParameters; - }; + type HandleRequestDevicePrompt = ({ + "method": ("bluetooth.handleRequestDevicePrompt"); + "params": (Bluetooth.HandleRequestDevicePromptParameters); + }); } export declare namespace Bluetooth { - type HandleRequestDevicePromptParameters = { - context: string; - prompt: Bluetooth.RequestDevicePrompt; - } & ( - | Bluetooth.HandleRequestDevicePromptAcceptParameters - | Bluetooth.HandleRequestDevicePromptCancelParameters - ); + type HandleRequestDevicePromptParameters = (({ + "context": (string); + "prompt": (Bluetooth.RequestDevicePrompt); + } & (Bluetooth.HandleRequestDevicePromptAcceptParameters | Bluetooth.HandleRequestDevicePromptCancelParameters))); } export declare namespace Bluetooth { - type HandleRequestDevicePromptAcceptParameters = { - accept: true; - device: Bluetooth.RequestDevice; - }; + type HandleRequestDevicePromptAcceptParameters = ({ + "accept": (true); + "device": (Bluetooth.RequestDevice); + }); } export declare namespace Bluetooth { - type HandleRequestDevicePromptCancelParameters = { - accept: false; - }; + type HandleRequestDevicePromptCancelParameters = ({ + "accept": (false); + }); } export declare namespace Bluetooth { - type SimulateAdapter = { - method: 'bluetooth.simulateAdapter'; - params: Bluetooth.SimulateAdapterParameters; - }; + type SimulateAdapter = ({ + "method": ("bluetooth.simulateAdapter"); + "params": (Bluetooth.SimulateAdapterParameters); + }); } export declare namespace Bluetooth { - type SimulateAdapterParameters = { - context: string; - leSupported?: boolean; - state: 'absent' | 'powered-off' | 'powered-on'; - }; + type SimulateAdapterParameters = (({ + "context": (string); + "leSupported"?: (boolean); + "state": ("absent" | "powered-off" | "powered-on"); + })); } export declare namespace Bluetooth { - type DisableSimulation = { - method: 'bluetooth.disableSimulation'; - params: Bluetooth.DisableSimulationParameters; - }; + type DisableSimulation = ({ + "method": ("bluetooth.disableSimulation"); + "params": (Bluetooth.DisableSimulationParameters); + }); } export declare namespace Bluetooth { - type DisableSimulationParameters = { - context: string; - }; + type DisableSimulationParameters = (({ + "context": (string); + })); } export declare namespace Bluetooth { - type SimulatePreconnectedPeripheral = { - method: 'bluetooth.simulatePreconnectedPeripheral'; - params: Bluetooth.SimulatePreconnectedPeripheralParameters; - }; + type SimulatePreconnectedPeripheral = ({ + "method": ("bluetooth.simulatePreconnectedPeripheral"); + "params": (Bluetooth.SimulatePreconnectedPeripheralParameters); + }); } export declare namespace Bluetooth { - type SimulatePreconnectedPeripheralParameters = { - context: string; - address: string; - name: string; - manufacturerData: [...Bluetooth.BluetoothManufacturerData[]]; - knownServiceUuids: [...Bluetooth.BluetoothUuid[]]; - }; + type SimulatePreconnectedPeripheralParameters = (({ + "context": (string); + "address": (string); + "name": (string); + "manufacturerData": ([ + ...((Bluetooth.BluetoothManufacturerData)[]) + ]); + "knownServiceUuids": ([ + ...((Bluetooth.BluetoothUuid)[]) + ]); + })); } export declare namespace Bluetooth { - type SimulateAdvertisement = { - method: 'bluetooth.simulateAdvertisement'; - params: Bluetooth.SimulateAdvertisementParameters; - }; + type SimulateAdvertisement = ({ + "method": ("bluetooth.simulateAdvertisement"); + "params": (Bluetooth.SimulateAdvertisementParameters); + }); } export declare namespace Bluetooth { - type SimulateAdvertisementParameters = { - context: string; - scanEntry: Bluetooth.SimulateAdvertisementScanEntryParameters; - }; + type SimulateAdvertisementParameters = (({ + "context": (string); + "scanEntry": (Bluetooth.SimulateAdvertisementScanEntryParameters); + })); } export declare namespace Bluetooth { - type SimulateAdvertisementScanEntryParameters = { - deviceAddress: string; - rssi: number; - scanRecord: Bluetooth.ScanRecord; - }; + type SimulateAdvertisementScanEntryParameters = (({ + "deviceAddress": (string); + "rssi": (number); + "scanRecord": (Bluetooth.ScanRecord); + })); } export declare namespace Bluetooth { - type SimulateGattConnectionResponse = { - method: 'bluetooth.simulateGattConnectionResponse'; - params: Bluetooth.SimulateGattConnectionResponseParameters; - }; + type SimulateGattConnectionResponse = ({ + "method": ("bluetooth.simulateGattConnectionResponse"); + "params": (Bluetooth.SimulateGattConnectionResponseParameters); + }); } export declare namespace Bluetooth { - type SimulateGattConnectionResponseParameters = { - context: string; - address: string; - code: number; - }; + type SimulateGattConnectionResponseParameters = (({ + "context": (string); + "address": (string); + "code": (number); + })); } export declare namespace Bluetooth { - type SimulateGattDisconnection = { - method: 'bluetooth.simulateGattDisconnection'; - params: Bluetooth.SimulateGattDisconnectionParameters; - }; + type SimulateGattDisconnection = ({ + "method": ("bluetooth.simulateGattDisconnection"); + "params": (Bluetooth.SimulateGattDisconnectionParameters); + }); } export declare namespace Bluetooth { - type SimulateGattDisconnectionParameters = { - context: string; - address: string; - }; + type SimulateGattDisconnectionParameters = (({ + "context": (string); + "address": (string); + })); } export declare namespace Bluetooth { - type SimulateService = { - method: 'bluetooth.simulateService'; - params: Bluetooth.SimulateServiceParameters; - }; + type SimulateService = ({ + "method": ("bluetooth.simulateService"); + "params": (Bluetooth.SimulateServiceParameters); + }); } export declare namespace Bluetooth { - type SimulateServiceParameters = { - context: string; - address: string; - uuid: Bluetooth.BluetoothUuid; - type: 'add' | 'remove'; - }; + type SimulateServiceParameters = (({ + "context": (string); + "address": (string); + "uuid": (Bluetooth.BluetoothUuid); + "type": ("add" | "remove"); + })); } export declare namespace Bluetooth { - type SimulateCharacteristic = { - method: 'bluetooth.simulateCharacteristic'; - params: Bluetooth.SimulateCharacteristicParameters; - }; + type SimulateCharacteristic = ({ + "method": ("bluetooth.simulateCharacteristic"); + "params": (Bluetooth.SimulateCharacteristicParameters); + }); } export declare namespace Bluetooth { - type SimulateCharacteristicParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - characteristicProperties?: Bluetooth.CharacteristicProperties; - type: 'add' | 'remove'; - }; + type SimulateCharacteristicParameters = (({ + "context": (string); + "address": (string); + "serviceUuid": (Bluetooth.BluetoothUuid); + "characteristicUuid": (Bluetooth.BluetoothUuid); + "characteristicProperties"?: (Bluetooth.CharacteristicProperties); + "type": ("add" | "remove"); + })); } export declare namespace Bluetooth { - type SimulateCharacteristicResponse = { - method: 'bluetooth.simulateCharacteristicResponse'; - params: Bluetooth.SimulateCharacteristicResponseParameters; - }; + type SimulateCharacteristicResponse = ({ + "method": ("bluetooth.simulateCharacteristicResponse"); + "params": (Bluetooth.SimulateCharacteristicResponseParameters); + }); } export declare namespace Bluetooth { - type SimulateCharacteristicResponseParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - type: - | 'read' - | 'write' - | 'subscribe-to-notifications' - | 'unsubscribe-from-notifications'; - code: number; - data?: [...number[]]; - }; + type SimulateCharacteristicResponseParameters = (({ + "context": (string); + "address": (string); + "serviceUuid": (Bluetooth.BluetoothUuid); + "characteristicUuid": (Bluetooth.BluetoothUuid); + "type": ("read" | "write" | "subscribe-to-notifications" | "unsubscribe-from-notifications"); + "code": (number); + "data"?: ([ + ...((number)[]) + ]); + })); } export declare namespace Bluetooth { - type SimulateDescriptor = { - method: 'bluetooth.simulateDescriptor'; - params: Bluetooth.SimulateDescriptorParameters; - }; + type SimulateDescriptor = ({ + "method": ("bluetooth.simulateDescriptor"); + "params": (Bluetooth.SimulateDescriptorParameters); + }); } export declare namespace Bluetooth { - type SimulateDescriptorParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - descriptorUuid: Bluetooth.BluetoothUuid; - type: 'add' | 'remove'; - }; + type SimulateDescriptorParameters = (({ + "context": (string); + "address": (string); + "serviceUuid": (Bluetooth.BluetoothUuid); + "characteristicUuid": (Bluetooth.BluetoothUuid); + "descriptorUuid": (Bluetooth.BluetoothUuid); + "type": ("add" | "remove"); + })); } export declare namespace Bluetooth { - type SimulateDescriptorResponse = { - method: 'bluetooth.simulateDescriptorResponse'; - params: Bluetooth.SimulateDescriptorResponseParameters; - }; + type SimulateDescriptorResponse = ({ + "method": ("bluetooth.simulateDescriptorResponse"); + "params": (Bluetooth.SimulateDescriptorResponseParameters); + }); } export declare namespace Bluetooth { - type SimulateDescriptorResponseParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - descriptorUuid: Bluetooth.BluetoothUuid; - type: 'read' | 'write'; - code: number; - data?: [...number[]]; - }; -} -export type BluetoothEvent = - | Bluetooth.RequestDevicePromptUpdated - | Bluetooth.GattConnectionAttempted; -export declare namespace Bluetooth { - type RequestDevicePromptUpdated = { - method: 'bluetooth.requestDevicePromptUpdated'; - params: Bluetooth.RequestDevicePromptUpdatedParameters; - }; -} -export declare namespace Bluetooth { - type RequestDevicePromptUpdatedParameters = { - context: string; - prompt: Bluetooth.RequestDevicePrompt; - devices: [...Bluetooth.RequestDeviceInfo[]]; - }; -} -export declare namespace Bluetooth { - type GattConnectionAttempted = { - method: 'bluetooth.gattConnectionAttempted'; - params: Bluetooth.GattConnectionAttemptedParameters; - }; -} -export declare namespace Bluetooth { - type GattConnectionAttemptedParameters = { - context: string; - address: string; - }; -} -export declare namespace Bluetooth { - type CharacteristicEventGenerated = { - method: 'bluetooth.characteristicEventGenerated'; - params: Bluetooth.CharacteristicEventGeneratedParameters; - }; -} -export declare namespace Bluetooth { - type CharacteristicEventGeneratedParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - type: - | 'read' - | 'write-with-response' - | 'write-without-response' - | 'subscribe-to-notifications' - | 'unsubscribe-from-notifications'; - data?: [...number[]]; - }; -} -export declare namespace Bluetooth { - type DescriptorEventGenerated = { - method: 'bluetooth.descriptorEventGenerated'; - params: Bluetooth.DescriptorEventGeneratedParameters; - }; -} -export declare namespace Bluetooth { - type DescriptorEventGeneratedParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - descriptorUuid: Bluetooth.BluetoothUuid; - type: 'read' | 'write'; - data?: [...number[]]; - }; + type SimulateDescriptorResponseParameters = (({ + "context": (string); + "address": (string); + "serviceUuid": (Bluetooth.BluetoothUuid); + "characteristicUuid": (Bluetooth.BluetoothUuid); + "descriptorUuid": (Bluetooth.BluetoothUuid); + "type": ("read" | "write"); + "code": (number); + "data"?: ([ + ...((number)[]) + ]); + })); +} +export type BluetoothEvent = (Bluetooth.RequestDevicePromptUpdated | Bluetooth.GattConnectionAttempted); +export declare namespace Bluetooth { + type RequestDevicePromptUpdated = ({ + "method": ("bluetooth.requestDevicePromptUpdated"); + "params": (Bluetooth.RequestDevicePromptUpdatedParameters); + }); +} +export declare namespace Bluetooth { + type RequestDevicePromptUpdatedParameters = (({ + "context": (string); + "prompt": (Bluetooth.RequestDevicePrompt); + "devices": ([ + ...((Bluetooth.RequestDeviceInfo)[]) + ]); + })); +} +export declare namespace Bluetooth { + type GattConnectionAttempted = ({ + "method": ("bluetooth.gattConnectionAttempted"); + "params": (Bluetooth.GattConnectionAttemptedParameters); + }); +} +export declare namespace Bluetooth { + type GattConnectionAttemptedParameters = (({ + "context": (string); + "address": (string); + })); +} +export declare namespace Bluetooth { + type CharacteristicEventGenerated = ({ + "method": ("bluetooth.characteristicEventGenerated"); + "params": (Bluetooth.CharacteristicEventGeneratedParameters); + }); +} +export declare namespace Bluetooth { + type CharacteristicEventGeneratedParameters = (({ + "context": (string); + "address": (string); + "serviceUuid": (Bluetooth.BluetoothUuid); + "characteristicUuid": (Bluetooth.BluetoothUuid); + "type": ("read" | "write-with-response" | "write-without-response" | "subscribe-to-notifications" | "unsubscribe-from-notifications"); + "data"?: ([ + ...((number)[]) + ]); + })); +} +export declare namespace Bluetooth { + type DescriptorEventGenerated = ({ + "method": ("bluetooth.descriptorEventGenerated"); + "params": (Bluetooth.DescriptorEventGeneratedParameters); + }); +} +export declare namespace Bluetooth { + type DescriptorEventGeneratedParameters = (({ + "context": (string); + "address": (string); + "serviceUuid": (Bluetooth.BluetoothUuid); + "characteristicUuid": (Bluetooth.BluetoothUuid); + "descriptorUuid": (Bluetooth.BluetoothUuid); + "type": ("read" | "write"); + "data"?: ([ + ...((number)[]) + ]); + })); } diff --git a/out/gen/web-bluetooth.js b/out/gen/web-bluetooth.js index 38813da..c8ad2e5 100644 --- a/out/gen/web-bluetooth.js +++ b/out/gen/web-bluetooth.js @@ -1,2 +1,2 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/out/index.d.ts b/out/index.d.ts index 84689fd..7727157 100644 --- a/out/index.d.ts +++ b/out/index.d.ts @@ -3,279 +3,9 @@ * Copyright 2024 Google Inc. * SPDX-License-Identifier: Apache-2.0 */ -import * as Bidi from './gen/main.js'; -import * as BidiPermissions from './gen/permissions.js'; -import * as BidiBluetooth from './gen/web-bluetooth.js'; export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -type ExternalSpecCommand = { - id: Bidi.JsUint; -} & T; -type ExternalSpecEvent = { - type: 'event'; -} & T & - Bidi.Extensible; -export type Command = - | Bidi.Command - | ExternalSpecCommand - | ExternalSpecCommand; -export type Event = - | Bidi.Event - | ExternalSpecEvent; -export interface Commands { - 'bluetooth.handleRequestDevicePrompt': { - params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.disableSimulation': { - params: BidiBluetooth.Bluetooth.DisableSimulationParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateAdapter': { - params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateAdvertisement': { - params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulatePreconnectedPeripheral': { - params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateGattDisconnection': { - params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateDescriptor': { - params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateDescriptorResponse': { - params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; - returnType: Bidi.EmptyResult; - }; - 'browser.close': { - params: Bidi.EmptyParams; - returnType: Bidi.EmptyResult; - }; - 'browser.getgetClientWindows': { - params: Bidi.EmptyParams; - returnType: Bidi.Browser.GetClientWindowsResult; - }; - 'browser.createUserContext': { - params: Bidi.EmptyParams; - returnType: Bidi.Browser.CreateUserContextResult; - }; - 'browser.getUserContexts': { - params: Bidi.EmptyParams; - returnType: Bidi.Browser.GetUserContextsResult; - }; - 'browser.removeUserContext': { - params: { - userContext: Bidi.Browser.UserContext; - }; - returnType: Bidi.Browser.RemoveUserContext; - }; - 'browser.setClientWindowState': { - params: Bidi.Browser.SetClientWindowStateParameters; - returnType: Bidi.Browser.ClientWindowInfo; - }; - 'browsingContext.activate': { - params: Bidi.BrowsingContext.ActivateParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.create': { - params: Bidi.BrowsingContext.CreateParameters; - returnType: Bidi.BrowsingContext.CreateResult; - }; - 'browsingContext.close': { - params: Bidi.BrowsingContext.CloseParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.getTree': { - params: Bidi.BrowsingContext.GetTreeParameters; - returnType: Bidi.BrowsingContext.GetTreeResult; - }; - 'browsingContext.locateNodes': { - params: Bidi.BrowsingContext.LocateNodesParameters; - returnType: Bidi.BrowsingContext.LocateNodesResult; - }; - 'browsingContext.navigate': { - params: Bidi.BrowsingContext.NavigateParameters; - returnType: Bidi.BrowsingContext.NavigateResult; - }; - 'browsingContext.reload': { - params: Bidi.BrowsingContext.ReloadParameters; - returnType: Bidi.BrowsingContext.NavigateResult; - }; - 'browsingContext.print': { - params: Bidi.BrowsingContext.PrintParameters; - returnType: Bidi.BrowsingContext.PrintResult; - }; - 'browsingContext.captureScreenshot': { - params: Bidi.BrowsingContext.CaptureScreenshotParameters; - returnType: Bidi.BrowsingContext.CaptureScreenshotResult; - }; - 'browsingContext.handleUserPrompt': { - params: Bidi.BrowsingContext.HandleUserPromptParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.setViewport': { - params: Bidi.BrowsingContext.SetViewportParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.traverseHistory': { - params: Bidi.BrowsingContext.TraverseHistoryParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setForcedColorsModeThemeOverride': { - params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setGeolocationOverride': { - params: Bidi.Emulation.SetGeolocationOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setLocaleOverride': { - params: Bidi.Emulation.SetLocaleOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setScreenOrientationOverride': { - params: Bidi.Emulation.SetScreenOrientationOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setTimezoneOverride': { - params: Bidi.Emulation.SetTimezoneOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setScriptingEnabled': { - params: Bidi.Emulation.SetScriptingEnabledParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setUserAgentOverride': { - params: Bidi.Emulation.SetUserAgentOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'input.performActions': { - params: Bidi.Input.PerformActionsParameters; - returnType: Bidi.EmptyResult; - }; - 'input.releaseActions': { - params: Bidi.Input.ReleaseActionsParameters; - returnType: Bidi.EmptyResult; - }; - 'input.setFiles': { - params: Bidi.Input.SetFilesParameters; - returnType: Bidi.EmptyResult; - }; - 'permissions.setPermission': { - params: BidiPermissions.Permissions.SetPermissionParameters; - returnType: Bidi.EmptyResult; - }; - 'script.evaluate': { - params: Bidi.Script.EvaluateParameters; - returnType: Bidi.Script.EvaluateResult; - }; - 'script.callFunction': { - params: Bidi.Script.CallFunctionParameters; - returnType: Bidi.Script.EvaluateResult; - }; - 'script.disown': { - params: Bidi.Script.DisownParameters; - returnType: Bidi.EmptyResult; - }; - 'script.addPreloadScript': { - params: Bidi.Script.AddPreloadScriptParameters; - returnType: Bidi.Script.AddPreloadScriptResult; - }; - 'script.removePreloadScript': { - params: Bidi.Script.RemovePreloadScriptParameters; - returnType: Bidi.EmptyResult; - }; - 'session.end': { - params: Bidi.EmptyParams; - returnType: Bidi.EmptyResult; - }; - 'session.new': { - params: Bidi.Session.NewParameters; - returnType: Bidi.Session.NewResult; - }; - 'session.status': { - params: object; - returnType: Bidi.Session.StatusResult; - }; - 'session.subscribe': { - params: Bidi.Session.SubscriptionRequest; - returnType: Bidi.EmptyResult; - }; - 'session.unsubscribe': { - params: Bidi.Session.SubscriptionRequest; - returnType: Bidi.EmptyResult; - }; - 'storage.deleteCookies': { - params: Bidi.Storage.DeleteCookiesParameters; - returnType: Bidi.Storage.DeleteCookiesResult; - }; - 'storage.getCookies': { - params: Bidi.Storage.GetCookiesParameters; - returnType: Bidi.Storage.GetCookiesResult; - }; - 'storage.setCookie': { - params: Bidi.Storage.SetCookieParameters; - returnType: Bidi.Storage.SetCookieParameters; - }; - 'network.addDataCollector': { - params: Bidi.Network.AddDataCollectorParameters; - returnType: Bidi.Network.AddDataCollectorResult; - }; - 'network.addIntercept': { - params: Bidi.Network.AddInterceptParameters; - returnType: Bidi.Network.AddInterceptResult; - }; - 'network.removeIntercept': { - params: Bidi.Network.RemoveInterceptParameters; - returnType: Bidi.EmptyResult; - }; - 'network.continueRequest': { - params: Bidi.Network.ContinueRequestParameters; - returnType: Bidi.EmptyResult; - }; - 'network.continueWithAuth': { - params: Bidi.Network.ContinueWithAuthParameters; - returnType: Bidi.EmptyResult; - }; - 'network.failRequest': { - params: Bidi.Network.FailRequestParameters; - returnType: Bidi.EmptyResult; - }; - 'network.provideResponse': { - params: Bidi.Network.ProvideResponseParameters; - returnType: Bidi.EmptyResult; - }; - 'network.disownData': { - params: Bidi.Network.DisownDataParameters; - returnType: Bidi.EmptyResult; - }; - 'network.getData': { - params: Bidi.Network.GetDataParameters; - returnType: Bidi.Network.GetDataResult; - }; - 'network.setCacheBehavior': { - params: Bidi.Network.SetCacheBehaviorParameters; - returnType: Bidi.EmptyResult; - }; - 'network.setExtraHeaders': { - params: Bidi.Network.SetExtraHeadersParameters; - returnType: Bidi.EmptyResult; - }; - 'webExtension.install': { - params: Bidi.WebExtension.InstallParameters; - returnType: Bidi.WebExtension.InstallResult; - }; - 'webExtension.uninstall': { - params: Bidi.WebExtension.UninstallParameters; - returnType: Bidi.EmptyResult; - }; -} +export { Command } from './commands.js'; +export { Event } from './events.js'; +export { CommandMapping } from './gen/mapping.js'; diff --git a/out/index.js b/out/index.js index 7a7008f..b69b4b9 100644 --- a/out/index.js +++ b/out/index.js @@ -1,40 +1,24 @@ -'use strict'; +"use strict"; /** * @license * Copyright 2024 Google Inc. * SPDX-License-Identifier: Apache-2.0 */ -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if ( - !desc || - ('get' in desc ? !m.__esModule : desc.writable || desc.configurable) - ) { - desc = { - enumerable: true, - get: function () { - return m[k]; - }, - }; - } - Object.defineProperty(o, k2, desc); - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) - if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) - __createBinding(exports, m, p); - }; -Object.defineProperty(exports, '__esModule', {value: true}); -__exportStar(require('./gen/main.js'), exports); -__exportStar(require('./gen/permissions.js'), exports); -__exportStar(require('./gen/web-bluetooth.js'), exports); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./gen/main.js"), exports); +__exportStar(require("./gen/permissions.js"), exports); +__exportStar(require("./gen/web-bluetooth.js"), exports); diff --git a/package-lock.json b/package-lock.json index ae7d7c3..7ddac8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "gts": "^6.0.2", "parse5": "^8.0.0", "prettier": "3.6.2", + "ts-morph": "27.0.0", "tsd": "0.33.0", "typescript": "5.9.2" } @@ -210,6 +211,29 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -276,6 +300,34 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, + "node_modules/@ts-morph/common": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.28.0.tgz", + "integrity": "sha512-4w6X/oFmvXcwux6y6ExfM/xSqMHw20cYwFJH+BlYrtGa6nwY9qGq8GXnUs1sVYeF2o/KT3S8hAH6sKBI3VOkBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimatch": "^10.0.1", + "path-browserify": "^1.0.1", + "tinyglobby": "^0.2.14" + } + }, + "node_modules/@ts-morph/common/node_modules/minimatch": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@tsd/typescript": { "version": "5.9.2", "resolved": "https://registry.npmjs.org/@tsd/typescript/-/typescript-5.9.2.tgz", @@ -637,10 +689,11 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -745,6 +798,13 @@ "node": ">= 10" } }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "dev": true, + "license": "MIT" + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -770,10 +830,11 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1620,19 +1681,6 @@ "typescript": ">=5" } }, - "node_modules/gts/node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "node_modules/gts/node_modules/eslint-plugin-prettier": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", @@ -2174,10 +2222,11 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -2419,6 +2468,13 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3030,6 +3086,54 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -3063,6 +3167,17 @@ "node": ">=8" } }, + "node_modules/ts-morph": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-27.0.0.tgz", + "integrity": "sha512-xcqelpTR5PCuZMs54qp9DE3t7tPgA2v/P1/qdW4ke5b3Y5liTGTYj6a/twT35EQW/H5okRqp1UOqwNlgg0K0eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ts-morph/common": "~0.28.0", + "code-block-writer": "^13.0.3" + } + }, "node_modules/tsd": { "version": "0.33.0", "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.33.0.tgz", diff --git a/package.json b/package.json index c8c76bb..fa1e171 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "parse5": "^8.0.0", "prettier": "3.6.2", "tsd": "0.33.0", - "typescript": "5.9.2" + "typescript": "5.9.2", + "ts-morph": "27.0.0" } } diff --git a/src/commands.ts b/src/commands.ts new file mode 100644 index 0000000..43738a7 --- /dev/null +++ b/src/commands.ts @@ -0,0 +1,24 @@ +/** + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as Bidi from './gen/main.js'; +import * as BidiPermissions from './gen/permissions.js'; +import * as BidiBluetooth from './gen/web-bluetooth.js'; + +export * from './gen/main.js'; +export * from './gen/permissions.js'; +export * from './gen/web-bluetooth.js'; + +type ExternalSpecCommand = { + // id is defined by the main WebDriver BiDi spec and extension specs do + // not re-define it. Therefore, it's not part of generated types. + id: Bidi.JsUint; +} & T; + +export type Result = Bidi.ResultData; + +export type Command = Bidi.Command; +// | ExternalSpecCommand +// | ExternalSpecCommand; diff --git a/src/events.ts b/src/events.ts new file mode 100644 index 0000000..1df2a06 --- /dev/null +++ b/src/events.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as Bidi from './gen/main.js'; +import * as BidiBluetooth from './gen/web-bluetooth.js'; + +type ExternalSpecEvent = { + // type is defined by the main WebDriver BiDi spec and extension specs do + // not re-define it. Therefore, it's not part of generated types. + type: 'event'; +} & T & + Bidi.Extensible; + +export type Event = + | Bidi.Event + | ExternalSpecEvent; diff --git a/src/gen/main.ts b/src/gen/main.ts index 6136aae..a863c18 100644 --- a/src/gen/main.ts +++ b/src/gen/main.ts @@ -1,2728 +1,1758 @@ -export type Command = { - id: JsUint; -} & CommandData & - Extensible; -export type CommandData = - | BrowserCommand - | BrowsingContextCommand - | EmulationCommand - | InputCommand - | NetworkCommand - | ScriptCommand - | SessionCommand - | StorageCommand - | WebExtensionCommand; -export type EmptyParams = Extensible; -export type Message = CommandResponse | ErrorResponse | Event; -export type CommandResponse = { - type: 'success'; - id: JsUint; - result: ResultData; -} & Extensible; -export type ErrorResponse = { - type: 'error'; - id: JsUint | null; - error: ErrorCode; - message: string; - stacktrace?: string; -} & Extensible; -export type ResultData = - | BrowsingContextResult - | EmptyResult - | NetworkResult - | ScriptResult - | SessionResult - | StorageResult - | WebExtensionResult; -export type EmptyResult = Extensible; -export type Event = { - type: 'event'; -} & EventData & - Extensible; -export type EventData = - | BrowsingContextEvent - | InputEvent - | LogEvent - | NetworkEvent - | ScriptEvent; -export type Extensible = { - [key: string]: any; -}; +export type Event = (({ +"type":("event")}&EventData&Extensible)); +export type Command = (({ +"id":(JsUint)}&CommandData&Extensible)); +export type CommandResponse = (({ +"type":("success"),"id":(JsUint),"result":(ResultData)}&Extensible)); +export type EventData = (BrowsingContextEvent| InputEvent| LogEvent| NetworkEvent| ScriptEvent); +export type CommandData = (BrowserCommand| BrowsingContextCommand| EmulationCommand| InputCommand| NetworkCommand| ScriptCommand| SessionCommand| StorageCommand| WebExtensionCommand); +export type ResultData = ((BrowsingContextResult| EmptyResult| NetworkResult| ScriptResult| SessionResult| StorageResult| WebExtensionResult)); +export type EmptyParams = ((Extensible)); +export type Message = ((CommandResponse| ErrorResponse| Event)); +export type ErrorResponse = (({ +"type":("error"),"id":(JsUint| null),"error":(ErrorCode),"message":(string),"stacktrace"?:(string)}&Extensible)); +export type EmptyResult = ((Extensible)); +export type Extensible = ({ +[key: string]:(any)}); /** * Must be between `-9007199254740991` and `9007199254740991`, inclusive. */ -export type JsInt = number; +export type JsInt = (number); /** * Must be between `0` and `9007199254740991`, inclusive. */ -export type JsUint = number; -export const enum ErrorCode { - InvalidArgument = 'invalid argument', - InvalidSelector = 'invalid selector', - InvalidSessionId = 'invalid session id', - InvalidWebExtension = 'invalid web extension', - MoveTargetOutOfBounds = 'move target out of bounds', - NoSuchAlert = 'no such alert', - NoSuchNetworkCollector = 'no such network collector', - NoSuchElement = 'no such element', - NoSuchFrame = 'no such frame', - NoSuchHandle = 'no such handle', - NoSuchHistoryEntry = 'no such history entry', - NoSuchIntercept = 'no such intercept', - NoSuchNetworkData = 'no such network data', - NoSuchNode = 'no such node', - NoSuchRequest = 'no such request', - NoSuchScript = 'no such script', - NoSuchStoragePartition = 'no such storage partition', - NoSuchUserContext = 'no such user context', - NoSuchWebExtension = 'no such web extension', - SessionNotCreated = 'session not created', - UnableToCaptureScreen = 'unable to capture screen', - UnableToCloseBrowser = 'unable to close browser', - UnableToSetCookie = 'unable to set cookie', - UnableToSetFileInput = 'unable to set file input', - UnavailableNetworkData = 'unavailable network data', - UnderspecifiedStoragePartition = 'underspecified storage partition', - UnknownCommand = 'unknown command', - UnknownError = 'unknown error', - UnsupportedOperation = 'unsupported operation', -} -export type SessionCommand = - | Session.End - | Session.New - | Session.Status - | Session.Subscribe - | Session.Unsubscribe; -export type SessionResult = - | Session.NewResult - | Session.StatusResult - | Session.SubscribeResult; +export type JsUint = (number); +export const enum ErrorCode {InvalidArgument = "invalid argument", +InvalidSelector = "invalid selector", +InvalidSessionId = "invalid session id", +InvalidWebExtension = "invalid web extension", +MoveTargetOutOfBounds = "move target out of bounds", +NoSuchAlert = "no such alert", +NoSuchNetworkCollector = "no such network collector", +NoSuchElement = "no such element", +NoSuchFrame = "no such frame", +NoSuchHandle = "no such handle", +NoSuchHistoryEntry = "no such history entry", +NoSuchIntercept = "no such intercept", +NoSuchNetworkData = "no such network data", +NoSuchNode = "no such node", +NoSuchRequest = "no such request", +NoSuchScript = "no such script", +NoSuchStoragePartition = "no such storage partition", +NoSuchUserContext = "no such user context", +NoSuchWebExtension = "no such web extension", +SessionNotCreated = "session not created", +UnableToCaptureScreen = "unable to capture screen", +UnableToCloseBrowser = "unable to close browser", +UnableToSetCookie = "unable to set cookie", +UnableToSetFileInput = "unable to set file input", +UnavailableNetworkData = "unavailable network data", +UnderspecifiedStoragePartition = "underspecified storage partition", +UnknownCommand = "unknown command", +UnknownError = "unknown error", +UnsupportedOperation = "unsupported operation", +} +export type SessionCommand = (Session.End| Session.New| Session.Status| Session.Subscribe| Session.Unsubscribe); export namespace Session { - export type CapabilitiesRequest = { - alwaysMatch?: Session.CapabilityRequest; - firstMatch?: [...Session.CapabilityRequest[]]; - }; +export type ProxyConfiguration = ((Session.AutodetectProxyConfiguration| Session.DirectProxyConfiguration| Session.ManualProxyConfiguration| Session.PacProxyConfiguration| Session.SystemProxyConfiguration)); } +export type SessionResult = ((Session.NewResult| Session.StatusResult| Session.SubscribeResult)); export namespace Session { - export type CapabilityRequest = { - acceptInsecureCerts?: boolean; - browserName?: string; - browserVersion?: string; - platformName?: string; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - } & Extensible; +export type CapabilitiesRequest = (({ +"alwaysMatch"?:(Session.CapabilityRequest),"firstMatch"?:([ +...((Session.CapabilityRequest)[])])})); } export namespace Session { - export type ProxyConfiguration = - | Session.AutodetectProxyConfiguration - | Session.DirectProxyConfiguration - | Session.ManualProxyConfiguration - | Session.PacProxyConfiguration - | Session.SystemProxyConfiguration; +export type CapabilityRequest = (({ +"acceptInsecureCerts"?:(boolean),"browserName"?:(string),"browserVersion"?:(string),"platformName"?:(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)}&Extensible)); } export namespace Session { - export type AutodetectProxyConfiguration = { - proxyType: 'autodetect'; - } & Extensible; +export type AutodetectProxyConfiguration = ({ +"proxyType":("autodetect")}&Extensible); } export namespace Session { - export type DirectProxyConfiguration = { - proxyType: 'direct'; - } & Extensible; +export type DirectProxyConfiguration = ({ +"proxyType":("direct")}&Extensible); } export namespace Session { - export type ManualProxyConfiguration = { - proxyType: 'manual'; - httpProxy?: string; - sslProxy?: string; - } & ({} | Session.SocksProxyConfiguration) & { - noProxy?: [...string[]]; - } & Extensible; +export type ManualProxyConfiguration = ({ +"proxyType":("manual"),"httpProxy"?:(string),"sslProxy"?:(string)}&({} |Session.SocksProxyConfiguration)&{ +"noProxy"?:([ +...((string)[])])}&Extensible); } export namespace Session { - export type SocksProxyConfiguration = { - socksProxy: string; - /** - * Must be between `0` and `255`, inclusive. - */ - socksVersion: number; - }; +export type SocksProxyConfiguration = ({ +"socksProxy":(string), +/** + * Must be between `0` and `255`, inclusive. + */ +"socksVersion":(number)}); } export namespace Session { - export type PacProxyConfiguration = { - proxyType: 'pac'; - proxyAutoconfigUrl: string; - } & Extensible; +export type PacProxyConfiguration = ({ +"proxyType":("pac"),"proxyAutoconfigUrl":(string)}&Extensible); } export namespace Session { - export type SystemProxyConfiguration = { - proxyType: 'system'; - } & Extensible; +export type SystemProxyConfiguration = ({ +"proxyType":("system")}&Extensible); } export namespace Session { - export type UserPromptHandler = { - alert?: Session.UserPromptHandlerType; - beforeUnload?: Session.UserPromptHandlerType; - confirm?: Session.UserPromptHandlerType; - default?: Session.UserPromptHandlerType; - file?: Session.UserPromptHandlerType; - prompt?: Session.UserPromptHandlerType; - }; +export type UserPromptHandler = (({ +"alert"?:(Session.UserPromptHandlerType),"beforeUnload"?:(Session.UserPromptHandlerType),"confirm"?:(Session.UserPromptHandlerType),"default"?:(Session.UserPromptHandlerType),"file"?:(Session.UserPromptHandlerType),"prompt"?:(Session.UserPromptHandlerType)})); } export namespace Session { - export const enum UserPromptHandlerType { - Accept = 'accept', - Dismiss = 'dismiss', - Ignore = 'ignore', - } +export const enum UserPromptHandlerType {Accept = "accept", +Dismiss = "dismiss", +Ignore = "ignore", +} } export namespace Session { - export type Subscription = string; +export type Subscription = (string); } export namespace Session { - export type SubscriptionRequest = { - events: [string, ...string[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SubscriptionRequest = (({ +"events":([ +(string),...(string)[]]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Session { - export type UnsubscribeByIdRequest = { - subscriptions: [Session.Subscription, ...Session.Subscription[]]; - }; +export type UnsubscribeByIdRequest = (({ +"subscriptions":([ +(Session.Subscription),...(Session.Subscription)[]])})); } export namespace Session { - export type UnsubscribeByAttributesRequest = { - events: [string, ...string[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - }; +export type UnsubscribeByAttributesRequest = (({ +"events":([ +(string),...(string)[]]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); } export namespace Session { - export type Status = { - method: 'session.status'; - params: EmptyParams; - }; +export type Status = ({ +"method":("session.status"),"params":(EmptyParams)}); } export namespace Session { - export type StatusResult = { - ready: boolean; - message: string; - }; +export type StatusResult = (({ +"ready":(boolean),"message":(string)})); } export namespace Session { - export type New = { - method: 'session.new'; - params: Session.NewParameters; - }; +export type New = ({ +"method":("session.new"),"params":(Session.NewParameters)}); } export namespace Session { - export type NewParameters = { - capabilities: Session.CapabilitiesRequest; - }; +export type NewParameters = (({ +"capabilities":(Session.CapabilitiesRequest)})); } export namespace Session { - export type NewResult = { - sessionId: string; - capabilities: { - acceptInsecureCerts: boolean; - browserName: string; - browserVersion: string; - platformName: string; - setWindowRect: boolean; - userAgent: string; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - webSocketUrl?: string; - } & Extensible; - }; +export type NewResult = (({ +"sessionId":(string),"capabilities":(({ +"acceptInsecureCerts":(boolean),"browserName":(string),"browserVersion":(string),"platformName":(string),"setWindowRect":(boolean),"userAgent":(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler),"webSocketUrl"?:(string)}&Extensible))})); } export namespace Session { - export type End = { - method: 'session.end'; - params: EmptyParams; - }; +export type End = ({ +"method":("session.end"),"params":(EmptyParams)}); } export namespace Session { - export type Subscribe = { - method: 'session.subscribe'; - params: Session.SubscriptionRequest; - }; +export type Subscribe = ({ +"method":("session.subscribe"),"params":(Session.SubscriptionRequest)}); } export namespace Session { - export type SubscribeResult = { - subscription: Session.Subscription; - }; +export type SubscribeResult = (({ +"subscription":(Session.Subscription)})); } export namespace Session { - export type Unsubscribe = { - method: 'session.unsubscribe'; - params: Session.UnsubscribeParameters; - }; +export type Unsubscribe = ({ +"method":("session.unsubscribe"),"params":(Session.UnsubscribeParameters)}); } export namespace Session { - export type UnsubscribeParameters = - | Session.UnsubscribeByAttributesRequest - | Session.UnsubscribeByIdRequest; -} -export type BrowserCommand = - | Browser.Close - | Browser.CreateUserContext - | Browser.GetClientWindows - | Browser.GetUserContexts - | Browser.RemoveUserContext - | Browser.SetClientWindowState; -export type BrowserResult = - | Browser.CreateUserContextResult - | Browser.GetUserContextsResult; +export type UnsubscribeParameters = (Session.UnsubscribeByAttributesRequest| Session.UnsubscribeByIdRequest); +} +export type BrowserCommand = (Browser.Close| Browser.CreateUserContext| Browser.GetClientWindows| Browser.GetUserContexts| Browser.RemoveUserContext| Browser.SetClientWindowState); +export type BrowserResult = ((Browser.CreateUserContextResult| Browser.GetUserContextsResult)); export namespace Browser { - export type ClientWindow = string; +export type ClientWindow = (string); } export namespace Browser { - export type ClientWindowInfo = { - active: boolean; - clientWindow: Browser.ClientWindow; - height: JsUint; - state: 'fullscreen' | 'maximized' | 'minimized' | 'normal'; - width: JsUint; - x: JsInt; - y: JsInt; - }; +export type ClientWindowInfo = (({ +"active":(boolean),"clientWindow":(Browser.ClientWindow),"height":(JsUint),"state":("fullscreen"| "maximized"| "minimized"| "normal"),"width":(JsUint),"x":(JsInt),"y":(JsInt)})); } export namespace Browser { - export type UserContext = string; +export type UserContext = (string); } export namespace Browser { - export type UserContextInfo = { - userContext: Browser.UserContext; - }; +export type UserContextInfo = (({ +"userContext":(Browser.UserContext)})); } export namespace Browser { - export type Close = { - method: 'browser.close'; - params: EmptyParams; - }; +export type Close = ({ +"method":("browser.close"),"params":(EmptyParams)}); } export namespace Browser { - export type CreateUserContext = { - method: 'browser.createUserContext'; - params: Browser.CreateUserContextParameters; - }; +export type CreateUserContext = ({ +"method":("browser.createUserContext"),"params":(Browser.CreateUserContextParameters)}); } export namespace Browser { - export type CreateUserContextParameters = { - acceptInsecureCerts?: boolean; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - }; +export type CreateUserContextParameters = (({ +"acceptInsecureCerts"?:(boolean),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)})); } export namespace Browser { - export type CreateUserContextResult = Browser.UserContextInfo; +export type CreateUserContextResult = (Browser.UserContextInfo); } export namespace Browser { - export type GetClientWindows = { - method: 'browser.getClientWindows'; - params: EmptyParams; - }; +export type GetClientWindows = ({ +"method":("browser.getClientWindows"),"params":(EmptyParams)}); } export namespace Browser { - export type GetClientWindowsResult = { - clientWindows: [...Browser.ClientWindowInfo[]]; - }; +export type GetClientWindowsResult = (({ +"clientWindows":([ +...((Browser.ClientWindowInfo)[])])})); } export namespace Browser { - export type GetUserContexts = { - method: 'browser.getUserContexts'; - params: EmptyParams; - }; +export type GetUserContexts = ({ +"method":("browser.getUserContexts"),"params":(EmptyParams)}); } export namespace Browser { - export type GetUserContextsResult = { - userContexts: [Browser.UserContextInfo, ...Browser.UserContextInfo[]]; - }; +export type GetUserContextsResult = (({ +"userContexts":([ +(Browser.UserContextInfo),...(Browser.UserContextInfo)[]])})); } export namespace Browser { - export type RemoveUserContext = { - method: 'browser.removeUserContext'; - params: Browser.RemoveUserContextParameters; - }; +export type RemoveUserContext = ({ +"method":("browser.removeUserContext"),"params":(Browser.RemoveUserContextParameters)}); } export namespace Browser { - export type RemoveUserContextParameters = { - userContext: Browser.UserContext; - }; +export type RemoveUserContextParameters = (({ +"userContext":(Browser.UserContext)})); } export namespace Browser { - export type SetClientWindowState = { - method: 'browser.setClientWindowState'; - params: Browser.SetClientWindowStateParameters; - }; +export type SetClientWindowState = ({ +"method":("browser.setClientWindowState"),"params":(Browser.SetClientWindowStateParameters)}); } export namespace Browser { - export type SetClientWindowStateParameters = { - clientWindow: Browser.ClientWindow; - } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState); +export type SetClientWindowStateParameters = (({ +"clientWindow":(Browser.ClientWindow)}&(Browser.ClientWindowNamedState| Browser.ClientWindowRectState))); } export namespace Browser { - export type ClientWindowNamedState = { - state: 'fullscreen' | 'maximized' | 'minimized'; - }; +export type ClientWindowNamedState = ({ +"state":("fullscreen"| "maximized"| "minimized")}); } export namespace Browser { - export type ClientWindowRectState = { - state: 'normal'; - width?: JsUint; - height?: JsUint; - x?: JsInt; - y?: JsInt; - }; -} -export type BrowsingContextCommand = - | BrowsingContext.Activate - | BrowsingContext.CaptureScreenshot - | BrowsingContext.Close - | BrowsingContext.Create - | BrowsingContext.GetTree - | BrowsingContext.HandleUserPrompt - | BrowsingContext.LocateNodes - | BrowsingContext.Navigate - | BrowsingContext.Print - | BrowsingContext.Reload - | BrowsingContext.SetViewport - | BrowsingContext.TraverseHistory; -export type BrowsingContextResult = - | BrowsingContext.CaptureScreenshotResult - | BrowsingContext.CreateResult - | BrowsingContext.GetTreeResult - | BrowsingContext.LocateNodesResult - | BrowsingContext.NavigateResult - | BrowsingContext.PrintResult - | BrowsingContext.TraverseHistoryResult; -export type BrowsingContextEvent = - | BrowsingContext.ContextCreated - | BrowsingContext.ContextDestroyed - | BrowsingContext.DomContentLoaded - | BrowsingContext.DownloadEnd - | BrowsingContext.DownloadWillBegin - | BrowsingContext.FragmentNavigated - | BrowsingContext.HistoryUpdated - | BrowsingContext.Load - | BrowsingContext.NavigationAborted - | BrowsingContext.NavigationCommitted - | BrowsingContext.NavigationFailed - | BrowsingContext.NavigationStarted - | BrowsingContext.UserPromptClosed - | BrowsingContext.UserPromptOpened; -export namespace BrowsingContext { - export type BrowsingContext = string; -} -export namespace BrowsingContext { - export type InfoList = [...BrowsingContext.Info[]]; -} -export namespace BrowsingContext { - export type Info = { - children: BrowsingContext.InfoList | null; - clientWindow: Browser.ClientWindow; - context: BrowsingContext.BrowsingContext; - originalOpener: BrowsingContext.BrowsingContext | null; - url: string; - userContext: Browser.UserContext; - parent?: BrowsingContext.BrowsingContext | null; - }; -} -export namespace BrowsingContext { - export type Locator = - | BrowsingContext.AccessibilityLocator - | BrowsingContext.CssLocator - | BrowsingContext.ContextLocator - | BrowsingContext.InnerTextLocator - | BrowsingContext.XPathLocator; -} -export namespace BrowsingContext { - export type AccessibilityLocator = { - type: 'accessibility'; - value: { - name?: string; - role?: string; - }; - }; -} -export namespace BrowsingContext { - export type CssLocator = { - type: 'css'; - value: string; - }; -} -export namespace BrowsingContext { - export type ContextLocator = { - type: 'context'; - value: { - context: BrowsingContext.BrowsingContext; - }; - }; -} -export namespace BrowsingContext { - export type InnerTextLocator = { - type: 'innerText'; - value: string; - ignoreCase?: boolean; - matchType?: 'full' | 'partial'; - maxDepth?: JsUint; - }; -} -export namespace BrowsingContext { - export type XPathLocator = { - type: 'xpath'; - value: string; - }; +export type ClientWindowRectState = ({ +"state":("normal"),"width"?:(JsUint),"height"?:(JsUint),"x"?:(JsInt),"y"?:(JsInt)}); +} +export type BrowsingContextCommand = (BrowsingContext.Activate| BrowsingContext.CaptureScreenshot| BrowsingContext.Close| BrowsingContext.Create| BrowsingContext.GetTree| BrowsingContext.HandleUserPrompt| BrowsingContext.LocateNodes| BrowsingContext.Navigate| BrowsingContext.Print| BrowsingContext.Reload| BrowsingContext.SetViewport| BrowsingContext.TraverseHistory); +export type BrowsingContextEvent = (BrowsingContext.ContextCreated| BrowsingContext.ContextDestroyed| BrowsingContext.DomContentLoaded| BrowsingContext.DownloadEnd| BrowsingContext.DownloadWillBegin| BrowsingContext.FragmentNavigated| BrowsingContext.HistoryUpdated| BrowsingContext.Load| BrowsingContext.NavigationAborted| BrowsingContext.NavigationCommitted| BrowsingContext.NavigationFailed| BrowsingContext.NavigationStarted| BrowsingContext.UserPromptClosed| BrowsingContext.UserPromptOpened); +export type BrowsingContextResult = ((BrowsingContext.CaptureScreenshotResult| BrowsingContext.CreateResult| BrowsingContext.GetTreeResult| BrowsingContext.LocateNodesResult| BrowsingContext.NavigateResult| BrowsingContext.PrintResult| BrowsingContext.TraverseHistoryResult)); +export namespace BrowsingContext { +export type BrowsingContext = (string); +} +export namespace BrowsingContext { +export type InfoList = ([ +...((BrowsingContext.Info)[])]); +} +export namespace BrowsingContext { +export type Info = (({ +"children":(BrowsingContext.InfoList| null),"clientWindow":(Browser.ClientWindow),"context":(BrowsingContext.BrowsingContext),"originalOpener":(BrowsingContext.BrowsingContext| null),"url":(string),"userContext":(Browser.UserContext),"parent"?:(BrowsingContext.BrowsingContext| null)})); +} +export namespace BrowsingContext { +export type Locator = ((BrowsingContext.AccessibilityLocator| BrowsingContext.CssLocator| BrowsingContext.ContextLocator| BrowsingContext.InnerTextLocator| BrowsingContext.XPathLocator)); +} +export namespace BrowsingContext { +export type AccessibilityLocator = (({ +"type":("accessibility"),"value":(({ +"name"?:(string),"role"?:(string)}))})); +} +export namespace BrowsingContext { +export type CssLocator = (({ +"type":("css"),"value":(string)})); +} +export namespace BrowsingContext { +export type ContextLocator = (({ +"type":("context"),"value":(({ +"context":(BrowsingContext.BrowsingContext)}))})); +} +export namespace BrowsingContext { +export type InnerTextLocator = (({ +"type":("innerText"),"value":(string),"ignoreCase"?:(boolean),"matchType"?:("full"| "partial"),"maxDepth"?:(JsUint)})); +} +export namespace BrowsingContext { +export type XPathLocator = (({ +"type":("xpath"),"value":(string)})); +} +export namespace BrowsingContext { +export type Navigation = (string); +} +export namespace BrowsingContext { +export type BaseNavigationInfo = ({ +"context":(BrowsingContext.BrowsingContext),"navigation":(BrowsingContext.Navigation| null),"timestamp":(JsUint),"url":(string)}); +} +export namespace BrowsingContext { +export type NavigationInfo = ((BrowsingContext.BaseNavigationInfo)); +} +export namespace BrowsingContext { +export const enum ReadinessState {None = "none", +Interactive = "interactive", +Complete = "complete", +} +} +export namespace BrowsingContext { +export const enum UserPromptType {Alert = "alert", +Beforeunload = "beforeunload", +Confirm = "confirm", +Prompt = "prompt", +} +} +export namespace BrowsingContext { +export type Activate = ({ +"method":("browsingContext.activate"),"params":(BrowsingContext.ActivateParameters)}); +} +export namespace BrowsingContext { +export type ActivateParameters = (({ +"context":(BrowsingContext.BrowsingContext)})); +} +export namespace BrowsingContext { +export type CaptureScreenshotParameters = (({ +"context":(BrowsingContext.BrowsingContext), +/** + * @defaultValue `"viewport"` + */ +"origin"?:(("viewport"| "document")),"format"?:(BrowsingContext.ImageFormat),"clip"?:(BrowsingContext.ClipRectangle)})); +} +export namespace BrowsingContext { +export type CaptureScreenshot = ({ +"method":("browsingContext.captureScreenshot"),"params":(BrowsingContext.CaptureScreenshotParameters)}); +} +export namespace BrowsingContext { +export type ImageFormat = (({ +"type":(string), +/** + * Must be between `0` and `1`, inclusive. + */ +"quality"?:(number)})); } export namespace BrowsingContext { - export type Navigation = string; -} -export namespace BrowsingContext { - export type BaseNavigationInfo = { - context: BrowsingContext.BrowsingContext; - navigation: BrowsingContext.Navigation | null; - timestamp: JsUint; - url: string; - }; +export type ClipRectangle = ((BrowsingContext.BoxClipRectangle| BrowsingContext.ElementClipRectangle)); } export namespace BrowsingContext { - export type NavigationInfo = BrowsingContext.BaseNavigationInfo; +export type ElementClipRectangle = (({ +"type":("element"),"element":(Script.SharedReference)})); } export namespace BrowsingContext { - export const enum ReadinessState { - None = 'none', - Interactive = 'interactive', - Complete = 'complete', - } +export type BoxClipRectangle = (({ +"type":("box"),"x":(number),"y":(number),"width":(number),"height":(number)})); } export namespace BrowsingContext { - export const enum UserPromptType { - Alert = 'alert', - Beforeunload = 'beforeunload', - Confirm = 'confirm', - Prompt = 'prompt', - } +export type CaptureScreenshotResult = (({ +"data":(string)})); } export namespace BrowsingContext { - export type Activate = { - method: 'browsingContext.activate'; - params: BrowsingContext.ActivateParameters; - }; +export type Close = ({ +"method":("browsingContext.close"),"params":(BrowsingContext.CloseParameters)}); } export namespace BrowsingContext { - export type ActivateParameters = { - context: BrowsingContext.BrowsingContext; - }; +export type CloseParameters = (({ +"context":(BrowsingContext.BrowsingContext), +/** + * @defaultValue `false` + */ +"promptUnload"?:(boolean)})); } export namespace BrowsingContext { - export type CaptureScreenshot = { - method: 'browsingContext.captureScreenshot'; - params: BrowsingContext.CaptureScreenshotParameters; - }; +export type Create = ({ +"method":("browsingContext.create"),"params":(BrowsingContext.CreateParameters)}); } export namespace BrowsingContext { - export type CaptureScreenshotParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `"viewport"` - */ - origin?: 'viewport' | 'document'; - format?: BrowsingContext.ImageFormat; - clip?: BrowsingContext.ClipRectangle; - }; +export const enum CreateType {Tab = "tab", +Window = "window", +} } export namespace BrowsingContext { - export type ImageFormat = { - type: string; - /** - * Must be between `0` and `1`, inclusive. - */ - quality?: number; - }; +export type CreateParameters = (({ +"type":(BrowsingContext.CreateType),"referenceContext"?:(BrowsingContext.BrowsingContext), +/** + * @defaultValue `false` + */ +"background"?:(boolean),"userContext"?:(Browser.UserContext)})); } export namespace BrowsingContext { - export type ClipRectangle = - | BrowsingContext.BoxClipRectangle - | BrowsingContext.ElementClipRectangle; +export type CreateResult = (({ +"context":(BrowsingContext.BrowsingContext)})); } export namespace BrowsingContext { - export type ElementClipRectangle = { - type: 'element'; - element: Script.SharedReference; - }; +export type GetTree = ({ +"method":("browsingContext.getTree"),"params":(BrowsingContext.GetTreeParameters)}); } export namespace BrowsingContext { - export type BoxClipRectangle = { - type: 'box'; - x: number; - y: number; - width: number; - height: number; - }; +export type GetTreeParameters = (({ +"maxDepth"?:(JsUint),"root"?:(BrowsingContext.BrowsingContext)})); } export namespace BrowsingContext { - export type CaptureScreenshotResult = { - data: string; - }; +export type GetTreeResult = (({ +"contexts":(BrowsingContext.InfoList)})); } export namespace BrowsingContext { - export type Close = { - method: 'browsingContext.close'; - params: BrowsingContext.CloseParameters; - }; +export type HandleUserPrompt = ({ +"method":("browsingContext.handleUserPrompt"),"params":(BrowsingContext.HandleUserPromptParameters)}); } export namespace BrowsingContext { - export type CloseParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - promptUnload?: boolean; - }; +export type HandleUserPromptParameters = (({ +"context":(BrowsingContext.BrowsingContext),"accept"?:(boolean),"userText"?:(string)})); } export namespace BrowsingContext { - export type Create = { - method: 'browsingContext.create'; - params: BrowsingContext.CreateParameters; - }; +export type LocateNodesParameters = (({ +"context":(BrowsingContext.BrowsingContext),"locator":(BrowsingContext.Locator), +/** + * Must be greater than or equal to `1`. + */ +"maxNodeCount"?:((JsUint)),"serializationOptions"?:(Script.SerializationOptions),"startNodes"?:([ +(Script.SharedReference),...(Script.SharedReference)[]])})); } export namespace BrowsingContext { - export const enum CreateType { - Tab = 'tab', - Window = 'window', - } +export type LocateNodes = ({ +"method":("browsingContext.locateNodes"),"params":(BrowsingContext.LocateNodesParameters)}); } export namespace BrowsingContext { - export type CreateParameters = { - type: BrowsingContext.CreateType; - referenceContext?: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - background?: boolean; - userContext?: Browser.UserContext; - }; +export type LocateNodesResult = (({ +"nodes":([ +...((Script.NodeRemoteValue)[])])})); } export namespace BrowsingContext { - export type CreateResult = { - context: BrowsingContext.BrowsingContext; - }; +export type Navigate = ({ +"method":("browsingContext.navigate"),"params":(BrowsingContext.NavigateParameters)}); } export namespace BrowsingContext { - export type GetTree = { - method: 'browsingContext.getTree'; - params: BrowsingContext.GetTreeParameters; - }; +export type NavigateParameters = (({ +"context":(BrowsingContext.BrowsingContext),"url":(string),"wait"?:(BrowsingContext.ReadinessState)})); } export namespace BrowsingContext { - export type GetTreeParameters = { - maxDepth?: JsUint; - root?: BrowsingContext.BrowsingContext; - }; +export type NavigateResult = (({ +"navigation":(BrowsingContext.Navigation| null),"url":(string)})); } export namespace BrowsingContext { - export type GetTreeResult = { - contexts: BrowsingContext.InfoList; - }; +export type Print = ({ +"method":("browsingContext.print"),"params":(BrowsingContext.PrintParameters)}); } export namespace BrowsingContext { - export type HandleUserPrompt = { - method: 'browsingContext.handleUserPrompt'; - params: BrowsingContext.HandleUserPromptParameters; - }; +export type PrintParameters = (({ +"context":(BrowsingContext.BrowsingContext), +/** + * @defaultValue `false` + */ +"background"?:(boolean),"margin"?:(BrowsingContext.PrintMarginParameters), +/** + * @defaultValue `"portrait"` + */ +"orientation"?:(("portrait"| "landscape")),"page"?:(BrowsingContext.PrintPageParameters),"pageRanges"?:([ +...((JsUint| string)[])]), +/** + * Must be between `0.1` and `2`, inclusive. + * + * @defaultValue `1` + */ +"scale"?:((number)), +/** + * @defaultValue `true` + */ +"shrinkToFit"?:(boolean)})); } -export namespace BrowsingContext { - export type HandleUserPromptParameters = { - context: BrowsingContext.BrowsingContext; - accept?: boolean; - userText?: string; - }; -} -export namespace BrowsingContext { - export type LocateNodes = { - method: 'browsingContext.locateNodes'; - params: BrowsingContext.LocateNodesParameters; - }; -} -export namespace BrowsingContext { - export type LocateNodesParameters = { - context: BrowsingContext.BrowsingContext; - locator: BrowsingContext.Locator; - /** - * Must be greater than or equal to `1`. - */ - maxNodeCount?: JsUint; - serializationOptions?: Script.SerializationOptions; - startNodes?: [Script.SharedReference, ...Script.SharedReference[]]; - }; -} -export namespace BrowsingContext { - export type LocateNodesResult = { - nodes: [...Script.NodeRemoteValue[]]; - }; -} -export namespace BrowsingContext { - export type Navigate = { - method: 'browsingContext.navigate'; - params: BrowsingContext.NavigateParameters; - }; -} -export namespace BrowsingContext { - export type NavigateParameters = { - context: BrowsingContext.BrowsingContext; - url: string; - wait?: BrowsingContext.ReadinessState; - }; -} -export namespace BrowsingContext { - export type NavigateResult = { - navigation: BrowsingContext.Navigation | null; - url: string; - }; -} -export namespace BrowsingContext { - export type Print = { - method: 'browsingContext.print'; - params: BrowsingContext.PrintParameters; - }; -} -export namespace BrowsingContext { - export type PrintParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - background?: boolean; - margin?: BrowsingContext.PrintMarginParameters; - /** - * @defaultValue `"portrait"` - */ - orientation?: 'portrait' | 'landscape'; - page?: BrowsingContext.PrintPageParameters; - pageRanges?: [...(JsUint | string)[]]; - /** - * Must be between `0.1` and `2`, inclusive. - * - * @defaultValue `1` - */ - scale?: number; - /** - * @defaultValue `true` - */ - shrinkToFit?: boolean; - }; -} -export namespace BrowsingContext { - export type PrintMarginParameters = { - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - bottom?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - left?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - right?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - top?: number; - }; -} -export namespace BrowsingContext { - export type PrintPageParameters = { - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `27.94` - */ - height?: number; - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `21.59` - */ - width?: number; - }; +export namespace BrowsingContext { +export type PrintMarginParameters = (({ + +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"bottom"?:((number)), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"left"?:((number)), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"right"?:((number)), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"top"?:((number))})); +} +export namespace BrowsingContext { +export type PrintPageParameters = (({ + +/** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `27.94` + */ +"height"?:((number)), +/** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `21.59` + */ +"width"?:((number))})); } -export namespace BrowsingContext { - export type PrintResult = { - data: string; - }; -} -export namespace BrowsingContext { - export type Reload = { - method: 'browsingContext.reload'; - params: BrowsingContext.ReloadParameters; - }; -} -export namespace BrowsingContext { - export type ReloadParameters = { - context: BrowsingContext.BrowsingContext; - ignoreCache?: boolean; - wait?: BrowsingContext.ReadinessState; - }; +export namespace BrowsingContext { +export type PrintResult = (({ +"data":(string)})); } -export namespace BrowsingContext { - export type SetViewport = { - method: 'browsingContext.setViewport'; - params: BrowsingContext.SetViewportParameters; - }; +export namespace BrowsingContext { +export type Reload = ({ +"method":("browsingContext.reload"),"params":(BrowsingContext.ReloadParameters)}); } -export namespace BrowsingContext { - export type SetViewportParameters = { - context?: BrowsingContext.BrowsingContext; - viewport?: BrowsingContext.Viewport | null; - /** - * Must be greater than `0`. - */ - devicePixelRatio?: number | null; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export namespace BrowsingContext { +export type ReloadParameters = (({ +"context":(BrowsingContext.BrowsingContext),"ignoreCache"?:(boolean),"wait"?:(BrowsingContext.ReadinessState)})); } export namespace BrowsingContext { - export type Viewport = { - width: JsUint; - height: JsUint; - }; +export type SetViewport = ({ +"method":("browsingContext.setViewport"),"params":(BrowsingContext.SetViewportParameters)}); } export namespace BrowsingContext { - export type TraverseHistory = { - method: 'browsingContext.traverseHistory'; - params: BrowsingContext.TraverseHistoryParameters; - }; +export type SetViewportParameters = (({ +"context"?:(BrowsingContext.BrowsingContext),"viewport"?:(BrowsingContext.Viewport| null), +/** + * Must be greater than `0`. + */ +"devicePixelRatio"?:((number)| null),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace BrowsingContext { - export type TraverseHistoryParameters = { - context: BrowsingContext.BrowsingContext; - delta: JsInt; - }; +export type Viewport = (({ +"width":(JsUint),"height":(JsUint)})); } export namespace BrowsingContext { - export type TraverseHistoryResult = Record; +export type TraverseHistory = ({ +"method":("browsingContext.traverseHistory"),"params":(BrowsingContext.TraverseHistoryParameters)}); } export namespace BrowsingContext { - export type ContextCreated = { - method: 'browsingContext.contextCreated'; - params: BrowsingContext.Info; - }; +export type TraverseHistoryParameters = (({ +"context":(BrowsingContext.BrowsingContext),"delta":(JsInt)})); } export namespace BrowsingContext { - export type ContextDestroyed = { - method: 'browsingContext.contextDestroyed'; - params: BrowsingContext.Info; - }; +export type TraverseHistoryResult = ((Record +)); } export namespace BrowsingContext { - export type NavigationStarted = { - method: 'browsingContext.navigationStarted'; - params: BrowsingContext.NavigationInfo; - }; +export type ContextCreated = ({ +"method":("browsingContext.contextCreated"),"params":(BrowsingContext.Info)}); } export namespace BrowsingContext { - export type FragmentNavigated = { - method: 'browsingContext.fragmentNavigated'; - params: BrowsingContext.NavigationInfo; - }; +export type ContextDestroyed = ({ +"method":("browsingContext.contextDestroyed"),"params":(BrowsingContext.Info)}); } export namespace BrowsingContext { - export type HistoryUpdated = { - method: 'browsingContext.historyUpdated'; - params: BrowsingContext.HistoryUpdatedParameters; - }; +export type NavigationStarted = ({ +"method":("browsingContext.navigationStarted"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type HistoryUpdatedParameters = { - context: BrowsingContext.BrowsingContext; - timestamp: JsUint; - url: string; - }; +export type FragmentNavigated = ({ +"method":("browsingContext.fragmentNavigated"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type DomContentLoaded = { - method: 'browsingContext.domContentLoaded'; - params: BrowsingContext.NavigationInfo; - }; +export type HistoryUpdated = ({ +"method":("browsingContext.historyUpdated"),"params":(BrowsingContext.HistoryUpdatedParameters)}); } export namespace BrowsingContext { - export type Load = { - method: 'browsingContext.load'; - params: BrowsingContext.NavigationInfo; - }; +export type HistoryUpdatedParameters = (({ +"context":(BrowsingContext.BrowsingContext),"timestamp":(JsUint),"url":(string)})); } export namespace BrowsingContext { - export type DownloadWillBegin = { - method: 'browsingContext.downloadWillBegin'; - params: BrowsingContext.DownloadWillBeginParams; - }; +export type DomContentLoaded = ({ +"method":("browsingContext.domContentLoaded"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type DownloadWillBeginParams = { - suggestedFilename: string; - } & BrowsingContext.BaseNavigationInfo; +export type Load = ({ +"method":("browsingContext.load"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type DownloadEnd = { - method: 'browsingContext.downloadEnd'; - params: BrowsingContext.DownloadEndParams; - }; +export type DownloadWillBegin = ({ +"method":("browsingContext.downloadWillBegin"),"params":(BrowsingContext.DownloadWillBeginParams)}); } export namespace BrowsingContext { - export type DownloadEndParams = - | BrowsingContext.DownloadCanceledParams - | BrowsingContext.DownloadCompleteParams; +export type DownloadWillBeginParams = (({ +"suggestedFilename":(string)}&BrowsingContext.BaseNavigationInfo)); } export namespace BrowsingContext { - export type DownloadCanceledParams = { - status: 'canceled'; - } & BrowsingContext.BaseNavigationInfo; +export type DownloadEnd = ({ +"method":("browsingContext.downloadEnd"),"params":(BrowsingContext.DownloadEndParams)}); } export namespace BrowsingContext { - export type DownloadCompleteParams = { - status: 'complete'; - filepath: string | null; - } & BrowsingContext.BaseNavigationInfo; +export type DownloadEndParams = (((BrowsingContext.DownloadCanceledParams| BrowsingContext.DownloadCompleteParams))); } export namespace BrowsingContext { - export type NavigationAborted = { - method: 'browsingContext.navigationAborted'; - params: BrowsingContext.NavigationInfo; - }; +export type DownloadCanceledParams = ({ +"status":("canceled")}&BrowsingContext.BaseNavigationInfo); } export namespace BrowsingContext { - export type NavigationCommitted = { - method: 'browsingContext.navigationCommitted'; - params: BrowsingContext.NavigationInfo; - }; +export type DownloadCompleteParams = ({ +"status":("complete"),"filepath":(string| null)}&BrowsingContext.BaseNavigationInfo); } export namespace BrowsingContext { - export type NavigationFailed = { - method: 'browsingContext.navigationFailed'; - params: BrowsingContext.NavigationInfo; - }; +export type NavigationAborted = ({ +"method":("browsingContext.navigationAborted"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type UserPromptClosed = { - method: 'browsingContext.userPromptClosed'; - params: BrowsingContext.UserPromptClosedParameters; - }; +export type NavigationCommitted = ({ +"method":("browsingContext.navigationCommitted"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type UserPromptClosedParameters = { - context: BrowsingContext.BrowsingContext; - accepted: boolean; - type: BrowsingContext.UserPromptType; - userText?: string; - }; +export type NavigationFailed = ({ +"method":("browsingContext.navigationFailed"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type UserPromptOpened = { - method: 'browsingContext.userPromptOpened'; - params: BrowsingContext.UserPromptOpenedParameters; - }; +export type UserPromptClosed = ({ +"method":("browsingContext.userPromptClosed"),"params":(BrowsingContext.UserPromptClosedParameters)}); } export namespace BrowsingContext { - export type UserPromptOpenedParameters = { - context: BrowsingContext.BrowsingContext; - handler: Session.UserPromptHandlerType; - message: string; - type: BrowsingContext.UserPromptType; - defaultValue?: string; - }; +export type UserPromptClosedParameters = (({ +"context":(BrowsingContext.BrowsingContext),"accepted":(boolean),"type":(BrowsingContext.UserPromptType),"userText"?:(string)})); } -export type EmulationCommand = - | Emulation.SetForcedColorsModeThemeOverride - | Emulation.SetGeolocationOverride - | Emulation.SetLocaleOverride - | Emulation.SetScreenOrientationOverride - | Emulation.SetScriptingEnabled - | Emulation.SetTimezoneOverride - | Emulation.SetUserAgentOverride; +export namespace BrowsingContext { +export type UserPromptOpened = ({ +"method":("browsingContext.userPromptOpened"),"params":(BrowsingContext.UserPromptOpenedParameters)}); +} +export namespace BrowsingContext { +export type UserPromptOpenedParameters = (({ +"context":(BrowsingContext.BrowsingContext),"handler":(Session.UserPromptHandlerType),"message":(string),"type":(BrowsingContext.UserPromptType),"defaultValue"?:(string)})); +} +export type EmulationCommand = (Emulation.SetForcedColorsModeThemeOverride| Emulation.SetGeolocationOverride| Emulation.SetLocaleOverride| Emulation.SetScreenOrientationOverride| Emulation.SetScriptingEnabled| Emulation.SetTimezoneOverride| Emulation.SetUserAgentOverride); export namespace Emulation { - export type SetForcedColorsModeThemeOverride = { - method: 'emulation.setForcedColorsModeThemeOverride'; - params: Emulation.SetForcedColorsModeThemeOverrideParameters; - }; +export type SetForcedColorsModeThemeOverride = ({ +"method":("emulation.setForcedColorsModeThemeOverride"),"params":(Emulation.SetForcedColorsModeThemeOverrideParameters)}); } export namespace Emulation { - export type SetForcedColorsModeThemeOverrideParameters = { - theme: Emulation.ForcedColorsModeTheme | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetForcedColorsModeThemeOverrideParameters = (({ +"theme":(Emulation.ForcedColorsModeTheme| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export const enum ForcedColorsModeTheme { - Light = 'light', - Dark = 'dark', - } +export const enum ForcedColorsModeTheme {Light = "light", +Dark = "dark", +} } export namespace Emulation { - export type SetGeolocationOverride = { - method: 'emulation.setGeolocationOverride'; - params: Emulation.SetGeolocationOverrideParameters; - }; +export type SetGeolocationOverride = ({ +"method":("emulation.setGeolocationOverride"),"params":(Emulation.SetGeolocationOverrideParameters)}); } export namespace Emulation { - export type SetGeolocationOverrideParameters = ( - | { - coordinates: Emulation.GeolocationCoordinates | null; - } - | { - error: Emulation.GeolocationPositionError; - } - ) & { - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetGeolocationOverrideParameters = (((({ +"coordinates":(Emulation.GeolocationCoordinates| null)})| ({ +"error":(Emulation.GeolocationPositionError)}))&{ +"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type GeolocationCoordinates = { - /** - * Must be between `-90` and `90`, inclusive. - */ - latitude: number; - /** - * Must be between `-180` and `180`, inclusive. - */ - longitude: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - accuracy?: number; - /** - * @defaultValue `null` - */ - altitude?: number | null; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - altitudeAccuracy?: number | null; - /** - * Must be between `0` and `360`. - * - * @defaultValue `null` - */ - heading?: number | null; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - speed?: number | null; - }; +export type GeolocationCoordinates = (({ + +/** + * Must be between `-90` and `90`, inclusive. + */ +"latitude":(number), +/** + * Must be between `-180` and `180`, inclusive. + */ +"longitude":(number), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"accuracy"?:((number)), +/** + * @defaultValue `null` + */ +"altitude"?:(number| null), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ +"altitudeAccuracy"?:((number)| null), +/** + * Must be between `0` and `360`. + * + * @defaultValue `null` + */ +"heading"?:((number)| null), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ +"speed"?:((number)| null)})); } export namespace Emulation { - export type GeolocationPositionError = { - type: 'positionUnavailable'; - }; +export type GeolocationPositionError = (({ +"type":("positionUnavailable")})); } export namespace Emulation { - export type SetLocaleOverride = { - method: 'emulation.setLocaleOverride'; - params: Emulation.SetLocaleOverrideParameters; - }; +export type SetLocaleOverride = ({ +"method":("emulation.setLocaleOverride"),"params":(Emulation.SetLocaleOverrideParameters)}); } export namespace Emulation { - export type SetLocaleOverrideParameters = { - locale: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetLocaleOverrideParameters = (({ +"locale":(string| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetScreenOrientationOverride = { - method: 'emulation.setScreenOrientationOverride'; - params: Emulation.SetScreenOrientationOverrideParameters; - }; +export type SetScreenOrientationOverride = ({ +"method":("emulation.setScreenOrientationOverride"),"params":(Emulation.SetScreenOrientationOverrideParameters)}); } export namespace Emulation { - export const enum ScreenOrientationNatural { - Portrait = 'portrait', - Landscape = 'landscape', - } +export const enum ScreenOrientationNatural {Portrait = "portrait", +Landscape = "landscape", +} } export namespace Emulation { - export type ScreenOrientationType = - | 'portrait-primary' - | 'portrait-secondary' - | 'landscape-primary' - | 'landscape-secondary'; +export type ScreenOrientationType = ("portrait-primary"| "portrait-secondary"| "landscape-primary"| "landscape-secondary"); } export namespace Emulation { - export type ScreenOrientation = { - natural: Emulation.ScreenOrientationNatural; - type: Emulation.ScreenOrientationType; - }; +export type ScreenOrientation = (({ +"natural":(Emulation.ScreenOrientationNatural),"type":(Emulation.ScreenOrientationType)})); } export namespace Emulation { - export type SetScreenOrientationOverrideParameters = { - screenOrientation: Emulation.ScreenOrientation | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetScreenOrientationOverrideParameters = (({ +"screenOrientation":(Emulation.ScreenOrientation| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetUserAgentOverride = { - method: 'emulation.setUserAgentOverride'; - params: Emulation.SetUserAgentOverrideParameters; - }; +export type SetUserAgentOverride = ({ +"method":("emulation.setUserAgentOverride"),"params":(Emulation.SetUserAgentOverrideParameters)}); } export namespace Emulation { - export type SetUserAgentOverrideParameters = { - userAgent: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetUserAgentOverrideParameters = (({ +"userAgent":(string| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetScriptingEnabled = { - method: 'emulation.setScriptingEnabled'; - params: Emulation.SetScriptingEnabledParameters; - }; +export type SetScriptingEnabled = ({ +"method":("emulation.setScriptingEnabled"),"params":(Emulation.SetScriptingEnabledParameters)}); } export namespace Emulation { - export type SetScriptingEnabledParameters = { - enabled: false | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetScriptingEnabledParameters = (({ +"enabled":(false| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetTimezoneOverride = { - method: 'emulation.setTimezoneOverride'; - params: Emulation.SetTimezoneOverrideParameters; - }; +export type SetTimezoneOverride = ({ +"method":("emulation.setTimezoneOverride"),"params":(Emulation.SetTimezoneOverrideParameters)}); } export namespace Emulation { - export type SetTimezoneOverrideParameters = { - timezone: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; -} -export type NetworkCommand = - | Network.AddDataCollector - | Network.AddIntercept - | Network.ContinueRequest - | Network.ContinueResponse - | Network.ContinueWithAuth - | Network.DisownData - | Network.FailRequest - | Network.GetData - | Network.ProvideResponse - | Network.RemoveDataCollector - | Network.RemoveIntercept - | Network.SetCacheBehavior - | Network.SetExtraHeaders; -export type NetworkResult = Network.AddInterceptResult; -export type NetworkEvent = - | Network.AuthRequired - | Network.BeforeRequestSent - | Network.FetchError - | Network.ResponseCompleted - | Network.ResponseStarted; -export namespace Network { - export type AuthChallenge = { - scheme: string; - realm: string; - }; -} -export namespace Network { - export type AuthCredentials = { - type: 'password'; - username: string; - password: string; - }; -} -export namespace Network { - export type BaseParameters = { - context: BrowsingContext.BrowsingContext | null; - isBlocked: boolean; - navigation: BrowsingContext.Navigation | null; - redirectCount: JsUint; - request: Network.RequestData; - timestamp: JsUint; - intercepts?: [Network.Intercept, ...Network.Intercept[]]; - }; -} -export namespace Network { - export type BytesValue = Network.StringValue | Network.Base64Value; -} -export namespace Network { - export type StringValue = { - type: 'string'; - value: string; - }; -} -export namespace Network { - export type Base64Value = { - type: 'base64'; - value: string; - }; -} -export namespace Network { - export type Collector = string; -} -export namespace Network { - export const enum CollectorType { - Blob = 'blob', - } -} -export namespace Network { - export const enum SameSite { - Strict = 'strict', - Lax = 'lax', - None = 'none', - Default = 'default', - } -} -export namespace Network { - export type Cookie = { - name: string; - value: Network.BytesValue; - domain: string; - path: string; - size: JsUint; - httpOnly: boolean; - secure: boolean; - sameSite: Network.SameSite; - expiry?: JsUint; - } & Extensible; -} -export namespace Network { - export type CookieHeader = { - name: string; - value: Network.BytesValue; - }; -} -export namespace Network { - export const enum DataType { - Response = 'response', - } -} -export namespace Network { - export type FetchTimingInfo = { - timeOrigin: number; - requestTime: number; - redirectStart: number; - redirectEnd: number; - fetchStart: number; - dnsStart: number; - dnsEnd: number; - connectStart: number; - connectEnd: number; - tlsStart: number; - requestStart: number; - responseStart: number; - responseEnd: number; - }; +export type SetTimezoneOverrideParameters = (({ +"timezone":(string| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); +} +export type NetworkCommand = (Network.AddDataCollector| Network.AddIntercept| Network.ContinueRequest| Network.ContinueResponse| Network.ContinueWithAuth| Network.DisownData| Network.FailRequest| Network.GetData| Network.ProvideResponse| Network.RemoveDataCollector| Network.RemoveIntercept| Network.SetCacheBehavior| Network.SetExtraHeaders); +export type NetworkEvent = (Network.AuthRequired| Network.BeforeRequestSent| Network.FetchError| Network.ResponseCompleted| Network.ResponseStarted); +export type NetworkResult = ((Network.AddInterceptResult)); +export namespace Network { +export type AuthChallenge = (({ +"scheme":(string),"realm":(string)})); +} +export namespace Network { +export type AuthCredentials = (({ +"type":("password"),"username":(string),"password":(string)})); +} +export namespace Network { +export type BaseParameters = ({ +"context":(BrowsingContext.BrowsingContext| null),"isBlocked":(boolean),"navigation":(BrowsingContext.Navigation| null),"redirectCount":(JsUint),"request":(Network.RequestData),"timestamp":(JsUint),"intercepts"?:([ +(Network.Intercept),...(Network.Intercept)[]])}); +} +export namespace Network { +export type BytesValue = (Network.StringValue| Network.Base64Value); +} +export namespace Network { +export type StringValue = (({ +"type":("string"),"value":(string)})); +} +export namespace Network { +export type Base64Value = (({ +"type":("base64"),"value":(string)})); +} +export namespace Network { +export type Collector = (string); +} +export namespace Network { +export const enum CollectorType {Blob = "blob", +} +} +export namespace Network { +export const enum SameSite {Strict = "strict", +Lax = "lax", +None = "none", +Default = "default", +} +} +export namespace Network { +export type Cookie = (({ +"name":(string),"value":(Network.BytesValue),"domain":(string),"path":(string),"size":(JsUint),"httpOnly":(boolean),"secure":(boolean),"sameSite":(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); +} +export namespace Network { +export type CookieHeader = (({ +"name":(string),"value":(Network.BytesValue)})); +} +export namespace Network { +export const enum DataType {Response = "response", +} +} +export namespace Network { +export type FetchTimingInfo = (({ +"timeOrigin":(number),"requestTime":(number),"redirectStart":(number),"redirectEnd":(number),"fetchStart":(number),"dnsStart":(number),"dnsEnd":(number),"connectStart":(number),"connectEnd":(number),"tlsStart":(number),"requestStart":(number),"responseStart":(number),"responseEnd":(number)})); } export namespace Network { - export type Header = { - name: string; - value: Network.BytesValue; - }; +export type Header = (({ +"name":(string),"value":(Network.BytesValue)})); } export namespace Network { - export type Initiator = { - columnNumber?: JsUint; - lineNumber?: JsUint; - request?: Network.Request; - stackTrace?: Script.StackTrace; - type?: 'parser' | 'script' | 'preflight' | 'other'; - }; +export type Initiator = (({ +"columnNumber"?:(JsUint),"lineNumber"?:(JsUint),"request"?:(Network.Request),"stackTrace"?:(Script.StackTrace),"type"?:("parser"| "script"| "preflight"| "other")})); } export namespace Network { - export type Intercept = string; +export type Intercept = (string); } export namespace Network { - export type Request = string; +export type Request = (string); } export namespace Network { - export type RequestData = { - request: Network.Request; - url: string; - method: string; - headers: [...Network.Header[]]; - cookies: [...Network.Cookie[]]; - headersSize: JsUint; - bodySize: JsUint | null; - destination: string; - initiatorType: string | null; - timings: Network.FetchTimingInfo; - }; +export type RequestData = (({ +"request":(Network.Request),"url":(string),"method":(string),"headers":([ +...((Network.Header)[])]),"cookies":([ +...((Network.Cookie)[])]),"headersSize":(JsUint),"bodySize":(JsUint| null),"destination":(string),"initiatorType":(string| null),"timings":(Network.FetchTimingInfo)})); } export namespace Network { - export type ResponseContent = { - size: JsUint; - }; +export type ResponseContent = (({ +"size":(JsUint)})); } export namespace Network { - export type ResponseData = { - url: string; - protocol: string; - status: JsUint; - statusText: string; - fromCache: boolean; - headers: [...Network.Header[]]; - mimeType: string; - bytesReceived: JsUint; - headersSize: JsUint | null; - bodySize: JsUint | null; - content: Network.ResponseContent; - authChallenges?: [...Network.AuthChallenge[]]; - }; -} -export namespace Network { - export type SetCookieHeader = { - name: string; - value: Network.BytesValue; - domain?: string; - httpOnly?: boolean; - expiry?: string; - maxAge?: JsInt; - path?: string; - sameSite?: Network.SameSite; - secure?: boolean; - }; +export type ResponseData = (({ +"url":(string),"protocol":(string),"status":(JsUint),"statusText":(string),"fromCache":(boolean),"headers":([ +...((Network.Header)[])]),"mimeType":(string),"bytesReceived":(JsUint),"headersSize":(JsUint| null),"bodySize":(JsUint| null),"content":(Network.ResponseContent),"authChallenges"?:([ +...((Network.AuthChallenge)[])])})); } export namespace Network { - export type UrlPattern = Network.UrlPatternPattern | Network.UrlPatternString; +export type SetCookieHeader = (({ +"name":(string),"value":(Network.BytesValue),"domain"?:(string),"httpOnly"?:(boolean),"expiry"?:(string),"maxAge"?:(JsInt),"path"?:(string),"sameSite"?:(Network.SameSite),"secure"?:(boolean)})); } -export namespace Network { - export type UrlPatternPattern = { - type: 'pattern'; - protocol?: string; - hostname?: string; - port?: string; - pathname?: string; - search?: string; - }; +export namespace Network { +export type UrlPattern = ((Network.UrlPatternPattern| Network.UrlPatternString)); +} +export namespace Network { +export type UrlPatternPattern = (({ +"type":("pattern"),"protocol"?:(string),"hostname"?:(string),"port"?:(string),"pathname"?:(string),"search"?:(string)})); } export namespace Network { - export type UrlPatternString = { - type: 'string'; - pattern: string; - }; -} +export type UrlPatternString = (({ +"type":("string"),"pattern":(string)})); +} export namespace Network { - export type AddDataCollector = { - method: 'network.addDataCollector'; - params: Network.AddDataCollectorParameters; - }; +export type AddDataCollector = ({ +"method":("network.addDataCollector"),"params":(Network.AddDataCollectorParameters)}); } export namespace Network { - export type AddDataCollectorParameters = { - dataTypes: [Network.DataType, ...Network.DataType[]]; - maxEncodedDataSize: JsUint; - /** - * @defaultValue `"blob"` - */ - collectorType?: Network.CollectorType; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type AddDataCollectorParameters = (({ +"dataTypes":([ +(Network.DataType),...(Network.DataType)[]]),"maxEncodedDataSize":(JsUint), +/** + * @defaultValue `"blob"` + */ +"collectorType"?:(Network.CollectorType),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Network { - export type AddDataCollectorResult = { - collector: Network.Collector; - }; +export type AddDataCollectorResult = (({ +"collector":(Network.Collector)})); } export namespace Network { - export type AddIntercept = { - method: 'network.addIntercept'; - params: Network.AddInterceptParameters; - }; +export type AddInterceptParameters = (({ +"phases":([ +(Network.InterceptPhase),...(Network.InterceptPhase)[]]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"urlPatterns"?:([ +...((Network.UrlPattern)[])])})); } export namespace Network { - export type AddInterceptParameters = { - phases: [Network.InterceptPhase, ...Network.InterceptPhase[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - urlPatterns?: [...Network.UrlPattern[]]; - }; +export type AddIntercept = ({ +"method":("network.addIntercept"),"params":(Network.AddInterceptParameters)}); } export namespace Network { - export const enum InterceptPhase { - BeforeRequestSent = 'beforeRequestSent', - ResponseStarted = 'responseStarted', - AuthRequired = 'authRequired', - } +export const enum InterceptPhase {BeforeRequestSent = "beforeRequestSent", +ResponseStarted = "responseStarted", +AuthRequired = "authRequired", +} } export namespace Network { - export type AddInterceptResult = { - intercept: Network.Intercept; - }; +export type AddInterceptResult = (({ +"intercept":(Network.Intercept)})); } export namespace Network { - export type ContinueRequest = { - method: 'network.continueRequest'; - params: Network.ContinueRequestParameters; - }; +export type ContinueRequest = ({ +"method":("network.continueRequest"),"params":(Network.ContinueRequestParameters)}); } export namespace Network { - export type ContinueRequestParameters = { - request: Network.Request; - body?: Network.BytesValue; - cookies?: [...Network.CookieHeader[]]; - headers?: [...Network.Header[]]; - method?: string; - url?: string; - }; +export type ContinueRequestParameters = (({ +"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ +...((Network.CookieHeader)[])]),"headers"?:([ +...((Network.Header)[])]),"method"?:(string),"url"?:(string)})); } export namespace Network { - export type ContinueResponse = { - method: 'network.continueResponse'; - params: Network.ContinueResponseParameters; - }; +export type ContinueResponse = ({ +"method":("network.continueResponse"),"params":(Network.ContinueResponseParameters)}); } export namespace Network { - export type ContinueResponseParameters = { - request: Network.Request; - cookies?: [...Network.SetCookieHeader[]]; - credentials?: Network.AuthCredentials; - headers?: [...Network.Header[]]; - reasonPhrase?: string; - statusCode?: JsUint; - }; +export type ContinueResponseParameters = (({ +"request":(Network.Request),"cookies"?:([ +...((Network.SetCookieHeader)[])]),"credentials"?:(Network.AuthCredentials),"headers"?:([ +...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); } export namespace Network { - export type ContinueWithAuth = { - method: 'network.continueWithAuth'; - params: Network.ContinueWithAuthParameters; - }; +export type ContinueWithAuth = ({ +"method":("network.continueWithAuth"),"params":(Network.ContinueWithAuthParameters)}); } export namespace Network { - export type ContinueWithAuthParameters = { - request: Network.Request; - } & ( - | Network.ContinueWithAuthCredentials - | Network.ContinueWithAuthNoCredentials - ); +export type ContinueWithAuthParameters = (({ +"request":(Network.Request)}&(Network.ContinueWithAuthCredentials| Network.ContinueWithAuthNoCredentials))); } export namespace Network { - export type ContinueWithAuthCredentials = { - action: 'provideCredentials'; - credentials: Network.AuthCredentials; - }; +export type ContinueWithAuthCredentials = ({ +"action":("provideCredentials"),"credentials":(Network.AuthCredentials)}); } export namespace Network { - export type ContinueWithAuthNoCredentials = { - action: 'default' | 'cancel'; - }; +export type ContinueWithAuthNoCredentials = ({ +"action":("default"| "cancel")}); } export namespace Network { - export type DisownData = { - method: 'network.disownData'; - params: Network.DisownDataParameters; - }; +export type DisownData = ({ +"method":("network.disownData"),"params":(Network.DisownDataParameters)}); } export namespace Network { - export type DisownDataParameters = { - dataType: Network.DataType; - collector: Network.Collector; - request: Network.Request; - }; +export type DisownDataParameters = (({ +"dataType":(Network.DataType),"collector":(Network.Collector),"request":(Network.Request)})); } export namespace Network { - export type FailRequest = { - method: 'network.failRequest'; - params: Network.FailRequestParameters; - }; +export type FailRequest = ({ +"method":("network.failRequest"),"params":(Network.FailRequestParameters)}); } export namespace Network { - export type FailRequestParameters = { - request: Network.Request; - }; +export type FailRequestParameters = (({ +"request":(Network.Request)})); } export namespace Network { - export type GetData = { - method: 'network.getData'; - params: Network.GetDataParameters; - }; +export type GetData = ({ +"method":("network.getData"),"params":(Network.GetDataParameters)}); } export namespace Network { - export type GetDataParameters = { - dataType: Network.DataType; - collector?: Network.Collector; - /** - * @defaultValue `false` - */ - disown?: boolean; - request: Network.Request; - }; +export type GetDataParameters = (({ +"dataType":(Network.DataType),"collector"?:(Network.Collector), +/** + * @defaultValue `false` + */ +"disown"?:(boolean),"request":(Network.Request)})); } export namespace Network { - export type GetDataResult = { - bytes: Network.BytesValue; - }; +export type GetDataResult = (({ +"bytes":(Network.BytesValue)})); } export namespace Network { - export type ProvideResponse = { - method: 'network.provideResponse'; - params: Network.ProvideResponseParameters; - }; +export type ProvideResponse = ({ +"method":("network.provideResponse"),"params":(Network.ProvideResponseParameters)}); } export namespace Network { - export type ProvideResponseParameters = { - request: Network.Request; - body?: Network.BytesValue; - cookies?: [...Network.SetCookieHeader[]]; - headers?: [...Network.Header[]]; - reasonPhrase?: string; - statusCode?: JsUint; - }; +export type ProvideResponseParameters = (({ +"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ +...((Network.SetCookieHeader)[])]),"headers"?:([ +...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); } export namespace Network { - export type RemoveDataCollector = { - method: 'network.removeDataCollector'; - params: Network.RemoveDataCollectorParameters; - }; +export type RemoveDataCollector = ({ +"method":("network.removeDataCollector"),"params":(Network.RemoveDataCollectorParameters)}); } export namespace Network { - export type RemoveDataCollectorParameters = { - collector: Network.Collector; - }; +export type RemoveDataCollectorParameters = (({ +"collector":(Network.Collector)})); } export namespace Network { - export type RemoveIntercept = { - method: 'network.removeIntercept'; - params: Network.RemoveInterceptParameters; - }; +export type RemoveIntercept = ({ +"method":("network.removeIntercept"),"params":(Network.RemoveInterceptParameters)}); } export namespace Network { - export type RemoveInterceptParameters = { - intercept: Network.Intercept; - }; +export type RemoveInterceptParameters = (({ +"intercept":(Network.Intercept)})); } export namespace Network { - export type SetCacheBehavior = { - method: 'network.setCacheBehavior'; - params: Network.SetCacheBehaviorParameters; - }; +export type SetCacheBehavior = ({ +"method":("network.setCacheBehavior"),"params":(Network.SetCacheBehaviorParameters)}); } export namespace Network { - export type SetCacheBehaviorParameters = { - cacheBehavior: 'default' | 'bypass'; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - }; +export type SetCacheBehaviorParameters = (({ +"cacheBehavior":("default"| "bypass"),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); } export namespace Network { - export type SetExtraHeaders = { - method: 'network.setExtraHeaders'; - params: Network.SetExtraHeadersParameters; - }; +export type SetExtraHeaders = ({ +"method":("network.setExtraHeaders"),"params":(Network.SetExtraHeadersParameters)}); } export namespace Network { - export type SetExtraHeadersParameters = { - headers: [...Network.Header[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetExtraHeadersParameters = (({ +"headers":([ +...((Network.Header)[])]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } +export type ScriptEvent = (Script.Message| Script.RealmCreated| Script.RealmDestroyed); export namespace Network { - export type AuthRequired = { - method: 'network.authRequired'; - params: Network.AuthRequiredParameters; - }; +export type AuthRequiredParameters = ((Network.BaseParameters&{ +"response":(Network.ResponseData)})); } export namespace Network { - export type AuthRequiredParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; +export type BeforeRequestSentParameters = ((Network.BaseParameters&{ +"initiator"?:(Network.Initiator)})); } export namespace Network { - export type BeforeRequestSent = { - method: 'network.beforeRequestSent'; - params: Network.BeforeRequestSentParameters; - }; +export type FetchErrorParameters = ((Network.BaseParameters&{ +"errorText":(string)})); } export namespace Network { - export type BeforeRequestSentParameters = Network.BaseParameters & { - initiator?: Network.Initiator; - }; +export type ResponseCompletedParameters = ((Network.BaseParameters&{ +"response":(Network.ResponseData)})); } export namespace Network { - export type FetchError = { - method: 'network.fetchError'; - params: Network.FetchErrorParameters; - }; +export type ResponseStartedParameters = ((Network.BaseParameters&{ +"response":(Network.ResponseData)})); } +export type ScriptCommand = (Script.AddPreloadScript| Script.CallFunction| Script.Disown| Script.Evaluate| Script.GetRealms| Script.RemovePreloadScript); +export type ScriptResult = ((Script.AddPreloadScriptResult| Script.EvaluateResult| Script.GetRealmsResult)); export namespace Network { - export type FetchErrorParameters = Network.BaseParameters & { - errorText: string; - }; +export type AuthRequired = ({ +"method":("network.authRequired"),"params":(Network.AuthRequiredParameters)}); } export namespace Network { - export type ResponseCompleted = { - method: 'network.responseCompleted'; - params: Network.ResponseCompletedParameters; - }; +export type BeforeRequestSent = ({ +"method":("network.beforeRequestSent"),"params":(Network.BeforeRequestSentParameters)}); } export namespace Network { - export type ResponseCompletedParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; +export type FetchError = ({ +"method":("network.fetchError"),"params":(Network.FetchErrorParameters)}); } export namespace Network { - export type ResponseStarted = { - method: 'network.responseStarted'; - params: Network.ResponseStartedParameters; - }; +export type ResponseCompleted = ({ +"method":("network.responseCompleted"),"params":(Network.ResponseCompletedParameters)}); } export namespace Network { - export type ResponseStartedParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; +export type ResponseStarted = ({ +"method":("network.responseStarted"),"params":(Network.ResponseStartedParameters)}); } -export type ScriptCommand = - | Script.AddPreloadScript - | Script.CallFunction - | Script.Disown - | Script.Evaluate - | Script.GetRealms - | Script.RemovePreloadScript; -export type ScriptResult = - | Script.AddPreloadScriptResult - | Script.EvaluateResult - | Script.GetRealmsResult; -export type ScriptEvent = - | Script.Message - | Script.RealmCreated - | Script.RealmDestroyed; export namespace Script { - export type Channel = string; +export type Channel = (string); } export namespace Script { - export type ChannelValue = { - type: 'channel'; - value: Script.ChannelProperties; - }; +export type EvaluateResultSuccess = (({ +"type":("success"),"result":(Script.RemoteValue),"realm":(Script.Realm)})); } export namespace Script { - export type ChannelProperties = { - channel: Script.Channel; - serializationOptions?: Script.SerializationOptions; - ownership?: Script.ResultOwnership; - }; +export type ExceptionDetails = (({ +"columnNumber":(JsUint),"exception":(Script.RemoteValue),"lineNumber":(JsUint),"stackTrace":(Script.StackTrace),"text":(string)})); } export namespace Script { - export type EvaluateResult = - | Script.EvaluateResultSuccess - | Script.EvaluateResultException; +export type ChannelValue = (({ +"type":("channel"),"value":(Script.ChannelProperties)})); } export namespace Script { - export type EvaluateResultSuccess = { - type: 'success'; - result: Script.RemoteValue; - realm: Script.Realm; - }; +export type ChannelProperties = (({ +"channel":(Script.Channel),"serializationOptions"?:(Script.SerializationOptions),"ownership"?:(Script.ResultOwnership)})); } export namespace Script { - export type EvaluateResultException = { - type: 'exception'; - exceptionDetails: Script.ExceptionDetails; - realm: Script.Realm; - }; +export type EvaluateResult = ((Script.EvaluateResultSuccess| Script.EvaluateResultException)); } export namespace Script { - export type ExceptionDetails = { - columnNumber: JsUint; - exception: Script.RemoteValue; - lineNumber: JsUint; - stackTrace: Script.StackTrace; - text: string; - }; +export type EvaluateResultException = (({ +"type":("exception"),"exceptionDetails":(Script.ExceptionDetails),"realm":(Script.Realm)})); } export namespace Script { - export type Handle = string; +export type Handle = (string); } export namespace Script { - export type InternalId = string; +export type InternalId = (string); } export namespace Script { - export type LocalValue = - | Script.RemoteReference - | Script.PrimitiveProtocolValue - | Script.ChannelValue - | Script.ArrayLocalValue - | Script.DateLocalValue - | Script.MapLocalValue - | Script.ObjectLocalValue - | Script.RegExpLocalValue - | Script.SetLocalValue; +export type ListLocalValue = ([ +...((Script.LocalValue)[])]); } export namespace Script { - export type ListLocalValue = [...Script.LocalValue[]]; +export type LocalValue = ((Script.RemoteReference| Script.PrimitiveProtocolValue| Script.ChannelValue| Script.ArrayLocalValue| (Script.DateLocalValue)| Script.MapLocalValue| Script.ObjectLocalValue| (Script.RegExpLocalValue)| Script.SetLocalValue)); } export namespace Script { - export type ArrayLocalValue = { - type: 'array'; - value: Script.ListLocalValue; - }; +export type ArrayLocalValue = (({ +"type":("array"),"value":(Script.ListLocalValue)})); } export namespace Script { - export type DateLocalValue = { - type: 'date'; - value: string; - }; +export type DateLocalValue = ({ +"type":("date"),"value":(string)}); } export namespace Script { - export type MappingLocalValue = [ - ...[Script.LocalValue | string, Script.LocalValue][], - ]; +export type MappingLocalValue = ([ +...(([ +(Script.LocalValue| string),(Script.LocalValue)])[])]); } export namespace Script { - export type MapLocalValue = { - type: 'map'; - value: Script.MappingLocalValue; - }; +export type MapLocalValue = (({ +"type":("map"),"value":(Script.MappingLocalValue)})); } export namespace Script { - export type ObjectLocalValue = { - type: 'object'; - value: Script.MappingLocalValue; - }; +export type ObjectLocalValue = (({ +"type":("object"),"value":(Script.MappingLocalValue)})); } export namespace Script { - export type RegExpValue = { - pattern: string; - flags?: string; - }; +export type RegExpValue = (({ +"pattern":(string),"flags"?:(string)})); } export namespace Script { - export type RegExpLocalValue = { - type: 'regexp'; - value: Script.RegExpValue; - }; +export type RegExpLocalValue = ({ +"type":("regexp"),"value":(Script.RegExpValue)}); } export namespace Script { - export type SetLocalValue = { - type: 'set'; - value: Script.ListLocalValue; - }; +export type SetLocalValue = (({ +"type":("set"),"value":(Script.ListLocalValue)})); } export namespace Script { - export type PreloadScript = string; +export type PreloadScript = (string); } export namespace Script { - export type Realm = string; +export type Realm = (string); } export namespace Script { - export type PrimitiveProtocolValue = - | Script.UndefinedValue - | Script.NullValue - | Script.StringValue - | Script.NumberValue - | Script.BooleanValue - | Script.BigIntValue; +export type PrimitiveProtocolValue = ((Script.UndefinedValue| Script.NullValue| Script.StringValue| Script.NumberValue| Script.BooleanValue| Script.BigIntValue)); } export namespace Script { - export type UndefinedValue = { - type: 'undefined'; - }; +export type UndefinedValue = (({ +"type":("undefined")})); } export namespace Script { - export type NullValue = { - type: 'null'; - }; +export type NullValue = (({ +"type":("null")})); } export namespace Script { - export type StringValue = { - type: 'string'; - value: string; - }; +export type StringValue = (({ +"type":("string"),"value":(string)})); } export namespace Script { - export type SpecialNumber = 'NaN' | '-0' | 'Infinity' | '-Infinity'; +export type SpecialNumber = ("NaN"| "-0"| "Infinity"| "-Infinity"); } export namespace Script { - export type NumberValue = { - type: 'number'; - value: number | Script.SpecialNumber; - }; +export type NumberValue = (({ +"type":("number"),"value":(number| Script.SpecialNumber)})); } export namespace Script { - export type BooleanValue = { - type: 'boolean'; - value: boolean; - }; +export type BooleanValue = (({ +"type":("boolean"),"value":(boolean)})); } export namespace Script { - export type BigIntValue = { - type: 'bigint'; - value: string; - }; +export type BigIntValue = (({ +"type":("bigint"),"value":(string)})); } export namespace Script { - export type RealmInfo = - | Script.WindowRealmInfo - | Script.DedicatedWorkerRealmInfo - | Script.SharedWorkerRealmInfo - | Script.ServiceWorkerRealmInfo - | Script.WorkerRealmInfo - | Script.PaintWorkletRealmInfo - | Script.AudioWorkletRealmInfo - | Script.WorkletRealmInfo; +export type RealmInfo = ((Script.WindowRealmInfo| Script.DedicatedWorkerRealmInfo| Script.SharedWorkerRealmInfo| Script.ServiceWorkerRealmInfo| Script.WorkerRealmInfo| Script.PaintWorkletRealmInfo| Script.AudioWorkletRealmInfo| Script.WorkletRealmInfo)); } export namespace Script { - export type BaseRealmInfo = { - realm: Script.Realm; - origin: string; - }; +export type BaseRealmInfo = ({ +"realm":(Script.Realm),"origin":(string)}); } export namespace Script { - export type WindowRealmInfo = Script.BaseRealmInfo & { - type: 'window'; - context: BrowsingContext.BrowsingContext; - sandbox?: string; - }; +export type WindowRealmInfo = ((Script.BaseRealmInfo&{ +"type":("window"),"context":(BrowsingContext.BrowsingContext),"sandbox"?:(string)})); } export namespace Script { - export type DedicatedWorkerRealmInfo = Script.BaseRealmInfo & { - type: 'dedicated-worker'; - owners: [Script.Realm]; - }; +export type DedicatedWorkerRealmInfo = ((Script.BaseRealmInfo&{ +"type":("dedicated-worker"),"owners":([ +(Script.Realm)])})); } export namespace Script { - export type SharedWorkerRealmInfo = Script.BaseRealmInfo & { - type: 'shared-worker'; - }; +export type SharedWorkerRealmInfo = ((Script.BaseRealmInfo&{ +"type":("shared-worker")})); } export namespace Script { - export type ServiceWorkerRealmInfo = Script.BaseRealmInfo & { - type: 'service-worker'; - }; +export type ServiceWorkerRealmInfo = ((Script.BaseRealmInfo&{ +"type":("service-worker")})); } export namespace Script { - export type WorkerRealmInfo = Script.BaseRealmInfo & { - type: 'worker'; - }; +export type WorkerRealmInfo = ((Script.BaseRealmInfo&{ +"type":("worker")})); } export namespace Script { - export type PaintWorkletRealmInfo = Script.BaseRealmInfo & { - type: 'paint-worklet'; - }; +export type PaintWorkletRealmInfo = ((Script.BaseRealmInfo&{ +"type":("paint-worklet")})); } export namespace Script { - export type AudioWorkletRealmInfo = Script.BaseRealmInfo & { - type: 'audio-worklet'; - }; +export type AudioWorkletRealmInfo = ((Script.BaseRealmInfo&{ +"type":("audio-worklet")})); } export namespace Script { - export type WorkletRealmInfo = Script.BaseRealmInfo & { - type: 'worklet'; - }; +export type WorkletRealmInfo = ((Script.BaseRealmInfo&{ +"type":("worklet")})); } export namespace Script { - export type RealmType = - | 'window' - | 'dedicated-worker' - | 'shared-worker' - | 'service-worker' - | 'worker' - | 'paint-worklet' - | 'audio-worklet' - | 'worklet'; +export type RealmType = ("window"| "dedicated-worker"| "shared-worker"| "service-worker"| "worker"| "paint-worklet"| "audio-worklet"| "worklet"); } export namespace Script { - export type RemoteReference = - | Script.SharedReference - | Script.RemoteObjectReference; +export type ListRemoteValue = ([ +...((Script.RemoteValue)[])]); } export namespace Script { - export type SharedReference = { - sharedId: Script.SharedId; - handle?: Script.Handle; - } & Extensible; +export type MappingRemoteValue = ([ +...(([ +(Script.RemoteValue| string),(Script.RemoteValue)])[])]); } export namespace Script { - export type RemoteObjectReference = { - handle: Script.Handle; - sharedId?: Script.SharedId; - } & Extensible; +export type RemoteValue = ((Script.PrimitiveProtocolValue| Script.SymbolRemoteValue| Script.ArrayRemoteValue| Script.ObjectRemoteValue| Script.FunctionRemoteValue| Script.RegExpRemoteValue| Script.DateRemoteValue| Script.MapRemoteValue| Script.SetRemoteValue| Script.WeakMapRemoteValue| Script.WeakSetRemoteValue| Script.GeneratorRemoteValue| Script.ErrorRemoteValue| Script.ProxyRemoteValue| Script.PromiseRemoteValue| Script.TypedArrayRemoteValue| Script.ArrayBufferRemoteValue| Script.NodeListRemoteValue| Script.HtmlCollectionRemoteValue| Script.NodeRemoteValue| Script.WindowProxyRemoteValue)); } export namespace Script { - export type RemoteValue = - | Script.PrimitiveProtocolValue - | Script.SymbolRemoteValue - | Script.ArrayRemoteValue - | Script.ObjectRemoteValue - | Script.FunctionRemoteValue - | Script.RegExpRemoteValue - | Script.DateRemoteValue - | Script.MapRemoteValue - | Script.SetRemoteValue - | Script.WeakMapRemoteValue - | Script.WeakSetRemoteValue - | Script.GeneratorRemoteValue - | Script.ErrorRemoteValue - | Script.ProxyRemoteValue - | Script.PromiseRemoteValue - | Script.TypedArrayRemoteValue - | Script.ArrayBufferRemoteValue - | Script.NodeListRemoteValue - | Script.HtmlCollectionRemoteValue - | Script.NodeRemoteValue - | Script.WindowProxyRemoteValue; +export type RemoteReference = ((Script.SharedReference| Script.RemoteObjectReference)); } export namespace Script { - export type ListRemoteValue = [...Script.RemoteValue[]]; +export type SharedReference = (({ +"sharedId":(Script.SharedId),"handle"?:(Script.Handle)}&Extensible)); } export namespace Script { - export type MappingRemoteValue = [ - ...[Script.RemoteValue | string, Script.RemoteValue][], - ]; +export type RemoteObjectReference = (({ +"handle":(Script.Handle),"sharedId"?:(Script.SharedId)}&Extensible)); } export namespace Script { - export type SymbolRemoteValue = { - type: 'symbol'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type SymbolRemoteValue = (({ +"type":("symbol"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ArrayRemoteValue = { - type: 'array'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type ArrayRemoteValue = (({ +"type":("array"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type ObjectRemoteValue = { - type: 'object'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.MappingRemoteValue; - }; +export type ObjectRemoteValue = (({ +"type":("object"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); } export namespace Script { - export type FunctionRemoteValue = { - type: 'function'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type FunctionRemoteValue = (({ +"type":("function"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type RegExpRemoteValue = Script.RegExpLocalValue & { - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type RegExpRemoteValue = ((Script.RegExpLocalValue&{ +"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type DateRemoteValue = Script.DateLocalValue & { - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type DateRemoteValue = ((Script.DateLocalValue&{ +"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type MapRemoteValue = { - type: 'map'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.MappingRemoteValue; - }; +export type MapRemoteValue = (({ +"type":("map"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); } export namespace Script { - export type SetRemoteValue = { - type: 'set'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type SetRemoteValue = (({ +"type":("set"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type WeakMapRemoteValue = { - type: 'weakmap'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type WeakMapRemoteValue = (({ +"type":("weakmap"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type WeakSetRemoteValue = { - type: 'weakset'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type WeakSetRemoteValue = (({ +"type":("weakset"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type GeneratorRemoteValue = { - type: 'generator'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type GeneratorRemoteValue = (({ +"type":("generator"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ErrorRemoteValue = { - type: 'error'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type ErrorRemoteValue = (({ +"type":("error"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ProxyRemoteValue = { - type: 'proxy'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type ProxyRemoteValue = (({ +"type":("proxy"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type PromiseRemoteValue = { - type: 'promise'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type PromiseRemoteValue = (({ +"type":("promise"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type TypedArrayRemoteValue = { - type: 'typedarray'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type TypedArrayRemoteValue = (({ +"type":("typedarray"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ArrayBufferRemoteValue = { - type: 'arraybuffer'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type ArrayBufferRemoteValue = (({ +"type":("arraybuffer"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type NodeListRemoteValue = { - type: 'nodelist'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type NodeListRemoteValue = (({ +"type":("nodelist"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type HtmlCollectionRemoteValue = { - type: 'htmlcollection'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type HtmlCollectionRemoteValue = (({ +"type":("htmlcollection"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type NodeRemoteValue = { - type: 'node'; - sharedId?: Script.SharedId; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.NodeProperties; - }; +export type NodeRemoteValue = (({ +"type":("node"),"sharedId"?:(Script.SharedId),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.NodeProperties)})); } export namespace Script { - export type NodeProperties = { - nodeType: JsUint; - childNodeCount: JsUint; - attributes?: { - [key: string]: string; - }; - children?: [...Script.NodeRemoteValue[]]; - localName?: string; - mode?: 'open' | 'closed'; - namespaceURI?: string; - nodeValue?: string; - shadowRoot?: Script.NodeRemoteValue | null; - }; +export type NodeProperties = (({ +"nodeType":(JsUint),"childNodeCount":(JsUint),"attributes"?:(({ +[key: string]:(string)})),"children"?:([ +...((Script.NodeRemoteValue)[])]),"localName"?:(string),"mode"?:("open"| "closed"),"namespaceURI"?:(string),"nodeValue"?:(string),"shadowRoot"?:(Script.NodeRemoteValue| null)})); } export namespace Script { - export type WindowProxyRemoteValue = { - type: 'window'; - value: Script.WindowProxyProperties; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type WindowProxyRemoteValue = (({ +"type":("window"),"value":(Script.WindowProxyProperties),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type WindowProxyProperties = { - context: BrowsingContext.BrowsingContext; - }; +export type WindowProxyProperties = (({ +"context":(BrowsingContext.BrowsingContext)})); } export namespace Script { - export const enum ResultOwnership { - Root = 'root', - None = 'none', - } +export const enum ResultOwnership {Root = "root", +None = "none", +} } export namespace Script { - export type SerializationOptions = { - /** - * @defaultValue `0` - */ - maxDomDepth?: JsUint | null; - /** - * @defaultValue `null` - */ - maxObjectDepth?: JsUint | null; - /** - * @defaultValue `"none"` - */ - includeShadowTree?: 'none' | 'open' | 'all'; - }; +export type SerializationOptions = (({ + +/** + * @defaultValue `0` + */ +"maxDomDepth"?:((JsUint| null)), +/** + * @defaultValue `null` + */ +"maxObjectDepth"?:((JsUint| null)), +/** + * @defaultValue `"none"` + */ +"includeShadowTree"?:(("none"| "open"| "all"))})); } export namespace Script { - export type SharedId = string; +export type SharedId = (string); } export namespace Script { - export type StackFrame = { - columnNumber: JsUint; - functionName: string; - lineNumber: JsUint; - url: string; - }; +export type StackFrame = (({ +"columnNumber":(JsUint),"functionName":(string),"lineNumber":(JsUint),"url":(string)})); } export namespace Script { - export type StackTrace = { - callFrames: [...Script.StackFrame[]]; - }; +export type StackTrace = (({ +"callFrames":([ +...((Script.StackFrame)[])])})); } export namespace Script { - export type Source = { - realm: Script.Realm; - context?: BrowsingContext.BrowsingContext; - }; +export type Source = (({ +"realm":(Script.Realm),"context"?:(BrowsingContext.BrowsingContext)})); } export namespace Script { - export type RealmTarget = { - realm: Script.Realm; - }; +export type RealmTarget = (({ +"realm":(Script.Realm)})); } export namespace Script { - export type ContextTarget = { - context: BrowsingContext.BrowsingContext; - sandbox?: string; - }; +export type ContextTarget = (({ +"context":(BrowsingContext.BrowsingContext),"sandbox"?:(string)})); } export namespace Script { - export type Target = Script.ContextTarget | Script.RealmTarget; +export type Target = ((Script.ContextTarget| Script.RealmTarget)); } export namespace Script { - export type AddPreloadScript = { - method: 'script.addPreloadScript'; - params: Script.AddPreloadScriptParameters; - }; +export type AddPreloadScript = ({ +"method":("script.addPreloadScript"),"params":(Script.AddPreloadScriptParameters)}); } export namespace Script { - export type AddPreloadScriptParameters = { - functionDeclaration: string; - arguments?: [...Script.ChannelValue[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - sandbox?: string; - }; +export type AddPreloadScriptParameters = (({ +"functionDeclaration":(string),"arguments"?:([ +...((Script.ChannelValue)[])]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]]),"sandbox"?:(string)})); } export namespace Script { - export type AddPreloadScriptResult = { - script: Script.PreloadScript; - }; +export type AddPreloadScriptResult = (({ +"script":(Script.PreloadScript)})); } export namespace Script { - export type Disown = { - method: 'script.disown'; - params: Script.DisownParameters; - }; +export type Disown = ({ +"method":("script.disown"),"params":(Script.DisownParameters)}); } export namespace Script { - export type DisownParameters = { - handles: [...Script.Handle[]]; - target: Script.Target; - }; +export type DisownParameters = (({ +"handles":([ +...((Script.Handle)[])]),"target":(Script.Target)})); } export namespace Script { - export type CallFunction = { - method: 'script.callFunction'; - params: Script.CallFunctionParameters; - }; +export type CallFunctionParameters = (({ +"functionDeclaration":(string),"awaitPromise":(boolean),"target":(Script.Target),"arguments"?:([ +...((Script.LocalValue)[])]),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions),"this"?:(Script.LocalValue), +/** + * @defaultValue `false` + */ +"userActivation"?:(boolean)})); } export namespace Script { - export type CallFunctionParameters = { - functionDeclaration: string; - awaitPromise: boolean; - target: Script.Target; - arguments?: [...Script.LocalValue[]]; - resultOwnership?: Script.ResultOwnership; - serializationOptions?: Script.SerializationOptions; - this?: Script.LocalValue; - /** - * @defaultValue `false` - */ - userActivation?: boolean; - }; +export type CallFunction = ({ +"method":("script.callFunction"),"params":(Script.CallFunctionParameters)}); } export namespace Script { - export type Evaluate = { - method: 'script.evaluate'; - params: Script.EvaluateParameters; - }; +export type Evaluate = ({ +"method":("script.evaluate"),"params":(Script.EvaluateParameters)}); } export namespace Script { - export type EvaluateParameters = { - expression: string; - target: Script.Target; - awaitPromise: boolean; - resultOwnership?: Script.ResultOwnership; - serializationOptions?: Script.SerializationOptions; - /** - * @defaultValue `false` - */ - userActivation?: boolean; - }; +export type EvaluateParameters = (({ +"expression":(string),"target":(Script.Target),"awaitPromise":(boolean),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions), +/** + * @defaultValue `false` + */ +"userActivation"?:(boolean)})); } export namespace Script { - export type GetRealms = { - method: 'script.getRealms'; - params: Script.GetRealmsParameters; - }; +export type GetRealms = ({ +"method":("script.getRealms"),"params":(Script.GetRealmsParameters)}); } export namespace Script { - export type GetRealmsParameters = { - context?: BrowsingContext.BrowsingContext; - type?: Script.RealmType; - }; +export type GetRealmsParameters = (({ +"context"?:(BrowsingContext.BrowsingContext),"type"?:(Script.RealmType)})); } export namespace Script { - export type GetRealmsResult = { - realms: [...Script.RealmInfo[]]; - }; +export type GetRealmsResult = (({ +"realms":([ +...((Script.RealmInfo)[])])})); } export namespace Script { - export type RemovePreloadScript = { - method: 'script.removePreloadScript'; - params: Script.RemovePreloadScriptParameters; - }; +export type RemovePreloadScript = ({ +"method":("script.removePreloadScript"),"params":(Script.RemovePreloadScriptParameters)}); } export namespace Script { - export type RemovePreloadScriptParameters = { - script: Script.PreloadScript; - }; +export type RemovePreloadScriptParameters = (({ +"script":(Script.PreloadScript)})); } export namespace Script { - export type Message = { - method: 'script.message'; - params: Script.MessageParameters; - }; +export type MessageParameters = (({ +"channel":(Script.Channel),"data":(Script.RemoteValue),"source":(Script.Source)})); } export namespace Script { - export type MessageParameters = { - channel: Script.Channel; - data: Script.RemoteValue; - source: Script.Source; - }; +export type RealmCreated = ({ +"method":("script.realmCreated"),"params":(Script.RealmInfo)}); } export namespace Script { - export type RealmCreated = { - method: 'script.realmCreated'; - params: Script.RealmInfo; - }; +export type Message = ({ +"method":("script.message"),"params":(Script.MessageParameters)}); } export namespace Script { - export type RealmDestroyed = { - method: 'script.realmDestroyed'; - params: Script.RealmDestroyedParameters; - }; +export type RealmDestroyed = ({ +"method":("script.realmDestroyed"),"params":(Script.RealmDestroyedParameters)}); } export namespace Script { - export type RealmDestroyedParameters = { - realm: Script.Realm; - }; +export type RealmDestroyedParameters = (({ +"realm":(Script.Realm)})); } -export type StorageCommand = - | Storage.DeleteCookies - | Storage.GetCookies - | Storage.SetCookie; -export type StorageResult = - | Storage.DeleteCookiesResult - | Storage.GetCookiesResult - | Storage.SetCookieResult; +export type StorageCommand = (Storage.DeleteCookies| Storage.GetCookies| Storage.SetCookie); +export type StorageResult = ((Storage.DeleteCookiesResult| Storage.GetCookiesResult| Storage.SetCookieResult)); export namespace Storage { - export type PartitionKey = { - userContext?: string; - sourceOrigin?: string; - } & Extensible; +export type PartitionKey = (({ +"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); } export namespace Storage { - export type GetCookies = { - method: 'storage.getCookies'; - params: Storage.GetCookiesParameters; - }; +export type GetCookies = ({ +"method":("storage.getCookies"),"params":(Storage.GetCookiesParameters)}); } export namespace Storage { - export type CookieFilter = { - name?: string; - value?: Network.BytesValue; - domain?: string; - path?: string; - size?: JsUint; - httpOnly?: boolean; - secure?: boolean; - sameSite?: Network.SameSite; - expiry?: JsUint; - } & Extensible; +export type CookieFilter = (({ +"name"?:(string),"value"?:(Network.BytesValue),"domain"?:(string),"path"?:(string),"size"?:(JsUint),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); } export namespace Storage { - export type BrowsingContextPartitionDescriptor = { - type: 'context'; - context: BrowsingContext.BrowsingContext; - }; +export type BrowsingContextPartitionDescriptor = (({ +"type":("context"),"context":(BrowsingContext.BrowsingContext)})); } export namespace Storage { - export type StorageKeyPartitionDescriptor = { - type: 'storageKey'; - userContext?: string; - sourceOrigin?: string; - } & Extensible; +export type StorageKeyPartitionDescriptor = (({ +"type":("storageKey"),"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); } export namespace Storage { - export type PartitionDescriptor = - | Storage.BrowsingContextPartitionDescriptor - | Storage.StorageKeyPartitionDescriptor; +export type PartitionDescriptor = ((Storage.BrowsingContextPartitionDescriptor| Storage.StorageKeyPartitionDescriptor)); } export namespace Storage { - export type GetCookiesParameters = { - filter?: Storage.CookieFilter; - partition?: Storage.PartitionDescriptor; - }; +export type GetCookiesParameters = (({ +"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); } export namespace Storage { - export type GetCookiesResult = { - cookies: [...Network.Cookie[]]; - partitionKey: Storage.PartitionKey; - }; +export type GetCookiesResult = (({ +"cookies":([ +...((Network.Cookie)[])]),"partitionKey":(Storage.PartitionKey)})); } export namespace Storage { - export type SetCookie = { - method: 'storage.setCookie'; - params: Storage.SetCookieParameters; - }; +export type SetCookie = ({ +"method":("storage.setCookie"),"params":(Storage.SetCookieParameters)}); } export namespace Storage { - export type PartialCookie = { - name: string; - value: Network.BytesValue; - domain: string; - path?: string; - httpOnly?: boolean; - secure?: boolean; - sameSite?: Network.SameSite; - expiry?: JsUint; - } & Extensible; +export type PartialCookie = (({ +"name":(string),"value":(Network.BytesValue),"domain":(string),"path"?:(string),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); } export namespace Storage { - export type SetCookieParameters = { - cookie: Storage.PartialCookie; - partition?: Storage.PartitionDescriptor; - }; +export type SetCookieParameters = (({ +"cookie":(Storage.PartialCookie),"partition"?:(Storage.PartitionDescriptor)})); } export namespace Storage { - export type SetCookieResult = { - partitionKey: Storage.PartitionKey; - }; +export type SetCookieResult = (({ +"partitionKey":(Storage.PartitionKey)})); } export namespace Storage { - export type DeleteCookies = { - method: 'storage.deleteCookies'; - params: Storage.DeleteCookiesParameters; - }; +export type DeleteCookies = ({ +"method":("storage.deleteCookies"),"params":(Storage.DeleteCookiesParameters)}); } export namespace Storage { - export type DeleteCookiesParameters = { - filter?: Storage.CookieFilter; - partition?: Storage.PartitionDescriptor; - }; +export type DeleteCookiesParameters = (({ +"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); } export namespace Storage { - export type DeleteCookiesResult = { - partitionKey: Storage.PartitionKey; - }; +export type DeleteCookiesResult = (({ +"partitionKey":(Storage.PartitionKey)})); } -export type LogEvent = Log.EntryAdded; +export type LogEvent = (Log.EntryAdded); export namespace Log { - export const enum Level { - Debug = 'debug', - Info = 'info', - Warn = 'warn', - Error = 'error', - } +export const enum Level {Debug = "debug", +Info = "info", +Warn = "warn", +Error = "error", +} } export namespace Log { - export type Entry = - | Log.GenericLogEntry - | Log.ConsoleLogEntry - | Log.JavascriptLogEntry; +export type Entry = ((Log.GenericLogEntry| Log.ConsoleLogEntry| Log.JavascriptLogEntry)); } export namespace Log { - export type BaseLogEntry = { - level: Log.Level; - source: Script.Source; - text: string | null; - timestamp: JsUint; - stackTrace?: Script.StackTrace; - }; +export type BaseLogEntry = ({ +"level":(Log.Level),"source":(Script.Source),"text":(string| null),"timestamp":(JsUint),"stackTrace"?:(Script.StackTrace)}); } export namespace Log { - export type GenericLogEntry = Log.BaseLogEntry & { - type: string; - }; +export type GenericLogEntry = ((Log.BaseLogEntry&{ +"type":(string)})); } export namespace Log { - export type ConsoleLogEntry = Log.BaseLogEntry & { - type: 'console'; - method: string; - args: [...Script.RemoteValue[]]; - }; +export type ConsoleLogEntry = ((Log.BaseLogEntry&{ +"type":("console"),"method":(string),"args":([ +...((Script.RemoteValue)[])])})); } export namespace Log { - export type JavascriptLogEntry = Log.BaseLogEntry & { - type: 'javascript'; - }; +export type JavascriptLogEntry = ((Log.BaseLogEntry&{ +"type":("javascript")})); } export namespace Log { - export type EntryAdded = { - method: 'log.entryAdded'; - params: Log.Entry; - }; -} -export type InputCommand = - | Input.PerformActions - | Input.ReleaseActions - | Input.SetFiles; -export type InputEvent = Input.FileDialogOpened; +export type EntryAdded = ({ +"method":("log.entryAdded"),"params":(Log.Entry)}); +} +export type InputCommand = (Input.PerformActions| Input.ReleaseActions| Input.SetFiles); +export type InputEvent = (Input.FileDialogOpened); export namespace Input { - export type ElementOrigin = { - type: 'element'; - element: Script.SharedReference; - }; +export type ElementOrigin = (({ +"type":("element"),"element":(Script.SharedReference)})); } export namespace Input { - export type PerformActions = { - method: 'input.performActions'; - params: Input.PerformActionsParameters; - }; +export type PerformActionsParameters = (({ +"context":(BrowsingContext.BrowsingContext),"actions":([ +...((Input.SourceActions)[])])})); } export namespace Input { - export type PerformActionsParameters = { - context: BrowsingContext.BrowsingContext; - actions: [...Input.SourceActions[]]; - }; +export type NoneSourceActions = (({ +"type":("none"),"id":(string),"actions":([ +...((Input.NoneSourceAction)[])])})); } export namespace Input { - export type SourceActions = - | Input.NoneSourceActions - | Input.KeySourceActions - | Input.PointerSourceActions - | Input.WheelSourceActions; +export type KeySourceActions = (({ +"type":("key"),"id":(string),"actions":([ +...((Input.KeySourceAction)[])])})); } export namespace Input { - export type NoneSourceActions = { - type: 'none'; - id: string; - actions: [...Input.NoneSourceAction[]]; - }; +export type PointerSourceActions = (({ +"type":("pointer"),"id":(string),"parameters"?:(Input.PointerParameters),"actions":([ +...((Input.PointerSourceAction)[])])})); } export namespace Input { - export type NoneSourceAction = Input.PauseAction; +export type PerformActions = ({ +"method":("input.performActions"),"params":(Input.PerformActionsParameters)}); } export namespace Input { - export type KeySourceActions = { - type: 'key'; - id: string; - actions: [...Input.KeySourceAction[]]; - }; +export type SourceActions = ((Input.NoneSourceActions| Input.KeySourceActions| Input.PointerSourceActions| Input.WheelSourceActions)); } export namespace Input { - export type KeySourceAction = - | Input.PauseAction - | Input.KeyDownAction - | Input.KeyUpAction; +export type NoneSourceAction = (Input.PauseAction); } export namespace Input { - export type PointerSourceActions = { - type: 'pointer'; - id: string; - parameters?: Input.PointerParameters; - actions: [...Input.PointerSourceAction[]]; - }; +export type KeySourceAction = ((Input.PauseAction| Input.KeyDownAction| Input.KeyUpAction)); } export namespace Input { - export const enum PointerType { - Mouse = 'mouse', - Pen = 'pen', - Touch = 'touch', - } +export const enum PointerType {Mouse = "mouse", +Pen = "pen", +Touch = "touch", +} } export namespace Input { - export type PointerParameters = { - /** - * @defaultValue `"mouse"` - */ - pointerType?: Input.PointerType; - }; +export type PointerParameters = (({ + +/** + * @defaultValue `"mouse"` + */ +"pointerType"?:(Input.PointerType)})); } export namespace Input { - export type PointerSourceAction = - | Input.PauseAction - | Input.PointerDownAction - | Input.PointerUpAction - | Input.PointerMoveAction; +export type WheelSourceActions = (({ +"type":("wheel"),"id":(string),"actions":([ +...((Input.WheelSourceAction)[])])})); } export namespace Input { - export type WheelSourceActions = { - type: 'wheel'; - id: string; - actions: [...Input.WheelSourceAction[]]; - }; +export type PointerSourceAction = ((Input.PauseAction| Input.PointerDownAction| Input.PointerUpAction| Input.PointerMoveAction)); } export namespace Input { - export type WheelSourceAction = Input.PauseAction | Input.WheelScrollAction; +export type WheelSourceAction = ((Input.PauseAction| Input.WheelScrollAction)); } export namespace Input { - export type PauseAction = { - type: 'pause'; - duration?: JsUint; - }; +export type PauseAction = (({ +"type":("pause"),"duration"?:(JsUint)})); } export namespace Input { - export type KeyDownAction = { - type: 'keyDown'; - value: string; - }; +export type KeyDownAction = (({ +"type":("keyDown"),"value":(string)})); } export namespace Input { - export type KeyUpAction = { - type: 'keyUp'; - value: string; - }; +export type KeyUpAction = (({ +"type":("keyUp"),"value":(string)})); } export namespace Input { - export type PointerUpAction = { - type: 'pointerUp'; - button: JsUint; - }; +export type PointerUpAction = (({ +"type":("pointerUp"),"button":(JsUint)})); } export namespace Input { - export type PointerDownAction = { - type: 'pointerDown'; - button: JsUint; - } & Input.PointerCommonProperties; +export type PointerDownAction = (({ +"type":("pointerDown"),"button":(JsUint)}&Input.PointerCommonProperties)); } export namespace Input { - export type PointerMoveAction = { - type: 'pointerMove'; - x: number; - y: number; - duration?: JsUint; - origin?: Input.Origin; - } & Input.PointerCommonProperties; +export type PointerMoveAction = (({ +"type":("pointerMove"),"x":(number),"y":(number),"duration"?:(JsUint),"origin"?:(Input.Origin)}&Input.PointerCommonProperties)); } export namespace Input { - export type WheelScrollAction = { - type: 'scroll'; - x: JsInt; - y: JsInt; - deltaX: JsInt; - deltaY: JsInt; - duration?: JsUint; - /** - * @defaultValue `"viewport"` - */ - origin?: Input.Origin; - }; +export type WheelScrollAction = (({ +"type":("scroll"),"x":(JsInt),"y":(JsInt),"deltaX":(JsInt),"deltaY":(JsInt),"duration"?:(JsUint), +/** + * @defaultValue `"viewport"` + */ +"origin"?:(Input.Origin)})); } export namespace Input { - export type PointerCommonProperties = { - /** - * @defaultValue `1` - */ - width?: JsUint; - /** - * @defaultValue `1` - */ - height?: JsUint; - /** - * @defaultValue `0` - */ - pressure?: number; - /** - * @defaultValue `0` - */ - tangentialPressure?: number; - /** - * Must be between `0` and `359`, inclusive. - * - * @defaultValue `0` - */ - twist?: number; - /** - * Must be between `0` and `1.5707963267948966`, inclusive. - * - * @defaultValue `0` - */ - altitudeAngle?: number; - /** - * Must be between `0` and `6.283185307179586`, inclusive. - * - * @defaultValue `0` - */ - azimuthAngle?: number; - }; +export type PointerCommonProperties = ({ + +/** + * @defaultValue `1` + */ +"width"?:(JsUint), +/** + * @defaultValue `1` + */ +"height"?:(JsUint), +/** + * @defaultValue `0` + */ +"pressure"?:(number), +/** + * @defaultValue `0` + */ +"tangentialPressure"?:(number), +/** + * Must be between `0` and `359`, inclusive. + * + * @defaultValue `0` + */ +"twist"?:((number)), +/** + * Must be between `0` and `1.5707963267948966`, inclusive. + * + * @defaultValue `0` + */ +"altitudeAngle"?:((number)), +/** + * Must be between `0` and `6.283185307179586`, inclusive. + * + * @defaultValue `0` + */ +"azimuthAngle"?:((number))}); } export namespace Input { - export type Origin = 'viewport' | 'pointer' | Input.ElementOrigin; +export type Origin = ("viewport"| "pointer"| Input.ElementOrigin); } export namespace Input { - export type ReleaseActions = { - method: 'input.releaseActions'; - params: Input.ReleaseActionsParameters; - }; +export type ReleaseActions = ({ +"method":("input.releaseActions"),"params":(Input.ReleaseActionsParameters)}); } export namespace Input { - export type ReleaseActionsParameters = { - context: BrowsingContext.BrowsingContext; - }; +export type ReleaseActionsParameters = (({ +"context":(BrowsingContext.BrowsingContext)})); } export namespace Input { - export type SetFiles = { - method: 'input.setFiles'; - params: Input.SetFilesParameters; - }; +export type SetFiles = ({ +"method":("input.setFiles"),"params":(Input.SetFilesParameters)}); } export namespace Input { - export type SetFilesParameters = { - context: BrowsingContext.BrowsingContext; - element: Script.SharedReference; - files: [...string[]]; - }; +export type SetFilesParameters = (({ +"context":(BrowsingContext.BrowsingContext),"element":(Script.SharedReference),"files":([ +...((string)[])])})); } export namespace Input { - export type FileDialogOpened = { - method: 'input.fileDialogOpened'; - params: Input.FileDialogInfo; - }; +export type FileDialogOpened = ({ +"method":("input.fileDialogOpened"),"params":(Input.FileDialogInfo)}); } export namespace Input { - export type FileDialogInfo = { - context: BrowsingContext.BrowsingContext; - element?: Script.SharedReference; - multiple: boolean; - }; -} -export type WebExtensionCommand = WebExtension.Install | WebExtension.Uninstall; -export type WebExtensionResult = WebExtension.InstallResult; +export type FileDialogInfo = (({ +"context":(BrowsingContext.BrowsingContext),"element"?:(Script.SharedReference),"multiple":(boolean)})); +} +export type WebExtensionCommand = (WebExtension.Install| WebExtension.Uninstall); +export type WebExtensionResult = ((WebExtension.InstallResult)); export namespace WebExtension { - export type Extension = string; +export type Extension = (string); } export namespace WebExtension { - export type Install = { - method: 'webExtension.install'; - params: WebExtension.InstallParameters; - }; +export type InstallParameters = (({ +"extensionData":(WebExtension.ExtensionData)})); } export namespace WebExtension { - export type InstallParameters = { - extensionData: WebExtension.ExtensionData; - }; +export type Install = ({ +"method":("webExtension.install"),"params":(WebExtension.InstallParameters)}); } export namespace WebExtension { - export type ExtensionData = - | WebExtension.ExtensionArchivePath - | WebExtension.ExtensionBase64Encoded - | WebExtension.ExtensionPath; +export type ExtensionData = ((WebExtension.ExtensionArchivePath| WebExtension.ExtensionBase64Encoded| WebExtension.ExtensionPath)); } export namespace WebExtension { - export type ExtensionPath = { - type: 'path'; - path: string; - }; +export type ExtensionPath = (({ +"type":("path"),"path":(string)})); } export namespace WebExtension { - export type ExtensionArchivePath = { - type: 'archivePath'; - path: string; - }; +export type ExtensionArchivePath = (({ +"type":("archivePath"),"path":(string)})); } export namespace WebExtension { - export type ExtensionBase64Encoded = { - type: 'base64'; - value: string; - }; +export type ExtensionBase64Encoded = (({ +"type":("base64"),"value":(string)})); } export namespace WebExtension { - export type InstallResult = { - extension: WebExtension.Extension; - }; +export type InstallResult = (({ +"extension":(WebExtension.Extension)})); } export namespace WebExtension { - export type Uninstall = { - method: 'webExtension.uninstall'; - params: WebExtension.UninstallParameters; - }; +export type Uninstall = ({ +"method":("webExtension.uninstall"),"params":(WebExtension.UninstallParameters)}); } export namespace WebExtension { - export type UninstallParameters = { - extension: WebExtension.Extension; - }; +export type UninstallParameters = (({ +"extension":(WebExtension.Extension)})); } diff --git a/src/gen/mapping.ts b/src/gen/mapping.ts new file mode 100644 index 0000000..45c64ff --- /dev/null +++ b/src/gen/mapping.ts @@ -0,0 +1,432 @@ +/* eslint-disable */ +/** + * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts + * Do not edit this file manually. + */ + +import type * as Bidi from "./main.ts"; +import type * as BidiPermissions from "./permissions.ts"; +import type * as BidiBluetooth from "./web-bluetooth.ts"; + +export interface CommandMapping { + "bluetooth.disableSimulation": + { + params: BidiBluetooth.Bluetooth.DisableSimulationParameters; + returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters; + } + ; + "bluetooth.handleRequestDevicePrompt": + { + params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + } + ; + "bluetooth.simulateAdapter": + { + params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + } + ; + "bluetooth.simulateAdvertisement": + { + params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + } + ; + "bluetooth.simulateCharacteristic": + { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + } + ; + "bluetooth.simulateCharacteristicResponse": + { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + } + ; + "bluetooth.simulateDescriptor": + { + params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + } + ; + "bluetooth.simulateDescriptorResponse": + { + params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + } + ; + "bluetooth.simulateGattConnectionResponse": + { + params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + } + ; + "bluetooth.simulateGattDisconnection": + { + params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + } + ; + "bluetooth.simulatePreconnectedPeripheral": + { + params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + } + ; + "bluetooth.simulateService": + { + params: BidiBluetooth.Bluetooth.SimulateServiceParameters; + returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters; + } + ; + "browser.close": + { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + } + ; + "browser.createUserContext": + { + params: Bidi.Browser.CreateUserContextParameters; + returnType: Bidi.Browser.CreateUserContextParameters; + } + ; + "browser.getClientWindows": + { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + } + ; + "browser.getUserContexts": + { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + } + ; + "browser.removeUserContext": + { + params: Bidi.Browser.RemoveUserContextParameters; + returnType: Bidi.Browser.RemoveUserContextParameters; + } + ; + "browser.setClientWindowState": + { + params: Bidi.Browser.SetClientWindowStateParameters; + returnType: Bidi.Browser.SetClientWindowStateParameters; + } + ; + "browsingContext.activate": + { + params: Bidi.BrowsingContext.ActivateParameters; + returnType: Bidi.BrowsingContext.ActivateParameters; + } + ; + "browsingContext.captureScreenshot": + { + params: Bidi.BrowsingContext.CaptureScreenshotParameters; + returnType: Bidi.BrowsingContext.CaptureScreenshotParameters; + } + ; + "browsingContext.close": + { + params: Bidi.BrowsingContext.CloseParameters; + returnType: Bidi.BrowsingContext.CloseParameters; + } + ; + "browsingContext.create": + { + params: Bidi.BrowsingContext.CreateParameters; + returnType: Bidi.BrowsingContext.CreateParameters; + } + ; + "browsingContext.getTree": + { + params: Bidi.BrowsingContext.GetTreeParameters; + returnType: Bidi.BrowsingContext.GetTreeParameters; + } + ; + "browsingContext.handleUserPrompt": + { + params: Bidi.BrowsingContext.HandleUserPromptParameters; + returnType: Bidi.BrowsingContext.HandleUserPromptParameters; + } + ; + "browsingContext.locateNodes": + { + params: Bidi.BrowsingContext.LocateNodesParameters; + returnType: Bidi.BrowsingContext.LocateNodesParameters; + } + ; + "browsingContext.navigate": + { + params: Bidi.BrowsingContext.NavigateParameters; + returnType: Bidi.BrowsingContext.NavigateParameters; + } + ; + "browsingContext.print": + { + params: Bidi.BrowsingContext.PrintParameters; + returnType: Bidi.BrowsingContext.PrintParameters; + } + ; + "browsingContext.reload": + { + params: Bidi.BrowsingContext.ReloadParameters; + returnType: Bidi.BrowsingContext.ReloadParameters; + } + ; + "browsingContext.setViewport": + { + params: Bidi.BrowsingContext.SetViewportParameters; + returnType: Bidi.BrowsingContext.SetViewportParameters; + } + ; + "browsingContext.traverseHistory": + { + params: Bidi.BrowsingContext.TraverseHistoryParameters; + returnType: Bidi.BrowsingContext.TraverseHistoryParameters; + } + ; + "emulation.setForcedColorsModeThemeOverride": + { + params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + } + ; + "emulation.setGeolocationOverride": + { + params: Bidi.Emulation.SetGeolocationOverrideParameters; + returnType: Bidi.Emulation.SetGeolocationOverrideParameters; + } + ; + "emulation.setLocaleOverride": + { + params: Bidi.Emulation.SetLocaleOverrideParameters; + returnType: Bidi.Emulation.SetLocaleOverrideParameters; + } + ; + "emulation.setScreenOrientationOverride": + { + params: Bidi.Emulation.SetScreenOrientationOverrideParameters; + returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters; + } + ; + "emulation.setScriptingEnabled": + { + params: Bidi.Emulation.SetScriptingEnabledParameters; + returnType: Bidi.Emulation.SetScriptingEnabledParameters; + } + ; + "emulation.setTimezoneOverride": + { + params: Bidi.Emulation.SetTimezoneOverrideParameters; + returnType: Bidi.Emulation.SetTimezoneOverrideParameters; + } + ; + "emulation.setUserAgentOverride": + { + params: Bidi.Emulation.SetUserAgentOverrideParameters; + returnType: Bidi.Emulation.SetUserAgentOverrideParameters; + } + ; + "input.performActions": + { + params: Bidi.Input.PerformActionsParameters; + returnType: Bidi.Input.PerformActionsParameters; + } + ; + "input.releaseActions": + { + params: Bidi.Input.ReleaseActionsParameters; + returnType: Bidi.Input.ReleaseActionsParameters; + } + ; + "input.setFiles": + { + params: Bidi.Input.SetFilesParameters; + returnType: Bidi.Input.SetFilesParameters; + } + ; + "network.addDataCollector": + { + params: Bidi.Network.AddDataCollectorParameters; + returnType: Bidi.Network.AddDataCollectorParameters; + } + ; + "network.addIntercept": + { + params: Bidi.Network.AddInterceptParameters; + returnType: Bidi.Network.AddInterceptParameters; + } + ; + "network.continueRequest": + { + params: Bidi.Network.ContinueRequestParameters; + returnType: Bidi.Network.ContinueRequestParameters; + } + ; + "network.continueResponse": + { + params: Bidi.Network.ContinueResponseParameters; + returnType: Bidi.Network.ContinueResponseParameters; + } + ; + "network.continueWithAuth": + { + params: Bidi.Network.ContinueWithAuthParameters; + returnType: Bidi.Network.ContinueWithAuthParameters; + } + ; + "network.disownData": + { + params: Bidi.Network.DisownDataParameters; + returnType: Bidi.Network.DisownDataParameters; + } + ; + "network.failRequest": + { + params: Bidi.Network.FailRequestParameters; + returnType: Bidi.Network.FailRequestParameters; + } + ; + "network.getData": + { + params: Bidi.Network.GetDataParameters; + returnType: Bidi.Network.GetDataParameters; + } + ; + "network.provideResponse": + { + params: Bidi.Network.ProvideResponseParameters; + returnType: Bidi.Network.ProvideResponseParameters; + } + ; + "network.removeDataCollector": + { + params: Bidi.Network.RemoveDataCollectorParameters; + returnType: Bidi.Network.RemoveDataCollectorParameters; + } + ; + "network.removeIntercept": + { + params: Bidi.Network.RemoveInterceptParameters; + returnType: Bidi.Network.RemoveInterceptParameters; + } + ; + "network.setCacheBehavior": + { + params: Bidi.Network.SetCacheBehaviorParameters; + returnType: Bidi.Network.SetCacheBehaviorParameters; + } + ; + "network.setExtraHeaders": + { + params: Bidi.Network.SetExtraHeadersParameters; + returnType: Bidi.Network.SetExtraHeadersParameters; + } + ; + "permissions.setPermission": + { + params: BidiPermissions.Permissions.SetPermissionParameters; + returnType: BidiPermissions.Permissions.SetPermissionParameters; + } + ; + "script.addPreloadScript": + { + params: Bidi.Script.AddPreloadScriptParameters; + returnType: Bidi.Script.AddPreloadScriptParameters; + } + ; + "script.callFunction": + { + params: Bidi.Script.CallFunctionParameters; + returnType: Bidi.Script.CallFunctionParameters; + } + ; + "script.disown": + { + params: Bidi.Script.DisownParameters; + returnType: Bidi.Script.DisownParameters; + } + ; + "script.evaluate": + { + params: Bidi.Script.EvaluateParameters; + returnType: Bidi.Script.EvaluateParameters; + } + ; + "script.getRealms": + { + params: Bidi.Script.GetRealmsParameters; + returnType: Bidi.Script.GetRealmsParameters; + } + ; + "script.removePreloadScript": + { + params: Bidi.Script.RemovePreloadScriptParameters; + returnType: Bidi.Script.RemovePreloadScriptParameters; + } + ; + "session.end": + { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + } + ; + "session.new": + { + params: Bidi.Session.NewParameters; + returnType: Bidi.Session.NewParameters; + } + ; + "session.status": + { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + } + ; + "session.subscribe": + { + params: Bidi.Session.SubscriptionRequest; + returnType: Bidi.Session.SubscriptionRequest; + } + ; + "session.unsubscribe": + { + params: Bidi.Session.UnsubscribeParameters; + returnType: Bidi.Session.UnsubscribeParameters; + } + ; + "storage.deleteCookies": + { + params: Bidi.Storage.DeleteCookiesParameters; + returnType: Bidi.Storage.DeleteCookiesParameters; + } + ; + "storage.getCookies": + { + params: Bidi.Storage.GetCookiesParameters; + returnType: Bidi.Storage.GetCookiesParameters; + } + ; + "storage.setCookie": + { + params: Bidi.Storage.SetCookieParameters; + returnType: Bidi.Storage.SetCookieParameters; + } + ; + "webExtension.install": + { + params: Bidi.WebExtension.InstallParameters; + returnType: Bidi.WebExtension.InstallParameters; + } + ; + "webExtension.uninstall": + { + params: Bidi.WebExtension.UninstallParameters; + returnType: Bidi.WebExtension.UninstallParameters; + } + ; +} diff --git a/src/gen/permissions.ts b/src/gen/permissions.ts index 3369343..6692483 100644 --- a/src/gen/permissions.ts +++ b/src/gen/permissions.ts @@ -1,27 +1,19 @@ -export type PermissionsCommand = Permissions.SetPermission; +export type PermissionsCommand = (Permissions.SetPermission); export namespace Permissions { - export type PermissionDescriptor = { - name: string; - }; +export type PermissionDescriptor = (({ +"name":(string)})); } export namespace Permissions { - export const enum PermissionState { - Granted = 'granted', - Denied = 'denied', - Prompt = 'prompt', - } +export const enum PermissionState {Granted = "granted", +Denied = "denied", +Prompt = "prompt", +} } export namespace Permissions { - export type SetPermission = { - method: 'permissions.setPermission'; - params: Permissions.SetPermissionParameters; - }; +export type SetPermission = ({ +"method":("permissions.setPermission"),"params":(Permissions.SetPermissionParameters)}); } export namespace Permissions { - export type SetPermissionParameters = { - descriptor: Permissions.PermissionDescriptor; - state: Permissions.PermissionState; - origin: string; - userContext?: string; - }; +export type SetPermissionParameters = (({ +"descriptor":(Permissions.PermissionDescriptor),"state":(Permissions.PermissionState),"origin":(string),"userContext"?:(string)})); } diff --git a/src/gen/web-bluetooth.ts b/src/gen/web-bluetooth.ts index f45b08e..ab7aaeb 100644 --- a/src/gen/web-bluetooth.ts +++ b/src/gen/web-bluetooth.ts @@ -1,315 +1,177 @@ export namespace Bluetooth { - export type BluetoothUuid = string; +export type BluetoothUuid = (string); } export namespace Bluetooth { - export type BluetoothManufacturerData = { - key: number; - data: string; - }; +export type BluetoothManufacturerData = (({ +"key":(number),"data":(string)})); } export namespace Bluetooth { - export type CharacteristicProperties = { - broadcast?: boolean; - read?: boolean; - writeWithoutResponse?: boolean; - write?: boolean; - notify?: boolean; - indicate?: boolean; - authenticatedSignedWrites?: boolean; - extendedProperties?: boolean; - }; +export type CharacteristicProperties = (({ +"broadcast"?:(boolean),"read"?:(boolean),"writeWithoutResponse"?:(boolean),"write"?:(boolean),"notify"?:(boolean),"indicate"?:(boolean),"authenticatedSignedWrites"?:(boolean),"extendedProperties"?:(boolean)})); } export namespace Bluetooth { - export type RequestDevice = string; +export type RequestDevice = (string); } export namespace Bluetooth { - export type RequestDeviceInfo = { - id: Bluetooth.RequestDevice; - name: string | null; - }; +export type RequestDeviceInfo = (({ +"id":(Bluetooth.RequestDevice),"name":(string| null)})); } export namespace Bluetooth { - export type RequestDevicePrompt = string; +export type RequestDevicePrompt = (string); } export namespace Bluetooth { - export type ScanRecord = { - name?: string; - uuids?: [...Bluetooth.BluetoothUuid[]]; - appearance?: number; - manufacturerData?: [...Bluetooth.BluetoothManufacturerData[]]; - }; +export type ScanRecord = (({ +"name"?:(string),"uuids"?:([ +...((Bluetooth.BluetoothUuid)[])]),"appearance"?:(number),"manufacturerData"?:([ +...((Bluetooth.BluetoothManufacturerData)[])])})); } -export type BluetoothCommand = - | Bluetooth.HandleRequestDevicePrompt - | Bluetooth.SimulateAdapter - | Bluetooth.DisableSimulation - | Bluetooth.SimulatePreconnectedPeripheral - | Bluetooth.SimulateAdvertisement - | Bluetooth.SimulateGattConnectionResponse - | Bluetooth.SimulateGattDisconnection - | Bluetooth.SimulateService - | Bluetooth.SimulateCharacteristic - | Bluetooth.SimulateCharacteristicResponse - | Bluetooth.SimulateDescriptor - | Bluetooth.SimulateDescriptorResponse - | Record; +export type BluetoothCommand = (Bluetooth.HandleRequestDevicePrompt| Bluetooth.SimulateAdapter| Bluetooth.DisableSimulation| Bluetooth.SimulatePreconnectedPeripheral| Bluetooth.SimulateAdvertisement| Bluetooth.SimulateGattConnectionResponse| Bluetooth.SimulateGattDisconnection| Bluetooth.SimulateService| Bluetooth.SimulateCharacteristic| Bluetooth.SimulateCharacteristicResponse| Bluetooth.SimulateDescriptor| Bluetooth.SimulateDescriptorResponse| Record +); export namespace Bluetooth { - export type HandleRequestDevicePrompt = { - method: 'bluetooth.handleRequestDevicePrompt'; - params: Bluetooth.HandleRequestDevicePromptParameters; - }; +export type HandleRequestDevicePrompt = ({ +"method":("bluetooth.handleRequestDevicePrompt"),"params":(Bluetooth.HandleRequestDevicePromptParameters)}); } export namespace Bluetooth { - export type HandleRequestDevicePromptParameters = { - context: string; - prompt: Bluetooth.RequestDevicePrompt; - } & ( - | Bluetooth.HandleRequestDevicePromptAcceptParameters - | Bluetooth.HandleRequestDevicePromptCancelParameters - ); +export type HandleRequestDevicePromptParameters = (({ +"context":(string),"prompt":(Bluetooth.RequestDevicePrompt)}&(Bluetooth.HandleRequestDevicePromptAcceptParameters| Bluetooth.HandleRequestDevicePromptCancelParameters))); } export namespace Bluetooth { - export type HandleRequestDevicePromptAcceptParameters = { - accept: true; - device: Bluetooth.RequestDevice; - }; +export type HandleRequestDevicePromptAcceptParameters = ({ +"accept":(true),"device":(Bluetooth.RequestDevice)}); } export namespace Bluetooth { - export type HandleRequestDevicePromptCancelParameters = { - accept: false; - }; +export type HandleRequestDevicePromptCancelParameters = ({ +"accept":(false)}); } export namespace Bluetooth { - export type SimulateAdapter = { - method: 'bluetooth.simulateAdapter'; - params: Bluetooth.SimulateAdapterParameters; - }; +export type SimulateAdapter = ({ +"method":("bluetooth.simulateAdapter"),"params":(Bluetooth.SimulateAdapterParameters)}); } export namespace Bluetooth { - export type SimulateAdapterParameters = { - context: string; - leSupported?: boolean; - state: 'absent' | 'powered-off' | 'powered-on'; - }; +export type SimulateAdapterParameters = (({ +"context":(string),"leSupported"?:(boolean),"state":("absent"| "powered-off"| "powered-on")})); } export namespace Bluetooth { - export type DisableSimulation = { - method: 'bluetooth.disableSimulation'; - params: Bluetooth.DisableSimulationParameters; - }; +export type DisableSimulation = ({ +"method":("bluetooth.disableSimulation"),"params":(Bluetooth.DisableSimulationParameters)}); } export namespace Bluetooth { - export type DisableSimulationParameters = { - context: string; - }; +export type DisableSimulationParameters = (({ +"context":(string)})); } export namespace Bluetooth { - export type SimulatePreconnectedPeripheral = { - method: 'bluetooth.simulatePreconnectedPeripheral'; - params: Bluetooth.SimulatePreconnectedPeripheralParameters; - }; +export type SimulatePreconnectedPeripheral = ({ +"method":("bluetooth.simulatePreconnectedPeripheral"),"params":(Bluetooth.SimulatePreconnectedPeripheralParameters)}); } export namespace Bluetooth { - export type SimulatePreconnectedPeripheralParameters = { - context: string; - address: string; - name: string; - manufacturerData: [...Bluetooth.BluetoothManufacturerData[]]; - knownServiceUuids: [...Bluetooth.BluetoothUuid[]]; - }; +export type SimulatePreconnectedPeripheralParameters = (({ +"context":(string),"address":(string),"name":(string),"manufacturerData":([ +...((Bluetooth.BluetoothManufacturerData)[])]),"knownServiceUuids":([ +...((Bluetooth.BluetoothUuid)[])])})); } export namespace Bluetooth { - export type SimulateAdvertisement = { - method: 'bluetooth.simulateAdvertisement'; - params: Bluetooth.SimulateAdvertisementParameters; - }; +export type SimulateAdvertisement = ({ +"method":("bluetooth.simulateAdvertisement"),"params":(Bluetooth.SimulateAdvertisementParameters)}); } export namespace Bluetooth { - export type SimulateAdvertisementParameters = { - context: string; - scanEntry: Bluetooth.SimulateAdvertisementScanEntryParameters; - }; +export type SimulateAdvertisementParameters = (({ +"context":(string),"scanEntry":(Bluetooth.SimulateAdvertisementScanEntryParameters)})); } export namespace Bluetooth { - export type SimulateAdvertisementScanEntryParameters = { - deviceAddress: string; - rssi: number; - scanRecord: Bluetooth.ScanRecord; - }; +export type SimulateAdvertisementScanEntryParameters = (({ +"deviceAddress":(string),"rssi":(number),"scanRecord":(Bluetooth.ScanRecord)})); } export namespace Bluetooth { - export type SimulateGattConnectionResponse = { - method: 'bluetooth.simulateGattConnectionResponse'; - params: Bluetooth.SimulateGattConnectionResponseParameters; - }; +export type SimulateGattConnectionResponse = ({ +"method":("bluetooth.simulateGattConnectionResponse"),"params":(Bluetooth.SimulateGattConnectionResponseParameters)}); } export namespace Bluetooth { - export type SimulateGattConnectionResponseParameters = { - context: string; - address: string; - code: number; - }; +export type SimulateGattConnectionResponseParameters = (({ +"context":(string),"address":(string),"code":(number)})); } export namespace Bluetooth { - export type SimulateGattDisconnection = { - method: 'bluetooth.simulateGattDisconnection'; - params: Bluetooth.SimulateGattDisconnectionParameters; - }; +export type SimulateGattDisconnection = ({ +"method":("bluetooth.simulateGattDisconnection"),"params":(Bluetooth.SimulateGattDisconnectionParameters)}); } export namespace Bluetooth { - export type SimulateGattDisconnectionParameters = { - context: string; - address: string; - }; +export type SimulateGattDisconnectionParameters = (({ +"context":(string),"address":(string)})); } export namespace Bluetooth { - export type SimulateService = { - method: 'bluetooth.simulateService'; - params: Bluetooth.SimulateServiceParameters; - }; +export type SimulateService = ({ +"method":("bluetooth.simulateService"),"params":(Bluetooth.SimulateServiceParameters)}); } export namespace Bluetooth { - export type SimulateServiceParameters = { - context: string; - address: string; - uuid: Bluetooth.BluetoothUuid; - type: 'add' | 'remove'; - }; +export type SimulateServiceParameters = (({ +"context":(string),"address":(string),"uuid":(Bluetooth.BluetoothUuid),"type":("add"| "remove")})); } export namespace Bluetooth { - export type SimulateCharacteristic = { - method: 'bluetooth.simulateCharacteristic'; - params: Bluetooth.SimulateCharacteristicParameters; - }; +export type SimulateCharacteristic = ({ +"method":("bluetooth.simulateCharacteristic"),"params":(Bluetooth.SimulateCharacteristicParameters)}); } export namespace Bluetooth { - export type SimulateCharacteristicParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - characteristicProperties?: Bluetooth.CharacteristicProperties; - type: 'add' | 'remove'; - }; +export type SimulateCharacteristicParameters = (({ +"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"characteristicProperties"?:(Bluetooth.CharacteristicProperties),"type":("add"| "remove")})); } export namespace Bluetooth { - export type SimulateCharacteristicResponse = { - method: 'bluetooth.simulateCharacteristicResponse'; - params: Bluetooth.SimulateCharacteristicResponseParameters; - }; +export type SimulateCharacteristicResponse = ({ +"method":("bluetooth.simulateCharacteristicResponse"),"params":(Bluetooth.SimulateCharacteristicResponseParameters)}); } export namespace Bluetooth { - export type SimulateCharacteristicResponseParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - type: - | 'read' - | 'write' - | 'subscribe-to-notifications' - | 'unsubscribe-from-notifications'; - code: number; - data?: [...number[]]; - }; +export type SimulateCharacteristicResponseParameters = (({ +"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write"| "subscribe-to-notifications"| "unsubscribe-from-notifications"),"code":(number),"data"?:([ +...((number)[])])})); } export namespace Bluetooth { - export type SimulateDescriptor = { - method: 'bluetooth.simulateDescriptor'; - params: Bluetooth.SimulateDescriptorParameters; - }; +export type SimulateDescriptor = ({ +"method":("bluetooth.simulateDescriptor"),"params":(Bluetooth.SimulateDescriptorParameters)}); } export namespace Bluetooth { - export type SimulateDescriptorParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - descriptorUuid: Bluetooth.BluetoothUuid; - type: 'add' | 'remove'; - }; +export type SimulateDescriptorParameters = (({ +"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"descriptorUuid":(Bluetooth.BluetoothUuid),"type":("add"| "remove")})); } export namespace Bluetooth { - export type SimulateDescriptorResponse = { - method: 'bluetooth.simulateDescriptorResponse'; - params: Bluetooth.SimulateDescriptorResponseParameters; - }; +export type SimulateDescriptorResponse = ({ +"method":("bluetooth.simulateDescriptorResponse"),"params":(Bluetooth.SimulateDescriptorResponseParameters)}); } export namespace Bluetooth { - export type SimulateDescriptorResponseParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - descriptorUuid: Bluetooth.BluetoothUuid; - type: 'read' | 'write'; - code: number; - data?: [...number[]]; - }; -} -export type BluetoothEvent = - | Bluetooth.RequestDevicePromptUpdated - | Bluetooth.GattConnectionAttempted; -export namespace Bluetooth { - export type RequestDevicePromptUpdated = { - method: 'bluetooth.requestDevicePromptUpdated'; - params: Bluetooth.RequestDevicePromptUpdatedParameters; - }; -} -export namespace Bluetooth { - export type RequestDevicePromptUpdatedParameters = { - context: string; - prompt: Bluetooth.RequestDevicePrompt; - devices: [...Bluetooth.RequestDeviceInfo[]]; - }; -} -export namespace Bluetooth { - export type GattConnectionAttempted = { - method: 'bluetooth.gattConnectionAttempted'; - params: Bluetooth.GattConnectionAttemptedParameters; - }; -} -export namespace Bluetooth { - export type GattConnectionAttemptedParameters = { - context: string; - address: string; - }; -} -export namespace Bluetooth { - export type CharacteristicEventGenerated = { - method: 'bluetooth.characteristicEventGenerated'; - params: Bluetooth.CharacteristicEventGeneratedParameters; - }; -} -export namespace Bluetooth { - export type CharacteristicEventGeneratedParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - type: - | 'read' - | 'write-with-response' - | 'write-without-response' - | 'subscribe-to-notifications' - | 'unsubscribe-from-notifications'; - data?: [...number[]]; - }; -} -export namespace Bluetooth { - export type DescriptorEventGenerated = { - method: 'bluetooth.descriptorEventGenerated'; - params: Bluetooth.DescriptorEventGeneratedParameters; - }; -} -export namespace Bluetooth { - export type DescriptorEventGeneratedParameters = { - context: string; - address: string; - serviceUuid: Bluetooth.BluetoothUuid; - characteristicUuid: Bluetooth.BluetoothUuid; - descriptorUuid: Bluetooth.BluetoothUuid; - type: 'read' | 'write'; - data?: [...number[]]; - }; +export type SimulateDescriptorResponseParameters = (({ +"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"descriptorUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write"),"code":(number),"data"?:([ +...((number)[])])})); +} +export type BluetoothEvent = (Bluetooth.RequestDevicePromptUpdated| Bluetooth.GattConnectionAttempted); +export namespace Bluetooth { +export type RequestDevicePromptUpdated = ({ +"method":("bluetooth.requestDevicePromptUpdated"),"params":(Bluetooth.RequestDevicePromptUpdatedParameters)}); +} +export namespace Bluetooth { +export type RequestDevicePromptUpdatedParameters = (({ +"context":(string),"prompt":(Bluetooth.RequestDevicePrompt),"devices":([ +...((Bluetooth.RequestDeviceInfo)[])])})); +} +export namespace Bluetooth { +export type GattConnectionAttempted = ({ +"method":("bluetooth.gattConnectionAttempted"),"params":(Bluetooth.GattConnectionAttemptedParameters)}); +} +export namespace Bluetooth { +export type GattConnectionAttemptedParameters = (({ +"context":(string),"address":(string)})); +} +export namespace Bluetooth { +export type CharacteristicEventGenerated = ({ +"method":("bluetooth.characteristicEventGenerated"),"params":(Bluetooth.CharacteristicEventGeneratedParameters)}); +} +export namespace Bluetooth { +export type CharacteristicEventGeneratedParameters = (({ +"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write-with-response"| "write-without-response"| "subscribe-to-notifications"| "unsubscribe-from-notifications"),"data"?:([ +...((number)[])])})); +} +export namespace Bluetooth { +export type DescriptorEventGenerated = ({ +"method":("bluetooth.descriptorEventGenerated"),"params":(Bluetooth.DescriptorEventGeneratedParameters)}); +} +export namespace Bluetooth { +export type DescriptorEventGeneratedParameters = (({ +"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"descriptorUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write"),"data"?:([ +...((number)[])])})); } diff --git a/src/index.ts b/src/index.ts index ec9669d..43af758 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,292 +12,7 @@ export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -type ExternalSpecCommand = { - // id is defined by the main WebDriver BiDi spec and extension specs do - // not re-define it. Therefore, it's not part of generated types. - id: Bidi.JsUint; -} & T; +export {Command} from './commands.js'; +export {Event} from './events.js'; -type ExternalSpecEvent = { - // type is defined by the main WebDriver BiDi spec and extension specs do - // not re-define it. Therefore, it's not part of generated types. - type: 'event'; -} & T & - Bidi.Extensible; - -export type Command = - | Bidi.Command - | ExternalSpecCommand - | ExternalSpecCommand; - -export type Event = - | Bidi.Event - | ExternalSpecEvent; - -// TODO: is there a way to generate this mapping? -export interface Commands { - 'bluetooth.handleRequestDevicePrompt': { - params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.disableSimulation': { - params: BidiBluetooth.Bluetooth.DisableSimulationParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateAdapter': { - params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateAdvertisement': { - params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulatePreconnectedPeripheral': { - params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateGattDisconnection': { - params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateDescriptor': { - params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; - returnType: Bidi.EmptyResult; - }; - 'bluetooth.simulateDescriptorResponse': { - params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; - returnType: Bidi.EmptyResult; - }; - - 'browser.close': { - params: Bidi.EmptyParams; - returnType: Bidi.EmptyResult; - }; - 'browser.getgetClientWindows': { - params: Bidi.EmptyParams; - returnType: Bidi.Browser.GetClientWindowsResult; - }; - 'browser.createUserContext': { - params: Bidi.EmptyParams; - returnType: Bidi.Browser.CreateUserContextResult; - }; - 'browser.getUserContexts': { - params: Bidi.EmptyParams; - returnType: Bidi.Browser.GetUserContextsResult; - }; - 'browser.removeUserContext': { - params: { - userContext: Bidi.Browser.UserContext; - }; - returnType: Bidi.Browser.RemoveUserContext; - }; - 'browser.setClientWindowState': { - params: Bidi.Browser.SetClientWindowStateParameters; - returnType: Bidi.Browser.ClientWindowInfo; - }; - - 'browsingContext.activate': { - params: Bidi.BrowsingContext.ActivateParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.create': { - params: Bidi.BrowsingContext.CreateParameters; - returnType: Bidi.BrowsingContext.CreateResult; - }; - 'browsingContext.close': { - params: Bidi.BrowsingContext.CloseParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.getTree': { - params: Bidi.BrowsingContext.GetTreeParameters; - returnType: Bidi.BrowsingContext.GetTreeResult; - }; - 'browsingContext.locateNodes': { - params: Bidi.BrowsingContext.LocateNodesParameters; - returnType: Bidi.BrowsingContext.LocateNodesResult; - }; - 'browsingContext.navigate': { - params: Bidi.BrowsingContext.NavigateParameters; - returnType: Bidi.BrowsingContext.NavigateResult; - }; - 'browsingContext.reload': { - params: Bidi.BrowsingContext.ReloadParameters; - returnType: Bidi.BrowsingContext.NavigateResult; - }; - 'browsingContext.print': { - params: Bidi.BrowsingContext.PrintParameters; - returnType: Bidi.BrowsingContext.PrintResult; - }; - 'browsingContext.captureScreenshot': { - params: Bidi.BrowsingContext.CaptureScreenshotParameters; - returnType: Bidi.BrowsingContext.CaptureScreenshotResult; - }; - 'browsingContext.handleUserPrompt': { - params: Bidi.BrowsingContext.HandleUserPromptParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.setViewport': { - params: Bidi.BrowsingContext.SetViewportParameters; - returnType: Bidi.EmptyResult; - }; - 'browsingContext.traverseHistory': { - params: Bidi.BrowsingContext.TraverseHistoryParameters; - returnType: Bidi.EmptyResult; - }; - - 'emulation.setForcedColorsModeThemeOverride': { - params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setGeolocationOverride': { - params: Bidi.Emulation.SetGeolocationOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setLocaleOverride': { - params: Bidi.Emulation.SetLocaleOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setScreenOrientationOverride': { - params: Bidi.Emulation.SetScreenOrientationOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setTimezoneOverride': { - params: Bidi.Emulation.SetTimezoneOverrideParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setScriptingEnabled': { - params: Bidi.Emulation.SetScriptingEnabledParameters; - returnType: Bidi.EmptyResult; - }; - 'emulation.setUserAgentOverride': { - params: Bidi.Emulation.SetUserAgentOverrideParameters; - returnType: Bidi.EmptyResult; - }; - - 'input.performActions': { - params: Bidi.Input.PerformActionsParameters; - returnType: Bidi.EmptyResult; - }; - 'input.releaseActions': { - params: Bidi.Input.ReleaseActionsParameters; - returnType: Bidi.EmptyResult; - }; - 'input.setFiles': { - params: Bidi.Input.SetFilesParameters; - returnType: Bidi.EmptyResult; - }; - - 'permissions.setPermission': { - params: BidiPermissions.Permissions.SetPermissionParameters; - returnType: Bidi.EmptyResult; - }; - - 'script.evaluate': { - params: Bidi.Script.EvaluateParameters; - returnType: Bidi.Script.EvaluateResult; - }; - 'script.callFunction': { - params: Bidi.Script.CallFunctionParameters; - returnType: Bidi.Script.EvaluateResult; - }; - 'script.disown': { - params: Bidi.Script.DisownParameters; - returnType: Bidi.EmptyResult; - }; - 'script.addPreloadScript': { - params: Bidi.Script.AddPreloadScriptParameters; - returnType: Bidi.Script.AddPreloadScriptResult; - }; - 'script.removePreloadScript': { - params: Bidi.Script.RemovePreloadScriptParameters; - returnType: Bidi.EmptyResult; - }; - - 'session.end': { - params: Bidi.EmptyParams; - returnType: Bidi.EmptyResult; - }; - 'session.new': { - params: Bidi.Session.NewParameters; - returnType: Bidi.Session.NewResult; - }; - 'session.status': { - params: object; - returnType: Bidi.Session.StatusResult; - }; - 'session.subscribe': { - params: Bidi.Session.SubscriptionRequest; - returnType: Bidi.EmptyResult; - }; - 'session.unsubscribe': { - params: Bidi.Session.SubscriptionRequest; - returnType: Bidi.EmptyResult; - }; - - 'storage.deleteCookies': { - params: Bidi.Storage.DeleteCookiesParameters; - returnType: Bidi.Storage.DeleteCookiesResult; - }; - 'storage.getCookies': { - params: Bidi.Storage.GetCookiesParameters; - returnType: Bidi.Storage.GetCookiesResult; - }; - 'storage.setCookie': { - params: Bidi.Storage.SetCookieParameters; - returnType: Bidi.Storage.SetCookieParameters; - }; - - 'network.addDataCollector': { - params: Bidi.Network.AddDataCollectorParameters; - returnType: Bidi.Network.AddDataCollectorResult; - }; - 'network.addIntercept': { - params: Bidi.Network.AddInterceptParameters; - returnType: Bidi.Network.AddInterceptResult; - }; - 'network.removeIntercept': { - params: Bidi.Network.RemoveInterceptParameters; - returnType: Bidi.EmptyResult; - }; - 'network.continueRequest': { - params: Bidi.Network.ContinueRequestParameters; - returnType: Bidi.EmptyResult; - }; - 'network.continueWithAuth': { - params: Bidi.Network.ContinueWithAuthParameters; - returnType: Bidi.EmptyResult; - }; - 'network.failRequest': { - params: Bidi.Network.FailRequestParameters; - returnType: Bidi.EmptyResult; - }; - 'network.provideResponse': { - params: Bidi.Network.ProvideResponseParameters; - returnType: Bidi.EmptyResult; - }; - 'network.disownData': { - params: Bidi.Network.DisownDataParameters; - returnType: Bidi.EmptyResult; - }; - 'network.getData': { - params: Bidi.Network.GetDataParameters; - returnType: Bidi.Network.GetDataResult; - }; - 'network.setCacheBehavior': { - params: Bidi.Network.SetCacheBehaviorParameters; - returnType: Bidi.EmptyResult; - }; - 'network.setExtraHeaders': { - params: Bidi.Network.SetExtraHeadersParameters; - returnType: Bidi.EmptyResult; - }; - - 'webExtension.install': { - params: Bidi.WebExtension.InstallParameters; - returnType: Bidi.WebExtension.InstallResult; - }; - 'webExtension.uninstall': { - params: Bidi.WebExtension.UninstallParameters; - returnType: Bidi.EmptyResult; - }; -} +export {CommandMapping} from './gen/mapping.js'; diff --git a/test-d/webdriver-bidi-protocol.test-d.ts b/test-d/webdriver-bidi-protocol.test-d.ts index 584244a..db73ec2 100644 --- a/test-d/webdriver-bidi-protocol.test-d.ts +++ b/test-d/webdriver-bidi-protocol.test-d.ts @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Event, Command, Commands} from '..'; +import {Event, Command, CommandMapping} from '..'; function sendCommand(command: Command) {} function handleEvent(event: Event) {} -function sendCommandMultipleArgs( +function sendCommandMultipleArgs( method: T, - params: Commands[T]['params'], -): {result: Commands[T]['returnType']} { + params: CommandMapping[T]['params'], +): {result: CommandMapping[T]['returnType']} { throw new Error('Not implemented'); } diff --git a/tools/build.sh b/tools/build.sh index 3bffd7e..a463305 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -4,6 +4,8 @@ # Copyright 2024 Google Inc. # SPDX-License-Identifier: Apache-2.0 +set -e + rm -rf src/gen && mkdir src/gen rm -rf out @@ -23,6 +25,7 @@ cddlconv specs/web-bluetooth/all.cddl > src/gen/web-bluetooth.ts git submodule deinit --all +node --experimental-strip-types ./tools/generateCommandMap.ts npx tsc -p tsconfig.json npx tsd -npm run format \ No newline at end of file +npm run format diff --git a/tools/generateCommandMap.ts b/tools/generateCommandMap.ts new file mode 100644 index 0000000..01a305f --- /dev/null +++ b/tools/generateCommandMap.ts @@ -0,0 +1,153 @@ +/** + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import {Project, Type, TypeFormatFlags} from 'ts-morph'; +import * as path from 'path'; +import { + getTypeInNamespaceOrThrow, + type MappingInterface, + type SpecType, +} from './utils.ts'; + +const rootDir = path.resolve(import.meta.dirname, '..'); + +const specs: SpecType[] = [ + { + inputFile: './main.ts', + commandType: 'CommandData', + modulePrefix: 'Bidi', + }, + { + inputFile: './permissions.ts', + commandType: 'PermissionsCommand', + modulePrefix: 'BidiPermissions', + }, + { + inputFile: './web-bluetooth.ts', + commandType: 'BluetoothCommand', + modulePrefix: 'BidiBluetooth', + }, +]; + +const project = new Project({ + tsConfigFilePath: path.resolve(rootDir, 'tsconfig.json'), +}); +const commandMappingEntries: MappingInterface[] = []; +for (const spec of specs) { + const apiIndexFile = project.addSourceFileAtPath( + path.resolve(rootDir, 'src/gen', spec.inputFile), + ); + + // Allow other name + const commandType = apiIndexFile.getTypeAliasOrThrow(spec.commandType); + const unionType = commandType.getType(); + let types: Type[]; + if (unionType.isUnion()) { + types = unionType.getUnionTypes(); + } else { + types = [commandType.getTypeNodeOrThrow().getType()]; + } + + for (const unionMember of types) { + const methodProp = unionMember.getProperty('method'); + if (!methodProp) { + // If not method is found continue. + // For some reason the Bluetooth spec has Record + // TODO: fix it upstream + continue; + } + + const methodType = methodProp.getTypeAtLocation(commandType); + + if (!methodType.isStringLiteral()) { + throw new Error(`Non string found ${methodProp.getName()}`); + } + + const methodString = `${methodType.getLiteralValue()}`; + + const paramsProp = unionMember.getPropertyOrThrow('params'); + const paramsType = paramsProp.getTypeAtLocation(commandType); + + const paramsTypeString = paramsType.getText( + commandType, + TypeFormatFlags.None, + ); + + let expectedResultTypeName = paramsTypeString.replace('Params', 'Result'); + + try { + // Usually we get something like `BrowsingContext.GetTreeResult` + getTypeInNamespaceOrThrow(apiIndexFile, expectedResultTypeName); + } catch { + try { + // Maybe it was not inside an Namespace try on the module scope + apiIndexFile.getTypeAliasOrThrow(expectedResultTypeName); + } catch { + // Default to EmptyResult + expectedResultTypeName = `EmptyResult`; + } + } + + commandMappingEntries.push({ + method: methodString, + params: `${spec.modulePrefix}.${paramsTypeString}`, + resultType: `${spec.modulePrefix}.${expectedResultTypeName}`, + }); + } +} + +// Start generating the mapping types +const outputPath = path.resolve(rootDir, 'src/gen/mapping.ts'); +const generatedFile = project.createSourceFile(outputPath, '', { + overwrite: true, +}); + +for (const spec of specs) { + generatedFile.addImportDeclaration({ + moduleSpecifier: spec.inputFile, + isTypeOnly: true, + namespaceImport: spec.modulePrefix, + }); +} + +// 11. Add the GENERATED interface +const mapInterface = generatedFile.addInterface({ + name: 'CommandMapping', + isExported: true, +}); + +const sortedCommandMappingEntries = commandMappingEntries.sort((a, b) => { + if (a.method > b.method) { + return 1; + } else if (a.method < b.method) { + return -1; + } + + return 0; +}); + +for (const entry of sortedCommandMappingEntries) { + mapInterface.addProperty({ + // Wrap in quotes as we use . + // syntax + name: `"${entry.method}"`, + type: writer => { + writer.write(` + { + params: ${entry.params}; + returnType: ${entry.resultType}; + } + `); + }, + }); +} + +generatedFile.insertText( + 0, + `/* eslint-disable */\n/**\n * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts\n * Do not edit this file manually.\n */\n\n`, +); + +await generatedFile.save(); diff --git a/tools/utils.ts b/tools/utils.ts new file mode 100644 index 0000000..7370f3b --- /dev/null +++ b/tools/utils.ts @@ -0,0 +1,63 @@ +import { + ModuleDeclaration, + Project, + SourceFile, + TypeAliasDeclaration, + TypeFormatFlags, +} from 'ts-morph'; + +export function getNamespaces(file: SourceFile, s: String) { + const result: ModuleDeclaration[] = []; + for (const n of file.getModules()) { + if (n.getDeclarationKind() === 'namespace') { + if (s === n.getName()) { + result.push(n); + } + } + } + return result; +} + +// // Helper to convert a camelCase string to PascalCase +// function toPascalCase(str: string): string { +// if (!str) { +// return ''; +// } +// return str +// .split('.') +// .map(s => { +// return s.charAt(0).toUpperCase() + s.slice(1); +// }) +// .join('.'); +// } + +export interface SpecType { + inputFile: string; + commandType: string; + modulePrefix: string; +} +export interface MappingInterface { + method: string; + params: string; + resultType: string; +} + +export function getTypeInNamespaceOrThrow( + file: SourceFile, + typeWithNamespace: String, +): TypeAliasDeclaration { + const [namespaceName, typeName] = typeWithNamespace.split('.') as [ + string, + string, + ]; + + for (const namespace of getNamespaces(file, namespaceName)) { + const type = namespace.getTypeAlias(typeName); + + if (type) { + return type; + } + } + + throw new Error('Not found'); +} diff --git a/tsconfig.json b/tsconfig.json index bec0766..ae7c1d5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,110 +1,15 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "NodeNext", /* Specify what module code is generated. */ - "rootDir": "./src", /* Specify the root folder within your source files. */ - "moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./out", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "target": "ESNext", + "module": "NodeNext", + "rootDir": "./src", + "moduleResolution": "NodeNext", + "declaration": true, + "outDir": "./out", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true }, "include": ["src/**/*.ts"] } From 6c13edbb5612657b10d7d212d02c7a047577f8ef Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 19:45:45 +0200 Subject: [PATCH 2/9] format --- out/commands.js | 54 +- out/events.d.ts | 9 +- out/events.js | 4 +- out/gen/main.d.ts | 4123 ++++++++++++++++++------------------ out/gen/main.js | 4 +- out/gen/mapping.d.ts | 566 ++--- out/gen/mapping.js | 4 +- out/gen/permissions.d.ts | 38 +- out/gen/permissions.js | 4 +- out/gen/web-bluetooth.d.ts | 485 ++--- out/gen/web-bluetooth.js | 4 +- out/index.d.ts | 6 +- out/index.js | 54 +- src/gen/main.ts | 3194 ++++++++++++++++++---------- src/gen/mapping.ts | 706 +++--- src/gen/permissions.ts | 30 +- src/gen/web-bluetooth.ts | 356 +++- 17 files changed, 5371 insertions(+), 4270 deletions(-) diff --git a/out/commands.js b/out/commands.js index 82beef8..5cffe81 100644 --- a/out/commands.js +++ b/out/commands.js @@ -1,21 +1,37 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./gen/main.js"), exports); -__exportStar(require("./gen/permissions.js"), exports); -__exportStar(require("./gen/web-bluetooth.js"), exports); +'use strict'; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ('get' in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; +Object.defineProperty(exports, '__esModule', {value: true}); +__exportStar(require('./gen/main.js'), exports); +__exportStar(require('./gen/permissions.js'), exports); +__exportStar(require('./gen/web-bluetooth.js'), exports); // | ExternalSpecCommand // | ExternalSpecCommand; diff --git a/out/events.d.ts b/out/events.d.ts index 0114e24..b54f53e 100644 --- a/out/events.d.ts +++ b/out/events.d.ts @@ -6,7 +6,10 @@ import * as Bidi from './gen/main.js'; import * as BidiBluetooth from './gen/web-bluetooth.js'; type ExternalSpecEvent = { - type: 'event'; -} & T & Bidi.Extensible; -export type Event = Bidi.Event | ExternalSpecEvent; + type: 'event'; +} & T & + Bidi.Extensible; +export type Event = + | Bidi.Event + | ExternalSpecEvent; export {}; diff --git a/out/events.js b/out/events.js index c8ad2e5..38813da 100644 --- a/out/events.js +++ b/out/events.js @@ -1,2 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/gen/main.d.ts b/out/gen/main.d.ts index b7e831c..f222644 100644 --- a/out/gen/main.d.ts +++ b/out/gen/main.d.ts @@ -1,2643 +1,2724 @@ -export type Event = (({ - "type": ("event"); -} & EventData & Extensible)); -export type Command = (({ - "id": (JsUint); -} & CommandData & Extensible)); -export type CommandResponse = (({ - "type": ("success"); - "id": (JsUint); - "result": (ResultData); -} & Extensible)); -export type EventData = (BrowsingContextEvent | InputEvent | LogEvent | NetworkEvent | ScriptEvent); -export type CommandData = (BrowserCommand | BrowsingContextCommand | EmulationCommand | InputCommand | NetworkCommand | ScriptCommand | SessionCommand | StorageCommand | WebExtensionCommand); -export type ResultData = ((BrowsingContextResult | EmptyResult | NetworkResult | ScriptResult | SessionResult | StorageResult | WebExtensionResult)); -export type EmptyParams = ((Extensible)); -export type Message = ((CommandResponse | ErrorResponse | Event)); -export type ErrorResponse = (({ - "type": ("error"); - "id": (JsUint | null); - "error": (ErrorCode); - "message": (string); - "stacktrace"?: (string); -} & Extensible)); -export type EmptyResult = ((Extensible)); -export type Extensible = ({ - [key: string]: (any); -}); +export type Event = { + type: 'event'; +} & EventData & + Extensible; +export type Command = { + id: JsUint; +} & CommandData & + Extensible; +export type CommandResponse = { + type: 'success'; + id: JsUint; + result: ResultData; +} & Extensible; +export type EventData = + | BrowsingContextEvent + | InputEvent + | LogEvent + | NetworkEvent + | ScriptEvent; +export type CommandData = + | BrowserCommand + | BrowsingContextCommand + | EmulationCommand + | InputCommand + | NetworkCommand + | ScriptCommand + | SessionCommand + | StorageCommand + | WebExtensionCommand; +export type ResultData = + | BrowsingContextResult + | EmptyResult + | NetworkResult + | ScriptResult + | SessionResult + | StorageResult + | WebExtensionResult; +export type EmptyParams = Extensible; +export type Message = CommandResponse | ErrorResponse | Event; +export type ErrorResponse = { + type: 'error'; + id: JsUint | null; + error: ErrorCode; + message: string; + stacktrace?: string; +} & Extensible; +export type EmptyResult = Extensible; +export type Extensible = { + [key: string]: any; +}; /** * Must be between `-9007199254740991` and `9007199254740991`, inclusive. */ -export type JsInt = (number); +export type JsInt = number; /** * Must be between `0` and `9007199254740991`, inclusive. */ -export type JsUint = (number); +export type JsUint = number; export declare const enum ErrorCode { - InvalidArgument = "invalid argument", - InvalidSelector = "invalid selector", - InvalidSessionId = "invalid session id", - InvalidWebExtension = "invalid web extension", - MoveTargetOutOfBounds = "move target out of bounds", - NoSuchAlert = "no such alert", - NoSuchNetworkCollector = "no such network collector", - NoSuchElement = "no such element", - NoSuchFrame = "no such frame", - NoSuchHandle = "no such handle", - NoSuchHistoryEntry = "no such history entry", - NoSuchIntercept = "no such intercept", - NoSuchNetworkData = "no such network data", - NoSuchNode = "no such node", - NoSuchRequest = "no such request", - NoSuchScript = "no such script", - NoSuchStoragePartition = "no such storage partition", - NoSuchUserContext = "no such user context", - NoSuchWebExtension = "no such web extension", - SessionNotCreated = "session not created", - UnableToCaptureScreen = "unable to capture screen", - UnableToCloseBrowser = "unable to close browser", - UnableToSetCookie = "unable to set cookie", - UnableToSetFileInput = "unable to set file input", - UnavailableNetworkData = "unavailable network data", - UnderspecifiedStoragePartition = "underspecified storage partition", - UnknownCommand = "unknown command", - UnknownError = "unknown error", - UnsupportedOperation = "unsupported operation" -} -export type SessionCommand = (Session.End | Session.New | Session.Status | Session.Subscribe | Session.Unsubscribe); + InvalidArgument = 'invalid argument', + InvalidSelector = 'invalid selector', + InvalidSessionId = 'invalid session id', + InvalidWebExtension = 'invalid web extension', + MoveTargetOutOfBounds = 'move target out of bounds', + NoSuchAlert = 'no such alert', + NoSuchNetworkCollector = 'no such network collector', + NoSuchElement = 'no such element', + NoSuchFrame = 'no such frame', + NoSuchHandle = 'no such handle', + NoSuchHistoryEntry = 'no such history entry', + NoSuchIntercept = 'no such intercept', + NoSuchNetworkData = 'no such network data', + NoSuchNode = 'no such node', + NoSuchRequest = 'no such request', + NoSuchScript = 'no such script', + NoSuchStoragePartition = 'no such storage partition', + NoSuchUserContext = 'no such user context', + NoSuchWebExtension = 'no such web extension', + SessionNotCreated = 'session not created', + UnableToCaptureScreen = 'unable to capture screen', + UnableToCloseBrowser = 'unable to close browser', + UnableToSetCookie = 'unable to set cookie', + UnableToSetFileInput = 'unable to set file input', + UnavailableNetworkData = 'unavailable network data', + UnderspecifiedStoragePartition = 'underspecified storage partition', + UnknownCommand = 'unknown command', + UnknownError = 'unknown error', + UnsupportedOperation = 'unsupported operation', +} +export type SessionCommand = + | Session.End + | Session.New + | Session.Status + | Session.Subscribe + | Session.Unsubscribe; export declare namespace Session { - type ProxyConfiguration = ((Session.AutodetectProxyConfiguration | Session.DirectProxyConfiguration | Session.ManualProxyConfiguration | Session.PacProxyConfiguration | Session.SystemProxyConfiguration)); -} -export type SessionResult = ((Session.NewResult | Session.StatusResult | Session.SubscribeResult)); + type ProxyConfiguration = + | Session.AutodetectProxyConfiguration + | Session.DirectProxyConfiguration + | Session.ManualProxyConfiguration + | Session.PacProxyConfiguration + | Session.SystemProxyConfiguration; +} +export type SessionResult = + | Session.NewResult + | Session.StatusResult + | Session.SubscribeResult; export declare namespace Session { - type CapabilitiesRequest = (({ - "alwaysMatch"?: (Session.CapabilityRequest); - "firstMatch"?: ([ - ...((Session.CapabilityRequest)[]) - ]); - })); + type CapabilitiesRequest = { + alwaysMatch?: Session.CapabilityRequest; + firstMatch?: [...Session.CapabilityRequest[]]; + }; } export declare namespace Session { - type CapabilityRequest = (({ - "acceptInsecureCerts"?: (boolean); - "browserName"?: (string); - "browserVersion"?: (string); - "platformName"?: (string); - "proxy"?: (Session.ProxyConfiguration); - "unhandledPromptBehavior"?: (Session.UserPromptHandler); - } & Extensible)); + type CapabilityRequest = { + acceptInsecureCerts?: boolean; + browserName?: string; + browserVersion?: string; + platformName?: string; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + } & Extensible; } export declare namespace Session { - type AutodetectProxyConfiguration = ({ - "proxyType": ("autodetect"); - } & Extensible); + type AutodetectProxyConfiguration = { + proxyType: 'autodetect'; + } & Extensible; } export declare namespace Session { - type DirectProxyConfiguration = ({ - "proxyType": ("direct"); - } & Extensible); + type DirectProxyConfiguration = { + proxyType: 'direct'; + } & Extensible; } export declare namespace Session { - type ManualProxyConfiguration = ({ - "proxyType": ("manual"); - "httpProxy"?: (string); - "sslProxy"?: (string); - } & ({} | Session.SocksProxyConfiguration) & { - "noProxy"?: ([ - ...((string)[]) - ]); - } & Extensible); + type ManualProxyConfiguration = { + proxyType: 'manual'; + httpProxy?: string; + sslProxy?: string; + } & ({} | Session.SocksProxyConfiguration) & { + noProxy?: [...string[]]; + } & Extensible; } export declare namespace Session { - type SocksProxyConfiguration = ({ - "socksProxy": (string); - /** - * Must be between `0` and `255`, inclusive. - */ - "socksVersion": (number); - }); + type SocksProxyConfiguration = { + socksProxy: string; + /** + * Must be between `0` and `255`, inclusive. + */ + socksVersion: number; + }; } export declare namespace Session { - type PacProxyConfiguration = ({ - "proxyType": ("pac"); - "proxyAutoconfigUrl": (string); - } & Extensible); + type PacProxyConfiguration = { + proxyType: 'pac'; + proxyAutoconfigUrl: string; + } & Extensible; } export declare namespace Session { - type SystemProxyConfiguration = ({ - "proxyType": ("system"); - } & Extensible); + type SystemProxyConfiguration = { + proxyType: 'system'; + } & Extensible; } export declare namespace Session { - type UserPromptHandler = (({ - "alert"?: (Session.UserPromptHandlerType); - "beforeUnload"?: (Session.UserPromptHandlerType); - "confirm"?: (Session.UserPromptHandlerType); - "default"?: (Session.UserPromptHandlerType); - "file"?: (Session.UserPromptHandlerType); - "prompt"?: (Session.UserPromptHandlerType); - })); + type UserPromptHandler = { + alert?: Session.UserPromptHandlerType; + beforeUnload?: Session.UserPromptHandlerType; + confirm?: Session.UserPromptHandlerType; + default?: Session.UserPromptHandlerType; + file?: Session.UserPromptHandlerType; + prompt?: Session.UserPromptHandlerType; + }; } export declare namespace Session { - const enum UserPromptHandlerType { - Accept = "accept", - Dismiss = "dismiss", - Ignore = "ignore" - } + const enum UserPromptHandlerType { + Accept = 'accept', + Dismiss = 'dismiss', + Ignore = 'ignore', + } } export declare namespace Session { - type Subscription = (string); + type Subscription = string; } export declare namespace Session { - type SubscriptionRequest = (({ - "events": ([ - (string), - ...(string)[] - ]); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SubscriptionRequest = { + events: [string, ...string[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Session { - type UnsubscribeByIdRequest = (({ - "subscriptions": ([ - (Session.Subscription), - ...(Session.Subscription)[] - ]); - })); + type UnsubscribeByIdRequest = { + subscriptions: [Session.Subscription, ...Session.Subscription[]]; + }; } export declare namespace Session { - type UnsubscribeByAttributesRequest = (({ - "events": ([ - (string), - ...(string)[] - ]); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - })); + type UnsubscribeByAttributesRequest = { + events: [string, ...string[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + }; } export declare namespace Session { - type Status = ({ - "method": ("session.status"); - "params": (EmptyParams); - }); + type Status = { + method: 'session.status'; + params: EmptyParams; + }; } export declare namespace Session { - type StatusResult = (({ - "ready": (boolean); - "message": (string); - })); + type StatusResult = { + ready: boolean; + message: string; + }; } export declare namespace Session { - type New = ({ - "method": ("session.new"); - "params": (Session.NewParameters); - }); + type New = { + method: 'session.new'; + params: Session.NewParameters; + }; } export declare namespace Session { - type NewParameters = (({ - "capabilities": (Session.CapabilitiesRequest); - })); + type NewParameters = { + capabilities: Session.CapabilitiesRequest; + }; } export declare namespace Session { - type NewResult = (({ - "sessionId": (string); - "capabilities": (({ - "acceptInsecureCerts": (boolean); - "browserName": (string); - "browserVersion": (string); - "platformName": (string); - "setWindowRect": (boolean); - "userAgent": (string); - "proxy"?: (Session.ProxyConfiguration); - "unhandledPromptBehavior"?: (Session.UserPromptHandler); - "webSocketUrl"?: (string); - } & Extensible)); - })); + type NewResult = { + sessionId: string; + capabilities: { + acceptInsecureCerts: boolean; + browserName: string; + browserVersion: string; + platformName: string; + setWindowRect: boolean; + userAgent: string; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + webSocketUrl?: string; + } & Extensible; + }; } export declare namespace Session { - type End = ({ - "method": ("session.end"); - "params": (EmptyParams); - }); + type End = { + method: 'session.end'; + params: EmptyParams; + }; } export declare namespace Session { - type Subscribe = ({ - "method": ("session.subscribe"); - "params": (Session.SubscriptionRequest); - }); + type Subscribe = { + method: 'session.subscribe'; + params: Session.SubscriptionRequest; + }; } export declare namespace Session { - type SubscribeResult = (({ - "subscription": (Session.Subscription); - })); + type SubscribeResult = { + subscription: Session.Subscription; + }; } export declare namespace Session { - type Unsubscribe = ({ - "method": ("session.unsubscribe"); - "params": (Session.UnsubscribeParameters); - }); + type Unsubscribe = { + method: 'session.unsubscribe'; + params: Session.UnsubscribeParameters; + }; } export declare namespace Session { - type UnsubscribeParameters = (Session.UnsubscribeByAttributesRequest | Session.UnsubscribeByIdRequest); -} -export type BrowserCommand = (Browser.Close | Browser.CreateUserContext | Browser.GetClientWindows | Browser.GetUserContexts | Browser.RemoveUserContext | Browser.SetClientWindowState); -export type BrowserResult = ((Browser.CreateUserContextResult | Browser.GetUserContextsResult)); + type UnsubscribeParameters = + | Session.UnsubscribeByAttributesRequest + | Session.UnsubscribeByIdRequest; +} +export type BrowserCommand = + | Browser.Close + | Browser.CreateUserContext + | Browser.GetClientWindows + | Browser.GetUserContexts + | Browser.RemoveUserContext + | Browser.SetClientWindowState; +export type BrowserResult = + | Browser.CreateUserContextResult + | Browser.GetUserContextsResult; export declare namespace Browser { - type ClientWindow = (string); + type ClientWindow = string; } export declare namespace Browser { - type ClientWindowInfo = (({ - "active": (boolean); - "clientWindow": (Browser.ClientWindow); - "height": (JsUint); - "state": ("fullscreen" | "maximized" | "minimized" | "normal"); - "width": (JsUint); - "x": (JsInt); - "y": (JsInt); - })); + type ClientWindowInfo = { + active: boolean; + clientWindow: Browser.ClientWindow; + height: JsUint; + state: 'fullscreen' | 'maximized' | 'minimized' | 'normal'; + width: JsUint; + x: JsInt; + y: JsInt; + }; } export declare namespace Browser { - type UserContext = (string); + type UserContext = string; } export declare namespace Browser { - type UserContextInfo = (({ - "userContext": (Browser.UserContext); - })); + type UserContextInfo = { + userContext: Browser.UserContext; + }; } export declare namespace Browser { - type Close = ({ - "method": ("browser.close"); - "params": (EmptyParams); - }); + type Close = { + method: 'browser.close'; + params: EmptyParams; + }; } export declare namespace Browser { - type CreateUserContext = ({ - "method": ("browser.createUserContext"); - "params": (Browser.CreateUserContextParameters); - }); + type CreateUserContext = { + method: 'browser.createUserContext'; + params: Browser.CreateUserContextParameters; + }; } export declare namespace Browser { - type CreateUserContextParameters = (({ - "acceptInsecureCerts"?: (boolean); - "proxy"?: (Session.ProxyConfiguration); - "unhandledPromptBehavior"?: (Session.UserPromptHandler); - })); + type CreateUserContextParameters = { + acceptInsecureCerts?: boolean; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + }; } export declare namespace Browser { - type CreateUserContextResult = (Browser.UserContextInfo); + type CreateUserContextResult = Browser.UserContextInfo; } export declare namespace Browser { - type GetClientWindows = ({ - "method": ("browser.getClientWindows"); - "params": (EmptyParams); - }); + type GetClientWindows = { + method: 'browser.getClientWindows'; + params: EmptyParams; + }; } export declare namespace Browser { - type GetClientWindowsResult = (({ - "clientWindows": ([ - ...((Browser.ClientWindowInfo)[]) - ]); - })); + type GetClientWindowsResult = { + clientWindows: [...Browser.ClientWindowInfo[]]; + }; } export declare namespace Browser { - type GetUserContexts = ({ - "method": ("browser.getUserContexts"); - "params": (EmptyParams); - }); + type GetUserContexts = { + method: 'browser.getUserContexts'; + params: EmptyParams; + }; } export declare namespace Browser { - type GetUserContextsResult = (({ - "userContexts": ([ - (Browser.UserContextInfo), - ...(Browser.UserContextInfo)[] - ]); - })); + type GetUserContextsResult = { + userContexts: [Browser.UserContextInfo, ...Browser.UserContextInfo[]]; + }; } export declare namespace Browser { - type RemoveUserContext = ({ - "method": ("browser.removeUserContext"); - "params": (Browser.RemoveUserContextParameters); - }); + type RemoveUserContext = { + method: 'browser.removeUserContext'; + params: Browser.RemoveUserContextParameters; + }; } export declare namespace Browser { - type RemoveUserContextParameters = (({ - "userContext": (Browser.UserContext); - })); + type RemoveUserContextParameters = { + userContext: Browser.UserContext; + }; } export declare namespace Browser { - type SetClientWindowState = ({ - "method": ("browser.setClientWindowState"); - "params": (Browser.SetClientWindowStateParameters); - }); + type SetClientWindowState = { + method: 'browser.setClientWindowState'; + params: Browser.SetClientWindowStateParameters; + }; } export declare namespace Browser { - type SetClientWindowStateParameters = (({ - "clientWindow": (Browser.ClientWindow); - } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState))); + type SetClientWindowStateParameters = { + clientWindow: Browser.ClientWindow; + } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState); } export declare namespace Browser { - type ClientWindowNamedState = ({ - "state": ("fullscreen" | "maximized" | "minimized"); - }); + type ClientWindowNamedState = { + state: 'fullscreen' | 'maximized' | 'minimized'; + }; } export declare namespace Browser { - type ClientWindowRectState = ({ - "state": ("normal"); - "width"?: (JsUint); - "height"?: (JsUint); - "x"?: (JsInt); - "y"?: (JsInt); - }); -} -export type BrowsingContextCommand = (BrowsingContext.Activate | BrowsingContext.CaptureScreenshot | BrowsingContext.Close | BrowsingContext.Create | BrowsingContext.GetTree | BrowsingContext.HandleUserPrompt | BrowsingContext.LocateNodes | BrowsingContext.Navigate | BrowsingContext.Print | BrowsingContext.Reload | BrowsingContext.SetViewport | BrowsingContext.TraverseHistory); -export type BrowsingContextEvent = (BrowsingContext.ContextCreated | BrowsingContext.ContextDestroyed | BrowsingContext.DomContentLoaded | BrowsingContext.DownloadEnd | BrowsingContext.DownloadWillBegin | BrowsingContext.FragmentNavigated | BrowsingContext.HistoryUpdated | BrowsingContext.Load | BrowsingContext.NavigationAborted | BrowsingContext.NavigationCommitted | BrowsingContext.NavigationFailed | BrowsingContext.NavigationStarted | BrowsingContext.UserPromptClosed | BrowsingContext.UserPromptOpened); -export type BrowsingContextResult = ((BrowsingContext.CaptureScreenshotResult | BrowsingContext.CreateResult | BrowsingContext.GetTreeResult | BrowsingContext.LocateNodesResult | BrowsingContext.NavigateResult | BrowsingContext.PrintResult | BrowsingContext.TraverseHistoryResult)); -export declare namespace BrowsingContext { - type BrowsingContext = (string); -} -export declare namespace BrowsingContext { - type InfoList = ([ - ...((BrowsingContext.Info)[]) - ]); -} -export declare namespace BrowsingContext { - type Info = (({ - "children": (BrowsingContext.InfoList | null); - "clientWindow": (Browser.ClientWindow); - "context": (BrowsingContext.BrowsingContext); - "originalOpener": (BrowsingContext.BrowsingContext | null); - "url": (string); - "userContext": (Browser.UserContext); - "parent"?: (BrowsingContext.BrowsingContext | null); - })); -} -export declare namespace BrowsingContext { - type Locator = ((BrowsingContext.AccessibilityLocator | BrowsingContext.CssLocator | BrowsingContext.ContextLocator | BrowsingContext.InnerTextLocator | BrowsingContext.XPathLocator)); -} -export declare namespace BrowsingContext { - type AccessibilityLocator = (({ - "type": ("accessibility"); - "value": (({ - "name"?: (string); - "role"?: (string); - })); - })); + type ClientWindowRectState = { + state: 'normal'; + width?: JsUint; + height?: JsUint; + x?: JsInt; + y?: JsInt; + }; +} +export type BrowsingContextCommand = + | BrowsingContext.Activate + | BrowsingContext.CaptureScreenshot + | BrowsingContext.Close + | BrowsingContext.Create + | BrowsingContext.GetTree + | BrowsingContext.HandleUserPrompt + | BrowsingContext.LocateNodes + | BrowsingContext.Navigate + | BrowsingContext.Print + | BrowsingContext.Reload + | BrowsingContext.SetViewport + | BrowsingContext.TraverseHistory; +export type BrowsingContextEvent = + | BrowsingContext.ContextCreated + | BrowsingContext.ContextDestroyed + | BrowsingContext.DomContentLoaded + | BrowsingContext.DownloadEnd + | BrowsingContext.DownloadWillBegin + | BrowsingContext.FragmentNavigated + | BrowsingContext.HistoryUpdated + | BrowsingContext.Load + | BrowsingContext.NavigationAborted + | BrowsingContext.NavigationCommitted + | BrowsingContext.NavigationFailed + | BrowsingContext.NavigationStarted + | BrowsingContext.UserPromptClosed + | BrowsingContext.UserPromptOpened; +export type BrowsingContextResult = + | BrowsingContext.CaptureScreenshotResult + | BrowsingContext.CreateResult + | BrowsingContext.GetTreeResult + | BrowsingContext.LocateNodesResult + | BrowsingContext.NavigateResult + | BrowsingContext.PrintResult + | BrowsingContext.TraverseHistoryResult; +export declare namespace BrowsingContext { + type BrowsingContext = string; +} +export declare namespace BrowsingContext { + type InfoList = [...BrowsingContext.Info[]]; +} +export declare namespace BrowsingContext { + type Info = { + children: BrowsingContext.InfoList | null; + clientWindow: Browser.ClientWindow; + context: BrowsingContext.BrowsingContext; + originalOpener: BrowsingContext.BrowsingContext | null; + url: string; + userContext: Browser.UserContext; + parent?: BrowsingContext.BrowsingContext | null; + }; +} +export declare namespace BrowsingContext { + type Locator = + | BrowsingContext.AccessibilityLocator + | BrowsingContext.CssLocator + | BrowsingContext.ContextLocator + | BrowsingContext.InnerTextLocator + | BrowsingContext.XPathLocator; +} +export declare namespace BrowsingContext { + type AccessibilityLocator = { + type: 'accessibility'; + value: { + name?: string; + role?: string; + }; + }; +} +export declare namespace BrowsingContext { + type CssLocator = { + type: 'css'; + value: string; + }; +} +export declare namespace BrowsingContext { + type ContextLocator = { + type: 'context'; + value: { + context: BrowsingContext.BrowsingContext; + }; + }; +} +export declare namespace BrowsingContext { + type InnerTextLocator = { + type: 'innerText'; + value: string; + ignoreCase?: boolean; + matchType?: 'full' | 'partial'; + maxDepth?: JsUint; + }; +} +export declare namespace BrowsingContext { + type XPathLocator = { + type: 'xpath'; + value: string; + }; } export declare namespace BrowsingContext { - type CssLocator = (({ - "type": ("css"); - "value": (string); - })); + type Navigation = string; +} +export declare namespace BrowsingContext { + type BaseNavigationInfo = { + context: BrowsingContext.BrowsingContext; + navigation: BrowsingContext.Navigation | null; + timestamp: JsUint; + url: string; + }; } export declare namespace BrowsingContext { - type ContextLocator = (({ - "type": ("context"); - "value": (({ - "context": (BrowsingContext.BrowsingContext); - })); - })); + type NavigationInfo = BrowsingContext.BaseNavigationInfo; } export declare namespace BrowsingContext { - type InnerTextLocator = (({ - "type": ("innerText"); - "value": (string); - "ignoreCase"?: (boolean); - "matchType"?: ("full" | "partial"); - "maxDepth"?: (JsUint); - })); + const enum ReadinessState { + None = 'none', + Interactive = 'interactive', + Complete = 'complete', + } } export declare namespace BrowsingContext { - type XPathLocator = (({ - "type": ("xpath"); - "value": (string); - })); + const enum UserPromptType { + Alert = 'alert', + Beforeunload = 'beforeunload', + Confirm = 'confirm', + Prompt = 'prompt', + } } export declare namespace BrowsingContext { - type Navigation = (string); + type Activate = { + method: 'browsingContext.activate'; + params: BrowsingContext.ActivateParameters; + }; } export declare namespace BrowsingContext { - type BaseNavigationInfo = ({ - "context": (BrowsingContext.BrowsingContext); - "navigation": (BrowsingContext.Navigation | null); - "timestamp": (JsUint); - "url": (string); - }); + type ActivateParameters = { + context: BrowsingContext.BrowsingContext; + }; } export declare namespace BrowsingContext { - type NavigationInfo = ((BrowsingContext.BaseNavigationInfo)); + type CaptureScreenshotParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `"viewport"` + */ + origin?: 'viewport' | 'document'; + format?: BrowsingContext.ImageFormat; + clip?: BrowsingContext.ClipRectangle; + }; } export declare namespace BrowsingContext { - const enum ReadinessState { - None = "none", - Interactive = "interactive", - Complete = "complete" - } + type CaptureScreenshot = { + method: 'browsingContext.captureScreenshot'; + params: BrowsingContext.CaptureScreenshotParameters; + }; } export declare namespace BrowsingContext { - const enum UserPromptType { - Alert = "alert", - Beforeunload = "beforeunload", - Confirm = "confirm", - Prompt = "prompt" - } + type ImageFormat = { + type: string; + /** + * Must be between `0` and `1`, inclusive. + */ + quality?: number; + }; } export declare namespace BrowsingContext { - type Activate = ({ - "method": ("browsingContext.activate"); - "params": (BrowsingContext.ActivateParameters); - }); + type ClipRectangle = + | BrowsingContext.BoxClipRectangle + | BrowsingContext.ElementClipRectangle; } export declare namespace BrowsingContext { - type ActivateParameters = (({ - "context": (BrowsingContext.BrowsingContext); - })); + type ElementClipRectangle = { + type: 'element'; + element: Script.SharedReference; + }; } export declare namespace BrowsingContext { - type CaptureScreenshotParameters = (({ - "context": (BrowsingContext.BrowsingContext); - /** - * @defaultValue `"viewport"` - */ - "origin"?: (("viewport" | "document")); - "format"?: (BrowsingContext.ImageFormat); - "clip"?: (BrowsingContext.ClipRectangle); - })); + type BoxClipRectangle = { + type: 'box'; + x: number; + y: number; + width: number; + height: number; + }; } export declare namespace BrowsingContext { - type CaptureScreenshot = ({ - "method": ("browsingContext.captureScreenshot"); - "params": (BrowsingContext.CaptureScreenshotParameters); - }); + type CaptureScreenshotResult = { + data: string; + }; } export declare namespace BrowsingContext { - type ImageFormat = (({ - "type": (string); - /** - * Must be between `0` and `1`, inclusive. - */ - "quality"?: (number); - })); + type Close = { + method: 'browsingContext.close'; + params: BrowsingContext.CloseParameters; + }; } export declare namespace BrowsingContext { - type ClipRectangle = ((BrowsingContext.BoxClipRectangle | BrowsingContext.ElementClipRectangle)); + type CloseParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + promptUnload?: boolean; + }; } export declare namespace BrowsingContext { - type ElementClipRectangle = (({ - "type": ("element"); - "element": (Script.SharedReference); - })); + type Create = { + method: 'browsingContext.create'; + params: BrowsingContext.CreateParameters; + }; } export declare namespace BrowsingContext { - type BoxClipRectangle = (({ - "type": ("box"); - "x": (number); - "y": (number); - "width": (number); - "height": (number); - })); + const enum CreateType { + Tab = 'tab', + Window = 'window', + } } export declare namespace BrowsingContext { - type CaptureScreenshotResult = (({ - "data": (string); - })); + type CreateParameters = { + type: BrowsingContext.CreateType; + referenceContext?: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + background?: boolean; + userContext?: Browser.UserContext; + }; } export declare namespace BrowsingContext { - type Close = ({ - "method": ("browsingContext.close"); - "params": (BrowsingContext.CloseParameters); - }); + type CreateResult = { + context: BrowsingContext.BrowsingContext; + }; } export declare namespace BrowsingContext { - type CloseParameters = (({ - "context": (BrowsingContext.BrowsingContext); - /** - * @defaultValue `false` - */ - "promptUnload"?: (boolean); - })); + type GetTree = { + method: 'browsingContext.getTree'; + params: BrowsingContext.GetTreeParameters; + }; } export declare namespace BrowsingContext { - type Create = ({ - "method": ("browsingContext.create"); - "params": (BrowsingContext.CreateParameters); - }); + type GetTreeParameters = { + maxDepth?: JsUint; + root?: BrowsingContext.BrowsingContext; + }; } export declare namespace BrowsingContext { - const enum CreateType { - Tab = "tab", - Window = "window" - } + type GetTreeResult = { + contexts: BrowsingContext.InfoList; + }; } export declare namespace BrowsingContext { - type CreateParameters = (({ - "type": (BrowsingContext.CreateType); - "referenceContext"?: (BrowsingContext.BrowsingContext); - /** - * @defaultValue `false` - */ - "background"?: (boolean); - "userContext"?: (Browser.UserContext); - })); + type HandleUserPrompt = { + method: 'browsingContext.handleUserPrompt'; + params: BrowsingContext.HandleUserPromptParameters; + }; } -export declare namespace BrowsingContext { - type CreateResult = (({ - "context": (BrowsingContext.BrowsingContext); - })); +export declare namespace BrowsingContext { + type HandleUserPromptParameters = { + context: BrowsingContext.BrowsingContext; + accept?: boolean; + userText?: string; + }; +} +export declare namespace BrowsingContext { + type LocateNodesParameters = { + context: BrowsingContext.BrowsingContext; + locator: BrowsingContext.Locator; + /** + * Must be greater than or equal to `1`. + */ + maxNodeCount?: JsUint; + serializationOptions?: Script.SerializationOptions; + startNodes?: [Script.SharedReference, ...Script.SharedReference[]]; + }; +} +export declare namespace BrowsingContext { + type LocateNodes = { + method: 'browsingContext.locateNodes'; + params: BrowsingContext.LocateNodesParameters; + }; +} +export declare namespace BrowsingContext { + type LocateNodesResult = { + nodes: [...Script.NodeRemoteValue[]]; + }; +} +export declare namespace BrowsingContext { + type Navigate = { + method: 'browsingContext.navigate'; + params: BrowsingContext.NavigateParameters; + }; +} +export declare namespace BrowsingContext { + type NavigateParameters = { + context: BrowsingContext.BrowsingContext; + url: string; + wait?: BrowsingContext.ReadinessState; + }; +} +export declare namespace BrowsingContext { + type NavigateResult = { + navigation: BrowsingContext.Navigation | null; + url: string; + }; +} +export declare namespace BrowsingContext { + type Print = { + method: 'browsingContext.print'; + params: BrowsingContext.PrintParameters; + }; +} +export declare namespace BrowsingContext { + type PrintParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + background?: boolean; + margin?: BrowsingContext.PrintMarginParameters; + /** + * @defaultValue `"portrait"` + */ + orientation?: 'portrait' | 'landscape'; + page?: BrowsingContext.PrintPageParameters; + pageRanges?: [...(JsUint | string)[]]; + /** + * Must be between `0.1` and `2`, inclusive. + * + * @defaultValue `1` + */ + scale?: number; + /** + * @defaultValue `true` + */ + shrinkToFit?: boolean; + }; +} +export declare namespace BrowsingContext { + type PrintMarginParameters = { + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + bottom?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + left?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + right?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + top?: number; + }; +} +export declare namespace BrowsingContext { + type PrintPageParameters = { + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `27.94` + */ + height?: number; + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `21.59` + */ + width?: number; + }; } -export declare namespace BrowsingContext { - type GetTree = ({ - "method": ("browsingContext.getTree"); - "params": (BrowsingContext.GetTreeParameters); - }); +export declare namespace BrowsingContext { + type PrintResult = { + data: string; + }; +} +export declare namespace BrowsingContext { + type Reload = { + method: 'browsingContext.reload'; + params: BrowsingContext.ReloadParameters; + }; +} +export declare namespace BrowsingContext { + type ReloadParameters = { + context: BrowsingContext.BrowsingContext; + ignoreCache?: boolean; + wait?: BrowsingContext.ReadinessState; + }; } -export declare namespace BrowsingContext { - type GetTreeParameters = (({ - "maxDepth"?: (JsUint); - "root"?: (BrowsingContext.BrowsingContext); - })); +export declare namespace BrowsingContext { + type SetViewport = { + method: 'browsingContext.setViewport'; + params: BrowsingContext.SetViewportParameters; + }; } -export declare namespace BrowsingContext { - type GetTreeResult = (({ - "contexts": (BrowsingContext.InfoList); - })); +export declare namespace BrowsingContext { + type SetViewportParameters = { + context?: BrowsingContext.BrowsingContext; + viewport?: BrowsingContext.Viewport | null; + /** + * Must be greater than `0`. + */ + devicePixelRatio?: number | null; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace BrowsingContext { - type HandleUserPrompt = ({ - "method": ("browsingContext.handleUserPrompt"); - "params": (BrowsingContext.HandleUserPromptParameters); - }); + type Viewport = { + width: JsUint; + height: JsUint; + }; } export declare namespace BrowsingContext { - type HandleUserPromptParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "accept"?: (boolean); - "userText"?: (string); - })); -} -export declare namespace BrowsingContext { - type LocateNodesParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "locator": (BrowsingContext.Locator); - /** - * Must be greater than or equal to `1`. - */ - "maxNodeCount"?: ((JsUint)); - "serializationOptions"?: (Script.SerializationOptions); - "startNodes"?: ([ - (Script.SharedReference), - ...(Script.SharedReference)[] - ]); - })); -} -export declare namespace BrowsingContext { - type LocateNodes = ({ - "method": ("browsingContext.locateNodes"); - "params": (BrowsingContext.LocateNodesParameters); - }); -} -export declare namespace BrowsingContext { - type LocateNodesResult = (({ - "nodes": ([ - ...((Script.NodeRemoteValue)[]) - ]); - })); -} -export declare namespace BrowsingContext { - type Navigate = ({ - "method": ("browsingContext.navigate"); - "params": (BrowsingContext.NavigateParameters); - }); -} -export declare namespace BrowsingContext { - type NavigateParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "url": (string); - "wait"?: (BrowsingContext.ReadinessState); - })); -} -export declare namespace BrowsingContext { - type NavigateResult = (({ - "navigation": (BrowsingContext.Navigation | null); - "url": (string); - })); -} -export declare namespace BrowsingContext { - type Print = ({ - "method": ("browsingContext.print"); - "params": (BrowsingContext.PrintParameters); - }); -} -export declare namespace BrowsingContext { - type PrintParameters = (({ - "context": (BrowsingContext.BrowsingContext); - /** - * @defaultValue `false` - */ - "background"?: (boolean); - "margin"?: (BrowsingContext.PrintMarginParameters); - /** - * @defaultValue `"portrait"` - */ - "orientation"?: (("portrait" | "landscape")); - "page"?: (BrowsingContext.PrintPageParameters); - "pageRanges"?: ([ - ...((JsUint | string)[]) - ]); - /** - * Must be between `0.1` and `2`, inclusive. - * - * @defaultValue `1` - */ - "scale"?: ((number)); - /** - * @defaultValue `true` - */ - "shrinkToFit"?: (boolean); - })); -} -export declare namespace BrowsingContext { - type PrintMarginParameters = (({ - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - "bottom"?: ((number)); - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - "left"?: ((number)); - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - "right"?: ((number)); - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - "top"?: ((number)); - })); -} -export declare namespace BrowsingContext { - type PrintPageParameters = (({ - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `27.94` - */ - "height"?: ((number)); - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `21.59` - */ - "width"?: ((number)); - })); -} -export declare namespace BrowsingContext { - type PrintResult = (({ - "data": (string); - })); -} -export declare namespace BrowsingContext { - type Reload = ({ - "method": ("browsingContext.reload"); - "params": (BrowsingContext.ReloadParameters); - }); -} -export declare namespace BrowsingContext { - type ReloadParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "ignoreCache"?: (boolean); - "wait"?: (BrowsingContext.ReadinessState); - })); -} -export declare namespace BrowsingContext { - type SetViewport = ({ - "method": ("browsingContext.setViewport"); - "params": (BrowsingContext.SetViewportParameters); - }); -} -export declare namespace BrowsingContext { - type SetViewportParameters = (({ - "context"?: (BrowsingContext.BrowsingContext); - "viewport"?: (BrowsingContext.Viewport | null); - /** - * Must be greater than `0`. - */ - "devicePixelRatio"?: ((number) | null); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type TraverseHistory = { + method: 'browsingContext.traverseHistory'; + params: BrowsingContext.TraverseHistoryParameters; + }; } export declare namespace BrowsingContext { - type Viewport = (({ - "width": (JsUint); - "height": (JsUint); - })); + type TraverseHistoryParameters = { + context: BrowsingContext.BrowsingContext; + delta: JsInt; + }; } export declare namespace BrowsingContext { - type TraverseHistory = ({ - "method": ("browsingContext.traverseHistory"); - "params": (BrowsingContext.TraverseHistoryParameters); - }); + type TraverseHistoryResult = Record; } export declare namespace BrowsingContext { - type TraverseHistoryParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "delta": (JsInt); - })); + type ContextCreated = { + method: 'browsingContext.contextCreated'; + params: BrowsingContext.Info; + }; } export declare namespace BrowsingContext { - type TraverseHistoryResult = ((Record)); + type ContextDestroyed = { + method: 'browsingContext.contextDestroyed'; + params: BrowsingContext.Info; + }; } export declare namespace BrowsingContext { - type ContextCreated = ({ - "method": ("browsingContext.contextCreated"); - "params": (BrowsingContext.Info); - }); + type NavigationStarted = { + method: 'browsingContext.navigationStarted'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type ContextDestroyed = ({ - "method": ("browsingContext.contextDestroyed"); - "params": (BrowsingContext.Info); - }); + type FragmentNavigated = { + method: 'browsingContext.fragmentNavigated'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type NavigationStarted = ({ - "method": ("browsingContext.navigationStarted"); - "params": (BrowsingContext.NavigationInfo); - }); + type HistoryUpdated = { + method: 'browsingContext.historyUpdated'; + params: BrowsingContext.HistoryUpdatedParameters; + }; } export declare namespace BrowsingContext { - type FragmentNavigated = ({ - "method": ("browsingContext.fragmentNavigated"); - "params": (BrowsingContext.NavigationInfo); - }); + type HistoryUpdatedParameters = { + context: BrowsingContext.BrowsingContext; + timestamp: JsUint; + url: string; + }; } export declare namespace BrowsingContext { - type HistoryUpdated = ({ - "method": ("browsingContext.historyUpdated"); - "params": (BrowsingContext.HistoryUpdatedParameters); - }); + type DomContentLoaded = { + method: 'browsingContext.domContentLoaded'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type HistoryUpdatedParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "timestamp": (JsUint); - "url": (string); - })); + type Load = { + method: 'browsingContext.load'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type DomContentLoaded = ({ - "method": ("browsingContext.domContentLoaded"); - "params": (BrowsingContext.NavigationInfo); - }); + type DownloadWillBegin = { + method: 'browsingContext.downloadWillBegin'; + params: BrowsingContext.DownloadWillBeginParams; + }; } export declare namespace BrowsingContext { - type Load = ({ - "method": ("browsingContext.load"); - "params": (BrowsingContext.NavigationInfo); - }); + type DownloadWillBeginParams = { + suggestedFilename: string; + } & BrowsingContext.BaseNavigationInfo; } export declare namespace BrowsingContext { - type DownloadWillBegin = ({ - "method": ("browsingContext.downloadWillBegin"); - "params": (BrowsingContext.DownloadWillBeginParams); - }); + type DownloadEnd = { + method: 'browsingContext.downloadEnd'; + params: BrowsingContext.DownloadEndParams; + }; } export declare namespace BrowsingContext { - type DownloadWillBeginParams = (({ - "suggestedFilename": (string); - } & BrowsingContext.BaseNavigationInfo)); + type DownloadEndParams = + | BrowsingContext.DownloadCanceledParams + | BrowsingContext.DownloadCompleteParams; } export declare namespace BrowsingContext { - type DownloadEnd = ({ - "method": ("browsingContext.downloadEnd"); - "params": (BrowsingContext.DownloadEndParams); - }); + type DownloadCanceledParams = { + status: 'canceled'; + } & BrowsingContext.BaseNavigationInfo; } export declare namespace BrowsingContext { - type DownloadEndParams = (((BrowsingContext.DownloadCanceledParams | BrowsingContext.DownloadCompleteParams))); + type DownloadCompleteParams = { + status: 'complete'; + filepath: string | null; + } & BrowsingContext.BaseNavigationInfo; } export declare namespace BrowsingContext { - type DownloadCanceledParams = ({ - "status": ("canceled"); - } & BrowsingContext.BaseNavigationInfo); + type NavigationAborted = { + method: 'browsingContext.navigationAborted'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type DownloadCompleteParams = ({ - "status": ("complete"); - "filepath": (string | null); - } & BrowsingContext.BaseNavigationInfo); + type NavigationCommitted = { + method: 'browsingContext.navigationCommitted'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type NavigationAborted = ({ - "method": ("browsingContext.navigationAborted"); - "params": (BrowsingContext.NavigationInfo); - }); + type NavigationFailed = { + method: 'browsingContext.navigationFailed'; + params: BrowsingContext.NavigationInfo; + }; } export declare namespace BrowsingContext { - type NavigationCommitted = ({ - "method": ("browsingContext.navigationCommitted"); - "params": (BrowsingContext.NavigationInfo); - }); + type UserPromptClosed = { + method: 'browsingContext.userPromptClosed'; + params: BrowsingContext.UserPromptClosedParameters; + }; } export declare namespace BrowsingContext { - type NavigationFailed = ({ - "method": ("browsingContext.navigationFailed"); - "params": (BrowsingContext.NavigationInfo); - }); + type UserPromptClosedParameters = { + context: BrowsingContext.BrowsingContext; + accepted: boolean; + type: BrowsingContext.UserPromptType; + userText?: string; + }; } export declare namespace BrowsingContext { - type UserPromptClosed = ({ - "method": ("browsingContext.userPromptClosed"); - "params": (BrowsingContext.UserPromptClosedParameters); - }); + type UserPromptOpened = { + method: 'browsingContext.userPromptOpened'; + params: BrowsingContext.UserPromptOpenedParameters; + }; } export declare namespace BrowsingContext { - type UserPromptClosedParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "accepted": (boolean); - "type": (BrowsingContext.UserPromptType); - "userText"?: (string); - })); + type UserPromptOpenedParameters = { + context: BrowsingContext.BrowsingContext; + handler: Session.UserPromptHandlerType; + message: string; + type: BrowsingContext.UserPromptType; + defaultValue?: string; + }; } -export declare namespace BrowsingContext { - type UserPromptOpened = ({ - "method": ("browsingContext.userPromptOpened"); - "params": (BrowsingContext.UserPromptOpenedParameters); - }); -} -export declare namespace BrowsingContext { - type UserPromptOpenedParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "handler": (Session.UserPromptHandlerType); - "message": (string); - "type": (BrowsingContext.UserPromptType); - "defaultValue"?: (string); - })); -} -export type EmulationCommand = (Emulation.SetForcedColorsModeThemeOverride | Emulation.SetGeolocationOverride | Emulation.SetLocaleOverride | Emulation.SetScreenOrientationOverride | Emulation.SetScriptingEnabled | Emulation.SetTimezoneOverride | Emulation.SetUserAgentOverride); +export type EmulationCommand = + | Emulation.SetForcedColorsModeThemeOverride + | Emulation.SetGeolocationOverride + | Emulation.SetLocaleOverride + | Emulation.SetScreenOrientationOverride + | Emulation.SetScriptingEnabled + | Emulation.SetTimezoneOverride + | Emulation.SetUserAgentOverride; export declare namespace Emulation { - type SetForcedColorsModeThemeOverride = ({ - "method": ("emulation.setForcedColorsModeThemeOverride"); - "params": (Emulation.SetForcedColorsModeThemeOverrideParameters); - }); + type SetForcedColorsModeThemeOverride = { + method: 'emulation.setForcedColorsModeThemeOverride'; + params: Emulation.SetForcedColorsModeThemeOverrideParameters; + }; } export declare namespace Emulation { - type SetForcedColorsModeThemeOverrideParameters = (({ - "theme": (Emulation.ForcedColorsModeTheme | null); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetForcedColorsModeThemeOverrideParameters = { + theme: Emulation.ForcedColorsModeTheme | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Emulation { - const enum ForcedColorsModeTheme { - Light = "light", - Dark = "dark" - } + const enum ForcedColorsModeTheme { + Light = 'light', + Dark = 'dark', + } } export declare namespace Emulation { - type SetGeolocationOverride = ({ - "method": ("emulation.setGeolocationOverride"); - "params": (Emulation.SetGeolocationOverrideParameters); - }); + type SetGeolocationOverride = { + method: 'emulation.setGeolocationOverride'; + params: Emulation.SetGeolocationOverrideParameters; + }; } export declare namespace Emulation { - type SetGeolocationOverrideParameters = (((({ - "coordinates": (Emulation.GeolocationCoordinates | null); - }) | ({ - "error": (Emulation.GeolocationPositionError); - })) & { - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetGeolocationOverrideParameters = ( + | { + coordinates: Emulation.GeolocationCoordinates | null; + } + | { + error: Emulation.GeolocationPositionError; + } + ) & { + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Emulation { - type GeolocationCoordinates = (({ - /** - * Must be between `-90` and `90`, inclusive. - */ - "latitude": (number); - /** - * Must be between `-180` and `180`, inclusive. - */ - "longitude": (number); - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - "accuracy"?: ((number)); - /** - * @defaultValue `null` - */ - "altitude"?: (number | null); - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - "altitudeAccuracy"?: ((number) | null); - /** - * Must be between `0` and `360`. - * - * @defaultValue `null` - */ - "heading"?: ((number) | null); - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - "speed"?: ((number) | null); - })); + type GeolocationCoordinates = { + /** + * Must be between `-90` and `90`, inclusive. + */ + latitude: number; + /** + * Must be between `-180` and `180`, inclusive. + */ + longitude: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + accuracy?: number; + /** + * @defaultValue `null` + */ + altitude?: number | null; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + altitudeAccuracy?: number | null; + /** + * Must be between `0` and `360`. + * + * @defaultValue `null` + */ + heading?: number | null; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + speed?: number | null; + }; } export declare namespace Emulation { - type GeolocationPositionError = (({ - "type": ("positionUnavailable"); - })); + type GeolocationPositionError = { + type: 'positionUnavailable'; + }; } export declare namespace Emulation { - type SetLocaleOverride = ({ - "method": ("emulation.setLocaleOverride"); - "params": (Emulation.SetLocaleOverrideParameters); - }); + type SetLocaleOverride = { + method: 'emulation.setLocaleOverride'; + params: Emulation.SetLocaleOverrideParameters; + }; } export declare namespace Emulation { - type SetLocaleOverrideParameters = (({ - "locale": (string | null); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetLocaleOverrideParameters = { + locale: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Emulation { - type SetScreenOrientationOverride = ({ - "method": ("emulation.setScreenOrientationOverride"); - "params": (Emulation.SetScreenOrientationOverrideParameters); - }); + type SetScreenOrientationOverride = { + method: 'emulation.setScreenOrientationOverride'; + params: Emulation.SetScreenOrientationOverrideParameters; + }; } export declare namespace Emulation { - const enum ScreenOrientationNatural { - Portrait = "portrait", - Landscape = "landscape" - } + const enum ScreenOrientationNatural { + Portrait = 'portrait', + Landscape = 'landscape', + } } export declare namespace Emulation { - type ScreenOrientationType = ("portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"); + type ScreenOrientationType = + | 'portrait-primary' + | 'portrait-secondary' + | 'landscape-primary' + | 'landscape-secondary'; } export declare namespace Emulation { - type ScreenOrientation = (({ - "natural": (Emulation.ScreenOrientationNatural); - "type": (Emulation.ScreenOrientationType); - })); + type ScreenOrientation = { + natural: Emulation.ScreenOrientationNatural; + type: Emulation.ScreenOrientationType; + }; } export declare namespace Emulation { - type SetScreenOrientationOverrideParameters = (({ - "screenOrientation": (Emulation.ScreenOrientation | null); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetScreenOrientationOverrideParameters = { + screenOrientation: Emulation.ScreenOrientation | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Emulation { - type SetUserAgentOverride = ({ - "method": ("emulation.setUserAgentOverride"); - "params": (Emulation.SetUserAgentOverrideParameters); - }); + type SetUserAgentOverride = { + method: 'emulation.setUserAgentOverride'; + params: Emulation.SetUserAgentOverrideParameters; + }; } export declare namespace Emulation { - type SetUserAgentOverrideParameters = (({ - "userAgent": (string | null); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetUserAgentOverrideParameters = { + userAgent: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Emulation { - type SetScriptingEnabled = ({ - "method": ("emulation.setScriptingEnabled"); - "params": (Emulation.SetScriptingEnabledParameters); - }); + type SetScriptingEnabled = { + method: 'emulation.setScriptingEnabled'; + params: Emulation.SetScriptingEnabledParameters; + }; } export declare namespace Emulation { - type SetScriptingEnabledParameters = (({ - "enabled": (false | null); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetScriptingEnabledParameters = { + enabled: false | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Emulation { - type SetTimezoneOverride = ({ - "method": ("emulation.setTimezoneOverride"); - "params": (Emulation.SetTimezoneOverrideParameters); - }); + type SetTimezoneOverride = { + method: 'emulation.setTimezoneOverride'; + params: Emulation.SetTimezoneOverrideParameters; + }; } export declare namespace Emulation { - type SetTimezoneOverrideParameters = (({ - "timezone": (string | null); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); -} -export type NetworkCommand = (Network.AddDataCollector | Network.AddIntercept | Network.ContinueRequest | Network.ContinueResponse | Network.ContinueWithAuth | Network.DisownData | Network.FailRequest | Network.GetData | Network.ProvideResponse | Network.RemoveDataCollector | Network.RemoveIntercept | Network.SetCacheBehavior | Network.SetExtraHeaders); -export type NetworkEvent = (Network.AuthRequired | Network.BeforeRequestSent | Network.FetchError | Network.ResponseCompleted | Network.ResponseStarted); -export type NetworkResult = ((Network.AddInterceptResult)); -export declare namespace Network { - type AuthChallenge = (({ - "scheme": (string); - "realm": (string); - })); + type SetTimezoneOverrideParameters = { + timezone: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; +} +export type NetworkCommand = + | Network.AddDataCollector + | Network.AddIntercept + | Network.ContinueRequest + | Network.ContinueResponse + | Network.ContinueWithAuth + | Network.DisownData + | Network.FailRequest + | Network.GetData + | Network.ProvideResponse + | Network.RemoveDataCollector + | Network.RemoveIntercept + | Network.SetCacheBehavior + | Network.SetExtraHeaders; +export type NetworkEvent = + | Network.AuthRequired + | Network.BeforeRequestSent + | Network.FetchError + | Network.ResponseCompleted + | Network.ResponseStarted; +export type NetworkResult = Network.AddInterceptResult; +export declare namespace Network { + type AuthChallenge = { + scheme: string; + realm: string; + }; +} +export declare namespace Network { + type AuthCredentials = { + type: 'password'; + username: string; + password: string; + }; +} +export declare namespace Network { + type BaseParameters = { + context: BrowsingContext.BrowsingContext | null; + isBlocked: boolean; + navigation: BrowsingContext.Navigation | null; + redirectCount: JsUint; + request: Network.RequestData; + timestamp: JsUint; + intercepts?: [Network.Intercept, ...Network.Intercept[]]; + }; +} +export declare namespace Network { + type BytesValue = Network.StringValue | Network.Base64Value; +} +export declare namespace Network { + type StringValue = { + type: 'string'; + value: string; + }; +} +export declare namespace Network { + type Base64Value = { + type: 'base64'; + value: string; + }; +} +export declare namespace Network { + type Collector = string; +} +export declare namespace Network { + const enum CollectorType { + Blob = 'blob', + } +} +export declare namespace Network { + const enum SameSite { + Strict = 'strict', + Lax = 'lax', + None = 'none', + Default = 'default', + } +} +export declare namespace Network { + type Cookie = { + name: string; + value: Network.BytesValue; + domain: string; + path: string; + size: JsUint; + httpOnly: boolean; + secure: boolean; + sameSite: Network.SameSite; + expiry?: JsUint; + } & Extensible; +} +export declare namespace Network { + type CookieHeader = { + name: string; + value: Network.BytesValue; + }; +} +export declare namespace Network { + const enum DataType { + Response = 'response', + } +} +export declare namespace Network { + type FetchTimingInfo = { + timeOrigin: number; + requestTime: number; + redirectStart: number; + redirectEnd: number; + fetchStart: number; + dnsStart: number; + dnsEnd: number; + connectStart: number; + connectEnd: number; + tlsStart: number; + requestStart: number; + responseStart: number; + responseEnd: number; + }; +} +export declare namespace Network { + type Header = { + name: string; + value: Network.BytesValue; + }; } export declare namespace Network { - type AuthCredentials = (({ - "type": ("password"); - "username": (string); - "password": (string); - })); -} -export declare namespace Network { - type BaseParameters = ({ - "context": (BrowsingContext.BrowsingContext | null); - "isBlocked": (boolean); - "navigation": (BrowsingContext.Navigation | null); - "redirectCount": (JsUint); - "request": (Network.RequestData); - "timestamp": (JsUint); - "intercepts"?: ([ - (Network.Intercept), - ...(Network.Intercept)[] - ]); - }); + type Initiator = { + columnNumber?: JsUint; + lineNumber?: JsUint; + request?: Network.Request; + stackTrace?: Script.StackTrace; + type?: 'parser' | 'script' | 'preflight' | 'other'; + }; } export declare namespace Network { - type BytesValue = (Network.StringValue | Network.Base64Value); + type Intercept = string; } export declare namespace Network { - type StringValue = (({ - "type": ("string"); - "value": (string); - })); -} -export declare namespace Network { - type Base64Value = (({ - "type": ("base64"); - "value": (string); - })); -} + type Request = string; +} +export declare namespace Network { + type RequestData = { + request: Network.Request; + url: string; + method: string; + headers: [...Network.Header[]]; + cookies: [...Network.Cookie[]]; + headersSize: JsUint; + bodySize: JsUint | null; + destination: string; + initiatorType: string | null; + timings: Network.FetchTimingInfo; + }; +} +export declare namespace Network { + type ResponseContent = { + size: JsUint; + }; +} +export declare namespace Network { + type ResponseData = { + url: string; + protocol: string; + status: JsUint; + statusText: string; + fromCache: boolean; + headers: [...Network.Header[]]; + mimeType: string; + bytesReceived: JsUint; + headersSize: JsUint | null; + bodySize: JsUint | null; + content: Network.ResponseContent; + authChallenges?: [...Network.AuthChallenge[]]; + }; +} +export declare namespace Network { + type SetCookieHeader = { + name: string; + value: Network.BytesValue; + domain?: string; + httpOnly?: boolean; + expiry?: string; + maxAge?: JsInt; + path?: string; + sameSite?: Network.SameSite; + secure?: boolean; + }; +} +export declare namespace Network { + type UrlPattern = Network.UrlPatternPattern | Network.UrlPatternString; +} +export declare namespace Network { + type UrlPatternPattern = { + type: 'pattern'; + protocol?: string; + hostname?: string; + port?: string; + pathname?: string; + search?: string; + }; +} +export declare namespace Network { + type UrlPatternString = { + type: 'string'; + pattern: string; + }; +} export declare namespace Network { - type Collector = (string); + type AddDataCollector = { + method: 'network.addDataCollector'; + params: Network.AddDataCollectorParameters; + }; } export declare namespace Network { - const enum CollectorType { - Blob = "blob" - } -} -export declare namespace Network { - const enum SameSite { - Strict = "strict", - Lax = "lax", - None = "none", - Default = "default" - } -} -export declare namespace Network { - type Cookie = (({ - "name": (string); - "value": (Network.BytesValue); - "domain": (string); - "path": (string); - "size": (JsUint); - "httpOnly": (boolean); - "secure": (boolean); - "sameSite": (Network.SameSite); - "expiry"?: (JsUint); - } & Extensible)); -} -export declare namespace Network { - type CookieHeader = (({ - "name": (string); - "value": (Network.BytesValue); - })); -} -export declare namespace Network { - const enum DataType { - Response = "response" - } -} -export declare namespace Network { - type FetchTimingInfo = (({ - "timeOrigin": (number); - "requestTime": (number); - "redirectStart": (number); - "redirectEnd": (number); - "fetchStart": (number); - "dnsStart": (number); - "dnsEnd": (number); - "connectStart": (number); - "connectEnd": (number); - "tlsStart": (number); - "requestStart": (number); - "responseStart": (number); - "responseEnd": (number); - })); -} -export declare namespace Network { - type Header = (({ - "name": (string); - "value": (Network.BytesValue); - })); + type AddDataCollectorParameters = { + dataTypes: [Network.DataType, ...Network.DataType[]]; + maxEncodedDataSize: JsUint; + /** + * @defaultValue `"blob"` + */ + collectorType?: Network.CollectorType; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export declare namespace Network { - type Initiator = (({ - "columnNumber"?: (JsUint); - "lineNumber"?: (JsUint); - "request"?: (Network.Request); - "stackTrace"?: (Script.StackTrace); - "type"?: ("parser" | "script" | "preflight" | "other"); - })); -} -export declare namespace Network { - type Intercept = (string); -} -export declare namespace Network { - type Request = (string); -} -export declare namespace Network { - type RequestData = (({ - "request": (Network.Request); - "url": (string); - "method": (string); - "headers": ([ - ...((Network.Header)[]) - ]); - "cookies": ([ - ...((Network.Cookie)[]) - ]); - "headersSize": (JsUint); - "bodySize": (JsUint | null); - "destination": (string); - "initiatorType": (string | null); - "timings": (Network.FetchTimingInfo); - })); -} -export declare namespace Network { - type ResponseContent = (({ - "size": (JsUint); - })); -} -export declare namespace Network { - type ResponseData = (({ - "url": (string); - "protocol": (string); - "status": (JsUint); - "statusText": (string); - "fromCache": (boolean); - "headers": ([ - ...((Network.Header)[]) - ]); - "mimeType": (string); - "bytesReceived": (JsUint); - "headersSize": (JsUint | null); - "bodySize": (JsUint | null); - "content": (Network.ResponseContent); - "authChallenges"?: ([ - ...((Network.AuthChallenge)[]) - ]); - })); -} -export declare namespace Network { - type SetCookieHeader = (({ - "name": (string); - "value": (Network.BytesValue); - "domain"?: (string); - "httpOnly"?: (boolean); - "expiry"?: (string); - "maxAge"?: (JsInt); - "path"?: (string); - "sameSite"?: (Network.SameSite); - "secure"?: (boolean); - })); -} -export declare namespace Network { - type UrlPattern = ((Network.UrlPatternPattern | Network.UrlPatternString)); -} -export declare namespace Network { - type UrlPatternPattern = (({ - "type": ("pattern"); - "protocol"?: (string); - "hostname"?: (string); - "port"?: (string); - "pathname"?: (string); - "search"?: (string); - })); -} -export declare namespace Network { - type UrlPatternString = (({ - "type": ("string"); - "pattern": (string); - })); -} -export declare namespace Network { - type AddDataCollector = ({ - "method": ("network.addDataCollector"); - "params": (Network.AddDataCollectorParameters); - }); -} -export declare namespace Network { - type AddDataCollectorParameters = (({ - "dataTypes": ([ - (Network.DataType), - ...(Network.DataType)[] - ]); - "maxEncodedDataSize": (JsUint); - /** - * @defaultValue `"blob"` - */ - "collectorType"?: (Network.CollectorType); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); -} -export declare namespace Network { - type AddDataCollectorResult = (({ - "collector": (Network.Collector); - })); -} -export declare namespace Network { - type AddInterceptParameters = (({ - "phases": ([ - (Network.InterceptPhase), - ...(Network.InterceptPhase)[] - ]); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "urlPatterns"?: ([ - ...((Network.UrlPattern)[]) - ]); - })); -} -export declare namespace Network { - type AddIntercept = ({ - "method": ("network.addIntercept"); - "params": (Network.AddInterceptParameters); - }); -} -export declare namespace Network { - const enum InterceptPhase { - BeforeRequestSent = "beforeRequestSent", - ResponseStarted = "responseStarted", - AuthRequired = "authRequired" - } + type AddDataCollectorResult = { + collector: Network.Collector; + }; } export declare namespace Network { - type AddInterceptResult = (({ - "intercept": (Network.Intercept); - })); + type AddInterceptParameters = { + phases: [Network.InterceptPhase, ...Network.InterceptPhase[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + urlPatterns?: [...Network.UrlPattern[]]; + }; } export declare namespace Network { - type ContinueRequest = ({ - "method": ("network.continueRequest"); - "params": (Network.ContinueRequestParameters); - }); + type AddIntercept = { + method: 'network.addIntercept'; + params: Network.AddInterceptParameters; + }; } export declare namespace Network { - type ContinueRequestParameters = (({ - "request": (Network.Request); - "body"?: (Network.BytesValue); - "cookies"?: ([ - ...((Network.CookieHeader)[]) - ]); - "headers"?: ([ - ...((Network.Header)[]) - ]); - "method"?: (string); - "url"?: (string); - })); + const enum InterceptPhase { + BeforeRequestSent = 'beforeRequestSent', + ResponseStarted = 'responseStarted', + AuthRequired = 'authRequired', + } } export declare namespace Network { - type ContinueResponse = ({ - "method": ("network.continueResponse"); - "params": (Network.ContinueResponseParameters); - }); + type AddInterceptResult = { + intercept: Network.Intercept; + }; } export declare namespace Network { - type ContinueResponseParameters = (({ - "request": (Network.Request); - "cookies"?: ([ - ...((Network.SetCookieHeader)[]) - ]); - "credentials"?: (Network.AuthCredentials); - "headers"?: ([ - ...((Network.Header)[]) - ]); - "reasonPhrase"?: (string); - "statusCode"?: (JsUint); - })); + type ContinueRequest = { + method: 'network.continueRequest'; + params: Network.ContinueRequestParameters; + }; } export declare namespace Network { - type ContinueWithAuth = ({ - "method": ("network.continueWithAuth"); - "params": (Network.ContinueWithAuthParameters); - }); + type ContinueRequestParameters = { + request: Network.Request; + body?: Network.BytesValue; + cookies?: [...Network.CookieHeader[]]; + headers?: [...Network.Header[]]; + method?: string; + url?: string; + }; } export declare namespace Network { - type ContinueWithAuthParameters = (({ - "request": (Network.Request); - } & (Network.ContinueWithAuthCredentials | Network.ContinueWithAuthNoCredentials))); + type ContinueResponse = { + method: 'network.continueResponse'; + params: Network.ContinueResponseParameters; + }; } export declare namespace Network { - type ContinueWithAuthCredentials = ({ - "action": ("provideCredentials"); - "credentials": (Network.AuthCredentials); - }); + type ContinueResponseParameters = { + request: Network.Request; + cookies?: [...Network.SetCookieHeader[]]; + credentials?: Network.AuthCredentials; + headers?: [...Network.Header[]]; + reasonPhrase?: string; + statusCode?: JsUint; + }; } export declare namespace Network { - type ContinueWithAuthNoCredentials = ({ - "action": ("default" | "cancel"); - }); + type ContinueWithAuth = { + method: 'network.continueWithAuth'; + params: Network.ContinueWithAuthParameters; + }; } export declare namespace Network { - type DisownData = ({ - "method": ("network.disownData"); - "params": (Network.DisownDataParameters); - }); + type ContinueWithAuthParameters = { + request: Network.Request; + } & ( + | Network.ContinueWithAuthCredentials + | Network.ContinueWithAuthNoCredentials + ); } export declare namespace Network { - type DisownDataParameters = (({ - "dataType": (Network.DataType); - "collector": (Network.Collector); - "request": (Network.Request); - })); + type ContinueWithAuthCredentials = { + action: 'provideCredentials'; + credentials: Network.AuthCredentials; + }; } export declare namespace Network { - type FailRequest = ({ - "method": ("network.failRequest"); - "params": (Network.FailRequestParameters); - }); + type ContinueWithAuthNoCredentials = { + action: 'default' | 'cancel'; + }; } export declare namespace Network { - type FailRequestParameters = (({ - "request": (Network.Request); - })); + type DisownData = { + method: 'network.disownData'; + params: Network.DisownDataParameters; + }; } export declare namespace Network { - type GetData = ({ - "method": ("network.getData"); - "params": (Network.GetDataParameters); - }); + type DisownDataParameters = { + dataType: Network.DataType; + collector: Network.Collector; + request: Network.Request; + }; } export declare namespace Network { - type GetDataParameters = (({ - "dataType": (Network.DataType); - "collector"?: (Network.Collector); - /** - * @defaultValue `false` - */ - "disown"?: (boolean); - "request": (Network.Request); - })); + type FailRequest = { + method: 'network.failRequest'; + params: Network.FailRequestParameters; + }; } export declare namespace Network { - type GetDataResult = (({ - "bytes": (Network.BytesValue); - })); + type FailRequestParameters = { + request: Network.Request; + }; } export declare namespace Network { - type ProvideResponse = ({ - "method": ("network.provideResponse"); - "params": (Network.ProvideResponseParameters); - }); + type GetData = { + method: 'network.getData'; + params: Network.GetDataParameters; + }; } export declare namespace Network { - type ProvideResponseParameters = (({ - "request": (Network.Request); - "body"?: (Network.BytesValue); - "cookies"?: ([ - ...((Network.SetCookieHeader)[]) - ]); - "headers"?: ([ - ...((Network.Header)[]) - ]); - "reasonPhrase"?: (string); - "statusCode"?: (JsUint); - })); + type GetDataParameters = { + dataType: Network.DataType; + collector?: Network.Collector; + /** + * @defaultValue `false` + */ + disown?: boolean; + request: Network.Request; + }; } export declare namespace Network { - type RemoveDataCollector = ({ - "method": ("network.removeDataCollector"); - "params": (Network.RemoveDataCollectorParameters); - }); + type GetDataResult = { + bytes: Network.BytesValue; + }; } export declare namespace Network { - type RemoveDataCollectorParameters = (({ - "collector": (Network.Collector); - })); + type ProvideResponse = { + method: 'network.provideResponse'; + params: Network.ProvideResponseParameters; + }; } export declare namespace Network { - type RemoveIntercept = ({ - "method": ("network.removeIntercept"); - "params": (Network.RemoveInterceptParameters); - }); + type ProvideResponseParameters = { + request: Network.Request; + body?: Network.BytesValue; + cookies?: [...Network.SetCookieHeader[]]; + headers?: [...Network.Header[]]; + reasonPhrase?: string; + statusCode?: JsUint; + }; } export declare namespace Network { - type RemoveInterceptParameters = (({ - "intercept": (Network.Intercept); - })); + type RemoveDataCollector = { + method: 'network.removeDataCollector'; + params: Network.RemoveDataCollectorParameters; + }; } export declare namespace Network { - type SetCacheBehavior = ({ - "method": ("network.setCacheBehavior"); - "params": (Network.SetCacheBehaviorParameters); - }); + type RemoveDataCollectorParameters = { + collector: Network.Collector; + }; } export declare namespace Network { - type SetCacheBehaviorParameters = (({ - "cacheBehavior": ("default" | "bypass"); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - })); + type RemoveIntercept = { + method: 'network.removeIntercept'; + params: Network.RemoveInterceptParameters; + }; } export declare namespace Network { - type SetExtraHeaders = ({ - "method": ("network.setExtraHeaders"); - "params": (Network.SetExtraHeadersParameters); - }); + type RemoveInterceptParameters = { + intercept: Network.Intercept; + }; } export declare namespace Network { - type SetExtraHeadersParameters = (({ - "headers": ([ - ...((Network.Header)[]) - ]); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - })); + type SetCacheBehavior = { + method: 'network.setCacheBehavior'; + params: Network.SetCacheBehaviorParameters; + }; } -export type ScriptEvent = (Script.Message | Script.RealmCreated | Script.RealmDestroyed); export declare namespace Network { - type AuthRequiredParameters = ((Network.BaseParameters & { - "response": (Network.ResponseData); - })); + type SetCacheBehaviorParameters = { + cacheBehavior: 'default' | 'bypass'; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + }; } export declare namespace Network { - type BeforeRequestSentParameters = ((Network.BaseParameters & { - "initiator"?: (Network.Initiator); - })); + type SetExtraHeaders = { + method: 'network.setExtraHeaders'; + params: Network.SetExtraHeadersParameters; + }; } export declare namespace Network { - type FetchErrorParameters = ((Network.BaseParameters & { - "errorText": (string); - })); + type SetExtraHeadersParameters = { + headers: [...Network.Header[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } +export type ScriptEvent = + | Script.Message + | Script.RealmCreated + | Script.RealmDestroyed; export declare namespace Network { - type ResponseCompletedParameters = ((Network.BaseParameters & { - "response": (Network.ResponseData); - })); + type AuthRequiredParameters = Network.BaseParameters & { + response: Network.ResponseData; + }; } export declare namespace Network { - type ResponseStartedParameters = ((Network.BaseParameters & { - "response": (Network.ResponseData); - })); + type BeforeRequestSentParameters = Network.BaseParameters & { + initiator?: Network.Initiator; + }; } -export type ScriptCommand = (Script.AddPreloadScript | Script.CallFunction | Script.Disown | Script.Evaluate | Script.GetRealms | Script.RemovePreloadScript); -export type ScriptResult = ((Script.AddPreloadScriptResult | Script.EvaluateResult | Script.GetRealmsResult)); export declare namespace Network { - type AuthRequired = ({ - "method": ("network.authRequired"); - "params": (Network.AuthRequiredParameters); - }); + type FetchErrorParameters = Network.BaseParameters & { + errorText: string; + }; } export declare namespace Network { - type BeforeRequestSent = ({ - "method": ("network.beforeRequestSent"); - "params": (Network.BeforeRequestSentParameters); - }); + type ResponseCompletedParameters = Network.BaseParameters & { + response: Network.ResponseData; + }; } export declare namespace Network { - type FetchError = ({ - "method": ("network.fetchError"); - "params": (Network.FetchErrorParameters); - }); + type ResponseStartedParameters = Network.BaseParameters & { + response: Network.ResponseData; + }; } +export type ScriptCommand = + | Script.AddPreloadScript + | Script.CallFunction + | Script.Disown + | Script.Evaluate + | Script.GetRealms + | Script.RemovePreloadScript; +export type ScriptResult = + | Script.AddPreloadScriptResult + | Script.EvaluateResult + | Script.GetRealmsResult; export declare namespace Network { - type ResponseCompleted = ({ - "method": ("network.responseCompleted"); - "params": (Network.ResponseCompletedParameters); - }); + type AuthRequired = { + method: 'network.authRequired'; + params: Network.AuthRequiredParameters; + }; } export declare namespace Network { - type ResponseStarted = ({ - "method": ("network.responseStarted"); - "params": (Network.ResponseStartedParameters); - }); + type BeforeRequestSent = { + method: 'network.beforeRequestSent'; + params: Network.BeforeRequestSentParameters; + }; +} +export declare namespace Network { + type FetchError = { + method: 'network.fetchError'; + params: Network.FetchErrorParameters; + }; +} +export declare namespace Network { + type ResponseCompleted = { + method: 'network.responseCompleted'; + params: Network.ResponseCompletedParameters; + }; +} +export declare namespace Network { + type ResponseStarted = { + method: 'network.responseStarted'; + params: Network.ResponseStartedParameters; + }; } export declare namespace Script { - type Channel = (string); + type Channel = string; } export declare namespace Script { - type EvaluateResultSuccess = (({ - "type": ("success"); - "result": (Script.RemoteValue); - "realm": (Script.Realm); - })); + type EvaluateResultSuccess = { + type: 'success'; + result: Script.RemoteValue; + realm: Script.Realm; + }; } export declare namespace Script { - type ExceptionDetails = (({ - "columnNumber": (JsUint); - "exception": (Script.RemoteValue); - "lineNumber": (JsUint); - "stackTrace": (Script.StackTrace); - "text": (string); - })); + type ExceptionDetails = { + columnNumber: JsUint; + exception: Script.RemoteValue; + lineNumber: JsUint; + stackTrace: Script.StackTrace; + text: string; + }; } export declare namespace Script { - type ChannelValue = (({ - "type": ("channel"); - "value": (Script.ChannelProperties); - })); + type ChannelValue = { + type: 'channel'; + value: Script.ChannelProperties; + }; } export declare namespace Script { - type ChannelProperties = (({ - "channel": (Script.Channel); - "serializationOptions"?: (Script.SerializationOptions); - "ownership"?: (Script.ResultOwnership); - })); + type ChannelProperties = { + channel: Script.Channel; + serializationOptions?: Script.SerializationOptions; + ownership?: Script.ResultOwnership; + }; } export declare namespace Script { - type EvaluateResult = ((Script.EvaluateResultSuccess | Script.EvaluateResultException)); + type EvaluateResult = + | Script.EvaluateResultSuccess + | Script.EvaluateResultException; } export declare namespace Script { - type EvaluateResultException = (({ - "type": ("exception"); - "exceptionDetails": (Script.ExceptionDetails); - "realm": (Script.Realm); - })); + type EvaluateResultException = { + type: 'exception'; + exceptionDetails: Script.ExceptionDetails; + realm: Script.Realm; + }; } export declare namespace Script { - type Handle = (string); + type Handle = string; } export declare namespace Script { - type InternalId = (string); + type InternalId = string; } export declare namespace Script { - type ListLocalValue = ([ - ...((Script.LocalValue)[]) - ]); + type ListLocalValue = [...Script.LocalValue[]]; } export declare namespace Script { - type LocalValue = ((Script.RemoteReference | Script.PrimitiveProtocolValue | Script.ChannelValue | Script.ArrayLocalValue | (Script.DateLocalValue) | Script.MapLocalValue | Script.ObjectLocalValue | (Script.RegExpLocalValue) | Script.SetLocalValue)); + type LocalValue = + | Script.RemoteReference + | Script.PrimitiveProtocolValue + | Script.ChannelValue + | Script.ArrayLocalValue + | Script.DateLocalValue + | Script.MapLocalValue + | Script.ObjectLocalValue + | Script.RegExpLocalValue + | Script.SetLocalValue; } export declare namespace Script { - type ArrayLocalValue = (({ - "type": ("array"); - "value": (Script.ListLocalValue); - })); + type ArrayLocalValue = { + type: 'array'; + value: Script.ListLocalValue; + }; } export declare namespace Script { - type DateLocalValue = ({ - "type": ("date"); - "value": (string); - }); + type DateLocalValue = { + type: 'date'; + value: string; + }; } export declare namespace Script { - type MappingLocalValue = ([ - ...(([ - (Script.LocalValue | string), - (Script.LocalValue) - ])[]) - ]); + type MappingLocalValue = [ + ...[Script.LocalValue | string, Script.LocalValue][], + ]; } export declare namespace Script { - type MapLocalValue = (({ - "type": ("map"); - "value": (Script.MappingLocalValue); - })); + type MapLocalValue = { + type: 'map'; + value: Script.MappingLocalValue; + }; } export declare namespace Script { - type ObjectLocalValue = (({ - "type": ("object"); - "value": (Script.MappingLocalValue); - })); + type ObjectLocalValue = { + type: 'object'; + value: Script.MappingLocalValue; + }; } export declare namespace Script { - type RegExpValue = (({ - "pattern": (string); - "flags"?: (string); - })); + type RegExpValue = { + pattern: string; + flags?: string; + }; } export declare namespace Script { - type RegExpLocalValue = ({ - "type": ("regexp"); - "value": (Script.RegExpValue); - }); + type RegExpLocalValue = { + type: 'regexp'; + value: Script.RegExpValue; + }; } export declare namespace Script { - type SetLocalValue = (({ - "type": ("set"); - "value": (Script.ListLocalValue); - })); + type SetLocalValue = { + type: 'set'; + value: Script.ListLocalValue; + }; } export declare namespace Script { - type PreloadScript = (string); + type PreloadScript = string; } export declare namespace Script { - type Realm = (string); + type Realm = string; } export declare namespace Script { - type PrimitiveProtocolValue = ((Script.UndefinedValue | Script.NullValue | Script.StringValue | Script.NumberValue | Script.BooleanValue | Script.BigIntValue)); + type PrimitiveProtocolValue = + | Script.UndefinedValue + | Script.NullValue + | Script.StringValue + | Script.NumberValue + | Script.BooleanValue + | Script.BigIntValue; } export declare namespace Script { - type UndefinedValue = (({ - "type": ("undefined"); - })); + type UndefinedValue = { + type: 'undefined'; + }; } export declare namespace Script { - type NullValue = (({ - "type": ("null"); - })); + type NullValue = { + type: 'null'; + }; } export declare namespace Script { - type StringValue = (({ - "type": ("string"); - "value": (string); - })); + type StringValue = { + type: 'string'; + value: string; + }; } export declare namespace Script { - type SpecialNumber = ("NaN" | "-0" | "Infinity" | "-Infinity"); + type SpecialNumber = 'NaN' | '-0' | 'Infinity' | '-Infinity'; } export declare namespace Script { - type NumberValue = (({ - "type": ("number"); - "value": (number | Script.SpecialNumber); - })); + type NumberValue = { + type: 'number'; + value: number | Script.SpecialNumber; + }; } export declare namespace Script { - type BooleanValue = (({ - "type": ("boolean"); - "value": (boolean); - })); + type BooleanValue = { + type: 'boolean'; + value: boolean; + }; } export declare namespace Script { - type BigIntValue = (({ - "type": ("bigint"); - "value": (string); - })); + type BigIntValue = { + type: 'bigint'; + value: string; + }; } export declare namespace Script { - type RealmInfo = ((Script.WindowRealmInfo | Script.DedicatedWorkerRealmInfo | Script.SharedWorkerRealmInfo | Script.ServiceWorkerRealmInfo | Script.WorkerRealmInfo | Script.PaintWorkletRealmInfo | Script.AudioWorkletRealmInfo | Script.WorkletRealmInfo)); + type RealmInfo = + | Script.WindowRealmInfo + | Script.DedicatedWorkerRealmInfo + | Script.SharedWorkerRealmInfo + | Script.ServiceWorkerRealmInfo + | Script.WorkerRealmInfo + | Script.PaintWorkletRealmInfo + | Script.AudioWorkletRealmInfo + | Script.WorkletRealmInfo; } export declare namespace Script { - type BaseRealmInfo = ({ - "realm": (Script.Realm); - "origin": (string); - }); + type BaseRealmInfo = { + realm: Script.Realm; + origin: string; + }; } export declare namespace Script { - type WindowRealmInfo = ((Script.BaseRealmInfo & { - "type": ("window"); - "context": (BrowsingContext.BrowsingContext); - "sandbox"?: (string); - })); + type WindowRealmInfo = Script.BaseRealmInfo & { + type: 'window'; + context: BrowsingContext.BrowsingContext; + sandbox?: string; + }; } export declare namespace Script { - type DedicatedWorkerRealmInfo = ((Script.BaseRealmInfo & { - "type": ("dedicated-worker"); - "owners": ([ - (Script.Realm) - ]); - })); + type DedicatedWorkerRealmInfo = Script.BaseRealmInfo & { + type: 'dedicated-worker'; + owners: [Script.Realm]; + }; } export declare namespace Script { - type SharedWorkerRealmInfo = ((Script.BaseRealmInfo & { - "type": ("shared-worker"); - })); + type SharedWorkerRealmInfo = Script.BaseRealmInfo & { + type: 'shared-worker'; + }; } export declare namespace Script { - type ServiceWorkerRealmInfo = ((Script.BaseRealmInfo & { - "type": ("service-worker"); - })); + type ServiceWorkerRealmInfo = Script.BaseRealmInfo & { + type: 'service-worker'; + }; } export declare namespace Script { - type WorkerRealmInfo = ((Script.BaseRealmInfo & { - "type": ("worker"); - })); + type WorkerRealmInfo = Script.BaseRealmInfo & { + type: 'worker'; + }; } export declare namespace Script { - type PaintWorkletRealmInfo = ((Script.BaseRealmInfo & { - "type": ("paint-worklet"); - })); + type PaintWorkletRealmInfo = Script.BaseRealmInfo & { + type: 'paint-worklet'; + }; } export declare namespace Script { - type AudioWorkletRealmInfo = ((Script.BaseRealmInfo & { - "type": ("audio-worklet"); - })); + type AudioWorkletRealmInfo = Script.BaseRealmInfo & { + type: 'audio-worklet'; + }; } export declare namespace Script { - type WorkletRealmInfo = ((Script.BaseRealmInfo & { - "type": ("worklet"); - })); + type WorkletRealmInfo = Script.BaseRealmInfo & { + type: 'worklet'; + }; } export declare namespace Script { - type RealmType = ("window" | "dedicated-worker" | "shared-worker" | "service-worker" | "worker" | "paint-worklet" | "audio-worklet" | "worklet"); + type RealmType = + | 'window' + | 'dedicated-worker' + | 'shared-worker' + | 'service-worker' + | 'worker' + | 'paint-worklet' + | 'audio-worklet' + | 'worklet'; } export declare namespace Script { - type ListRemoteValue = ([ - ...((Script.RemoteValue)[]) - ]); + type ListRemoteValue = [...Script.RemoteValue[]]; } export declare namespace Script { - type MappingRemoteValue = ([ - ...(([ - (Script.RemoteValue | string), - (Script.RemoteValue) - ])[]) - ]); + type MappingRemoteValue = [ + ...[Script.RemoteValue | string, Script.RemoteValue][], + ]; } export declare namespace Script { - type RemoteValue = ((Script.PrimitiveProtocolValue | Script.SymbolRemoteValue | Script.ArrayRemoteValue | Script.ObjectRemoteValue | Script.FunctionRemoteValue | Script.RegExpRemoteValue | Script.DateRemoteValue | Script.MapRemoteValue | Script.SetRemoteValue | Script.WeakMapRemoteValue | Script.WeakSetRemoteValue | Script.GeneratorRemoteValue | Script.ErrorRemoteValue | Script.ProxyRemoteValue | Script.PromiseRemoteValue | Script.TypedArrayRemoteValue | Script.ArrayBufferRemoteValue | Script.NodeListRemoteValue | Script.HtmlCollectionRemoteValue | Script.NodeRemoteValue | Script.WindowProxyRemoteValue)); + type RemoteValue = + | Script.PrimitiveProtocolValue + | Script.SymbolRemoteValue + | Script.ArrayRemoteValue + | Script.ObjectRemoteValue + | Script.FunctionRemoteValue + | Script.RegExpRemoteValue + | Script.DateRemoteValue + | Script.MapRemoteValue + | Script.SetRemoteValue + | Script.WeakMapRemoteValue + | Script.WeakSetRemoteValue + | Script.GeneratorRemoteValue + | Script.ErrorRemoteValue + | Script.ProxyRemoteValue + | Script.PromiseRemoteValue + | Script.TypedArrayRemoteValue + | Script.ArrayBufferRemoteValue + | Script.NodeListRemoteValue + | Script.HtmlCollectionRemoteValue + | Script.NodeRemoteValue + | Script.WindowProxyRemoteValue; } export declare namespace Script { - type RemoteReference = ((Script.SharedReference | Script.RemoteObjectReference)); + type RemoteReference = Script.SharedReference | Script.RemoteObjectReference; } export declare namespace Script { - type SharedReference = (({ - "sharedId": (Script.SharedId); - "handle"?: (Script.Handle); - } & Extensible)); + type SharedReference = { + sharedId: Script.SharedId; + handle?: Script.Handle; + } & Extensible; } export declare namespace Script { - type RemoteObjectReference = (({ - "handle": (Script.Handle); - "sharedId"?: (Script.SharedId); - } & Extensible)); + type RemoteObjectReference = { + handle: Script.Handle; + sharedId?: Script.SharedId; + } & Extensible; } export declare namespace Script { - type SymbolRemoteValue = (({ - "type": ("symbol"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type SymbolRemoteValue = { + type: 'symbol'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type ArrayRemoteValue = (({ - "type": ("array"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.ListRemoteValue); - })); + type ArrayRemoteValue = { + type: 'array'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export declare namespace Script { - type ObjectRemoteValue = (({ - "type": ("object"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.MappingRemoteValue); - })); + type ObjectRemoteValue = { + type: 'object'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.MappingRemoteValue; + }; } export declare namespace Script { - type FunctionRemoteValue = (({ - "type": ("function"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type FunctionRemoteValue = { + type: 'function'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type RegExpRemoteValue = ((Script.RegExpLocalValue & { - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type RegExpRemoteValue = Script.RegExpLocalValue & { + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type DateRemoteValue = ((Script.DateLocalValue & { - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type DateRemoteValue = Script.DateLocalValue & { + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type MapRemoteValue = (({ - "type": ("map"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.MappingRemoteValue); - })); + type MapRemoteValue = { + type: 'map'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.MappingRemoteValue; + }; } export declare namespace Script { - type SetRemoteValue = (({ - "type": ("set"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.ListRemoteValue); - })); + type SetRemoteValue = { + type: 'set'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export declare namespace Script { - type WeakMapRemoteValue = (({ - "type": ("weakmap"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type WeakMapRemoteValue = { + type: 'weakmap'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type WeakSetRemoteValue = (({ - "type": ("weakset"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type WeakSetRemoteValue = { + type: 'weakset'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type GeneratorRemoteValue = (({ - "type": ("generator"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type GeneratorRemoteValue = { + type: 'generator'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type ErrorRemoteValue = (({ - "type": ("error"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type ErrorRemoteValue = { + type: 'error'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type ProxyRemoteValue = (({ - "type": ("proxy"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type ProxyRemoteValue = { + type: 'proxy'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type PromiseRemoteValue = (({ - "type": ("promise"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type PromiseRemoteValue = { + type: 'promise'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type TypedArrayRemoteValue = (({ - "type": ("typedarray"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type TypedArrayRemoteValue = { + type: 'typedarray'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type ArrayBufferRemoteValue = (({ - "type": ("arraybuffer"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type ArrayBufferRemoteValue = { + type: 'arraybuffer'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type NodeListRemoteValue = (({ - "type": ("nodelist"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.ListRemoteValue); - })); + type NodeListRemoteValue = { + type: 'nodelist'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export declare namespace Script { - type HtmlCollectionRemoteValue = (({ - "type": ("htmlcollection"); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.ListRemoteValue); - })); + type HtmlCollectionRemoteValue = { + type: 'htmlcollection'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export declare namespace Script { - type NodeRemoteValue = (({ - "type": ("node"); - "sharedId"?: (Script.SharedId); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - "value"?: (Script.NodeProperties); - })); + type NodeRemoteValue = { + type: 'node'; + sharedId?: Script.SharedId; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.NodeProperties; + }; } export declare namespace Script { - type NodeProperties = (({ - "nodeType": (JsUint); - "childNodeCount": (JsUint); - "attributes"?: (({ - [key: string]: (string); - })); - "children"?: ([ - ...((Script.NodeRemoteValue)[]) - ]); - "localName"?: (string); - "mode"?: ("open" | "closed"); - "namespaceURI"?: (string); - "nodeValue"?: (string); - "shadowRoot"?: (Script.NodeRemoteValue | null); - })); + type NodeProperties = { + nodeType: JsUint; + childNodeCount: JsUint; + attributes?: { + [key: string]: string; + }; + children?: [...Script.NodeRemoteValue[]]; + localName?: string; + mode?: 'open' | 'closed'; + namespaceURI?: string; + nodeValue?: string; + shadowRoot?: Script.NodeRemoteValue | null; + }; } export declare namespace Script { - type WindowProxyRemoteValue = (({ - "type": ("window"); - "value": (Script.WindowProxyProperties); - "handle"?: (Script.Handle); - "internalId"?: (Script.InternalId); - })); + type WindowProxyRemoteValue = { + type: 'window'; + value: Script.WindowProxyProperties; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export declare namespace Script { - type WindowProxyProperties = (({ - "context": (BrowsingContext.BrowsingContext); - })); + type WindowProxyProperties = { + context: BrowsingContext.BrowsingContext; + }; } export declare namespace Script { - const enum ResultOwnership { - Root = "root", - None = "none" - } + const enum ResultOwnership { + Root = 'root', + None = 'none', + } } export declare namespace Script { - type SerializationOptions = (({ - /** - * @defaultValue `0` - */ - "maxDomDepth"?: ((JsUint | null)); - /** - * @defaultValue `null` - */ - "maxObjectDepth"?: ((JsUint | null)); - /** - * @defaultValue `"none"` - */ - "includeShadowTree"?: (("none" | "open" | "all")); - })); + type SerializationOptions = { + /** + * @defaultValue `0` + */ + maxDomDepth?: JsUint | null; + /** + * @defaultValue `null` + */ + maxObjectDepth?: JsUint | null; + /** + * @defaultValue `"none"` + */ + includeShadowTree?: 'none' | 'open' | 'all'; + }; } export declare namespace Script { - type SharedId = (string); + type SharedId = string; } export declare namespace Script { - type StackFrame = (({ - "columnNumber": (JsUint); - "functionName": (string); - "lineNumber": (JsUint); - "url": (string); - })); + type StackFrame = { + columnNumber: JsUint; + functionName: string; + lineNumber: JsUint; + url: string; + }; } export declare namespace Script { - type StackTrace = (({ - "callFrames": ([ - ...((Script.StackFrame)[]) - ]); - })); -} -export declare namespace Script { - type Source = (({ - "realm": (Script.Realm); - "context"?: (BrowsingContext.BrowsingContext); - })); -} -export declare namespace Script { - type RealmTarget = (({ - "realm": (Script.Realm); - })); + type StackTrace = { + callFrames: [...Script.StackFrame[]]; + }; } export declare namespace Script { - type ContextTarget = (({ - "context": (BrowsingContext.BrowsingContext); - "sandbox"?: (string); - })); + type Source = { + realm: Script.Realm; + context?: BrowsingContext.BrowsingContext; + }; } export declare namespace Script { - type Target = ((Script.ContextTarget | Script.RealmTarget)); + type RealmTarget = { + realm: Script.Realm; + }; } export declare namespace Script { - type AddPreloadScript = ({ - "method": ("script.addPreloadScript"); - "params": (Script.AddPreloadScriptParameters); - }); + type ContextTarget = { + context: BrowsingContext.BrowsingContext; + sandbox?: string; + }; } export declare namespace Script { - type AddPreloadScriptParameters = (({ - "functionDeclaration": (string); - "arguments"?: ([ - ...((Script.ChannelValue)[]) - ]); - "contexts"?: ([ - (BrowsingContext.BrowsingContext), - ...(BrowsingContext.BrowsingContext)[] - ]); - "userContexts"?: ([ - (Browser.UserContext), - ...(Browser.UserContext)[] - ]); - "sandbox"?: (string); - })); + type Target = Script.ContextTarget | Script.RealmTarget; } export declare namespace Script { - type AddPreloadScriptResult = (({ - "script": (Script.PreloadScript); - })); + type AddPreloadScript = { + method: 'script.addPreloadScript'; + params: Script.AddPreloadScriptParameters; + }; } export declare namespace Script { - type Disown = ({ - "method": ("script.disown"); - "params": (Script.DisownParameters); - }); + type AddPreloadScriptParameters = { + functionDeclaration: string; + arguments?: [...Script.ChannelValue[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + sandbox?: string; + }; } export declare namespace Script { - type DisownParameters = (({ - "handles": ([ - ...((Script.Handle)[]) - ]); - "target": (Script.Target); - })); + type AddPreloadScriptResult = { + script: Script.PreloadScript; + }; } export declare namespace Script { - type CallFunctionParameters = (({ - "functionDeclaration": (string); - "awaitPromise": (boolean); - "target": (Script.Target); - "arguments"?: ([ - ...((Script.LocalValue)[]) - ]); - "resultOwnership"?: (Script.ResultOwnership); - "serializationOptions"?: (Script.SerializationOptions); - "this"?: (Script.LocalValue); - /** - * @defaultValue `false` - */ - "userActivation"?: (boolean); - })); + type Disown = { + method: 'script.disown'; + params: Script.DisownParameters; + }; } export declare namespace Script { - type CallFunction = ({ - "method": ("script.callFunction"); - "params": (Script.CallFunctionParameters); - }); + type DisownParameters = { + handles: [...Script.Handle[]]; + target: Script.Target; + }; } export declare namespace Script { - type Evaluate = ({ - "method": ("script.evaluate"); - "params": (Script.EvaluateParameters); - }); + type CallFunctionParameters = { + functionDeclaration: string; + awaitPromise: boolean; + target: Script.Target; + arguments?: [...Script.LocalValue[]]; + resultOwnership?: Script.ResultOwnership; + serializationOptions?: Script.SerializationOptions; + this?: Script.LocalValue; + /** + * @defaultValue `false` + */ + userActivation?: boolean; + }; } export declare namespace Script { - type EvaluateParameters = (({ - "expression": (string); - "target": (Script.Target); - "awaitPromise": (boolean); - "resultOwnership"?: (Script.ResultOwnership); - "serializationOptions"?: (Script.SerializationOptions); - /** - * @defaultValue `false` - */ - "userActivation"?: (boolean); - })); + type CallFunction = { + method: 'script.callFunction'; + params: Script.CallFunctionParameters; + }; } export declare namespace Script { - type GetRealms = ({ - "method": ("script.getRealms"); - "params": (Script.GetRealmsParameters); - }); + type Evaluate = { + method: 'script.evaluate'; + params: Script.EvaluateParameters; + }; } export declare namespace Script { - type GetRealmsParameters = (({ - "context"?: (BrowsingContext.BrowsingContext); - "type"?: (Script.RealmType); - })); + type EvaluateParameters = { + expression: string; + target: Script.Target; + awaitPromise: boolean; + resultOwnership?: Script.ResultOwnership; + serializationOptions?: Script.SerializationOptions; + /** + * @defaultValue `false` + */ + userActivation?: boolean; + }; } export declare namespace Script { - type GetRealmsResult = (({ - "realms": ([ - ...((Script.RealmInfo)[]) - ]); - })); + type GetRealms = { + method: 'script.getRealms'; + params: Script.GetRealmsParameters; + }; } export declare namespace Script { - type RemovePreloadScript = ({ - "method": ("script.removePreloadScript"); - "params": (Script.RemovePreloadScriptParameters); - }); + type GetRealmsParameters = { + context?: BrowsingContext.BrowsingContext; + type?: Script.RealmType; + }; } export declare namespace Script { - type RemovePreloadScriptParameters = (({ - "script": (Script.PreloadScript); - })); + type GetRealmsResult = { + realms: [...Script.RealmInfo[]]; + }; } export declare namespace Script { - type MessageParameters = (({ - "channel": (Script.Channel); - "data": (Script.RemoteValue); - "source": (Script.Source); - })); + type RemovePreloadScript = { + method: 'script.removePreloadScript'; + params: Script.RemovePreloadScriptParameters; + }; } export declare namespace Script { - type RealmCreated = ({ - "method": ("script.realmCreated"); - "params": (Script.RealmInfo); - }); + type RemovePreloadScriptParameters = { + script: Script.PreloadScript; + }; } export declare namespace Script { - type Message = ({ - "method": ("script.message"); - "params": (Script.MessageParameters); - }); + type MessageParameters = { + channel: Script.Channel; + data: Script.RemoteValue; + source: Script.Source; + }; } export declare namespace Script { - type RealmDestroyed = ({ - "method": ("script.realmDestroyed"); - "params": (Script.RealmDestroyedParameters); - }); + type RealmCreated = { + method: 'script.realmCreated'; + params: Script.RealmInfo; + }; } export declare namespace Script { - type RealmDestroyedParameters = (({ - "realm": (Script.Realm); - })); + type Message = { + method: 'script.message'; + params: Script.MessageParameters; + }; } -export type StorageCommand = (Storage.DeleteCookies | Storage.GetCookies | Storage.SetCookie); -export type StorageResult = ((Storage.DeleteCookiesResult | Storage.GetCookiesResult | Storage.SetCookieResult)); +export declare namespace Script { + type RealmDestroyed = { + method: 'script.realmDestroyed'; + params: Script.RealmDestroyedParameters; + }; +} +export declare namespace Script { + type RealmDestroyedParameters = { + realm: Script.Realm; + }; +} +export type StorageCommand = + | Storage.DeleteCookies + | Storage.GetCookies + | Storage.SetCookie; +export type StorageResult = + | Storage.DeleteCookiesResult + | Storage.GetCookiesResult + | Storage.SetCookieResult; export declare namespace Storage { - type PartitionKey = (({ - "userContext"?: (string); - "sourceOrigin"?: (string); - } & Extensible)); + type PartitionKey = { + userContext?: string; + sourceOrigin?: string; + } & Extensible; } export declare namespace Storage { - type GetCookies = ({ - "method": ("storage.getCookies"); - "params": (Storage.GetCookiesParameters); - }); + type GetCookies = { + method: 'storage.getCookies'; + params: Storage.GetCookiesParameters; + }; } export declare namespace Storage { - type CookieFilter = (({ - "name"?: (string); - "value"?: (Network.BytesValue); - "domain"?: (string); - "path"?: (string); - "size"?: (JsUint); - "httpOnly"?: (boolean); - "secure"?: (boolean); - "sameSite"?: (Network.SameSite); - "expiry"?: (JsUint); - } & Extensible)); + type CookieFilter = { + name?: string; + value?: Network.BytesValue; + domain?: string; + path?: string; + size?: JsUint; + httpOnly?: boolean; + secure?: boolean; + sameSite?: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export declare namespace Storage { - type BrowsingContextPartitionDescriptor = (({ - "type": ("context"); - "context": (BrowsingContext.BrowsingContext); - })); + type BrowsingContextPartitionDescriptor = { + type: 'context'; + context: BrowsingContext.BrowsingContext; + }; } export declare namespace Storage { - type StorageKeyPartitionDescriptor = (({ - "type": ("storageKey"); - "userContext"?: (string); - "sourceOrigin"?: (string); - } & Extensible)); + type StorageKeyPartitionDescriptor = { + type: 'storageKey'; + userContext?: string; + sourceOrigin?: string; + } & Extensible; } export declare namespace Storage { - type PartitionDescriptor = ((Storage.BrowsingContextPartitionDescriptor | Storage.StorageKeyPartitionDescriptor)); + type PartitionDescriptor = + | Storage.BrowsingContextPartitionDescriptor + | Storage.StorageKeyPartitionDescriptor; } export declare namespace Storage { - type GetCookiesParameters = (({ - "filter"?: (Storage.CookieFilter); - "partition"?: (Storage.PartitionDescriptor); - })); + type GetCookiesParameters = { + filter?: Storage.CookieFilter; + partition?: Storage.PartitionDescriptor; + }; } export declare namespace Storage { - type GetCookiesResult = (({ - "cookies": ([ - ...((Network.Cookie)[]) - ]); - "partitionKey": (Storage.PartitionKey); - })); + type GetCookiesResult = { + cookies: [...Network.Cookie[]]; + partitionKey: Storage.PartitionKey; + }; } export declare namespace Storage { - type SetCookie = ({ - "method": ("storage.setCookie"); - "params": (Storage.SetCookieParameters); - }); + type SetCookie = { + method: 'storage.setCookie'; + params: Storage.SetCookieParameters; + }; } export declare namespace Storage { - type PartialCookie = (({ - "name": (string); - "value": (Network.BytesValue); - "domain": (string); - "path"?: (string); - "httpOnly"?: (boolean); - "secure"?: (boolean); - "sameSite"?: (Network.SameSite); - "expiry"?: (JsUint); - } & Extensible)); + type PartialCookie = { + name: string; + value: Network.BytesValue; + domain: string; + path?: string; + httpOnly?: boolean; + secure?: boolean; + sameSite?: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export declare namespace Storage { - type SetCookieParameters = (({ - "cookie": (Storage.PartialCookie); - "partition"?: (Storage.PartitionDescriptor); - })); + type SetCookieParameters = { + cookie: Storage.PartialCookie; + partition?: Storage.PartitionDescriptor; + }; } export declare namespace Storage { - type SetCookieResult = (({ - "partitionKey": (Storage.PartitionKey); - })); + type SetCookieResult = { + partitionKey: Storage.PartitionKey; + }; } export declare namespace Storage { - type DeleteCookies = ({ - "method": ("storage.deleteCookies"); - "params": (Storage.DeleteCookiesParameters); - }); + type DeleteCookies = { + method: 'storage.deleteCookies'; + params: Storage.DeleteCookiesParameters; + }; } export declare namespace Storage { - type DeleteCookiesParameters = (({ - "filter"?: (Storage.CookieFilter); - "partition"?: (Storage.PartitionDescriptor); - })); + type DeleteCookiesParameters = { + filter?: Storage.CookieFilter; + partition?: Storage.PartitionDescriptor; + }; } export declare namespace Storage { - type DeleteCookiesResult = (({ - "partitionKey": (Storage.PartitionKey); - })); + type DeleteCookiesResult = { + partitionKey: Storage.PartitionKey; + }; } -export type LogEvent = (Log.EntryAdded); +export type LogEvent = Log.EntryAdded; export declare namespace Log { - const enum Level { - Debug = "debug", - Info = "info", - Warn = "warn", - Error = "error" - } + const enum Level { + Debug = 'debug', + Info = 'info', + Warn = 'warn', + Error = 'error', + } } export declare namespace Log { - type Entry = ((Log.GenericLogEntry | Log.ConsoleLogEntry | Log.JavascriptLogEntry)); + type Entry = + | Log.GenericLogEntry + | Log.ConsoleLogEntry + | Log.JavascriptLogEntry; } export declare namespace Log { - type BaseLogEntry = ({ - "level": (Log.Level); - "source": (Script.Source); - "text": (string | null); - "timestamp": (JsUint); - "stackTrace"?: (Script.StackTrace); - }); + type BaseLogEntry = { + level: Log.Level; + source: Script.Source; + text: string | null; + timestamp: JsUint; + stackTrace?: Script.StackTrace; + }; } export declare namespace Log { - type GenericLogEntry = ((Log.BaseLogEntry & { - "type": (string); - })); + type GenericLogEntry = Log.BaseLogEntry & { + type: string; + }; } export declare namespace Log { - type ConsoleLogEntry = ((Log.BaseLogEntry & { - "type": ("console"); - "method": (string); - "args": ([ - ...((Script.RemoteValue)[]) - ]); - })); + type ConsoleLogEntry = Log.BaseLogEntry & { + type: 'console'; + method: string; + args: [...Script.RemoteValue[]]; + }; } export declare namespace Log { - type JavascriptLogEntry = ((Log.BaseLogEntry & { - "type": ("javascript"); - })); + type JavascriptLogEntry = Log.BaseLogEntry & { + type: 'javascript'; + }; } export declare namespace Log { - type EntryAdded = ({ - "method": ("log.entryAdded"); - "params": (Log.Entry); - }); -} -export type InputCommand = (Input.PerformActions | Input.ReleaseActions | Input.SetFiles); -export type InputEvent = (Input.FileDialogOpened); + type EntryAdded = { + method: 'log.entryAdded'; + params: Log.Entry; + }; +} +export type InputCommand = + | Input.PerformActions + | Input.ReleaseActions + | Input.SetFiles; +export type InputEvent = Input.FileDialogOpened; export declare namespace Input { - type ElementOrigin = (({ - "type": ("element"); - "element": (Script.SharedReference); - })); + type ElementOrigin = { + type: 'element'; + element: Script.SharedReference; + }; } export declare namespace Input { - type PerformActionsParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "actions": ([ - ...((Input.SourceActions)[]) - ]); - })); + type PerformActionsParameters = { + context: BrowsingContext.BrowsingContext; + actions: [...Input.SourceActions[]]; + }; } export declare namespace Input { - type NoneSourceActions = (({ - "type": ("none"); - "id": (string); - "actions": ([ - ...((Input.NoneSourceAction)[]) - ]); - })); + type NoneSourceActions = { + type: 'none'; + id: string; + actions: [...Input.NoneSourceAction[]]; + }; } export declare namespace Input { - type KeySourceActions = (({ - "type": ("key"); - "id": (string); - "actions": ([ - ...((Input.KeySourceAction)[]) - ]); - })); + type KeySourceActions = { + type: 'key'; + id: string; + actions: [...Input.KeySourceAction[]]; + }; } export declare namespace Input { - type PointerSourceActions = (({ - "type": ("pointer"); - "id": (string); - "parameters"?: (Input.PointerParameters); - "actions": ([ - ...((Input.PointerSourceAction)[]) - ]); - })); + type PointerSourceActions = { + type: 'pointer'; + id: string; + parameters?: Input.PointerParameters; + actions: [...Input.PointerSourceAction[]]; + }; } export declare namespace Input { - type PerformActions = ({ - "method": ("input.performActions"); - "params": (Input.PerformActionsParameters); - }); + type PerformActions = { + method: 'input.performActions'; + params: Input.PerformActionsParameters; + }; } export declare namespace Input { - type SourceActions = ((Input.NoneSourceActions | Input.KeySourceActions | Input.PointerSourceActions | Input.WheelSourceActions)); + type SourceActions = + | Input.NoneSourceActions + | Input.KeySourceActions + | Input.PointerSourceActions + | Input.WheelSourceActions; } export declare namespace Input { - type NoneSourceAction = (Input.PauseAction); + type NoneSourceAction = Input.PauseAction; } export declare namespace Input { - type KeySourceAction = ((Input.PauseAction | Input.KeyDownAction | Input.KeyUpAction)); + type KeySourceAction = + | Input.PauseAction + | Input.KeyDownAction + | Input.KeyUpAction; } export declare namespace Input { - const enum PointerType { - Mouse = "mouse", - Pen = "pen", - Touch = "touch" - } + const enum PointerType { + Mouse = 'mouse', + Pen = 'pen', + Touch = 'touch', + } } export declare namespace Input { - type PointerParameters = (({ - /** - * @defaultValue `"mouse"` - */ - "pointerType"?: (Input.PointerType); - })); + type PointerParameters = { + /** + * @defaultValue `"mouse"` + */ + pointerType?: Input.PointerType; + }; } export declare namespace Input { - type WheelSourceActions = (({ - "type": ("wheel"); - "id": (string); - "actions": ([ - ...((Input.WheelSourceAction)[]) - ]); - })); + type WheelSourceActions = { + type: 'wheel'; + id: string; + actions: [...Input.WheelSourceAction[]]; + }; } export declare namespace Input { - type PointerSourceAction = ((Input.PauseAction | Input.PointerDownAction | Input.PointerUpAction | Input.PointerMoveAction)); + type PointerSourceAction = + | Input.PauseAction + | Input.PointerDownAction + | Input.PointerUpAction + | Input.PointerMoveAction; } export declare namespace Input { - type WheelSourceAction = ((Input.PauseAction | Input.WheelScrollAction)); + type WheelSourceAction = Input.PauseAction | Input.WheelScrollAction; } export declare namespace Input { - type PauseAction = (({ - "type": ("pause"); - "duration"?: (JsUint); - })); + type PauseAction = { + type: 'pause'; + duration?: JsUint; + }; } export declare namespace Input { - type KeyDownAction = (({ - "type": ("keyDown"); - "value": (string); - })); + type KeyDownAction = { + type: 'keyDown'; + value: string; + }; } export declare namespace Input { - type KeyUpAction = (({ - "type": ("keyUp"); - "value": (string); - })); + type KeyUpAction = { + type: 'keyUp'; + value: string; + }; } export declare namespace Input { - type PointerUpAction = (({ - "type": ("pointerUp"); - "button": (JsUint); - })); + type PointerUpAction = { + type: 'pointerUp'; + button: JsUint; + }; } export declare namespace Input { - type PointerDownAction = (({ - "type": ("pointerDown"); - "button": (JsUint); - } & Input.PointerCommonProperties)); + type PointerDownAction = { + type: 'pointerDown'; + button: JsUint; + } & Input.PointerCommonProperties; } export declare namespace Input { - type PointerMoveAction = (({ - "type": ("pointerMove"); - "x": (number); - "y": (number); - "duration"?: (JsUint); - "origin"?: (Input.Origin); - } & Input.PointerCommonProperties)); + type PointerMoveAction = { + type: 'pointerMove'; + x: number; + y: number; + duration?: JsUint; + origin?: Input.Origin; + } & Input.PointerCommonProperties; } export declare namespace Input { - type WheelScrollAction = (({ - "type": ("scroll"); - "x": (JsInt); - "y": (JsInt); - "deltaX": (JsInt); - "deltaY": (JsInt); - "duration"?: (JsUint); - /** - * @defaultValue `"viewport"` - */ - "origin"?: (Input.Origin); - })); + type WheelScrollAction = { + type: 'scroll'; + x: JsInt; + y: JsInt; + deltaX: JsInt; + deltaY: JsInt; + duration?: JsUint; + /** + * @defaultValue `"viewport"` + */ + origin?: Input.Origin; + }; } export declare namespace Input { - type PointerCommonProperties = ({ - /** - * @defaultValue `1` - */ - "width"?: (JsUint); - /** - * @defaultValue `1` - */ - "height"?: (JsUint); - /** - * @defaultValue `0` - */ - "pressure"?: (number); - /** - * @defaultValue `0` - */ - "tangentialPressure"?: (number); - /** - * Must be between `0` and `359`, inclusive. - * - * @defaultValue `0` - */ - "twist"?: ((number)); - /** - * Must be between `0` and `1.5707963267948966`, inclusive. - * - * @defaultValue `0` - */ - "altitudeAngle"?: ((number)); - /** - * Must be between `0` and `6.283185307179586`, inclusive. - * - * @defaultValue `0` - */ - "azimuthAngle"?: ((number)); - }); + type PointerCommonProperties = { + /** + * @defaultValue `1` + */ + width?: JsUint; + /** + * @defaultValue `1` + */ + height?: JsUint; + /** + * @defaultValue `0` + */ + pressure?: number; + /** + * @defaultValue `0` + */ + tangentialPressure?: number; + /** + * Must be between `0` and `359`, inclusive. + * + * @defaultValue `0` + */ + twist?: number; + /** + * Must be between `0` and `1.5707963267948966`, inclusive. + * + * @defaultValue `0` + */ + altitudeAngle?: number; + /** + * Must be between `0` and `6.283185307179586`, inclusive. + * + * @defaultValue `0` + */ + azimuthAngle?: number; + }; } export declare namespace Input { - type Origin = ("viewport" | "pointer" | Input.ElementOrigin); + type Origin = 'viewport' | 'pointer' | Input.ElementOrigin; } export declare namespace Input { - type ReleaseActions = ({ - "method": ("input.releaseActions"); - "params": (Input.ReleaseActionsParameters); - }); + type ReleaseActions = { + method: 'input.releaseActions'; + params: Input.ReleaseActionsParameters; + }; } export declare namespace Input { - type ReleaseActionsParameters = (({ - "context": (BrowsingContext.BrowsingContext); - })); + type ReleaseActionsParameters = { + context: BrowsingContext.BrowsingContext; + }; } export declare namespace Input { - type SetFiles = ({ - "method": ("input.setFiles"); - "params": (Input.SetFilesParameters); - }); + type SetFiles = { + method: 'input.setFiles'; + params: Input.SetFilesParameters; + }; } export declare namespace Input { - type SetFilesParameters = (({ - "context": (BrowsingContext.BrowsingContext); - "element": (Script.SharedReference); - "files": ([ - ...((string)[]) - ]); - })); + type SetFilesParameters = { + context: BrowsingContext.BrowsingContext; + element: Script.SharedReference; + files: [...string[]]; + }; } export declare namespace Input { - type FileDialogOpened = ({ - "method": ("input.fileDialogOpened"); - "params": (Input.FileDialogInfo); - }); + type FileDialogOpened = { + method: 'input.fileDialogOpened'; + params: Input.FileDialogInfo; + }; } export declare namespace Input { - type FileDialogInfo = (({ - "context": (BrowsingContext.BrowsingContext); - "element"?: (Script.SharedReference); - "multiple": (boolean); - })); -} -export type WebExtensionCommand = (WebExtension.Install | WebExtension.Uninstall); -export type WebExtensionResult = ((WebExtension.InstallResult)); + type FileDialogInfo = { + context: BrowsingContext.BrowsingContext; + element?: Script.SharedReference; + multiple: boolean; + }; +} +export type WebExtensionCommand = WebExtension.Install | WebExtension.Uninstall; +export type WebExtensionResult = WebExtension.InstallResult; export declare namespace WebExtension { - type Extension = (string); + type Extension = string; } export declare namespace WebExtension { - type InstallParameters = (({ - "extensionData": (WebExtension.ExtensionData); - })); + type InstallParameters = { + extensionData: WebExtension.ExtensionData; + }; } export declare namespace WebExtension { - type Install = ({ - "method": ("webExtension.install"); - "params": (WebExtension.InstallParameters); - }); + type Install = { + method: 'webExtension.install'; + params: WebExtension.InstallParameters; + }; } export declare namespace WebExtension { - type ExtensionData = ((WebExtension.ExtensionArchivePath | WebExtension.ExtensionBase64Encoded | WebExtension.ExtensionPath)); + type ExtensionData = + | WebExtension.ExtensionArchivePath + | WebExtension.ExtensionBase64Encoded + | WebExtension.ExtensionPath; } export declare namespace WebExtension { - type ExtensionPath = (({ - "type": ("path"); - "path": (string); - })); + type ExtensionPath = { + type: 'path'; + path: string; + }; } export declare namespace WebExtension { - type ExtensionArchivePath = (({ - "type": ("archivePath"); - "path": (string); - })); + type ExtensionArchivePath = { + type: 'archivePath'; + path: string; + }; } export declare namespace WebExtension { - type ExtensionBase64Encoded = (({ - "type": ("base64"); - "value": (string); - })); + type ExtensionBase64Encoded = { + type: 'base64'; + value: string; + }; } export declare namespace WebExtension { - type InstallResult = (({ - "extension": (WebExtension.Extension); - })); + type InstallResult = { + extension: WebExtension.Extension; + }; } export declare namespace WebExtension { - type Uninstall = ({ - "method": ("webExtension.uninstall"); - "params": (WebExtension.UninstallParameters); - }); + type Uninstall = { + method: 'webExtension.uninstall'; + params: WebExtension.UninstallParameters; + }; } export declare namespace WebExtension { - type UninstallParameters = (({ - "extension": (WebExtension.Extension); - })); + type UninstallParameters = { + extension: WebExtension.Extension; + }; } diff --git a/out/gen/main.js b/out/gen/main.js index c8ad2e5..38813da 100644 --- a/out/gen/main.js +++ b/out/gen/main.js @@ -1,2 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/gen/mapping.d.ts b/out/gen/mapping.d.ts index dd49275..1b1f1ec 100644 --- a/out/gen/mapping.d.ts +++ b/out/gen/mapping.d.ts @@ -2,288 +2,288 @@ * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts * Do not edit this file manually. */ -import type * as Bidi from "./main.ts"; -import type * as BidiPermissions from "./permissions.ts"; -import type * as BidiBluetooth from "./web-bluetooth.ts"; +import type * as Bidi from './main.ts'; +import type * as BidiPermissions from './permissions.ts'; +import type * as BidiBluetooth from './web-bluetooth.ts'; export interface CommandMapping { - "bluetooth.disableSimulation": { - params: BidiBluetooth.Bluetooth.DisableSimulationParameters; - returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters; - }; - "bluetooth.handleRequestDevicePrompt": { - params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; - returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; - }; - "bluetooth.simulateAdapter": { - params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; - returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters; - }; - "bluetooth.simulateAdvertisement": { - params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; - returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; - }; - "bluetooth.simulateCharacteristic": { - params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; - returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; - }; - "bluetooth.simulateCharacteristicResponse": { - params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; - returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; - }; - "bluetooth.simulateDescriptor": { - params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; - returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; - }; - "bluetooth.simulateDescriptorResponse": { - params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; - returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; - }; - "bluetooth.simulateGattConnectionResponse": { - params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; - returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; - }; - "bluetooth.simulateGattDisconnection": { - params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; - returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; - }; - "bluetooth.simulatePreconnectedPeripheral": { - params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; - returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; - }; - "bluetooth.simulateService": { - params: BidiBluetooth.Bluetooth.SimulateServiceParameters; - returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters; - }; - "browser.close": { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - }; - "browser.createUserContext": { - params: Bidi.Browser.CreateUserContextParameters; - returnType: Bidi.Browser.CreateUserContextParameters; - }; - "browser.getClientWindows": { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - }; - "browser.getUserContexts": { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - }; - "browser.removeUserContext": { - params: Bidi.Browser.RemoveUserContextParameters; - returnType: Bidi.Browser.RemoveUserContextParameters; - }; - "browser.setClientWindowState": { - params: Bidi.Browser.SetClientWindowStateParameters; - returnType: Bidi.Browser.SetClientWindowStateParameters; - }; - "browsingContext.activate": { - params: Bidi.BrowsingContext.ActivateParameters; - returnType: Bidi.BrowsingContext.ActivateParameters; - }; - "browsingContext.captureScreenshot": { - params: Bidi.BrowsingContext.CaptureScreenshotParameters; - returnType: Bidi.BrowsingContext.CaptureScreenshotParameters; - }; - "browsingContext.close": { - params: Bidi.BrowsingContext.CloseParameters; - returnType: Bidi.BrowsingContext.CloseParameters; - }; - "browsingContext.create": { - params: Bidi.BrowsingContext.CreateParameters; - returnType: Bidi.BrowsingContext.CreateParameters; - }; - "browsingContext.getTree": { - params: Bidi.BrowsingContext.GetTreeParameters; - returnType: Bidi.BrowsingContext.GetTreeParameters; - }; - "browsingContext.handleUserPrompt": { - params: Bidi.BrowsingContext.HandleUserPromptParameters; - returnType: Bidi.BrowsingContext.HandleUserPromptParameters; - }; - "browsingContext.locateNodes": { - params: Bidi.BrowsingContext.LocateNodesParameters; - returnType: Bidi.BrowsingContext.LocateNodesParameters; - }; - "browsingContext.navigate": { - params: Bidi.BrowsingContext.NavigateParameters; - returnType: Bidi.BrowsingContext.NavigateParameters; - }; - "browsingContext.print": { - params: Bidi.BrowsingContext.PrintParameters; - returnType: Bidi.BrowsingContext.PrintParameters; - }; - "browsingContext.reload": { - params: Bidi.BrowsingContext.ReloadParameters; - returnType: Bidi.BrowsingContext.ReloadParameters; - }; - "browsingContext.setViewport": { - params: Bidi.BrowsingContext.SetViewportParameters; - returnType: Bidi.BrowsingContext.SetViewportParameters; - }; - "browsingContext.traverseHistory": { - params: Bidi.BrowsingContext.TraverseHistoryParameters; - returnType: Bidi.BrowsingContext.TraverseHistoryParameters; - }; - "emulation.setForcedColorsModeThemeOverride": { - params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; - returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; - }; - "emulation.setGeolocationOverride": { - params: Bidi.Emulation.SetGeolocationOverrideParameters; - returnType: Bidi.Emulation.SetGeolocationOverrideParameters; - }; - "emulation.setLocaleOverride": { - params: Bidi.Emulation.SetLocaleOverrideParameters; - returnType: Bidi.Emulation.SetLocaleOverrideParameters; - }; - "emulation.setScreenOrientationOverride": { - params: Bidi.Emulation.SetScreenOrientationOverrideParameters; - returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters; - }; - "emulation.setScriptingEnabled": { - params: Bidi.Emulation.SetScriptingEnabledParameters; - returnType: Bidi.Emulation.SetScriptingEnabledParameters; - }; - "emulation.setTimezoneOverride": { - params: Bidi.Emulation.SetTimezoneOverrideParameters; - returnType: Bidi.Emulation.SetTimezoneOverrideParameters; - }; - "emulation.setUserAgentOverride": { - params: Bidi.Emulation.SetUserAgentOverrideParameters; - returnType: Bidi.Emulation.SetUserAgentOverrideParameters; - }; - "input.performActions": { - params: Bidi.Input.PerformActionsParameters; - returnType: Bidi.Input.PerformActionsParameters; - }; - "input.releaseActions": { - params: Bidi.Input.ReleaseActionsParameters; - returnType: Bidi.Input.ReleaseActionsParameters; - }; - "input.setFiles": { - params: Bidi.Input.SetFilesParameters; - returnType: Bidi.Input.SetFilesParameters; - }; - "network.addDataCollector": { - params: Bidi.Network.AddDataCollectorParameters; - returnType: Bidi.Network.AddDataCollectorParameters; - }; - "network.addIntercept": { - params: Bidi.Network.AddInterceptParameters; - returnType: Bidi.Network.AddInterceptParameters; - }; - "network.continueRequest": { - params: Bidi.Network.ContinueRequestParameters; - returnType: Bidi.Network.ContinueRequestParameters; - }; - "network.continueResponse": { - params: Bidi.Network.ContinueResponseParameters; - returnType: Bidi.Network.ContinueResponseParameters; - }; - "network.continueWithAuth": { - params: Bidi.Network.ContinueWithAuthParameters; - returnType: Bidi.Network.ContinueWithAuthParameters; - }; - "network.disownData": { - params: Bidi.Network.DisownDataParameters; - returnType: Bidi.Network.DisownDataParameters; - }; - "network.failRequest": { - params: Bidi.Network.FailRequestParameters; - returnType: Bidi.Network.FailRequestParameters; - }; - "network.getData": { - params: Bidi.Network.GetDataParameters; - returnType: Bidi.Network.GetDataParameters; - }; - "network.provideResponse": { - params: Bidi.Network.ProvideResponseParameters; - returnType: Bidi.Network.ProvideResponseParameters; - }; - "network.removeDataCollector": { - params: Bidi.Network.RemoveDataCollectorParameters; - returnType: Bidi.Network.RemoveDataCollectorParameters; - }; - "network.removeIntercept": { - params: Bidi.Network.RemoveInterceptParameters; - returnType: Bidi.Network.RemoveInterceptParameters; - }; - "network.setCacheBehavior": { - params: Bidi.Network.SetCacheBehaviorParameters; - returnType: Bidi.Network.SetCacheBehaviorParameters; - }; - "network.setExtraHeaders": { - params: Bidi.Network.SetExtraHeadersParameters; - returnType: Bidi.Network.SetExtraHeadersParameters; - }; - "permissions.setPermission": { - params: BidiPermissions.Permissions.SetPermissionParameters; - returnType: BidiPermissions.Permissions.SetPermissionParameters; - }; - "script.addPreloadScript": { - params: Bidi.Script.AddPreloadScriptParameters; - returnType: Bidi.Script.AddPreloadScriptParameters; - }; - "script.callFunction": { - params: Bidi.Script.CallFunctionParameters; - returnType: Bidi.Script.CallFunctionParameters; - }; - "script.disown": { - params: Bidi.Script.DisownParameters; - returnType: Bidi.Script.DisownParameters; - }; - "script.evaluate": { - params: Bidi.Script.EvaluateParameters; - returnType: Bidi.Script.EvaluateParameters; - }; - "script.getRealms": { - params: Bidi.Script.GetRealmsParameters; - returnType: Bidi.Script.GetRealmsParameters; - }; - "script.removePreloadScript": { - params: Bidi.Script.RemovePreloadScriptParameters; - returnType: Bidi.Script.RemovePreloadScriptParameters; - }; - "session.end": { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - }; - "session.new": { - params: Bidi.Session.NewParameters; - returnType: Bidi.Session.NewParameters; - }; - "session.status": { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - }; - "session.subscribe": { - params: Bidi.Session.SubscriptionRequest; - returnType: Bidi.Session.SubscriptionRequest; - }; - "session.unsubscribe": { - params: Bidi.Session.UnsubscribeParameters; - returnType: Bidi.Session.UnsubscribeParameters; - }; - "storage.deleteCookies": { - params: Bidi.Storage.DeleteCookiesParameters; - returnType: Bidi.Storage.DeleteCookiesParameters; - }; - "storage.getCookies": { - params: Bidi.Storage.GetCookiesParameters; - returnType: Bidi.Storage.GetCookiesParameters; - }; - "storage.setCookie": { - params: Bidi.Storage.SetCookieParameters; - returnType: Bidi.Storage.SetCookieParameters; - }; - "webExtension.install": { - params: Bidi.WebExtension.InstallParameters; - returnType: Bidi.WebExtension.InstallParameters; - }; - "webExtension.uninstall": { - params: Bidi.WebExtension.UninstallParameters; - returnType: Bidi.WebExtension.UninstallParameters; - }; + 'bluetooth.disableSimulation': { + params: BidiBluetooth.Bluetooth.DisableSimulationParameters; + returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters; + }; + 'bluetooth.handleRequestDevicePrompt': { + params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + }; + 'bluetooth.simulateAdapter': { + params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + }; + 'bluetooth.simulateAdvertisement': { + params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + }; + 'bluetooth.simulateCharacteristic': { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + }; + 'bluetooth.simulateCharacteristicResponse': { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + }; + 'bluetooth.simulateDescriptor': { + params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + }; + 'bluetooth.simulateDescriptorResponse': { + params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + }; + 'bluetooth.simulateGattConnectionResponse': { + params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + }; + 'bluetooth.simulateGattDisconnection': { + params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + }; + 'bluetooth.simulatePreconnectedPeripheral': { + params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + }; + 'bluetooth.simulateService': { + params: BidiBluetooth.Bluetooth.SimulateServiceParameters; + returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters; + }; + 'browser.close': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'browser.createUserContext': { + params: Bidi.Browser.CreateUserContextParameters; + returnType: Bidi.Browser.CreateUserContextParameters; + }; + 'browser.getClientWindows': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'browser.getUserContexts': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'browser.removeUserContext': { + params: Bidi.Browser.RemoveUserContextParameters; + returnType: Bidi.Browser.RemoveUserContextParameters; + }; + 'browser.setClientWindowState': { + params: Bidi.Browser.SetClientWindowStateParameters; + returnType: Bidi.Browser.SetClientWindowStateParameters; + }; + 'browsingContext.activate': { + params: Bidi.BrowsingContext.ActivateParameters; + returnType: Bidi.BrowsingContext.ActivateParameters; + }; + 'browsingContext.captureScreenshot': { + params: Bidi.BrowsingContext.CaptureScreenshotParameters; + returnType: Bidi.BrowsingContext.CaptureScreenshotParameters; + }; + 'browsingContext.close': { + params: Bidi.BrowsingContext.CloseParameters; + returnType: Bidi.BrowsingContext.CloseParameters; + }; + 'browsingContext.create': { + params: Bidi.BrowsingContext.CreateParameters; + returnType: Bidi.BrowsingContext.CreateParameters; + }; + 'browsingContext.getTree': { + params: Bidi.BrowsingContext.GetTreeParameters; + returnType: Bidi.BrowsingContext.GetTreeParameters; + }; + 'browsingContext.handleUserPrompt': { + params: Bidi.BrowsingContext.HandleUserPromptParameters; + returnType: Bidi.BrowsingContext.HandleUserPromptParameters; + }; + 'browsingContext.locateNodes': { + params: Bidi.BrowsingContext.LocateNodesParameters; + returnType: Bidi.BrowsingContext.LocateNodesParameters; + }; + 'browsingContext.navigate': { + params: Bidi.BrowsingContext.NavigateParameters; + returnType: Bidi.BrowsingContext.NavigateParameters; + }; + 'browsingContext.print': { + params: Bidi.BrowsingContext.PrintParameters; + returnType: Bidi.BrowsingContext.PrintParameters; + }; + 'browsingContext.reload': { + params: Bidi.BrowsingContext.ReloadParameters; + returnType: Bidi.BrowsingContext.ReloadParameters; + }; + 'browsingContext.setViewport': { + params: Bidi.BrowsingContext.SetViewportParameters; + returnType: Bidi.BrowsingContext.SetViewportParameters; + }; + 'browsingContext.traverseHistory': { + params: Bidi.BrowsingContext.TraverseHistoryParameters; + returnType: Bidi.BrowsingContext.TraverseHistoryParameters; + }; + 'emulation.setForcedColorsModeThemeOverride': { + params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + }; + 'emulation.setGeolocationOverride': { + params: Bidi.Emulation.SetGeolocationOverrideParameters; + returnType: Bidi.Emulation.SetGeolocationOverrideParameters; + }; + 'emulation.setLocaleOverride': { + params: Bidi.Emulation.SetLocaleOverrideParameters; + returnType: Bidi.Emulation.SetLocaleOverrideParameters; + }; + 'emulation.setScreenOrientationOverride': { + params: Bidi.Emulation.SetScreenOrientationOverrideParameters; + returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters; + }; + 'emulation.setScriptingEnabled': { + params: Bidi.Emulation.SetScriptingEnabledParameters; + returnType: Bidi.Emulation.SetScriptingEnabledParameters; + }; + 'emulation.setTimezoneOverride': { + params: Bidi.Emulation.SetTimezoneOverrideParameters; + returnType: Bidi.Emulation.SetTimezoneOverrideParameters; + }; + 'emulation.setUserAgentOverride': { + params: Bidi.Emulation.SetUserAgentOverrideParameters; + returnType: Bidi.Emulation.SetUserAgentOverrideParameters; + }; + 'input.performActions': { + params: Bidi.Input.PerformActionsParameters; + returnType: Bidi.Input.PerformActionsParameters; + }; + 'input.releaseActions': { + params: Bidi.Input.ReleaseActionsParameters; + returnType: Bidi.Input.ReleaseActionsParameters; + }; + 'input.setFiles': { + params: Bidi.Input.SetFilesParameters; + returnType: Bidi.Input.SetFilesParameters; + }; + 'network.addDataCollector': { + params: Bidi.Network.AddDataCollectorParameters; + returnType: Bidi.Network.AddDataCollectorParameters; + }; + 'network.addIntercept': { + params: Bidi.Network.AddInterceptParameters; + returnType: Bidi.Network.AddInterceptParameters; + }; + 'network.continueRequest': { + params: Bidi.Network.ContinueRequestParameters; + returnType: Bidi.Network.ContinueRequestParameters; + }; + 'network.continueResponse': { + params: Bidi.Network.ContinueResponseParameters; + returnType: Bidi.Network.ContinueResponseParameters; + }; + 'network.continueWithAuth': { + params: Bidi.Network.ContinueWithAuthParameters; + returnType: Bidi.Network.ContinueWithAuthParameters; + }; + 'network.disownData': { + params: Bidi.Network.DisownDataParameters; + returnType: Bidi.Network.DisownDataParameters; + }; + 'network.failRequest': { + params: Bidi.Network.FailRequestParameters; + returnType: Bidi.Network.FailRequestParameters; + }; + 'network.getData': { + params: Bidi.Network.GetDataParameters; + returnType: Bidi.Network.GetDataParameters; + }; + 'network.provideResponse': { + params: Bidi.Network.ProvideResponseParameters; + returnType: Bidi.Network.ProvideResponseParameters; + }; + 'network.removeDataCollector': { + params: Bidi.Network.RemoveDataCollectorParameters; + returnType: Bidi.Network.RemoveDataCollectorParameters; + }; + 'network.removeIntercept': { + params: Bidi.Network.RemoveInterceptParameters; + returnType: Bidi.Network.RemoveInterceptParameters; + }; + 'network.setCacheBehavior': { + params: Bidi.Network.SetCacheBehaviorParameters; + returnType: Bidi.Network.SetCacheBehaviorParameters; + }; + 'network.setExtraHeaders': { + params: Bidi.Network.SetExtraHeadersParameters; + returnType: Bidi.Network.SetExtraHeadersParameters; + }; + 'permissions.setPermission': { + params: BidiPermissions.Permissions.SetPermissionParameters; + returnType: BidiPermissions.Permissions.SetPermissionParameters; + }; + 'script.addPreloadScript': { + params: Bidi.Script.AddPreloadScriptParameters; + returnType: Bidi.Script.AddPreloadScriptParameters; + }; + 'script.callFunction': { + params: Bidi.Script.CallFunctionParameters; + returnType: Bidi.Script.CallFunctionParameters; + }; + 'script.disown': { + params: Bidi.Script.DisownParameters; + returnType: Bidi.Script.DisownParameters; + }; + 'script.evaluate': { + params: Bidi.Script.EvaluateParameters; + returnType: Bidi.Script.EvaluateParameters; + }; + 'script.getRealms': { + params: Bidi.Script.GetRealmsParameters; + returnType: Bidi.Script.GetRealmsParameters; + }; + 'script.removePreloadScript': { + params: Bidi.Script.RemovePreloadScriptParameters; + returnType: Bidi.Script.RemovePreloadScriptParameters; + }; + 'session.end': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'session.new': { + params: Bidi.Session.NewParameters; + returnType: Bidi.Session.NewParameters; + }; + 'session.status': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'session.subscribe': { + params: Bidi.Session.SubscriptionRequest; + returnType: Bidi.Session.SubscriptionRequest; + }; + 'session.unsubscribe': { + params: Bidi.Session.UnsubscribeParameters; + returnType: Bidi.Session.UnsubscribeParameters; + }; + 'storage.deleteCookies': { + params: Bidi.Storage.DeleteCookiesParameters; + returnType: Bidi.Storage.DeleteCookiesParameters; + }; + 'storage.getCookies': { + params: Bidi.Storage.GetCookiesParameters; + returnType: Bidi.Storage.GetCookiesParameters; + }; + 'storage.setCookie': { + params: Bidi.Storage.SetCookieParameters; + returnType: Bidi.Storage.SetCookieParameters; + }; + 'webExtension.install': { + params: Bidi.WebExtension.InstallParameters; + returnType: Bidi.WebExtension.InstallParameters; + }; + 'webExtension.uninstall': { + params: Bidi.WebExtension.UninstallParameters; + returnType: Bidi.WebExtension.UninstallParameters; + }; } diff --git a/out/gen/mapping.js b/out/gen/mapping.js index a643a6d..5029460 100644 --- a/out/gen/mapping.js +++ b/out/gen/mapping.js @@ -1,7 +1,7 @@ -"use strict"; +'use strict'; /* eslint-disable */ /** * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts * Do not edit this file manually. */ -Object.defineProperty(exports, "__esModule", { value: true }); +Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/gen/permissions.d.ts b/out/gen/permissions.d.ts index b16fe62..256abf9 100644 --- a/out/gen/permissions.d.ts +++ b/out/gen/permissions.d.ts @@ -1,27 +1,27 @@ -export type PermissionsCommand = (Permissions.SetPermission); +export type PermissionsCommand = Permissions.SetPermission; export declare namespace Permissions { - type PermissionDescriptor = (({ - "name": (string); - })); + type PermissionDescriptor = { + name: string; + }; } export declare namespace Permissions { - const enum PermissionState { - Granted = "granted", - Denied = "denied", - Prompt = "prompt" - } + const enum PermissionState { + Granted = 'granted', + Denied = 'denied', + Prompt = 'prompt', + } } export declare namespace Permissions { - type SetPermission = ({ - "method": ("permissions.setPermission"); - "params": (Permissions.SetPermissionParameters); - }); + type SetPermission = { + method: 'permissions.setPermission'; + params: Permissions.SetPermissionParameters; + }; } export declare namespace Permissions { - type SetPermissionParameters = (({ - "descriptor": (Permissions.PermissionDescriptor); - "state": (Permissions.PermissionState); - "origin": (string); - "userContext"?: (string); - })); + type SetPermissionParameters = { + descriptor: Permissions.PermissionDescriptor; + state: Permissions.PermissionState; + origin: string; + userContext?: string; + }; } diff --git a/out/gen/permissions.js b/out/gen/permissions.js index c8ad2e5..38813da 100644 --- a/out/gen/permissions.js +++ b/out/gen/permissions.js @@ -1,2 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/gen/web-bluetooth.d.ts b/out/gen/web-bluetooth.d.ts index 58aadc5..8b40810 100644 --- a/out/gen/web-bluetooth.d.ts +++ b/out/gen/web-bluetooth.d.ts @@ -1,306 +1,315 @@ export declare namespace Bluetooth { - type BluetoothUuid = (string); + type BluetoothUuid = string; } export declare namespace Bluetooth { - type BluetoothManufacturerData = (({ - "key": (number); - "data": (string); - })); + type BluetoothManufacturerData = { + key: number; + data: string; + }; } export declare namespace Bluetooth { - type CharacteristicProperties = (({ - "broadcast"?: (boolean); - "read"?: (boolean); - "writeWithoutResponse"?: (boolean); - "write"?: (boolean); - "notify"?: (boolean); - "indicate"?: (boolean); - "authenticatedSignedWrites"?: (boolean); - "extendedProperties"?: (boolean); - })); + type CharacteristicProperties = { + broadcast?: boolean; + read?: boolean; + writeWithoutResponse?: boolean; + write?: boolean; + notify?: boolean; + indicate?: boolean; + authenticatedSignedWrites?: boolean; + extendedProperties?: boolean; + }; } export declare namespace Bluetooth { - type RequestDevice = (string); + type RequestDevice = string; } export declare namespace Bluetooth { - type RequestDeviceInfo = (({ - "id": (Bluetooth.RequestDevice); - "name": (string | null); - })); + type RequestDeviceInfo = { + id: Bluetooth.RequestDevice; + name: string | null; + }; } export declare namespace Bluetooth { - type RequestDevicePrompt = (string); + type RequestDevicePrompt = string; } export declare namespace Bluetooth { - type ScanRecord = (({ - "name"?: (string); - "uuids"?: ([ - ...((Bluetooth.BluetoothUuid)[]) - ]); - "appearance"?: (number); - "manufacturerData"?: ([ - ...((Bluetooth.BluetoothManufacturerData)[]) - ]); - })); + type ScanRecord = { + name?: string; + uuids?: [...Bluetooth.BluetoothUuid[]]; + appearance?: number; + manufacturerData?: [...Bluetooth.BluetoothManufacturerData[]]; + }; } -export type BluetoothCommand = (Bluetooth.HandleRequestDevicePrompt | Bluetooth.SimulateAdapter | Bluetooth.DisableSimulation | Bluetooth.SimulatePreconnectedPeripheral | Bluetooth.SimulateAdvertisement | Bluetooth.SimulateGattConnectionResponse | Bluetooth.SimulateGattDisconnection | Bluetooth.SimulateService | Bluetooth.SimulateCharacteristic | Bluetooth.SimulateCharacteristicResponse | Bluetooth.SimulateDescriptor | Bluetooth.SimulateDescriptorResponse | Record); +export type BluetoothCommand = + | Bluetooth.HandleRequestDevicePrompt + | Bluetooth.SimulateAdapter + | Bluetooth.DisableSimulation + | Bluetooth.SimulatePreconnectedPeripheral + | Bluetooth.SimulateAdvertisement + | Bluetooth.SimulateGattConnectionResponse + | Bluetooth.SimulateGattDisconnection + | Bluetooth.SimulateService + | Bluetooth.SimulateCharacteristic + | Bluetooth.SimulateCharacteristicResponse + | Bluetooth.SimulateDescriptor + | Bluetooth.SimulateDescriptorResponse + | Record; export declare namespace Bluetooth { - type HandleRequestDevicePrompt = ({ - "method": ("bluetooth.handleRequestDevicePrompt"); - "params": (Bluetooth.HandleRequestDevicePromptParameters); - }); + type HandleRequestDevicePrompt = { + method: 'bluetooth.handleRequestDevicePrompt'; + params: Bluetooth.HandleRequestDevicePromptParameters; + }; } export declare namespace Bluetooth { - type HandleRequestDevicePromptParameters = (({ - "context": (string); - "prompt": (Bluetooth.RequestDevicePrompt); - } & (Bluetooth.HandleRequestDevicePromptAcceptParameters | Bluetooth.HandleRequestDevicePromptCancelParameters))); + type HandleRequestDevicePromptParameters = { + context: string; + prompt: Bluetooth.RequestDevicePrompt; + } & ( + | Bluetooth.HandleRequestDevicePromptAcceptParameters + | Bluetooth.HandleRequestDevicePromptCancelParameters + ); } export declare namespace Bluetooth { - type HandleRequestDevicePromptAcceptParameters = ({ - "accept": (true); - "device": (Bluetooth.RequestDevice); - }); + type HandleRequestDevicePromptAcceptParameters = { + accept: true; + device: Bluetooth.RequestDevice; + }; } export declare namespace Bluetooth { - type HandleRequestDevicePromptCancelParameters = ({ - "accept": (false); - }); + type HandleRequestDevicePromptCancelParameters = { + accept: false; + }; } export declare namespace Bluetooth { - type SimulateAdapter = ({ - "method": ("bluetooth.simulateAdapter"); - "params": (Bluetooth.SimulateAdapterParameters); - }); + type SimulateAdapter = { + method: 'bluetooth.simulateAdapter'; + params: Bluetooth.SimulateAdapterParameters; + }; } export declare namespace Bluetooth { - type SimulateAdapterParameters = (({ - "context": (string); - "leSupported"?: (boolean); - "state": ("absent" | "powered-off" | "powered-on"); - })); + type SimulateAdapterParameters = { + context: string; + leSupported?: boolean; + state: 'absent' | 'powered-off' | 'powered-on'; + }; } export declare namespace Bluetooth { - type DisableSimulation = ({ - "method": ("bluetooth.disableSimulation"); - "params": (Bluetooth.DisableSimulationParameters); - }); + type DisableSimulation = { + method: 'bluetooth.disableSimulation'; + params: Bluetooth.DisableSimulationParameters; + }; } export declare namespace Bluetooth { - type DisableSimulationParameters = (({ - "context": (string); - })); + type DisableSimulationParameters = { + context: string; + }; } export declare namespace Bluetooth { - type SimulatePreconnectedPeripheral = ({ - "method": ("bluetooth.simulatePreconnectedPeripheral"); - "params": (Bluetooth.SimulatePreconnectedPeripheralParameters); - }); + type SimulatePreconnectedPeripheral = { + method: 'bluetooth.simulatePreconnectedPeripheral'; + params: Bluetooth.SimulatePreconnectedPeripheralParameters; + }; } export declare namespace Bluetooth { - type SimulatePreconnectedPeripheralParameters = (({ - "context": (string); - "address": (string); - "name": (string); - "manufacturerData": ([ - ...((Bluetooth.BluetoothManufacturerData)[]) - ]); - "knownServiceUuids": ([ - ...((Bluetooth.BluetoothUuid)[]) - ]); - })); + type SimulatePreconnectedPeripheralParameters = { + context: string; + address: string; + name: string; + manufacturerData: [...Bluetooth.BluetoothManufacturerData[]]; + knownServiceUuids: [...Bluetooth.BluetoothUuid[]]; + }; } export declare namespace Bluetooth { - type SimulateAdvertisement = ({ - "method": ("bluetooth.simulateAdvertisement"); - "params": (Bluetooth.SimulateAdvertisementParameters); - }); + type SimulateAdvertisement = { + method: 'bluetooth.simulateAdvertisement'; + params: Bluetooth.SimulateAdvertisementParameters; + }; } export declare namespace Bluetooth { - type SimulateAdvertisementParameters = (({ - "context": (string); - "scanEntry": (Bluetooth.SimulateAdvertisementScanEntryParameters); - })); + type SimulateAdvertisementParameters = { + context: string; + scanEntry: Bluetooth.SimulateAdvertisementScanEntryParameters; + }; } export declare namespace Bluetooth { - type SimulateAdvertisementScanEntryParameters = (({ - "deviceAddress": (string); - "rssi": (number); - "scanRecord": (Bluetooth.ScanRecord); - })); + type SimulateAdvertisementScanEntryParameters = { + deviceAddress: string; + rssi: number; + scanRecord: Bluetooth.ScanRecord; + }; } export declare namespace Bluetooth { - type SimulateGattConnectionResponse = ({ - "method": ("bluetooth.simulateGattConnectionResponse"); - "params": (Bluetooth.SimulateGattConnectionResponseParameters); - }); + type SimulateGattConnectionResponse = { + method: 'bluetooth.simulateGattConnectionResponse'; + params: Bluetooth.SimulateGattConnectionResponseParameters; + }; } export declare namespace Bluetooth { - type SimulateGattConnectionResponseParameters = (({ - "context": (string); - "address": (string); - "code": (number); - })); + type SimulateGattConnectionResponseParameters = { + context: string; + address: string; + code: number; + }; } export declare namespace Bluetooth { - type SimulateGattDisconnection = ({ - "method": ("bluetooth.simulateGattDisconnection"); - "params": (Bluetooth.SimulateGattDisconnectionParameters); - }); + type SimulateGattDisconnection = { + method: 'bluetooth.simulateGattDisconnection'; + params: Bluetooth.SimulateGattDisconnectionParameters; + }; } export declare namespace Bluetooth { - type SimulateGattDisconnectionParameters = (({ - "context": (string); - "address": (string); - })); + type SimulateGattDisconnectionParameters = { + context: string; + address: string; + }; } export declare namespace Bluetooth { - type SimulateService = ({ - "method": ("bluetooth.simulateService"); - "params": (Bluetooth.SimulateServiceParameters); - }); + type SimulateService = { + method: 'bluetooth.simulateService'; + params: Bluetooth.SimulateServiceParameters; + }; } export declare namespace Bluetooth { - type SimulateServiceParameters = (({ - "context": (string); - "address": (string); - "uuid": (Bluetooth.BluetoothUuid); - "type": ("add" | "remove"); - })); + type SimulateServiceParameters = { + context: string; + address: string; + uuid: Bluetooth.BluetoothUuid; + type: 'add' | 'remove'; + }; } export declare namespace Bluetooth { - type SimulateCharacteristic = ({ - "method": ("bluetooth.simulateCharacteristic"); - "params": (Bluetooth.SimulateCharacteristicParameters); - }); + type SimulateCharacteristic = { + method: 'bluetooth.simulateCharacteristic'; + params: Bluetooth.SimulateCharacteristicParameters; + }; } export declare namespace Bluetooth { - type SimulateCharacteristicParameters = (({ - "context": (string); - "address": (string); - "serviceUuid": (Bluetooth.BluetoothUuid); - "characteristicUuid": (Bluetooth.BluetoothUuid); - "characteristicProperties"?: (Bluetooth.CharacteristicProperties); - "type": ("add" | "remove"); - })); + type SimulateCharacteristicParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + characteristicProperties?: Bluetooth.CharacteristicProperties; + type: 'add' | 'remove'; + }; } export declare namespace Bluetooth { - type SimulateCharacteristicResponse = ({ - "method": ("bluetooth.simulateCharacteristicResponse"); - "params": (Bluetooth.SimulateCharacteristicResponseParameters); - }); + type SimulateCharacteristicResponse = { + method: 'bluetooth.simulateCharacteristicResponse'; + params: Bluetooth.SimulateCharacteristicResponseParameters; + }; } export declare namespace Bluetooth { - type SimulateCharacteristicResponseParameters = (({ - "context": (string); - "address": (string); - "serviceUuid": (Bluetooth.BluetoothUuid); - "characteristicUuid": (Bluetooth.BluetoothUuid); - "type": ("read" | "write" | "subscribe-to-notifications" | "unsubscribe-from-notifications"); - "code": (number); - "data"?: ([ - ...((number)[]) - ]); - })); + type SimulateCharacteristicResponseParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + type: + | 'read' + | 'write' + | 'subscribe-to-notifications' + | 'unsubscribe-from-notifications'; + code: number; + data?: [...number[]]; + }; } export declare namespace Bluetooth { - type SimulateDescriptor = ({ - "method": ("bluetooth.simulateDescriptor"); - "params": (Bluetooth.SimulateDescriptorParameters); - }); + type SimulateDescriptor = { + method: 'bluetooth.simulateDescriptor'; + params: Bluetooth.SimulateDescriptorParameters; + }; } export declare namespace Bluetooth { - type SimulateDescriptorParameters = (({ - "context": (string); - "address": (string); - "serviceUuid": (Bluetooth.BluetoothUuid); - "characteristicUuid": (Bluetooth.BluetoothUuid); - "descriptorUuid": (Bluetooth.BluetoothUuid); - "type": ("add" | "remove"); - })); + type SimulateDescriptorParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + descriptorUuid: Bluetooth.BluetoothUuid; + type: 'add' | 'remove'; + }; } export declare namespace Bluetooth { - type SimulateDescriptorResponse = ({ - "method": ("bluetooth.simulateDescriptorResponse"); - "params": (Bluetooth.SimulateDescriptorResponseParameters); - }); + type SimulateDescriptorResponse = { + method: 'bluetooth.simulateDescriptorResponse'; + params: Bluetooth.SimulateDescriptorResponseParameters; + }; } export declare namespace Bluetooth { - type SimulateDescriptorResponseParameters = (({ - "context": (string); - "address": (string); - "serviceUuid": (Bluetooth.BluetoothUuid); - "characteristicUuid": (Bluetooth.BluetoothUuid); - "descriptorUuid": (Bluetooth.BluetoothUuid); - "type": ("read" | "write"); - "code": (number); - "data"?: ([ - ...((number)[]) - ]); - })); -} -export type BluetoothEvent = (Bluetooth.RequestDevicePromptUpdated | Bluetooth.GattConnectionAttempted); -export declare namespace Bluetooth { - type RequestDevicePromptUpdated = ({ - "method": ("bluetooth.requestDevicePromptUpdated"); - "params": (Bluetooth.RequestDevicePromptUpdatedParameters); - }); -} -export declare namespace Bluetooth { - type RequestDevicePromptUpdatedParameters = (({ - "context": (string); - "prompt": (Bluetooth.RequestDevicePrompt); - "devices": ([ - ...((Bluetooth.RequestDeviceInfo)[]) - ]); - })); -} -export declare namespace Bluetooth { - type GattConnectionAttempted = ({ - "method": ("bluetooth.gattConnectionAttempted"); - "params": (Bluetooth.GattConnectionAttemptedParameters); - }); -} -export declare namespace Bluetooth { - type GattConnectionAttemptedParameters = (({ - "context": (string); - "address": (string); - })); -} -export declare namespace Bluetooth { - type CharacteristicEventGenerated = ({ - "method": ("bluetooth.characteristicEventGenerated"); - "params": (Bluetooth.CharacteristicEventGeneratedParameters); - }); -} -export declare namespace Bluetooth { - type CharacteristicEventGeneratedParameters = (({ - "context": (string); - "address": (string); - "serviceUuid": (Bluetooth.BluetoothUuid); - "characteristicUuid": (Bluetooth.BluetoothUuid); - "type": ("read" | "write-with-response" | "write-without-response" | "subscribe-to-notifications" | "unsubscribe-from-notifications"); - "data"?: ([ - ...((number)[]) - ]); - })); -} -export declare namespace Bluetooth { - type DescriptorEventGenerated = ({ - "method": ("bluetooth.descriptorEventGenerated"); - "params": (Bluetooth.DescriptorEventGeneratedParameters); - }); -} -export declare namespace Bluetooth { - type DescriptorEventGeneratedParameters = (({ - "context": (string); - "address": (string); - "serviceUuid": (Bluetooth.BluetoothUuid); - "characteristicUuid": (Bluetooth.BluetoothUuid); - "descriptorUuid": (Bluetooth.BluetoothUuid); - "type": ("read" | "write"); - "data"?: ([ - ...((number)[]) - ]); - })); + type SimulateDescriptorResponseParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + descriptorUuid: Bluetooth.BluetoothUuid; + type: 'read' | 'write'; + code: number; + data?: [...number[]]; + }; +} +export type BluetoothEvent = + | Bluetooth.RequestDevicePromptUpdated + | Bluetooth.GattConnectionAttempted; +export declare namespace Bluetooth { + type RequestDevicePromptUpdated = { + method: 'bluetooth.requestDevicePromptUpdated'; + params: Bluetooth.RequestDevicePromptUpdatedParameters; + }; +} +export declare namespace Bluetooth { + type RequestDevicePromptUpdatedParameters = { + context: string; + prompt: Bluetooth.RequestDevicePrompt; + devices: [...Bluetooth.RequestDeviceInfo[]]; + }; +} +export declare namespace Bluetooth { + type GattConnectionAttempted = { + method: 'bluetooth.gattConnectionAttempted'; + params: Bluetooth.GattConnectionAttemptedParameters; + }; +} +export declare namespace Bluetooth { + type GattConnectionAttemptedParameters = { + context: string; + address: string; + }; +} +export declare namespace Bluetooth { + type CharacteristicEventGenerated = { + method: 'bluetooth.characteristicEventGenerated'; + params: Bluetooth.CharacteristicEventGeneratedParameters; + }; +} +export declare namespace Bluetooth { + type CharacteristicEventGeneratedParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + type: + | 'read' + | 'write-with-response' + | 'write-without-response' + | 'subscribe-to-notifications' + | 'unsubscribe-from-notifications'; + data?: [...number[]]; + }; +} +export declare namespace Bluetooth { + type DescriptorEventGenerated = { + method: 'bluetooth.descriptorEventGenerated'; + params: Bluetooth.DescriptorEventGeneratedParameters; + }; +} +export declare namespace Bluetooth { + type DescriptorEventGeneratedParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + descriptorUuid: Bluetooth.BluetoothUuid; + type: 'read' | 'write'; + data?: [...number[]]; + }; } diff --git a/out/gen/web-bluetooth.js b/out/gen/web-bluetooth.js index c8ad2e5..38813da 100644 --- a/out/gen/web-bluetooth.js +++ b/out/gen/web-bluetooth.js @@ -1,2 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/index.d.ts b/out/index.d.ts index 7727157..f751c88 100644 --- a/out/index.d.ts +++ b/out/index.d.ts @@ -6,6 +6,6 @@ export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -export { Command } from './commands.js'; -export { Event } from './events.js'; -export { CommandMapping } from './gen/mapping.js'; +export {Command} from './commands.js'; +export {Event} from './events.js'; +export {CommandMapping} from './gen/mapping.js'; diff --git a/out/index.js b/out/index.js index b69b4b9..7a7008f 100644 --- a/out/index.js +++ b/out/index.js @@ -1,24 +1,40 @@ -"use strict"; +'use strict'; /** * @license * Copyright 2024 Google Inc. * SPDX-License-Identifier: Apache-2.0 */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./gen/main.js"), exports); -__exportStar(require("./gen/permissions.js"), exports); -__exportStar(require("./gen/web-bluetooth.js"), exports); +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ('get' in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; +Object.defineProperty(exports, '__esModule', {value: true}); +__exportStar(require('./gen/main.js'), exports); +__exportStar(require('./gen/permissions.js'), exports); +__exportStar(require('./gen/web-bluetooth.js'), exports); diff --git a/src/gen/main.ts b/src/gen/main.ts index a863c18..77d6d34 100644 --- a/src/gen/main.ts +++ b/src/gen/main.ts @@ -1,1758 +1,2728 @@ -export type Event = (({ -"type":("event")}&EventData&Extensible)); -export type Command = (({ -"id":(JsUint)}&CommandData&Extensible)); -export type CommandResponse = (({ -"type":("success"),"id":(JsUint),"result":(ResultData)}&Extensible)); -export type EventData = (BrowsingContextEvent| InputEvent| LogEvent| NetworkEvent| ScriptEvent); -export type CommandData = (BrowserCommand| BrowsingContextCommand| EmulationCommand| InputCommand| NetworkCommand| ScriptCommand| SessionCommand| StorageCommand| WebExtensionCommand); -export type ResultData = ((BrowsingContextResult| EmptyResult| NetworkResult| ScriptResult| SessionResult| StorageResult| WebExtensionResult)); -export type EmptyParams = ((Extensible)); -export type Message = ((CommandResponse| ErrorResponse| Event)); -export type ErrorResponse = (({ -"type":("error"),"id":(JsUint| null),"error":(ErrorCode),"message":(string),"stacktrace"?:(string)}&Extensible)); -export type EmptyResult = ((Extensible)); -export type Extensible = ({ -[key: string]:(any)}); +export type Event = { + type: 'event'; +} & EventData & + Extensible; +export type Command = { + id: JsUint; +} & CommandData & + Extensible; +export type CommandResponse = { + type: 'success'; + id: JsUint; + result: ResultData; +} & Extensible; +export type EventData = + | BrowsingContextEvent + | InputEvent + | LogEvent + | NetworkEvent + | ScriptEvent; +export type CommandData = + | BrowserCommand + | BrowsingContextCommand + | EmulationCommand + | InputCommand + | NetworkCommand + | ScriptCommand + | SessionCommand + | StorageCommand + | WebExtensionCommand; +export type ResultData = + | BrowsingContextResult + | EmptyResult + | NetworkResult + | ScriptResult + | SessionResult + | StorageResult + | WebExtensionResult; +export type EmptyParams = Extensible; +export type Message = CommandResponse | ErrorResponse | Event; +export type ErrorResponse = { + type: 'error'; + id: JsUint | null; + error: ErrorCode; + message: string; + stacktrace?: string; +} & Extensible; +export type EmptyResult = Extensible; +export type Extensible = { + [key: string]: any; +}; /** * Must be between `-9007199254740991` and `9007199254740991`, inclusive. */ -export type JsInt = (number); +export type JsInt = number; /** * Must be between `0` and `9007199254740991`, inclusive. */ -export type JsUint = (number); -export const enum ErrorCode {InvalidArgument = "invalid argument", -InvalidSelector = "invalid selector", -InvalidSessionId = "invalid session id", -InvalidWebExtension = "invalid web extension", -MoveTargetOutOfBounds = "move target out of bounds", -NoSuchAlert = "no such alert", -NoSuchNetworkCollector = "no such network collector", -NoSuchElement = "no such element", -NoSuchFrame = "no such frame", -NoSuchHandle = "no such handle", -NoSuchHistoryEntry = "no such history entry", -NoSuchIntercept = "no such intercept", -NoSuchNetworkData = "no such network data", -NoSuchNode = "no such node", -NoSuchRequest = "no such request", -NoSuchScript = "no such script", -NoSuchStoragePartition = "no such storage partition", -NoSuchUserContext = "no such user context", -NoSuchWebExtension = "no such web extension", -SessionNotCreated = "session not created", -UnableToCaptureScreen = "unable to capture screen", -UnableToCloseBrowser = "unable to close browser", -UnableToSetCookie = "unable to set cookie", -UnableToSetFileInput = "unable to set file input", -UnavailableNetworkData = "unavailable network data", -UnderspecifiedStoragePartition = "underspecified storage partition", -UnknownCommand = "unknown command", -UnknownError = "unknown error", -UnsupportedOperation = "unsupported operation", -} -export type SessionCommand = (Session.End| Session.New| Session.Status| Session.Subscribe| Session.Unsubscribe); +export type JsUint = number; +export const enum ErrorCode { + InvalidArgument = 'invalid argument', + InvalidSelector = 'invalid selector', + InvalidSessionId = 'invalid session id', + InvalidWebExtension = 'invalid web extension', + MoveTargetOutOfBounds = 'move target out of bounds', + NoSuchAlert = 'no such alert', + NoSuchNetworkCollector = 'no such network collector', + NoSuchElement = 'no such element', + NoSuchFrame = 'no such frame', + NoSuchHandle = 'no such handle', + NoSuchHistoryEntry = 'no such history entry', + NoSuchIntercept = 'no such intercept', + NoSuchNetworkData = 'no such network data', + NoSuchNode = 'no such node', + NoSuchRequest = 'no such request', + NoSuchScript = 'no such script', + NoSuchStoragePartition = 'no such storage partition', + NoSuchUserContext = 'no such user context', + NoSuchWebExtension = 'no such web extension', + SessionNotCreated = 'session not created', + UnableToCaptureScreen = 'unable to capture screen', + UnableToCloseBrowser = 'unable to close browser', + UnableToSetCookie = 'unable to set cookie', + UnableToSetFileInput = 'unable to set file input', + UnavailableNetworkData = 'unavailable network data', + UnderspecifiedStoragePartition = 'underspecified storage partition', + UnknownCommand = 'unknown command', + UnknownError = 'unknown error', + UnsupportedOperation = 'unsupported operation', +} +export type SessionCommand = + | Session.End + | Session.New + | Session.Status + | Session.Subscribe + | Session.Unsubscribe; export namespace Session { -export type ProxyConfiguration = ((Session.AutodetectProxyConfiguration| Session.DirectProxyConfiguration| Session.ManualProxyConfiguration| Session.PacProxyConfiguration| Session.SystemProxyConfiguration)); -} -export type SessionResult = ((Session.NewResult| Session.StatusResult| Session.SubscribeResult)); + export type ProxyConfiguration = + | Session.AutodetectProxyConfiguration + | Session.DirectProxyConfiguration + | Session.ManualProxyConfiguration + | Session.PacProxyConfiguration + | Session.SystemProxyConfiguration; +} +export type SessionResult = + | Session.NewResult + | Session.StatusResult + | Session.SubscribeResult; export namespace Session { -export type CapabilitiesRequest = (({ -"alwaysMatch"?:(Session.CapabilityRequest),"firstMatch"?:([ -...((Session.CapabilityRequest)[])])})); + export type CapabilitiesRequest = { + alwaysMatch?: Session.CapabilityRequest; + firstMatch?: [...Session.CapabilityRequest[]]; + }; } export namespace Session { -export type CapabilityRequest = (({ -"acceptInsecureCerts"?:(boolean),"browserName"?:(string),"browserVersion"?:(string),"platformName"?:(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)}&Extensible)); + export type CapabilityRequest = { + acceptInsecureCerts?: boolean; + browserName?: string; + browserVersion?: string; + platformName?: string; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + } & Extensible; } export namespace Session { -export type AutodetectProxyConfiguration = ({ -"proxyType":("autodetect")}&Extensible); + export type AutodetectProxyConfiguration = { + proxyType: 'autodetect'; + } & Extensible; } export namespace Session { -export type DirectProxyConfiguration = ({ -"proxyType":("direct")}&Extensible); + export type DirectProxyConfiguration = { + proxyType: 'direct'; + } & Extensible; } export namespace Session { -export type ManualProxyConfiguration = ({ -"proxyType":("manual"),"httpProxy"?:(string),"sslProxy"?:(string)}&({} |Session.SocksProxyConfiguration)&{ -"noProxy"?:([ -...((string)[])])}&Extensible); + export type ManualProxyConfiguration = { + proxyType: 'manual'; + httpProxy?: string; + sslProxy?: string; + } & ({} | Session.SocksProxyConfiguration) & { + noProxy?: [...string[]]; + } & Extensible; } export namespace Session { -export type SocksProxyConfiguration = ({ -"socksProxy":(string), -/** - * Must be between `0` and `255`, inclusive. - */ -"socksVersion":(number)}); + export type SocksProxyConfiguration = { + socksProxy: string; + /** + * Must be between `0` and `255`, inclusive. + */ + socksVersion: number; + }; } export namespace Session { -export type PacProxyConfiguration = ({ -"proxyType":("pac"),"proxyAutoconfigUrl":(string)}&Extensible); + export type PacProxyConfiguration = { + proxyType: 'pac'; + proxyAutoconfigUrl: string; + } & Extensible; } export namespace Session { -export type SystemProxyConfiguration = ({ -"proxyType":("system")}&Extensible); + export type SystemProxyConfiguration = { + proxyType: 'system'; + } & Extensible; } export namespace Session { -export type UserPromptHandler = (({ -"alert"?:(Session.UserPromptHandlerType),"beforeUnload"?:(Session.UserPromptHandlerType),"confirm"?:(Session.UserPromptHandlerType),"default"?:(Session.UserPromptHandlerType),"file"?:(Session.UserPromptHandlerType),"prompt"?:(Session.UserPromptHandlerType)})); + export type UserPromptHandler = { + alert?: Session.UserPromptHandlerType; + beforeUnload?: Session.UserPromptHandlerType; + confirm?: Session.UserPromptHandlerType; + default?: Session.UserPromptHandlerType; + file?: Session.UserPromptHandlerType; + prompt?: Session.UserPromptHandlerType; + }; } export namespace Session { -export const enum UserPromptHandlerType {Accept = "accept", -Dismiss = "dismiss", -Ignore = "ignore", -} + export const enum UserPromptHandlerType { + Accept = 'accept', + Dismiss = 'dismiss', + Ignore = 'ignore', + } } export namespace Session { -export type Subscription = (string); + export type Subscription = string; } export namespace Session { -export type SubscriptionRequest = (({ -"events":([ -(string),...(string)[]]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SubscriptionRequest = { + events: [string, ...string[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Session { -export type UnsubscribeByIdRequest = (({ -"subscriptions":([ -(Session.Subscription),...(Session.Subscription)[]])})); + export type UnsubscribeByIdRequest = { + subscriptions: [Session.Subscription, ...Session.Subscription[]]; + }; } export namespace Session { -export type UnsubscribeByAttributesRequest = (({ -"events":([ -(string),...(string)[]]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); + export type UnsubscribeByAttributesRequest = { + events: [string, ...string[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + }; } export namespace Session { -export type Status = ({ -"method":("session.status"),"params":(EmptyParams)}); + export type Status = { + method: 'session.status'; + params: EmptyParams; + }; } export namespace Session { -export type StatusResult = (({ -"ready":(boolean),"message":(string)})); + export type StatusResult = { + ready: boolean; + message: string; + }; } export namespace Session { -export type New = ({ -"method":("session.new"),"params":(Session.NewParameters)}); + export type New = { + method: 'session.new'; + params: Session.NewParameters; + }; } export namespace Session { -export type NewParameters = (({ -"capabilities":(Session.CapabilitiesRequest)})); + export type NewParameters = { + capabilities: Session.CapabilitiesRequest; + }; } export namespace Session { -export type NewResult = (({ -"sessionId":(string),"capabilities":(({ -"acceptInsecureCerts":(boolean),"browserName":(string),"browserVersion":(string),"platformName":(string),"setWindowRect":(boolean),"userAgent":(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler),"webSocketUrl"?:(string)}&Extensible))})); + export type NewResult = { + sessionId: string; + capabilities: { + acceptInsecureCerts: boolean; + browserName: string; + browserVersion: string; + platformName: string; + setWindowRect: boolean; + userAgent: string; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + webSocketUrl?: string; + } & Extensible; + }; } export namespace Session { -export type End = ({ -"method":("session.end"),"params":(EmptyParams)}); + export type End = { + method: 'session.end'; + params: EmptyParams; + }; } export namespace Session { -export type Subscribe = ({ -"method":("session.subscribe"),"params":(Session.SubscriptionRequest)}); + export type Subscribe = { + method: 'session.subscribe'; + params: Session.SubscriptionRequest; + }; } export namespace Session { -export type SubscribeResult = (({ -"subscription":(Session.Subscription)})); + export type SubscribeResult = { + subscription: Session.Subscription; + }; } export namespace Session { -export type Unsubscribe = ({ -"method":("session.unsubscribe"),"params":(Session.UnsubscribeParameters)}); + export type Unsubscribe = { + method: 'session.unsubscribe'; + params: Session.UnsubscribeParameters; + }; } export namespace Session { -export type UnsubscribeParameters = (Session.UnsubscribeByAttributesRequest| Session.UnsubscribeByIdRequest); -} -export type BrowserCommand = (Browser.Close| Browser.CreateUserContext| Browser.GetClientWindows| Browser.GetUserContexts| Browser.RemoveUserContext| Browser.SetClientWindowState); -export type BrowserResult = ((Browser.CreateUserContextResult| Browser.GetUserContextsResult)); + export type UnsubscribeParameters = + | Session.UnsubscribeByAttributesRequest + | Session.UnsubscribeByIdRequest; +} +export type BrowserCommand = + | Browser.Close + | Browser.CreateUserContext + | Browser.GetClientWindows + | Browser.GetUserContexts + | Browser.RemoveUserContext + | Browser.SetClientWindowState; +export type BrowserResult = + | Browser.CreateUserContextResult + | Browser.GetUserContextsResult; export namespace Browser { -export type ClientWindow = (string); + export type ClientWindow = string; } export namespace Browser { -export type ClientWindowInfo = (({ -"active":(boolean),"clientWindow":(Browser.ClientWindow),"height":(JsUint),"state":("fullscreen"| "maximized"| "minimized"| "normal"),"width":(JsUint),"x":(JsInt),"y":(JsInt)})); + export type ClientWindowInfo = { + active: boolean; + clientWindow: Browser.ClientWindow; + height: JsUint; + state: 'fullscreen' | 'maximized' | 'minimized' | 'normal'; + width: JsUint; + x: JsInt; + y: JsInt; + }; } export namespace Browser { -export type UserContext = (string); + export type UserContext = string; } export namespace Browser { -export type UserContextInfo = (({ -"userContext":(Browser.UserContext)})); + export type UserContextInfo = { + userContext: Browser.UserContext; + }; } export namespace Browser { -export type Close = ({ -"method":("browser.close"),"params":(EmptyParams)}); + export type Close = { + method: 'browser.close'; + params: EmptyParams; + }; } export namespace Browser { -export type CreateUserContext = ({ -"method":("browser.createUserContext"),"params":(Browser.CreateUserContextParameters)}); + export type CreateUserContext = { + method: 'browser.createUserContext'; + params: Browser.CreateUserContextParameters; + }; } export namespace Browser { -export type CreateUserContextParameters = (({ -"acceptInsecureCerts"?:(boolean),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)})); + export type CreateUserContextParameters = { + acceptInsecureCerts?: boolean; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + }; } export namespace Browser { -export type CreateUserContextResult = (Browser.UserContextInfo); + export type CreateUserContextResult = Browser.UserContextInfo; } export namespace Browser { -export type GetClientWindows = ({ -"method":("browser.getClientWindows"),"params":(EmptyParams)}); + export type GetClientWindows = { + method: 'browser.getClientWindows'; + params: EmptyParams; + }; } export namespace Browser { -export type GetClientWindowsResult = (({ -"clientWindows":([ -...((Browser.ClientWindowInfo)[])])})); + export type GetClientWindowsResult = { + clientWindows: [...Browser.ClientWindowInfo[]]; + }; } export namespace Browser { -export type GetUserContexts = ({ -"method":("browser.getUserContexts"),"params":(EmptyParams)}); + export type GetUserContexts = { + method: 'browser.getUserContexts'; + params: EmptyParams; + }; } export namespace Browser { -export type GetUserContextsResult = (({ -"userContexts":([ -(Browser.UserContextInfo),...(Browser.UserContextInfo)[]])})); + export type GetUserContextsResult = { + userContexts: [Browser.UserContextInfo, ...Browser.UserContextInfo[]]; + }; } export namespace Browser { -export type RemoveUserContext = ({ -"method":("browser.removeUserContext"),"params":(Browser.RemoveUserContextParameters)}); + export type RemoveUserContext = { + method: 'browser.removeUserContext'; + params: Browser.RemoveUserContextParameters; + }; } export namespace Browser { -export type RemoveUserContextParameters = (({ -"userContext":(Browser.UserContext)})); + export type RemoveUserContextParameters = { + userContext: Browser.UserContext; + }; } export namespace Browser { -export type SetClientWindowState = ({ -"method":("browser.setClientWindowState"),"params":(Browser.SetClientWindowStateParameters)}); + export type SetClientWindowState = { + method: 'browser.setClientWindowState'; + params: Browser.SetClientWindowStateParameters; + }; } export namespace Browser { -export type SetClientWindowStateParameters = (({ -"clientWindow":(Browser.ClientWindow)}&(Browser.ClientWindowNamedState| Browser.ClientWindowRectState))); + export type SetClientWindowStateParameters = { + clientWindow: Browser.ClientWindow; + } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState); } export namespace Browser { -export type ClientWindowNamedState = ({ -"state":("fullscreen"| "maximized"| "minimized")}); + export type ClientWindowNamedState = { + state: 'fullscreen' | 'maximized' | 'minimized'; + }; } export namespace Browser { -export type ClientWindowRectState = ({ -"state":("normal"),"width"?:(JsUint),"height"?:(JsUint),"x"?:(JsInt),"y"?:(JsInt)}); + export type ClientWindowRectState = { + state: 'normal'; + width?: JsUint; + height?: JsUint; + x?: JsInt; + y?: JsInt; + }; +} +export type BrowsingContextCommand = + | BrowsingContext.Activate + | BrowsingContext.CaptureScreenshot + | BrowsingContext.Close + | BrowsingContext.Create + | BrowsingContext.GetTree + | BrowsingContext.HandleUserPrompt + | BrowsingContext.LocateNodes + | BrowsingContext.Navigate + | BrowsingContext.Print + | BrowsingContext.Reload + | BrowsingContext.SetViewport + | BrowsingContext.TraverseHistory; +export type BrowsingContextEvent = + | BrowsingContext.ContextCreated + | BrowsingContext.ContextDestroyed + | BrowsingContext.DomContentLoaded + | BrowsingContext.DownloadEnd + | BrowsingContext.DownloadWillBegin + | BrowsingContext.FragmentNavigated + | BrowsingContext.HistoryUpdated + | BrowsingContext.Load + | BrowsingContext.NavigationAborted + | BrowsingContext.NavigationCommitted + | BrowsingContext.NavigationFailed + | BrowsingContext.NavigationStarted + | BrowsingContext.UserPromptClosed + | BrowsingContext.UserPromptOpened; +export type BrowsingContextResult = + | BrowsingContext.CaptureScreenshotResult + | BrowsingContext.CreateResult + | BrowsingContext.GetTreeResult + | BrowsingContext.LocateNodesResult + | BrowsingContext.NavigateResult + | BrowsingContext.PrintResult + | BrowsingContext.TraverseHistoryResult; +export namespace BrowsingContext { + export type BrowsingContext = string; +} +export namespace BrowsingContext { + export type InfoList = [...BrowsingContext.Info[]]; +} +export namespace BrowsingContext { + export type Info = { + children: BrowsingContext.InfoList | null; + clientWindow: Browser.ClientWindow; + context: BrowsingContext.BrowsingContext; + originalOpener: BrowsingContext.BrowsingContext | null; + url: string; + userContext: Browser.UserContext; + parent?: BrowsingContext.BrowsingContext | null; + }; +} +export namespace BrowsingContext { + export type Locator = + | BrowsingContext.AccessibilityLocator + | BrowsingContext.CssLocator + | BrowsingContext.ContextLocator + | BrowsingContext.InnerTextLocator + | BrowsingContext.XPathLocator; +} +export namespace BrowsingContext { + export type AccessibilityLocator = { + type: 'accessibility'; + value: { + name?: string; + role?: string; + }; + }; +} +export namespace BrowsingContext { + export type CssLocator = { + type: 'css'; + value: string; + }; +} +export namespace BrowsingContext { + export type ContextLocator = { + type: 'context'; + value: { + context: BrowsingContext.BrowsingContext; + }; + }; +} +export namespace BrowsingContext { + export type InnerTextLocator = { + type: 'innerText'; + value: string; + ignoreCase?: boolean; + matchType?: 'full' | 'partial'; + maxDepth?: JsUint; + }; +} +export namespace BrowsingContext { + export type XPathLocator = { + type: 'xpath'; + value: string; + }; } -export type BrowsingContextCommand = (BrowsingContext.Activate| BrowsingContext.CaptureScreenshot| BrowsingContext.Close| BrowsingContext.Create| BrowsingContext.GetTree| BrowsingContext.HandleUserPrompt| BrowsingContext.LocateNodes| BrowsingContext.Navigate| BrowsingContext.Print| BrowsingContext.Reload| BrowsingContext.SetViewport| BrowsingContext.TraverseHistory); -export type BrowsingContextEvent = (BrowsingContext.ContextCreated| BrowsingContext.ContextDestroyed| BrowsingContext.DomContentLoaded| BrowsingContext.DownloadEnd| BrowsingContext.DownloadWillBegin| BrowsingContext.FragmentNavigated| BrowsingContext.HistoryUpdated| BrowsingContext.Load| BrowsingContext.NavigationAborted| BrowsingContext.NavigationCommitted| BrowsingContext.NavigationFailed| BrowsingContext.NavigationStarted| BrowsingContext.UserPromptClosed| BrowsingContext.UserPromptOpened); -export type BrowsingContextResult = ((BrowsingContext.CaptureScreenshotResult| BrowsingContext.CreateResult| BrowsingContext.GetTreeResult| BrowsingContext.LocateNodesResult| BrowsingContext.NavigateResult| BrowsingContext.PrintResult| BrowsingContext.TraverseHistoryResult)); export namespace BrowsingContext { -export type BrowsingContext = (string); + export type Navigation = string; +} +export namespace BrowsingContext { + export type BaseNavigationInfo = { + context: BrowsingContext.BrowsingContext; + navigation: BrowsingContext.Navigation | null; + timestamp: JsUint; + url: string; + }; } export namespace BrowsingContext { -export type InfoList = ([ -...((BrowsingContext.Info)[])]); + export type NavigationInfo = BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type Info = (({ -"children":(BrowsingContext.InfoList| null),"clientWindow":(Browser.ClientWindow),"context":(BrowsingContext.BrowsingContext),"originalOpener":(BrowsingContext.BrowsingContext| null),"url":(string),"userContext":(Browser.UserContext),"parent"?:(BrowsingContext.BrowsingContext| null)})); + export const enum ReadinessState { + None = 'none', + Interactive = 'interactive', + Complete = 'complete', + } } export namespace BrowsingContext { -export type Locator = ((BrowsingContext.AccessibilityLocator| BrowsingContext.CssLocator| BrowsingContext.ContextLocator| BrowsingContext.InnerTextLocator| BrowsingContext.XPathLocator)); + export const enum UserPromptType { + Alert = 'alert', + Beforeunload = 'beforeunload', + Confirm = 'confirm', + Prompt = 'prompt', + } } export namespace BrowsingContext { -export type AccessibilityLocator = (({ -"type":("accessibility"),"value":(({ -"name"?:(string),"role"?:(string)}))})); + export type Activate = { + method: 'browsingContext.activate'; + params: BrowsingContext.ActivateParameters; + }; } export namespace BrowsingContext { -export type CssLocator = (({ -"type":("css"),"value":(string)})); + export type ActivateParameters = { + context: BrowsingContext.BrowsingContext; + }; } export namespace BrowsingContext { -export type ContextLocator = (({ -"type":("context"),"value":(({ -"context":(BrowsingContext.BrowsingContext)}))})); + export type CaptureScreenshotParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `"viewport"` + */ + origin?: 'viewport' | 'document'; + format?: BrowsingContext.ImageFormat; + clip?: BrowsingContext.ClipRectangle; + }; } export namespace BrowsingContext { -export type InnerTextLocator = (({ -"type":("innerText"),"value":(string),"ignoreCase"?:(boolean),"matchType"?:("full"| "partial"),"maxDepth"?:(JsUint)})); + export type CaptureScreenshot = { + method: 'browsingContext.captureScreenshot'; + params: BrowsingContext.CaptureScreenshotParameters; + }; } export namespace BrowsingContext { -export type XPathLocator = (({ -"type":("xpath"),"value":(string)})); + export type ImageFormat = { + type: string; + /** + * Must be between `0` and `1`, inclusive. + */ + quality?: number; + }; } export namespace BrowsingContext { -export type Navigation = (string); + export type ClipRectangle = + | BrowsingContext.BoxClipRectangle + | BrowsingContext.ElementClipRectangle; } export namespace BrowsingContext { -export type BaseNavigationInfo = ({ -"context":(BrowsingContext.BrowsingContext),"navigation":(BrowsingContext.Navigation| null),"timestamp":(JsUint),"url":(string)}); + export type ElementClipRectangle = { + type: 'element'; + element: Script.SharedReference; + }; } export namespace BrowsingContext { -export type NavigationInfo = ((BrowsingContext.BaseNavigationInfo)); + export type BoxClipRectangle = { + type: 'box'; + x: number; + y: number; + width: number; + height: number; + }; } export namespace BrowsingContext { -export const enum ReadinessState {None = "none", -Interactive = "interactive", -Complete = "complete", -} + export type CaptureScreenshotResult = { + data: string; + }; } export namespace BrowsingContext { -export const enum UserPromptType {Alert = "alert", -Beforeunload = "beforeunload", -Confirm = "confirm", -Prompt = "prompt", -} + export type Close = { + method: 'browsingContext.close'; + params: BrowsingContext.CloseParameters; + }; } export namespace BrowsingContext { -export type Activate = ({ -"method":("browsingContext.activate"),"params":(BrowsingContext.ActivateParameters)}); + export type CloseParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + promptUnload?: boolean; + }; } export namespace BrowsingContext { -export type ActivateParameters = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type Create = { + method: 'browsingContext.create'; + params: BrowsingContext.CreateParameters; + }; } export namespace BrowsingContext { -export type CaptureScreenshotParameters = (({ -"context":(BrowsingContext.BrowsingContext), -/** - * @defaultValue `"viewport"` - */ -"origin"?:(("viewport"| "document")),"format"?:(BrowsingContext.ImageFormat),"clip"?:(BrowsingContext.ClipRectangle)})); + export const enum CreateType { + Tab = 'tab', + Window = 'window', + } } export namespace BrowsingContext { -export type CaptureScreenshot = ({ -"method":("browsingContext.captureScreenshot"),"params":(BrowsingContext.CaptureScreenshotParameters)}); + export type CreateParameters = { + type: BrowsingContext.CreateType; + referenceContext?: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + background?: boolean; + userContext?: Browser.UserContext; + }; } export namespace BrowsingContext { -export type ImageFormat = (({ -"type":(string), -/** - * Must be between `0` and `1`, inclusive. - */ -"quality"?:(number)})); + export type CreateResult = { + context: BrowsingContext.BrowsingContext; + }; } export namespace BrowsingContext { -export type ClipRectangle = ((BrowsingContext.BoxClipRectangle| BrowsingContext.ElementClipRectangle)); + export type GetTree = { + method: 'browsingContext.getTree'; + params: BrowsingContext.GetTreeParameters; + }; } export namespace BrowsingContext { -export type ElementClipRectangle = (({ -"type":("element"),"element":(Script.SharedReference)})); + export type GetTreeParameters = { + maxDepth?: JsUint; + root?: BrowsingContext.BrowsingContext; + }; } export namespace BrowsingContext { -export type BoxClipRectangle = (({ -"type":("box"),"x":(number),"y":(number),"width":(number),"height":(number)})); + export type GetTreeResult = { + contexts: BrowsingContext.InfoList; + }; } export namespace BrowsingContext { -export type CaptureScreenshotResult = (({ -"data":(string)})); + export type HandleUserPrompt = { + method: 'browsingContext.handleUserPrompt'; + params: BrowsingContext.HandleUserPromptParameters; + }; } -export namespace BrowsingContext { -export type Close = ({ -"method":("browsingContext.close"),"params":(BrowsingContext.CloseParameters)}); +export namespace BrowsingContext { + export type HandleUserPromptParameters = { + context: BrowsingContext.BrowsingContext; + accept?: boolean; + userText?: string; + }; +} +export namespace BrowsingContext { + export type LocateNodesParameters = { + context: BrowsingContext.BrowsingContext; + locator: BrowsingContext.Locator; + /** + * Must be greater than or equal to `1`. + */ + maxNodeCount?: JsUint; + serializationOptions?: Script.SerializationOptions; + startNodes?: [Script.SharedReference, ...Script.SharedReference[]]; + }; +} +export namespace BrowsingContext { + export type LocateNodes = { + method: 'browsingContext.locateNodes'; + params: BrowsingContext.LocateNodesParameters; + }; +} +export namespace BrowsingContext { + export type LocateNodesResult = { + nodes: [...Script.NodeRemoteValue[]]; + }; +} +export namespace BrowsingContext { + export type Navigate = { + method: 'browsingContext.navigate'; + params: BrowsingContext.NavigateParameters; + }; +} +export namespace BrowsingContext { + export type NavigateParameters = { + context: BrowsingContext.BrowsingContext; + url: string; + wait?: BrowsingContext.ReadinessState; + }; +} +export namespace BrowsingContext { + export type NavigateResult = { + navigation: BrowsingContext.Navigation | null; + url: string; + }; +} +export namespace BrowsingContext { + export type Print = { + method: 'browsingContext.print'; + params: BrowsingContext.PrintParameters; + }; +} +export namespace BrowsingContext { + export type PrintParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + background?: boolean; + margin?: BrowsingContext.PrintMarginParameters; + /** + * @defaultValue `"portrait"` + */ + orientation?: 'portrait' | 'landscape'; + page?: BrowsingContext.PrintPageParameters; + pageRanges?: [...(JsUint | string)[]]; + /** + * Must be between `0.1` and `2`, inclusive. + * + * @defaultValue `1` + */ + scale?: number; + /** + * @defaultValue `true` + */ + shrinkToFit?: boolean; + }; +} +export namespace BrowsingContext { + export type PrintMarginParameters = { + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + bottom?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + left?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + right?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + top?: number; + }; +} +export namespace BrowsingContext { + export type PrintPageParameters = { + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `27.94` + */ + height?: number; + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `21.59` + */ + width?: number; + }; } -export namespace BrowsingContext { -export type CloseParameters = (({ -"context":(BrowsingContext.BrowsingContext), -/** - * @defaultValue `false` - */ -"promptUnload"?:(boolean)})); +export namespace BrowsingContext { + export type PrintResult = { + data: string; + }; +} +export namespace BrowsingContext { + export type Reload = { + method: 'browsingContext.reload'; + params: BrowsingContext.ReloadParameters; + }; +} +export namespace BrowsingContext { + export type ReloadParameters = { + context: BrowsingContext.BrowsingContext; + ignoreCache?: boolean; + wait?: BrowsingContext.ReadinessState; + }; } -export namespace BrowsingContext { -export type Create = ({ -"method":("browsingContext.create"),"params":(BrowsingContext.CreateParameters)}); -} -export namespace BrowsingContext { -export const enum CreateType {Tab = "tab", -Window = "window", +export namespace BrowsingContext { + export type SetViewport = { + method: 'browsingContext.setViewport'; + params: BrowsingContext.SetViewportParameters; + }; } +export namespace BrowsingContext { + export type SetViewportParameters = { + context?: BrowsingContext.BrowsingContext; + viewport?: BrowsingContext.Viewport | null; + /** + * Must be greater than `0`. + */ + devicePixelRatio?: number | null; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace BrowsingContext { -export type CreateParameters = (({ -"type":(BrowsingContext.CreateType),"referenceContext"?:(BrowsingContext.BrowsingContext), -/** - * @defaultValue `false` - */ -"background"?:(boolean),"userContext"?:(Browser.UserContext)})); + export type Viewport = { + width: JsUint; + height: JsUint; + }; } export namespace BrowsingContext { -export type CreateResult = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type TraverseHistory = { + method: 'browsingContext.traverseHistory'; + params: BrowsingContext.TraverseHistoryParameters; + }; } export namespace BrowsingContext { -export type GetTree = ({ -"method":("browsingContext.getTree"),"params":(BrowsingContext.GetTreeParameters)}); + export type TraverseHistoryParameters = { + context: BrowsingContext.BrowsingContext; + delta: JsInt; + }; } export namespace BrowsingContext { -export type GetTreeParameters = (({ -"maxDepth"?:(JsUint),"root"?:(BrowsingContext.BrowsingContext)})); + export type TraverseHistoryResult = Record; } export namespace BrowsingContext { -export type GetTreeResult = (({ -"contexts":(BrowsingContext.InfoList)})); + export type ContextCreated = { + method: 'browsingContext.contextCreated'; + params: BrowsingContext.Info; + }; } export namespace BrowsingContext { -export type HandleUserPrompt = ({ -"method":("browsingContext.handleUserPrompt"),"params":(BrowsingContext.HandleUserPromptParameters)}); + export type ContextDestroyed = { + method: 'browsingContext.contextDestroyed'; + params: BrowsingContext.Info; + }; } export namespace BrowsingContext { -export type HandleUserPromptParameters = (({ -"context":(BrowsingContext.BrowsingContext),"accept"?:(boolean),"userText"?:(string)})); + export type NavigationStarted = { + method: 'browsingContext.navigationStarted'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type LocateNodesParameters = (({ -"context":(BrowsingContext.BrowsingContext),"locator":(BrowsingContext.Locator), -/** - * Must be greater than or equal to `1`. - */ -"maxNodeCount"?:((JsUint)),"serializationOptions"?:(Script.SerializationOptions),"startNodes"?:([ -(Script.SharedReference),...(Script.SharedReference)[]])})); + export type FragmentNavigated = { + method: 'browsingContext.fragmentNavigated'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type LocateNodes = ({ -"method":("browsingContext.locateNodes"),"params":(BrowsingContext.LocateNodesParameters)}); + export type HistoryUpdated = { + method: 'browsingContext.historyUpdated'; + params: BrowsingContext.HistoryUpdatedParameters; + }; } export namespace BrowsingContext { -export type LocateNodesResult = (({ -"nodes":([ -...((Script.NodeRemoteValue)[])])})); + export type HistoryUpdatedParameters = { + context: BrowsingContext.BrowsingContext; + timestamp: JsUint; + url: string; + }; } export namespace BrowsingContext { -export type Navigate = ({ -"method":("browsingContext.navigate"),"params":(BrowsingContext.NavigateParameters)}); + export type DomContentLoaded = { + method: 'browsingContext.domContentLoaded'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type NavigateParameters = (({ -"context":(BrowsingContext.BrowsingContext),"url":(string),"wait"?:(BrowsingContext.ReadinessState)})); + export type Load = { + method: 'browsingContext.load'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type NavigateResult = (({ -"navigation":(BrowsingContext.Navigation| null),"url":(string)})); + export type DownloadWillBegin = { + method: 'browsingContext.downloadWillBegin'; + params: BrowsingContext.DownloadWillBeginParams; + }; } export namespace BrowsingContext { -export type Print = ({ -"method":("browsingContext.print"),"params":(BrowsingContext.PrintParameters)}); + export type DownloadWillBeginParams = { + suggestedFilename: string; + } & BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type PrintParameters = (({ -"context":(BrowsingContext.BrowsingContext), -/** - * @defaultValue `false` - */ -"background"?:(boolean),"margin"?:(BrowsingContext.PrintMarginParameters), -/** - * @defaultValue `"portrait"` - */ -"orientation"?:(("portrait"| "landscape")),"page"?:(BrowsingContext.PrintPageParameters),"pageRanges"?:([ -...((JsUint| string)[])]), -/** - * Must be between `0.1` and `2`, inclusive. - * - * @defaultValue `1` - */ -"scale"?:((number)), -/** - * @defaultValue `true` - */ -"shrinkToFit"?:(boolean)})); + export type DownloadEnd = { + method: 'browsingContext.downloadEnd'; + params: BrowsingContext.DownloadEndParams; + }; } export namespace BrowsingContext { -export type PrintMarginParameters = (({ - -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"bottom"?:((number)), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"left"?:((number)), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"right"?:((number)), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"top"?:((number))})); + export type DownloadEndParams = + | BrowsingContext.DownloadCanceledParams + | BrowsingContext.DownloadCompleteParams; } export namespace BrowsingContext { -export type PrintPageParameters = (({ - -/** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `27.94` - */ -"height"?:((number)), -/** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `21.59` - */ -"width"?:((number))})); + export type DownloadCanceledParams = { + status: 'canceled'; + } & BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type PrintResult = (({ -"data":(string)})); + export type DownloadCompleteParams = { + status: 'complete'; + filepath: string | null; + } & BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type Reload = ({ -"method":("browsingContext.reload"),"params":(BrowsingContext.ReloadParameters)}); + export type NavigationAborted = { + method: 'browsingContext.navigationAborted'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type ReloadParameters = (({ -"context":(BrowsingContext.BrowsingContext),"ignoreCache"?:(boolean),"wait"?:(BrowsingContext.ReadinessState)})); + export type NavigationCommitted = { + method: 'browsingContext.navigationCommitted'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type SetViewport = ({ -"method":("browsingContext.setViewport"),"params":(BrowsingContext.SetViewportParameters)}); + export type NavigationFailed = { + method: 'browsingContext.navigationFailed'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type SetViewportParameters = (({ -"context"?:(BrowsingContext.BrowsingContext),"viewport"?:(BrowsingContext.Viewport| null), -/** - * Must be greater than `0`. - */ -"devicePixelRatio"?:((number)| null),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type UserPromptClosed = { + method: 'browsingContext.userPromptClosed'; + params: BrowsingContext.UserPromptClosedParameters; + }; } export namespace BrowsingContext { -export type Viewport = (({ -"width":(JsUint),"height":(JsUint)})); + export type UserPromptClosedParameters = { + context: BrowsingContext.BrowsingContext; + accepted: boolean; + type: BrowsingContext.UserPromptType; + userText?: string; + }; } export namespace BrowsingContext { -export type TraverseHistory = ({ -"method":("browsingContext.traverseHistory"),"params":(BrowsingContext.TraverseHistoryParameters)}); + export type UserPromptOpened = { + method: 'browsingContext.userPromptOpened'; + params: BrowsingContext.UserPromptOpenedParameters; + }; } export namespace BrowsingContext { -export type TraverseHistoryParameters = (({ -"context":(BrowsingContext.BrowsingContext),"delta":(JsInt)})); + export type UserPromptOpenedParameters = { + context: BrowsingContext.BrowsingContext; + handler: Session.UserPromptHandlerType; + message: string; + type: BrowsingContext.UserPromptType; + defaultValue?: string; + }; } -export namespace BrowsingContext { -export type TraverseHistoryResult = ((Record -)); -} -export namespace BrowsingContext { -export type ContextCreated = ({ -"method":("browsingContext.contextCreated"),"params":(BrowsingContext.Info)}); -} -export namespace BrowsingContext { -export type ContextDestroyed = ({ -"method":("browsingContext.contextDestroyed"),"params":(BrowsingContext.Info)}); -} -export namespace BrowsingContext { -export type NavigationStarted = ({ -"method":("browsingContext.navigationStarted"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type FragmentNavigated = ({ -"method":("browsingContext.fragmentNavigated"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type HistoryUpdated = ({ -"method":("browsingContext.historyUpdated"),"params":(BrowsingContext.HistoryUpdatedParameters)}); -} -export namespace BrowsingContext { -export type HistoryUpdatedParameters = (({ -"context":(BrowsingContext.BrowsingContext),"timestamp":(JsUint),"url":(string)})); -} -export namespace BrowsingContext { -export type DomContentLoaded = ({ -"method":("browsingContext.domContentLoaded"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type Load = ({ -"method":("browsingContext.load"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type DownloadWillBegin = ({ -"method":("browsingContext.downloadWillBegin"),"params":(BrowsingContext.DownloadWillBeginParams)}); -} -export namespace BrowsingContext { -export type DownloadWillBeginParams = (({ -"suggestedFilename":(string)}&BrowsingContext.BaseNavigationInfo)); -} -export namespace BrowsingContext { -export type DownloadEnd = ({ -"method":("browsingContext.downloadEnd"),"params":(BrowsingContext.DownloadEndParams)}); -} -export namespace BrowsingContext { -export type DownloadEndParams = (((BrowsingContext.DownloadCanceledParams| BrowsingContext.DownloadCompleteParams))); -} -export namespace BrowsingContext { -export type DownloadCanceledParams = ({ -"status":("canceled")}&BrowsingContext.BaseNavigationInfo); -} -export namespace BrowsingContext { -export type DownloadCompleteParams = ({ -"status":("complete"),"filepath":(string| null)}&BrowsingContext.BaseNavigationInfo); -} -export namespace BrowsingContext { -export type NavigationAborted = ({ -"method":("browsingContext.navigationAborted"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type NavigationCommitted = ({ -"method":("browsingContext.navigationCommitted"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type NavigationFailed = ({ -"method":("browsingContext.navigationFailed"),"params":(BrowsingContext.NavigationInfo)}); -} -export namespace BrowsingContext { -export type UserPromptClosed = ({ -"method":("browsingContext.userPromptClosed"),"params":(BrowsingContext.UserPromptClosedParameters)}); -} -export namespace BrowsingContext { -export type UserPromptClosedParameters = (({ -"context":(BrowsingContext.BrowsingContext),"accepted":(boolean),"type":(BrowsingContext.UserPromptType),"userText"?:(string)})); -} -export namespace BrowsingContext { -export type UserPromptOpened = ({ -"method":("browsingContext.userPromptOpened"),"params":(BrowsingContext.UserPromptOpenedParameters)}); -} -export namespace BrowsingContext { -export type UserPromptOpenedParameters = (({ -"context":(BrowsingContext.BrowsingContext),"handler":(Session.UserPromptHandlerType),"message":(string),"type":(BrowsingContext.UserPromptType),"defaultValue"?:(string)})); -} -export type EmulationCommand = (Emulation.SetForcedColorsModeThemeOverride| Emulation.SetGeolocationOverride| Emulation.SetLocaleOverride| Emulation.SetScreenOrientationOverride| Emulation.SetScriptingEnabled| Emulation.SetTimezoneOverride| Emulation.SetUserAgentOverride); +export type EmulationCommand = + | Emulation.SetForcedColorsModeThemeOverride + | Emulation.SetGeolocationOverride + | Emulation.SetLocaleOverride + | Emulation.SetScreenOrientationOverride + | Emulation.SetScriptingEnabled + | Emulation.SetTimezoneOverride + | Emulation.SetUserAgentOverride; export namespace Emulation { -export type SetForcedColorsModeThemeOverride = ({ -"method":("emulation.setForcedColorsModeThemeOverride"),"params":(Emulation.SetForcedColorsModeThemeOverrideParameters)}); + export type SetForcedColorsModeThemeOverride = { + method: 'emulation.setForcedColorsModeThemeOverride'; + params: Emulation.SetForcedColorsModeThemeOverrideParameters; + }; } export namespace Emulation { -export type SetForcedColorsModeThemeOverrideParameters = (({ -"theme":(Emulation.ForcedColorsModeTheme| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetForcedColorsModeThemeOverrideParameters = { + theme: Emulation.ForcedColorsModeTheme | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export const enum ForcedColorsModeTheme {Light = "light", -Dark = "dark", -} + export const enum ForcedColorsModeTheme { + Light = 'light', + Dark = 'dark', + } } export namespace Emulation { -export type SetGeolocationOverride = ({ -"method":("emulation.setGeolocationOverride"),"params":(Emulation.SetGeolocationOverrideParameters)}); + export type SetGeolocationOverride = { + method: 'emulation.setGeolocationOverride'; + params: Emulation.SetGeolocationOverrideParameters; + }; } export namespace Emulation { -export type SetGeolocationOverrideParameters = (((({ -"coordinates":(Emulation.GeolocationCoordinates| null)})| ({ -"error":(Emulation.GeolocationPositionError)}))&{ -"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetGeolocationOverrideParameters = ( + | { + coordinates: Emulation.GeolocationCoordinates | null; + } + | { + error: Emulation.GeolocationPositionError; + } + ) & { + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type GeolocationCoordinates = (({ - -/** - * Must be between `-90` and `90`, inclusive. - */ -"latitude":(number), -/** - * Must be between `-180` and `180`, inclusive. - */ -"longitude":(number), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"accuracy"?:((number)), -/** - * @defaultValue `null` - */ -"altitude"?:(number| null), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ -"altitudeAccuracy"?:((number)| null), -/** - * Must be between `0` and `360`. - * - * @defaultValue `null` - */ -"heading"?:((number)| null), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ -"speed"?:((number)| null)})); + export type GeolocationCoordinates = { + /** + * Must be between `-90` and `90`, inclusive. + */ + latitude: number; + /** + * Must be between `-180` and `180`, inclusive. + */ + longitude: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + accuracy?: number; + /** + * @defaultValue `null` + */ + altitude?: number | null; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + altitudeAccuracy?: number | null; + /** + * Must be between `0` and `360`. + * + * @defaultValue `null` + */ + heading?: number | null; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + speed?: number | null; + }; } export namespace Emulation { -export type GeolocationPositionError = (({ -"type":("positionUnavailable")})); + export type GeolocationPositionError = { + type: 'positionUnavailable'; + }; } export namespace Emulation { -export type SetLocaleOverride = ({ -"method":("emulation.setLocaleOverride"),"params":(Emulation.SetLocaleOverrideParameters)}); + export type SetLocaleOverride = { + method: 'emulation.setLocaleOverride'; + params: Emulation.SetLocaleOverrideParameters; + }; } export namespace Emulation { -export type SetLocaleOverrideParameters = (({ -"locale":(string| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetLocaleOverrideParameters = { + locale: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetScreenOrientationOverride = ({ -"method":("emulation.setScreenOrientationOverride"),"params":(Emulation.SetScreenOrientationOverrideParameters)}); + export type SetScreenOrientationOverride = { + method: 'emulation.setScreenOrientationOverride'; + params: Emulation.SetScreenOrientationOverrideParameters; + }; } export namespace Emulation { -export const enum ScreenOrientationNatural {Portrait = "portrait", -Landscape = "landscape", -} + export const enum ScreenOrientationNatural { + Portrait = 'portrait', + Landscape = 'landscape', + } } export namespace Emulation { -export type ScreenOrientationType = ("portrait-primary"| "portrait-secondary"| "landscape-primary"| "landscape-secondary"); + export type ScreenOrientationType = + | 'portrait-primary' + | 'portrait-secondary' + | 'landscape-primary' + | 'landscape-secondary'; } export namespace Emulation { -export type ScreenOrientation = (({ -"natural":(Emulation.ScreenOrientationNatural),"type":(Emulation.ScreenOrientationType)})); + export type ScreenOrientation = { + natural: Emulation.ScreenOrientationNatural; + type: Emulation.ScreenOrientationType; + }; } export namespace Emulation { -export type SetScreenOrientationOverrideParameters = (({ -"screenOrientation":(Emulation.ScreenOrientation| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetScreenOrientationOverrideParameters = { + screenOrientation: Emulation.ScreenOrientation | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetUserAgentOverride = ({ -"method":("emulation.setUserAgentOverride"),"params":(Emulation.SetUserAgentOverrideParameters)}); + export type SetUserAgentOverride = { + method: 'emulation.setUserAgentOverride'; + params: Emulation.SetUserAgentOverrideParameters; + }; } export namespace Emulation { -export type SetUserAgentOverrideParameters = (({ -"userAgent":(string| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetUserAgentOverrideParameters = { + userAgent: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetScriptingEnabled = ({ -"method":("emulation.setScriptingEnabled"),"params":(Emulation.SetScriptingEnabledParameters)}); + export type SetScriptingEnabled = { + method: 'emulation.setScriptingEnabled'; + params: Emulation.SetScriptingEnabledParameters; + }; } export namespace Emulation { -export type SetScriptingEnabledParameters = (({ -"enabled":(false| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetScriptingEnabledParameters = { + enabled: false | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetTimezoneOverride = ({ -"method":("emulation.setTimezoneOverride"),"params":(Emulation.SetTimezoneOverrideParameters)}); + export type SetTimezoneOverride = { + method: 'emulation.setTimezoneOverride'; + params: Emulation.SetTimezoneOverrideParameters; + }; } export namespace Emulation { -export type SetTimezoneOverrideParameters = (({ -"timezone":(string| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); -} -export type NetworkCommand = (Network.AddDataCollector| Network.AddIntercept| Network.ContinueRequest| Network.ContinueResponse| Network.ContinueWithAuth| Network.DisownData| Network.FailRequest| Network.GetData| Network.ProvideResponse| Network.RemoveDataCollector| Network.RemoveIntercept| Network.SetCacheBehavior| Network.SetExtraHeaders); -export type NetworkEvent = (Network.AuthRequired| Network.BeforeRequestSent| Network.FetchError| Network.ResponseCompleted| Network.ResponseStarted); -export type NetworkResult = ((Network.AddInterceptResult)); -export namespace Network { -export type AuthChallenge = (({ -"scheme":(string),"realm":(string)})); -} -export namespace Network { -export type AuthCredentials = (({ -"type":("password"),"username":(string),"password":(string)})); -} -export namespace Network { -export type BaseParameters = ({ -"context":(BrowsingContext.BrowsingContext| null),"isBlocked":(boolean),"navigation":(BrowsingContext.Navigation| null),"redirectCount":(JsUint),"request":(Network.RequestData),"timestamp":(JsUint),"intercepts"?:([ -(Network.Intercept),...(Network.Intercept)[]])}); -} -export namespace Network { -export type BytesValue = (Network.StringValue| Network.Base64Value); -} -export namespace Network { -export type StringValue = (({ -"type":("string"),"value":(string)})); -} -export namespace Network { -export type Base64Value = (({ -"type":("base64"),"value":(string)})); -} -export namespace Network { -export type Collector = (string); -} -export namespace Network { -export const enum CollectorType {Blob = "blob", -} -} -export namespace Network { -export const enum SameSite {Strict = "strict", -Lax = "lax", -None = "none", -Default = "default", -} -} -export namespace Network { -export type Cookie = (({ -"name":(string),"value":(Network.BytesValue),"domain":(string),"path":(string),"size":(JsUint),"httpOnly":(boolean),"secure":(boolean),"sameSite":(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); -} -export namespace Network { -export type CookieHeader = (({ -"name":(string),"value":(Network.BytesValue)})); -} -export namespace Network { -export const enum DataType {Response = "response", -} -} -export namespace Network { -export type FetchTimingInfo = (({ -"timeOrigin":(number),"requestTime":(number),"redirectStart":(number),"redirectEnd":(number),"fetchStart":(number),"dnsStart":(number),"dnsEnd":(number),"connectStart":(number),"connectEnd":(number),"tlsStart":(number),"requestStart":(number),"responseStart":(number),"responseEnd":(number)})); + export type SetTimezoneOverrideParameters = { + timezone: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; +} +export type NetworkCommand = + | Network.AddDataCollector + | Network.AddIntercept + | Network.ContinueRequest + | Network.ContinueResponse + | Network.ContinueWithAuth + | Network.DisownData + | Network.FailRequest + | Network.GetData + | Network.ProvideResponse + | Network.RemoveDataCollector + | Network.RemoveIntercept + | Network.SetCacheBehavior + | Network.SetExtraHeaders; +export type NetworkEvent = + | Network.AuthRequired + | Network.BeforeRequestSent + | Network.FetchError + | Network.ResponseCompleted + | Network.ResponseStarted; +export type NetworkResult = Network.AddInterceptResult; +export namespace Network { + export type AuthChallenge = { + scheme: string; + realm: string; + }; +} +export namespace Network { + export type AuthCredentials = { + type: 'password'; + username: string; + password: string; + }; +} +export namespace Network { + export type BaseParameters = { + context: BrowsingContext.BrowsingContext | null; + isBlocked: boolean; + navigation: BrowsingContext.Navigation | null; + redirectCount: JsUint; + request: Network.RequestData; + timestamp: JsUint; + intercepts?: [Network.Intercept, ...Network.Intercept[]]; + }; +} +export namespace Network { + export type BytesValue = Network.StringValue | Network.Base64Value; +} +export namespace Network { + export type StringValue = { + type: 'string'; + value: string; + }; +} +export namespace Network { + export type Base64Value = { + type: 'base64'; + value: string; + }; +} +export namespace Network { + export type Collector = string; +} +export namespace Network { + export const enum CollectorType { + Blob = 'blob', + } +} +export namespace Network { + export const enum SameSite { + Strict = 'strict', + Lax = 'lax', + None = 'none', + Default = 'default', + } +} +export namespace Network { + export type Cookie = { + name: string; + value: Network.BytesValue; + domain: string; + path: string; + size: JsUint; + httpOnly: boolean; + secure: boolean; + sameSite: Network.SameSite; + expiry?: JsUint; + } & Extensible; +} +export namespace Network { + export type CookieHeader = { + name: string; + value: Network.BytesValue; + }; +} +export namespace Network { + export const enum DataType { + Response = 'response', + } +} +export namespace Network { + export type FetchTimingInfo = { + timeOrigin: number; + requestTime: number; + redirectStart: number; + redirectEnd: number; + fetchStart: number; + dnsStart: number; + dnsEnd: number; + connectStart: number; + connectEnd: number; + tlsStart: number; + requestStart: number; + responseStart: number; + responseEnd: number; + }; } export namespace Network { -export type Header = (({ -"name":(string),"value":(Network.BytesValue)})); + export type Header = { + name: string; + value: Network.BytesValue; + }; } export namespace Network { -export type Initiator = (({ -"columnNumber"?:(JsUint),"lineNumber"?:(JsUint),"request"?:(Network.Request),"stackTrace"?:(Script.StackTrace),"type"?:("parser"| "script"| "preflight"| "other")})); + export type Initiator = { + columnNumber?: JsUint; + lineNumber?: JsUint; + request?: Network.Request; + stackTrace?: Script.StackTrace; + type?: 'parser' | 'script' | 'preflight' | 'other'; + }; } export namespace Network { -export type Intercept = (string); + export type Intercept = string; } export namespace Network { -export type Request = (string); + export type Request = string; } export namespace Network { -export type RequestData = (({ -"request":(Network.Request),"url":(string),"method":(string),"headers":([ -...((Network.Header)[])]),"cookies":([ -...((Network.Cookie)[])]),"headersSize":(JsUint),"bodySize":(JsUint| null),"destination":(string),"initiatorType":(string| null),"timings":(Network.FetchTimingInfo)})); + export type RequestData = { + request: Network.Request; + url: string; + method: string; + headers: [...Network.Header[]]; + cookies: [...Network.Cookie[]]; + headersSize: JsUint; + bodySize: JsUint | null; + destination: string; + initiatorType: string | null; + timings: Network.FetchTimingInfo; + }; } export namespace Network { -export type ResponseContent = (({ -"size":(JsUint)})); + export type ResponseContent = { + size: JsUint; + }; } export namespace Network { -export type ResponseData = (({ -"url":(string),"protocol":(string),"status":(JsUint),"statusText":(string),"fromCache":(boolean),"headers":([ -...((Network.Header)[])]),"mimeType":(string),"bytesReceived":(JsUint),"headersSize":(JsUint| null),"bodySize":(JsUint| null),"content":(Network.ResponseContent),"authChallenges"?:([ -...((Network.AuthChallenge)[])])})); + export type ResponseData = { + url: string; + protocol: string; + status: JsUint; + statusText: string; + fromCache: boolean; + headers: [...Network.Header[]]; + mimeType: string; + bytesReceived: JsUint; + headersSize: JsUint | null; + bodySize: JsUint | null; + content: Network.ResponseContent; + authChallenges?: [...Network.AuthChallenge[]]; + }; +} +export namespace Network { + export type SetCookieHeader = { + name: string; + value: Network.BytesValue; + domain?: string; + httpOnly?: boolean; + expiry?: string; + maxAge?: JsInt; + path?: string; + sameSite?: Network.SameSite; + secure?: boolean; + }; } export namespace Network { -export type SetCookieHeader = (({ -"name":(string),"value":(Network.BytesValue),"domain"?:(string),"httpOnly"?:(boolean),"expiry"?:(string),"maxAge"?:(JsInt),"path"?:(string),"sameSite"?:(Network.SameSite),"secure"?:(boolean)})); + export type UrlPattern = Network.UrlPatternPattern | Network.UrlPatternString; } -export namespace Network { -export type UrlPattern = ((Network.UrlPatternPattern| Network.UrlPatternString)); -} -export namespace Network { -export type UrlPatternPattern = (({ -"type":("pattern"),"protocol"?:(string),"hostname"?:(string),"port"?:(string),"pathname"?:(string),"search"?:(string)})); +export namespace Network { + export type UrlPatternPattern = { + type: 'pattern'; + protocol?: string; + hostname?: string; + port?: string; + pathname?: string; + search?: string; + }; } export namespace Network { -export type UrlPatternString = (({ -"type":("string"),"pattern":(string)})); -} + export type UrlPatternString = { + type: 'string'; + pattern: string; + }; +} export namespace Network { -export type AddDataCollector = ({ -"method":("network.addDataCollector"),"params":(Network.AddDataCollectorParameters)}); + export type AddDataCollector = { + method: 'network.addDataCollector'; + params: Network.AddDataCollectorParameters; + }; } export namespace Network { -export type AddDataCollectorParameters = (({ -"dataTypes":([ -(Network.DataType),...(Network.DataType)[]]),"maxEncodedDataSize":(JsUint), -/** - * @defaultValue `"blob"` - */ -"collectorType"?:(Network.CollectorType),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type AddDataCollectorParameters = { + dataTypes: [Network.DataType, ...Network.DataType[]]; + maxEncodedDataSize: JsUint; + /** + * @defaultValue `"blob"` + */ + collectorType?: Network.CollectorType; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Network { -export type AddDataCollectorResult = (({ -"collector":(Network.Collector)})); + export type AddDataCollectorResult = { + collector: Network.Collector; + }; } export namespace Network { -export type AddInterceptParameters = (({ -"phases":([ -(Network.InterceptPhase),...(Network.InterceptPhase)[]]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"urlPatterns"?:([ -...((Network.UrlPattern)[])])})); + export type AddInterceptParameters = { + phases: [Network.InterceptPhase, ...Network.InterceptPhase[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + urlPatterns?: [...Network.UrlPattern[]]; + }; } export namespace Network { -export type AddIntercept = ({ -"method":("network.addIntercept"),"params":(Network.AddInterceptParameters)}); + export type AddIntercept = { + method: 'network.addIntercept'; + params: Network.AddInterceptParameters; + }; } export namespace Network { -export const enum InterceptPhase {BeforeRequestSent = "beforeRequestSent", -ResponseStarted = "responseStarted", -AuthRequired = "authRequired", -} + export const enum InterceptPhase { + BeforeRequestSent = 'beforeRequestSent', + ResponseStarted = 'responseStarted', + AuthRequired = 'authRequired', + } } export namespace Network { -export type AddInterceptResult = (({ -"intercept":(Network.Intercept)})); + export type AddInterceptResult = { + intercept: Network.Intercept; + }; } export namespace Network { -export type ContinueRequest = ({ -"method":("network.continueRequest"),"params":(Network.ContinueRequestParameters)}); + export type ContinueRequest = { + method: 'network.continueRequest'; + params: Network.ContinueRequestParameters; + }; } export namespace Network { -export type ContinueRequestParameters = (({ -"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ -...((Network.CookieHeader)[])]),"headers"?:([ -...((Network.Header)[])]),"method"?:(string),"url"?:(string)})); + export type ContinueRequestParameters = { + request: Network.Request; + body?: Network.BytesValue; + cookies?: [...Network.CookieHeader[]]; + headers?: [...Network.Header[]]; + method?: string; + url?: string; + }; } export namespace Network { -export type ContinueResponse = ({ -"method":("network.continueResponse"),"params":(Network.ContinueResponseParameters)}); + export type ContinueResponse = { + method: 'network.continueResponse'; + params: Network.ContinueResponseParameters; + }; } export namespace Network { -export type ContinueResponseParameters = (({ -"request":(Network.Request),"cookies"?:([ -...((Network.SetCookieHeader)[])]),"credentials"?:(Network.AuthCredentials),"headers"?:([ -...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); + export type ContinueResponseParameters = { + request: Network.Request; + cookies?: [...Network.SetCookieHeader[]]; + credentials?: Network.AuthCredentials; + headers?: [...Network.Header[]]; + reasonPhrase?: string; + statusCode?: JsUint; + }; } export namespace Network { -export type ContinueWithAuth = ({ -"method":("network.continueWithAuth"),"params":(Network.ContinueWithAuthParameters)}); + export type ContinueWithAuth = { + method: 'network.continueWithAuth'; + params: Network.ContinueWithAuthParameters; + }; } export namespace Network { -export type ContinueWithAuthParameters = (({ -"request":(Network.Request)}&(Network.ContinueWithAuthCredentials| Network.ContinueWithAuthNoCredentials))); + export type ContinueWithAuthParameters = { + request: Network.Request; + } & ( + | Network.ContinueWithAuthCredentials + | Network.ContinueWithAuthNoCredentials + ); } export namespace Network { -export type ContinueWithAuthCredentials = ({ -"action":("provideCredentials"),"credentials":(Network.AuthCredentials)}); + export type ContinueWithAuthCredentials = { + action: 'provideCredentials'; + credentials: Network.AuthCredentials; + }; } export namespace Network { -export type ContinueWithAuthNoCredentials = ({ -"action":("default"| "cancel")}); + export type ContinueWithAuthNoCredentials = { + action: 'default' | 'cancel'; + }; } export namespace Network { -export type DisownData = ({ -"method":("network.disownData"),"params":(Network.DisownDataParameters)}); + export type DisownData = { + method: 'network.disownData'; + params: Network.DisownDataParameters; + }; } export namespace Network { -export type DisownDataParameters = (({ -"dataType":(Network.DataType),"collector":(Network.Collector),"request":(Network.Request)})); + export type DisownDataParameters = { + dataType: Network.DataType; + collector: Network.Collector; + request: Network.Request; + }; } export namespace Network { -export type FailRequest = ({ -"method":("network.failRequest"),"params":(Network.FailRequestParameters)}); + export type FailRequest = { + method: 'network.failRequest'; + params: Network.FailRequestParameters; + }; } export namespace Network { -export type FailRequestParameters = (({ -"request":(Network.Request)})); + export type FailRequestParameters = { + request: Network.Request; + }; } export namespace Network { -export type GetData = ({ -"method":("network.getData"),"params":(Network.GetDataParameters)}); + export type GetData = { + method: 'network.getData'; + params: Network.GetDataParameters; + }; } export namespace Network { -export type GetDataParameters = (({ -"dataType":(Network.DataType),"collector"?:(Network.Collector), -/** - * @defaultValue `false` - */ -"disown"?:(boolean),"request":(Network.Request)})); + export type GetDataParameters = { + dataType: Network.DataType; + collector?: Network.Collector; + /** + * @defaultValue `false` + */ + disown?: boolean; + request: Network.Request; + }; } export namespace Network { -export type GetDataResult = (({ -"bytes":(Network.BytesValue)})); + export type GetDataResult = { + bytes: Network.BytesValue; + }; } export namespace Network { -export type ProvideResponse = ({ -"method":("network.provideResponse"),"params":(Network.ProvideResponseParameters)}); + export type ProvideResponse = { + method: 'network.provideResponse'; + params: Network.ProvideResponseParameters; + }; } export namespace Network { -export type ProvideResponseParameters = (({ -"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ -...((Network.SetCookieHeader)[])]),"headers"?:([ -...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); + export type ProvideResponseParameters = { + request: Network.Request; + body?: Network.BytesValue; + cookies?: [...Network.SetCookieHeader[]]; + headers?: [...Network.Header[]]; + reasonPhrase?: string; + statusCode?: JsUint; + }; } export namespace Network { -export type RemoveDataCollector = ({ -"method":("network.removeDataCollector"),"params":(Network.RemoveDataCollectorParameters)}); + export type RemoveDataCollector = { + method: 'network.removeDataCollector'; + params: Network.RemoveDataCollectorParameters; + }; } export namespace Network { -export type RemoveDataCollectorParameters = (({ -"collector":(Network.Collector)})); + export type RemoveDataCollectorParameters = { + collector: Network.Collector; + }; } export namespace Network { -export type RemoveIntercept = ({ -"method":("network.removeIntercept"),"params":(Network.RemoveInterceptParameters)}); + export type RemoveIntercept = { + method: 'network.removeIntercept'; + params: Network.RemoveInterceptParameters; + }; } export namespace Network { -export type RemoveInterceptParameters = (({ -"intercept":(Network.Intercept)})); + export type RemoveInterceptParameters = { + intercept: Network.Intercept; + }; } export namespace Network { -export type SetCacheBehavior = ({ -"method":("network.setCacheBehavior"),"params":(Network.SetCacheBehaviorParameters)}); + export type SetCacheBehavior = { + method: 'network.setCacheBehavior'; + params: Network.SetCacheBehaviorParameters; + }; } export namespace Network { -export type SetCacheBehaviorParameters = (({ -"cacheBehavior":("default"| "bypass"),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); + export type SetCacheBehaviorParameters = { + cacheBehavior: 'default' | 'bypass'; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + }; } export namespace Network { -export type SetExtraHeaders = ({ -"method":("network.setExtraHeaders"),"params":(Network.SetExtraHeadersParameters)}); + export type SetExtraHeaders = { + method: 'network.setExtraHeaders'; + params: Network.SetExtraHeadersParameters; + }; } export namespace Network { -export type SetExtraHeadersParameters = (({ -"headers":([ -...((Network.Header)[])]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetExtraHeadersParameters = { + headers: [...Network.Header[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } -export type ScriptEvent = (Script.Message| Script.RealmCreated| Script.RealmDestroyed); +export type ScriptEvent = + | Script.Message + | Script.RealmCreated + | Script.RealmDestroyed; export namespace Network { -export type AuthRequiredParameters = ((Network.BaseParameters&{ -"response":(Network.ResponseData)})); + export type AuthRequiredParameters = Network.BaseParameters & { + response: Network.ResponseData; + }; } export namespace Network { -export type BeforeRequestSentParameters = ((Network.BaseParameters&{ -"initiator"?:(Network.Initiator)})); + export type BeforeRequestSentParameters = Network.BaseParameters & { + initiator?: Network.Initiator; + }; } export namespace Network { -export type FetchErrorParameters = ((Network.BaseParameters&{ -"errorText":(string)})); + export type FetchErrorParameters = Network.BaseParameters & { + errorText: string; + }; } export namespace Network { -export type ResponseCompletedParameters = ((Network.BaseParameters&{ -"response":(Network.ResponseData)})); + export type ResponseCompletedParameters = Network.BaseParameters & { + response: Network.ResponseData; + }; } export namespace Network { -export type ResponseStartedParameters = ((Network.BaseParameters&{ -"response":(Network.ResponseData)})); + export type ResponseStartedParameters = Network.BaseParameters & { + response: Network.ResponseData; + }; } -export type ScriptCommand = (Script.AddPreloadScript| Script.CallFunction| Script.Disown| Script.Evaluate| Script.GetRealms| Script.RemovePreloadScript); -export type ScriptResult = ((Script.AddPreloadScriptResult| Script.EvaluateResult| Script.GetRealmsResult)); +export type ScriptCommand = + | Script.AddPreloadScript + | Script.CallFunction + | Script.Disown + | Script.Evaluate + | Script.GetRealms + | Script.RemovePreloadScript; +export type ScriptResult = + | Script.AddPreloadScriptResult + | Script.EvaluateResult + | Script.GetRealmsResult; export namespace Network { -export type AuthRequired = ({ -"method":("network.authRequired"),"params":(Network.AuthRequiredParameters)}); + export type AuthRequired = { + method: 'network.authRequired'; + params: Network.AuthRequiredParameters; + }; } export namespace Network { -export type BeforeRequestSent = ({ -"method":("network.beforeRequestSent"),"params":(Network.BeforeRequestSentParameters)}); + export type BeforeRequestSent = { + method: 'network.beforeRequestSent'; + params: Network.BeforeRequestSentParameters; + }; } export namespace Network { -export type FetchError = ({ -"method":("network.fetchError"),"params":(Network.FetchErrorParameters)}); + export type FetchError = { + method: 'network.fetchError'; + params: Network.FetchErrorParameters; + }; } export namespace Network { -export type ResponseCompleted = ({ -"method":("network.responseCompleted"),"params":(Network.ResponseCompletedParameters)}); + export type ResponseCompleted = { + method: 'network.responseCompleted'; + params: Network.ResponseCompletedParameters; + }; } export namespace Network { -export type ResponseStarted = ({ -"method":("network.responseStarted"),"params":(Network.ResponseStartedParameters)}); + export type ResponseStarted = { + method: 'network.responseStarted'; + params: Network.ResponseStartedParameters; + }; } export namespace Script { -export type Channel = (string); + export type Channel = string; } export namespace Script { -export type EvaluateResultSuccess = (({ -"type":("success"),"result":(Script.RemoteValue),"realm":(Script.Realm)})); + export type EvaluateResultSuccess = { + type: 'success'; + result: Script.RemoteValue; + realm: Script.Realm; + }; } export namespace Script { -export type ExceptionDetails = (({ -"columnNumber":(JsUint),"exception":(Script.RemoteValue),"lineNumber":(JsUint),"stackTrace":(Script.StackTrace),"text":(string)})); + export type ExceptionDetails = { + columnNumber: JsUint; + exception: Script.RemoteValue; + lineNumber: JsUint; + stackTrace: Script.StackTrace; + text: string; + }; } export namespace Script { -export type ChannelValue = (({ -"type":("channel"),"value":(Script.ChannelProperties)})); + export type ChannelValue = { + type: 'channel'; + value: Script.ChannelProperties; + }; } export namespace Script { -export type ChannelProperties = (({ -"channel":(Script.Channel),"serializationOptions"?:(Script.SerializationOptions),"ownership"?:(Script.ResultOwnership)})); + export type ChannelProperties = { + channel: Script.Channel; + serializationOptions?: Script.SerializationOptions; + ownership?: Script.ResultOwnership; + }; } export namespace Script { -export type EvaluateResult = ((Script.EvaluateResultSuccess| Script.EvaluateResultException)); + export type EvaluateResult = + | Script.EvaluateResultSuccess + | Script.EvaluateResultException; } export namespace Script { -export type EvaluateResultException = (({ -"type":("exception"),"exceptionDetails":(Script.ExceptionDetails),"realm":(Script.Realm)})); + export type EvaluateResultException = { + type: 'exception'; + exceptionDetails: Script.ExceptionDetails; + realm: Script.Realm; + }; } export namespace Script { -export type Handle = (string); + export type Handle = string; } export namespace Script { -export type InternalId = (string); + export type InternalId = string; } export namespace Script { -export type ListLocalValue = ([ -...((Script.LocalValue)[])]); + export type ListLocalValue = [...Script.LocalValue[]]; } export namespace Script { -export type LocalValue = ((Script.RemoteReference| Script.PrimitiveProtocolValue| Script.ChannelValue| Script.ArrayLocalValue| (Script.DateLocalValue)| Script.MapLocalValue| Script.ObjectLocalValue| (Script.RegExpLocalValue)| Script.SetLocalValue)); + export type LocalValue = + | Script.RemoteReference + | Script.PrimitiveProtocolValue + | Script.ChannelValue + | Script.ArrayLocalValue + | Script.DateLocalValue + | Script.MapLocalValue + | Script.ObjectLocalValue + | Script.RegExpLocalValue + | Script.SetLocalValue; } export namespace Script { -export type ArrayLocalValue = (({ -"type":("array"),"value":(Script.ListLocalValue)})); + export type ArrayLocalValue = { + type: 'array'; + value: Script.ListLocalValue; + }; } export namespace Script { -export type DateLocalValue = ({ -"type":("date"),"value":(string)}); + export type DateLocalValue = { + type: 'date'; + value: string; + }; } export namespace Script { -export type MappingLocalValue = ([ -...(([ -(Script.LocalValue| string),(Script.LocalValue)])[])]); + export type MappingLocalValue = [ + ...[Script.LocalValue | string, Script.LocalValue][], + ]; } export namespace Script { -export type MapLocalValue = (({ -"type":("map"),"value":(Script.MappingLocalValue)})); + export type MapLocalValue = { + type: 'map'; + value: Script.MappingLocalValue; + }; } export namespace Script { -export type ObjectLocalValue = (({ -"type":("object"),"value":(Script.MappingLocalValue)})); + export type ObjectLocalValue = { + type: 'object'; + value: Script.MappingLocalValue; + }; } export namespace Script { -export type RegExpValue = (({ -"pattern":(string),"flags"?:(string)})); + export type RegExpValue = { + pattern: string; + flags?: string; + }; } export namespace Script { -export type RegExpLocalValue = ({ -"type":("regexp"),"value":(Script.RegExpValue)}); + export type RegExpLocalValue = { + type: 'regexp'; + value: Script.RegExpValue; + }; } export namespace Script { -export type SetLocalValue = (({ -"type":("set"),"value":(Script.ListLocalValue)})); + export type SetLocalValue = { + type: 'set'; + value: Script.ListLocalValue; + }; } export namespace Script { -export type PreloadScript = (string); + export type PreloadScript = string; } export namespace Script { -export type Realm = (string); + export type Realm = string; } export namespace Script { -export type PrimitiveProtocolValue = ((Script.UndefinedValue| Script.NullValue| Script.StringValue| Script.NumberValue| Script.BooleanValue| Script.BigIntValue)); + export type PrimitiveProtocolValue = + | Script.UndefinedValue + | Script.NullValue + | Script.StringValue + | Script.NumberValue + | Script.BooleanValue + | Script.BigIntValue; } export namespace Script { -export type UndefinedValue = (({ -"type":("undefined")})); + export type UndefinedValue = { + type: 'undefined'; + }; } export namespace Script { -export type NullValue = (({ -"type":("null")})); + export type NullValue = { + type: 'null'; + }; } export namespace Script { -export type StringValue = (({ -"type":("string"),"value":(string)})); + export type StringValue = { + type: 'string'; + value: string; + }; } export namespace Script { -export type SpecialNumber = ("NaN"| "-0"| "Infinity"| "-Infinity"); + export type SpecialNumber = 'NaN' | '-0' | 'Infinity' | '-Infinity'; } export namespace Script { -export type NumberValue = (({ -"type":("number"),"value":(number| Script.SpecialNumber)})); + export type NumberValue = { + type: 'number'; + value: number | Script.SpecialNumber; + }; } export namespace Script { -export type BooleanValue = (({ -"type":("boolean"),"value":(boolean)})); + export type BooleanValue = { + type: 'boolean'; + value: boolean; + }; } export namespace Script { -export type BigIntValue = (({ -"type":("bigint"),"value":(string)})); + export type BigIntValue = { + type: 'bigint'; + value: string; + }; } export namespace Script { -export type RealmInfo = ((Script.WindowRealmInfo| Script.DedicatedWorkerRealmInfo| Script.SharedWorkerRealmInfo| Script.ServiceWorkerRealmInfo| Script.WorkerRealmInfo| Script.PaintWorkletRealmInfo| Script.AudioWorkletRealmInfo| Script.WorkletRealmInfo)); + export type RealmInfo = + | Script.WindowRealmInfo + | Script.DedicatedWorkerRealmInfo + | Script.SharedWorkerRealmInfo + | Script.ServiceWorkerRealmInfo + | Script.WorkerRealmInfo + | Script.PaintWorkletRealmInfo + | Script.AudioWorkletRealmInfo + | Script.WorkletRealmInfo; } export namespace Script { -export type BaseRealmInfo = ({ -"realm":(Script.Realm),"origin":(string)}); + export type BaseRealmInfo = { + realm: Script.Realm; + origin: string; + }; } export namespace Script { -export type WindowRealmInfo = ((Script.BaseRealmInfo&{ -"type":("window"),"context":(BrowsingContext.BrowsingContext),"sandbox"?:(string)})); + export type WindowRealmInfo = Script.BaseRealmInfo & { + type: 'window'; + context: BrowsingContext.BrowsingContext; + sandbox?: string; + }; } export namespace Script { -export type DedicatedWorkerRealmInfo = ((Script.BaseRealmInfo&{ -"type":("dedicated-worker"),"owners":([ -(Script.Realm)])})); + export type DedicatedWorkerRealmInfo = Script.BaseRealmInfo & { + type: 'dedicated-worker'; + owners: [Script.Realm]; + }; } export namespace Script { -export type SharedWorkerRealmInfo = ((Script.BaseRealmInfo&{ -"type":("shared-worker")})); + export type SharedWorkerRealmInfo = Script.BaseRealmInfo & { + type: 'shared-worker'; + }; } export namespace Script { -export type ServiceWorkerRealmInfo = ((Script.BaseRealmInfo&{ -"type":("service-worker")})); + export type ServiceWorkerRealmInfo = Script.BaseRealmInfo & { + type: 'service-worker'; + }; } export namespace Script { -export type WorkerRealmInfo = ((Script.BaseRealmInfo&{ -"type":("worker")})); + export type WorkerRealmInfo = Script.BaseRealmInfo & { + type: 'worker'; + }; } export namespace Script { -export type PaintWorkletRealmInfo = ((Script.BaseRealmInfo&{ -"type":("paint-worklet")})); + export type PaintWorkletRealmInfo = Script.BaseRealmInfo & { + type: 'paint-worklet'; + }; } export namespace Script { -export type AudioWorkletRealmInfo = ((Script.BaseRealmInfo&{ -"type":("audio-worklet")})); + export type AudioWorkletRealmInfo = Script.BaseRealmInfo & { + type: 'audio-worklet'; + }; } export namespace Script { -export type WorkletRealmInfo = ((Script.BaseRealmInfo&{ -"type":("worklet")})); + export type WorkletRealmInfo = Script.BaseRealmInfo & { + type: 'worklet'; + }; } export namespace Script { -export type RealmType = ("window"| "dedicated-worker"| "shared-worker"| "service-worker"| "worker"| "paint-worklet"| "audio-worklet"| "worklet"); + export type RealmType = + | 'window' + | 'dedicated-worker' + | 'shared-worker' + | 'service-worker' + | 'worker' + | 'paint-worklet' + | 'audio-worklet' + | 'worklet'; } export namespace Script { -export type ListRemoteValue = ([ -...((Script.RemoteValue)[])]); + export type ListRemoteValue = [...Script.RemoteValue[]]; } export namespace Script { -export type MappingRemoteValue = ([ -...(([ -(Script.RemoteValue| string),(Script.RemoteValue)])[])]); + export type MappingRemoteValue = [ + ...[Script.RemoteValue | string, Script.RemoteValue][], + ]; } export namespace Script { -export type RemoteValue = ((Script.PrimitiveProtocolValue| Script.SymbolRemoteValue| Script.ArrayRemoteValue| Script.ObjectRemoteValue| Script.FunctionRemoteValue| Script.RegExpRemoteValue| Script.DateRemoteValue| Script.MapRemoteValue| Script.SetRemoteValue| Script.WeakMapRemoteValue| Script.WeakSetRemoteValue| Script.GeneratorRemoteValue| Script.ErrorRemoteValue| Script.ProxyRemoteValue| Script.PromiseRemoteValue| Script.TypedArrayRemoteValue| Script.ArrayBufferRemoteValue| Script.NodeListRemoteValue| Script.HtmlCollectionRemoteValue| Script.NodeRemoteValue| Script.WindowProxyRemoteValue)); + export type RemoteValue = + | Script.PrimitiveProtocolValue + | Script.SymbolRemoteValue + | Script.ArrayRemoteValue + | Script.ObjectRemoteValue + | Script.FunctionRemoteValue + | Script.RegExpRemoteValue + | Script.DateRemoteValue + | Script.MapRemoteValue + | Script.SetRemoteValue + | Script.WeakMapRemoteValue + | Script.WeakSetRemoteValue + | Script.GeneratorRemoteValue + | Script.ErrorRemoteValue + | Script.ProxyRemoteValue + | Script.PromiseRemoteValue + | Script.TypedArrayRemoteValue + | Script.ArrayBufferRemoteValue + | Script.NodeListRemoteValue + | Script.HtmlCollectionRemoteValue + | Script.NodeRemoteValue + | Script.WindowProxyRemoteValue; } export namespace Script { -export type RemoteReference = ((Script.SharedReference| Script.RemoteObjectReference)); + export type RemoteReference = + | Script.SharedReference + | Script.RemoteObjectReference; } export namespace Script { -export type SharedReference = (({ -"sharedId":(Script.SharedId),"handle"?:(Script.Handle)}&Extensible)); + export type SharedReference = { + sharedId: Script.SharedId; + handle?: Script.Handle; + } & Extensible; } export namespace Script { -export type RemoteObjectReference = (({ -"handle":(Script.Handle),"sharedId"?:(Script.SharedId)}&Extensible)); + export type RemoteObjectReference = { + handle: Script.Handle; + sharedId?: Script.SharedId; + } & Extensible; } export namespace Script { -export type SymbolRemoteValue = (({ -"type":("symbol"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type SymbolRemoteValue = { + type: 'symbol'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ArrayRemoteValue = (({ -"type":("array"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type ArrayRemoteValue = { + type: 'array'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type ObjectRemoteValue = (({ -"type":("object"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); + export type ObjectRemoteValue = { + type: 'object'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.MappingRemoteValue; + }; } export namespace Script { -export type FunctionRemoteValue = (({ -"type":("function"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type FunctionRemoteValue = { + type: 'function'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type RegExpRemoteValue = ((Script.RegExpLocalValue&{ -"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type RegExpRemoteValue = Script.RegExpLocalValue & { + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type DateRemoteValue = ((Script.DateLocalValue&{ -"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type DateRemoteValue = Script.DateLocalValue & { + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type MapRemoteValue = (({ -"type":("map"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); + export type MapRemoteValue = { + type: 'map'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.MappingRemoteValue; + }; } export namespace Script { -export type SetRemoteValue = (({ -"type":("set"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type SetRemoteValue = { + type: 'set'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type WeakMapRemoteValue = (({ -"type":("weakmap"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type WeakMapRemoteValue = { + type: 'weakmap'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type WeakSetRemoteValue = (({ -"type":("weakset"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type WeakSetRemoteValue = { + type: 'weakset'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type GeneratorRemoteValue = (({ -"type":("generator"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type GeneratorRemoteValue = { + type: 'generator'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ErrorRemoteValue = (({ -"type":("error"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type ErrorRemoteValue = { + type: 'error'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ProxyRemoteValue = (({ -"type":("proxy"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type ProxyRemoteValue = { + type: 'proxy'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type PromiseRemoteValue = (({ -"type":("promise"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type PromiseRemoteValue = { + type: 'promise'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type TypedArrayRemoteValue = (({ -"type":("typedarray"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type TypedArrayRemoteValue = { + type: 'typedarray'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ArrayBufferRemoteValue = (({ -"type":("arraybuffer"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type ArrayBufferRemoteValue = { + type: 'arraybuffer'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type NodeListRemoteValue = (({ -"type":("nodelist"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type NodeListRemoteValue = { + type: 'nodelist'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type HtmlCollectionRemoteValue = (({ -"type":("htmlcollection"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type HtmlCollectionRemoteValue = { + type: 'htmlcollection'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type NodeRemoteValue = (({ -"type":("node"),"sharedId"?:(Script.SharedId),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.NodeProperties)})); + export type NodeRemoteValue = { + type: 'node'; + sharedId?: Script.SharedId; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.NodeProperties; + }; } export namespace Script { -export type NodeProperties = (({ -"nodeType":(JsUint),"childNodeCount":(JsUint),"attributes"?:(({ -[key: string]:(string)})),"children"?:([ -...((Script.NodeRemoteValue)[])]),"localName"?:(string),"mode"?:("open"| "closed"),"namespaceURI"?:(string),"nodeValue"?:(string),"shadowRoot"?:(Script.NodeRemoteValue| null)})); + export type NodeProperties = { + nodeType: JsUint; + childNodeCount: JsUint; + attributes?: { + [key: string]: string; + }; + children?: [...Script.NodeRemoteValue[]]; + localName?: string; + mode?: 'open' | 'closed'; + namespaceURI?: string; + nodeValue?: string; + shadowRoot?: Script.NodeRemoteValue | null; + }; } export namespace Script { -export type WindowProxyRemoteValue = (({ -"type":("window"),"value":(Script.WindowProxyProperties),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type WindowProxyRemoteValue = { + type: 'window'; + value: Script.WindowProxyProperties; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type WindowProxyProperties = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type WindowProxyProperties = { + context: BrowsingContext.BrowsingContext; + }; } export namespace Script { -export const enum ResultOwnership {Root = "root", -None = "none", -} + export const enum ResultOwnership { + Root = 'root', + None = 'none', + } } export namespace Script { -export type SerializationOptions = (({ - -/** - * @defaultValue `0` - */ -"maxDomDepth"?:((JsUint| null)), -/** - * @defaultValue `null` - */ -"maxObjectDepth"?:((JsUint| null)), -/** - * @defaultValue `"none"` - */ -"includeShadowTree"?:(("none"| "open"| "all"))})); + export type SerializationOptions = { + /** + * @defaultValue `0` + */ + maxDomDepth?: JsUint | null; + /** + * @defaultValue `null` + */ + maxObjectDepth?: JsUint | null; + /** + * @defaultValue `"none"` + */ + includeShadowTree?: 'none' | 'open' | 'all'; + }; } export namespace Script { -export type SharedId = (string); + export type SharedId = string; } export namespace Script { -export type StackFrame = (({ -"columnNumber":(JsUint),"functionName":(string),"lineNumber":(JsUint),"url":(string)})); + export type StackFrame = { + columnNumber: JsUint; + functionName: string; + lineNumber: JsUint; + url: string; + }; } export namespace Script { -export type StackTrace = (({ -"callFrames":([ -...((Script.StackFrame)[])])})); + export type StackTrace = { + callFrames: [...Script.StackFrame[]]; + }; } export namespace Script { -export type Source = (({ -"realm":(Script.Realm),"context"?:(BrowsingContext.BrowsingContext)})); + export type Source = { + realm: Script.Realm; + context?: BrowsingContext.BrowsingContext; + }; } export namespace Script { -export type RealmTarget = (({ -"realm":(Script.Realm)})); + export type RealmTarget = { + realm: Script.Realm; + }; } export namespace Script { -export type ContextTarget = (({ -"context":(BrowsingContext.BrowsingContext),"sandbox"?:(string)})); + export type ContextTarget = { + context: BrowsingContext.BrowsingContext; + sandbox?: string; + }; } export namespace Script { -export type Target = ((Script.ContextTarget| Script.RealmTarget)); + export type Target = Script.ContextTarget | Script.RealmTarget; } export namespace Script { -export type AddPreloadScript = ({ -"method":("script.addPreloadScript"),"params":(Script.AddPreloadScriptParameters)}); + export type AddPreloadScript = { + method: 'script.addPreloadScript'; + params: Script.AddPreloadScriptParameters; + }; } export namespace Script { -export type AddPreloadScriptParameters = (({ -"functionDeclaration":(string),"arguments"?:([ -...((Script.ChannelValue)[])]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]]),"sandbox"?:(string)})); + export type AddPreloadScriptParameters = { + functionDeclaration: string; + arguments?: [...Script.ChannelValue[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + sandbox?: string; + }; } export namespace Script { -export type AddPreloadScriptResult = (({ -"script":(Script.PreloadScript)})); + export type AddPreloadScriptResult = { + script: Script.PreloadScript; + }; } export namespace Script { -export type Disown = ({ -"method":("script.disown"),"params":(Script.DisownParameters)}); + export type Disown = { + method: 'script.disown'; + params: Script.DisownParameters; + }; } export namespace Script { -export type DisownParameters = (({ -"handles":([ -...((Script.Handle)[])]),"target":(Script.Target)})); + export type DisownParameters = { + handles: [...Script.Handle[]]; + target: Script.Target; + }; } export namespace Script { -export type CallFunctionParameters = (({ -"functionDeclaration":(string),"awaitPromise":(boolean),"target":(Script.Target),"arguments"?:([ -...((Script.LocalValue)[])]),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions),"this"?:(Script.LocalValue), -/** - * @defaultValue `false` - */ -"userActivation"?:(boolean)})); + export type CallFunctionParameters = { + functionDeclaration: string; + awaitPromise: boolean; + target: Script.Target; + arguments?: [...Script.LocalValue[]]; + resultOwnership?: Script.ResultOwnership; + serializationOptions?: Script.SerializationOptions; + this?: Script.LocalValue; + /** + * @defaultValue `false` + */ + userActivation?: boolean; + }; } export namespace Script { -export type CallFunction = ({ -"method":("script.callFunction"),"params":(Script.CallFunctionParameters)}); + export type CallFunction = { + method: 'script.callFunction'; + params: Script.CallFunctionParameters; + }; } export namespace Script { -export type Evaluate = ({ -"method":("script.evaluate"),"params":(Script.EvaluateParameters)}); + export type Evaluate = { + method: 'script.evaluate'; + params: Script.EvaluateParameters; + }; } export namespace Script { -export type EvaluateParameters = (({ -"expression":(string),"target":(Script.Target),"awaitPromise":(boolean),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions), -/** - * @defaultValue `false` - */ -"userActivation"?:(boolean)})); + export type EvaluateParameters = { + expression: string; + target: Script.Target; + awaitPromise: boolean; + resultOwnership?: Script.ResultOwnership; + serializationOptions?: Script.SerializationOptions; + /** + * @defaultValue `false` + */ + userActivation?: boolean; + }; } export namespace Script { -export type GetRealms = ({ -"method":("script.getRealms"),"params":(Script.GetRealmsParameters)}); + export type GetRealms = { + method: 'script.getRealms'; + params: Script.GetRealmsParameters; + }; } export namespace Script { -export type GetRealmsParameters = (({ -"context"?:(BrowsingContext.BrowsingContext),"type"?:(Script.RealmType)})); + export type GetRealmsParameters = { + context?: BrowsingContext.BrowsingContext; + type?: Script.RealmType; + }; } export namespace Script { -export type GetRealmsResult = (({ -"realms":([ -...((Script.RealmInfo)[])])})); + export type GetRealmsResult = { + realms: [...Script.RealmInfo[]]; + }; } export namespace Script { -export type RemovePreloadScript = ({ -"method":("script.removePreloadScript"),"params":(Script.RemovePreloadScriptParameters)}); + export type RemovePreloadScript = { + method: 'script.removePreloadScript'; + params: Script.RemovePreloadScriptParameters; + }; } export namespace Script { -export type RemovePreloadScriptParameters = (({ -"script":(Script.PreloadScript)})); + export type RemovePreloadScriptParameters = { + script: Script.PreloadScript; + }; } export namespace Script { -export type MessageParameters = (({ -"channel":(Script.Channel),"data":(Script.RemoteValue),"source":(Script.Source)})); + export type MessageParameters = { + channel: Script.Channel; + data: Script.RemoteValue; + source: Script.Source; + }; } export namespace Script { -export type RealmCreated = ({ -"method":("script.realmCreated"),"params":(Script.RealmInfo)}); + export type RealmCreated = { + method: 'script.realmCreated'; + params: Script.RealmInfo; + }; } export namespace Script { -export type Message = ({ -"method":("script.message"),"params":(Script.MessageParameters)}); + export type Message = { + method: 'script.message'; + params: Script.MessageParameters; + }; } export namespace Script { -export type RealmDestroyed = ({ -"method":("script.realmDestroyed"),"params":(Script.RealmDestroyedParameters)}); + export type RealmDestroyed = { + method: 'script.realmDestroyed'; + params: Script.RealmDestroyedParameters; + }; } export namespace Script { -export type RealmDestroyedParameters = (({ -"realm":(Script.Realm)})); + export type RealmDestroyedParameters = { + realm: Script.Realm; + }; } -export type StorageCommand = (Storage.DeleteCookies| Storage.GetCookies| Storage.SetCookie); -export type StorageResult = ((Storage.DeleteCookiesResult| Storage.GetCookiesResult| Storage.SetCookieResult)); +export type StorageCommand = + | Storage.DeleteCookies + | Storage.GetCookies + | Storage.SetCookie; +export type StorageResult = + | Storage.DeleteCookiesResult + | Storage.GetCookiesResult + | Storage.SetCookieResult; export namespace Storage { -export type PartitionKey = (({ -"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); + export type PartitionKey = { + userContext?: string; + sourceOrigin?: string; + } & Extensible; } export namespace Storage { -export type GetCookies = ({ -"method":("storage.getCookies"),"params":(Storage.GetCookiesParameters)}); + export type GetCookies = { + method: 'storage.getCookies'; + params: Storage.GetCookiesParameters; + }; } export namespace Storage { -export type CookieFilter = (({ -"name"?:(string),"value"?:(Network.BytesValue),"domain"?:(string),"path"?:(string),"size"?:(JsUint),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); + export type CookieFilter = { + name?: string; + value?: Network.BytesValue; + domain?: string; + path?: string; + size?: JsUint; + httpOnly?: boolean; + secure?: boolean; + sameSite?: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export namespace Storage { -export type BrowsingContextPartitionDescriptor = (({ -"type":("context"),"context":(BrowsingContext.BrowsingContext)})); + export type BrowsingContextPartitionDescriptor = { + type: 'context'; + context: BrowsingContext.BrowsingContext; + }; } export namespace Storage { -export type StorageKeyPartitionDescriptor = (({ -"type":("storageKey"),"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); + export type StorageKeyPartitionDescriptor = { + type: 'storageKey'; + userContext?: string; + sourceOrigin?: string; + } & Extensible; } export namespace Storage { -export type PartitionDescriptor = ((Storage.BrowsingContextPartitionDescriptor| Storage.StorageKeyPartitionDescriptor)); + export type PartitionDescriptor = + | Storage.BrowsingContextPartitionDescriptor + | Storage.StorageKeyPartitionDescriptor; } export namespace Storage { -export type GetCookiesParameters = (({ -"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); + export type GetCookiesParameters = { + filter?: Storage.CookieFilter; + partition?: Storage.PartitionDescriptor; + }; } export namespace Storage { -export type GetCookiesResult = (({ -"cookies":([ -...((Network.Cookie)[])]),"partitionKey":(Storage.PartitionKey)})); + export type GetCookiesResult = { + cookies: [...Network.Cookie[]]; + partitionKey: Storage.PartitionKey; + }; } export namespace Storage { -export type SetCookie = ({ -"method":("storage.setCookie"),"params":(Storage.SetCookieParameters)}); + export type SetCookie = { + method: 'storage.setCookie'; + params: Storage.SetCookieParameters; + }; } export namespace Storage { -export type PartialCookie = (({ -"name":(string),"value":(Network.BytesValue),"domain":(string),"path"?:(string),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); + export type PartialCookie = { + name: string; + value: Network.BytesValue; + domain: string; + path?: string; + httpOnly?: boolean; + secure?: boolean; + sameSite?: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export namespace Storage { -export type SetCookieParameters = (({ -"cookie":(Storage.PartialCookie),"partition"?:(Storage.PartitionDescriptor)})); + export type SetCookieParameters = { + cookie: Storage.PartialCookie; + partition?: Storage.PartitionDescriptor; + }; } export namespace Storage { -export type SetCookieResult = (({ -"partitionKey":(Storage.PartitionKey)})); + export type SetCookieResult = { + partitionKey: Storage.PartitionKey; + }; } export namespace Storage { -export type DeleteCookies = ({ -"method":("storage.deleteCookies"),"params":(Storage.DeleteCookiesParameters)}); + export type DeleteCookies = { + method: 'storage.deleteCookies'; + params: Storage.DeleteCookiesParameters; + }; } export namespace Storage { -export type DeleteCookiesParameters = (({ -"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); + export type DeleteCookiesParameters = { + filter?: Storage.CookieFilter; + partition?: Storage.PartitionDescriptor; + }; } export namespace Storage { -export type DeleteCookiesResult = (({ -"partitionKey":(Storage.PartitionKey)})); + export type DeleteCookiesResult = { + partitionKey: Storage.PartitionKey; + }; } -export type LogEvent = (Log.EntryAdded); +export type LogEvent = Log.EntryAdded; export namespace Log { -export const enum Level {Debug = "debug", -Info = "info", -Warn = "warn", -Error = "error", -} + export const enum Level { + Debug = 'debug', + Info = 'info', + Warn = 'warn', + Error = 'error', + } } export namespace Log { -export type Entry = ((Log.GenericLogEntry| Log.ConsoleLogEntry| Log.JavascriptLogEntry)); + export type Entry = + | Log.GenericLogEntry + | Log.ConsoleLogEntry + | Log.JavascriptLogEntry; } export namespace Log { -export type BaseLogEntry = ({ -"level":(Log.Level),"source":(Script.Source),"text":(string| null),"timestamp":(JsUint),"stackTrace"?:(Script.StackTrace)}); + export type BaseLogEntry = { + level: Log.Level; + source: Script.Source; + text: string | null; + timestamp: JsUint; + stackTrace?: Script.StackTrace; + }; } export namespace Log { -export type GenericLogEntry = ((Log.BaseLogEntry&{ -"type":(string)})); + export type GenericLogEntry = Log.BaseLogEntry & { + type: string; + }; } export namespace Log { -export type ConsoleLogEntry = ((Log.BaseLogEntry&{ -"type":("console"),"method":(string),"args":([ -...((Script.RemoteValue)[])])})); + export type ConsoleLogEntry = Log.BaseLogEntry & { + type: 'console'; + method: string; + args: [...Script.RemoteValue[]]; + }; } export namespace Log { -export type JavascriptLogEntry = ((Log.BaseLogEntry&{ -"type":("javascript")})); + export type JavascriptLogEntry = Log.BaseLogEntry & { + type: 'javascript'; + }; } export namespace Log { -export type EntryAdded = ({ -"method":("log.entryAdded"),"params":(Log.Entry)}); -} -export type InputCommand = (Input.PerformActions| Input.ReleaseActions| Input.SetFiles); -export type InputEvent = (Input.FileDialogOpened); + export type EntryAdded = { + method: 'log.entryAdded'; + params: Log.Entry; + }; +} +export type InputCommand = + | Input.PerformActions + | Input.ReleaseActions + | Input.SetFiles; +export type InputEvent = Input.FileDialogOpened; export namespace Input { -export type ElementOrigin = (({ -"type":("element"),"element":(Script.SharedReference)})); + export type ElementOrigin = { + type: 'element'; + element: Script.SharedReference; + }; } export namespace Input { -export type PerformActionsParameters = (({ -"context":(BrowsingContext.BrowsingContext),"actions":([ -...((Input.SourceActions)[])])})); + export type PerformActionsParameters = { + context: BrowsingContext.BrowsingContext; + actions: [...Input.SourceActions[]]; + }; } export namespace Input { -export type NoneSourceActions = (({ -"type":("none"),"id":(string),"actions":([ -...((Input.NoneSourceAction)[])])})); + export type NoneSourceActions = { + type: 'none'; + id: string; + actions: [...Input.NoneSourceAction[]]; + }; } export namespace Input { -export type KeySourceActions = (({ -"type":("key"),"id":(string),"actions":([ -...((Input.KeySourceAction)[])])})); + export type KeySourceActions = { + type: 'key'; + id: string; + actions: [...Input.KeySourceAction[]]; + }; } export namespace Input { -export type PointerSourceActions = (({ -"type":("pointer"),"id":(string),"parameters"?:(Input.PointerParameters),"actions":([ -...((Input.PointerSourceAction)[])])})); + export type PointerSourceActions = { + type: 'pointer'; + id: string; + parameters?: Input.PointerParameters; + actions: [...Input.PointerSourceAction[]]; + }; } export namespace Input { -export type PerformActions = ({ -"method":("input.performActions"),"params":(Input.PerformActionsParameters)}); + export type PerformActions = { + method: 'input.performActions'; + params: Input.PerformActionsParameters; + }; } export namespace Input { -export type SourceActions = ((Input.NoneSourceActions| Input.KeySourceActions| Input.PointerSourceActions| Input.WheelSourceActions)); + export type SourceActions = + | Input.NoneSourceActions + | Input.KeySourceActions + | Input.PointerSourceActions + | Input.WheelSourceActions; } export namespace Input { -export type NoneSourceAction = (Input.PauseAction); + export type NoneSourceAction = Input.PauseAction; } export namespace Input { -export type KeySourceAction = ((Input.PauseAction| Input.KeyDownAction| Input.KeyUpAction)); + export type KeySourceAction = + | Input.PauseAction + | Input.KeyDownAction + | Input.KeyUpAction; } export namespace Input { -export const enum PointerType {Mouse = "mouse", -Pen = "pen", -Touch = "touch", -} + export const enum PointerType { + Mouse = 'mouse', + Pen = 'pen', + Touch = 'touch', + } } export namespace Input { -export type PointerParameters = (({ - -/** - * @defaultValue `"mouse"` - */ -"pointerType"?:(Input.PointerType)})); + export type PointerParameters = { + /** + * @defaultValue `"mouse"` + */ + pointerType?: Input.PointerType; + }; } export namespace Input { -export type WheelSourceActions = (({ -"type":("wheel"),"id":(string),"actions":([ -...((Input.WheelSourceAction)[])])})); + export type WheelSourceActions = { + type: 'wheel'; + id: string; + actions: [...Input.WheelSourceAction[]]; + }; } export namespace Input { -export type PointerSourceAction = ((Input.PauseAction| Input.PointerDownAction| Input.PointerUpAction| Input.PointerMoveAction)); + export type PointerSourceAction = + | Input.PauseAction + | Input.PointerDownAction + | Input.PointerUpAction + | Input.PointerMoveAction; } export namespace Input { -export type WheelSourceAction = ((Input.PauseAction| Input.WheelScrollAction)); + export type WheelSourceAction = Input.PauseAction | Input.WheelScrollAction; } export namespace Input { -export type PauseAction = (({ -"type":("pause"),"duration"?:(JsUint)})); + export type PauseAction = { + type: 'pause'; + duration?: JsUint; + }; } export namespace Input { -export type KeyDownAction = (({ -"type":("keyDown"),"value":(string)})); + export type KeyDownAction = { + type: 'keyDown'; + value: string; + }; } export namespace Input { -export type KeyUpAction = (({ -"type":("keyUp"),"value":(string)})); + export type KeyUpAction = { + type: 'keyUp'; + value: string; + }; } export namespace Input { -export type PointerUpAction = (({ -"type":("pointerUp"),"button":(JsUint)})); + export type PointerUpAction = { + type: 'pointerUp'; + button: JsUint; + }; } export namespace Input { -export type PointerDownAction = (({ -"type":("pointerDown"),"button":(JsUint)}&Input.PointerCommonProperties)); + export type PointerDownAction = { + type: 'pointerDown'; + button: JsUint; + } & Input.PointerCommonProperties; } export namespace Input { -export type PointerMoveAction = (({ -"type":("pointerMove"),"x":(number),"y":(number),"duration"?:(JsUint),"origin"?:(Input.Origin)}&Input.PointerCommonProperties)); + export type PointerMoveAction = { + type: 'pointerMove'; + x: number; + y: number; + duration?: JsUint; + origin?: Input.Origin; + } & Input.PointerCommonProperties; } export namespace Input { -export type WheelScrollAction = (({ -"type":("scroll"),"x":(JsInt),"y":(JsInt),"deltaX":(JsInt),"deltaY":(JsInt),"duration"?:(JsUint), -/** - * @defaultValue `"viewport"` - */ -"origin"?:(Input.Origin)})); + export type WheelScrollAction = { + type: 'scroll'; + x: JsInt; + y: JsInt; + deltaX: JsInt; + deltaY: JsInt; + duration?: JsUint; + /** + * @defaultValue `"viewport"` + */ + origin?: Input.Origin; + }; } export namespace Input { -export type PointerCommonProperties = ({ - -/** - * @defaultValue `1` - */ -"width"?:(JsUint), -/** - * @defaultValue `1` - */ -"height"?:(JsUint), -/** - * @defaultValue `0` - */ -"pressure"?:(number), -/** - * @defaultValue `0` - */ -"tangentialPressure"?:(number), -/** - * Must be between `0` and `359`, inclusive. - * - * @defaultValue `0` - */ -"twist"?:((number)), -/** - * Must be between `0` and `1.5707963267948966`, inclusive. - * - * @defaultValue `0` - */ -"altitudeAngle"?:((number)), -/** - * Must be between `0` and `6.283185307179586`, inclusive. - * - * @defaultValue `0` - */ -"azimuthAngle"?:((number))}); + export type PointerCommonProperties = { + /** + * @defaultValue `1` + */ + width?: JsUint; + /** + * @defaultValue `1` + */ + height?: JsUint; + /** + * @defaultValue `0` + */ + pressure?: number; + /** + * @defaultValue `0` + */ + tangentialPressure?: number; + /** + * Must be between `0` and `359`, inclusive. + * + * @defaultValue `0` + */ + twist?: number; + /** + * Must be between `0` and `1.5707963267948966`, inclusive. + * + * @defaultValue `0` + */ + altitudeAngle?: number; + /** + * Must be between `0` and `6.283185307179586`, inclusive. + * + * @defaultValue `0` + */ + azimuthAngle?: number; + }; } export namespace Input { -export type Origin = ("viewport"| "pointer"| Input.ElementOrigin); + export type Origin = 'viewport' | 'pointer' | Input.ElementOrigin; } export namespace Input { -export type ReleaseActions = ({ -"method":("input.releaseActions"),"params":(Input.ReleaseActionsParameters)}); + export type ReleaseActions = { + method: 'input.releaseActions'; + params: Input.ReleaseActionsParameters; + }; } export namespace Input { -export type ReleaseActionsParameters = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type ReleaseActionsParameters = { + context: BrowsingContext.BrowsingContext; + }; } export namespace Input { -export type SetFiles = ({ -"method":("input.setFiles"),"params":(Input.SetFilesParameters)}); + export type SetFiles = { + method: 'input.setFiles'; + params: Input.SetFilesParameters; + }; } export namespace Input { -export type SetFilesParameters = (({ -"context":(BrowsingContext.BrowsingContext),"element":(Script.SharedReference),"files":([ -...((string)[])])})); + export type SetFilesParameters = { + context: BrowsingContext.BrowsingContext; + element: Script.SharedReference; + files: [...string[]]; + }; } export namespace Input { -export type FileDialogOpened = ({ -"method":("input.fileDialogOpened"),"params":(Input.FileDialogInfo)}); + export type FileDialogOpened = { + method: 'input.fileDialogOpened'; + params: Input.FileDialogInfo; + }; } export namespace Input { -export type FileDialogInfo = (({ -"context":(BrowsingContext.BrowsingContext),"element"?:(Script.SharedReference),"multiple":(boolean)})); -} -export type WebExtensionCommand = (WebExtension.Install| WebExtension.Uninstall); -export type WebExtensionResult = ((WebExtension.InstallResult)); + export type FileDialogInfo = { + context: BrowsingContext.BrowsingContext; + element?: Script.SharedReference; + multiple: boolean; + }; +} +export type WebExtensionCommand = WebExtension.Install | WebExtension.Uninstall; +export type WebExtensionResult = WebExtension.InstallResult; export namespace WebExtension { -export type Extension = (string); + export type Extension = string; } export namespace WebExtension { -export type InstallParameters = (({ -"extensionData":(WebExtension.ExtensionData)})); + export type InstallParameters = { + extensionData: WebExtension.ExtensionData; + }; } export namespace WebExtension { -export type Install = ({ -"method":("webExtension.install"),"params":(WebExtension.InstallParameters)}); + export type Install = { + method: 'webExtension.install'; + params: WebExtension.InstallParameters; + }; } export namespace WebExtension { -export type ExtensionData = ((WebExtension.ExtensionArchivePath| WebExtension.ExtensionBase64Encoded| WebExtension.ExtensionPath)); + export type ExtensionData = + | WebExtension.ExtensionArchivePath + | WebExtension.ExtensionBase64Encoded + | WebExtension.ExtensionPath; } export namespace WebExtension { -export type ExtensionPath = (({ -"type":("path"),"path":(string)})); + export type ExtensionPath = { + type: 'path'; + path: string; + }; } export namespace WebExtension { -export type ExtensionArchivePath = (({ -"type":("archivePath"),"path":(string)})); + export type ExtensionArchivePath = { + type: 'archivePath'; + path: string; + }; } export namespace WebExtension { -export type ExtensionBase64Encoded = (({ -"type":("base64"),"value":(string)})); + export type ExtensionBase64Encoded = { + type: 'base64'; + value: string; + }; } export namespace WebExtension { -export type InstallResult = (({ -"extension":(WebExtension.Extension)})); + export type InstallResult = { + extension: WebExtension.Extension; + }; } export namespace WebExtension { -export type Uninstall = ({ -"method":("webExtension.uninstall"),"params":(WebExtension.UninstallParameters)}); + export type Uninstall = { + method: 'webExtension.uninstall'; + params: WebExtension.UninstallParameters; + }; } export namespace WebExtension { -export type UninstallParameters = (({ -"extension":(WebExtension.Extension)})); + export type UninstallParameters = { + extension: WebExtension.Extension; + }; } diff --git a/src/gen/mapping.ts b/src/gen/mapping.ts index 45c64ff..76eee8d 100644 --- a/src/gen/mapping.ts +++ b/src/gen/mapping.ts @@ -4,429 +4,289 @@ * Do not edit this file manually. */ -import type * as Bidi from "./main.ts"; -import type * as BidiPermissions from "./permissions.ts"; -import type * as BidiBluetooth from "./web-bluetooth.ts"; +import type * as Bidi from './main.ts'; +import type * as BidiPermissions from './permissions.ts'; +import type * as BidiBluetooth from './web-bluetooth.ts'; export interface CommandMapping { - "bluetooth.disableSimulation": - { - params: BidiBluetooth.Bluetooth.DisableSimulationParameters; - returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters; - } - ; - "bluetooth.handleRequestDevicePrompt": - { - params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; - returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; - } - ; - "bluetooth.simulateAdapter": - { - params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; - returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters; - } - ; - "bluetooth.simulateAdvertisement": - { - params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; - returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; - } - ; - "bluetooth.simulateCharacteristic": - { - params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; - returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; - } - ; - "bluetooth.simulateCharacteristicResponse": - { - params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; - returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; - } - ; - "bluetooth.simulateDescriptor": - { - params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; - returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; - } - ; - "bluetooth.simulateDescriptorResponse": - { - params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; - returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; - } - ; - "bluetooth.simulateGattConnectionResponse": - { - params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; - returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; - } - ; - "bluetooth.simulateGattDisconnection": - { - params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; - returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; - } - ; - "bluetooth.simulatePreconnectedPeripheral": - { - params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; - returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; - } - ; - "bluetooth.simulateService": - { - params: BidiBluetooth.Bluetooth.SimulateServiceParameters; - returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters; - } - ; - "browser.close": - { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - } - ; - "browser.createUserContext": - { - params: Bidi.Browser.CreateUserContextParameters; - returnType: Bidi.Browser.CreateUserContextParameters; - } - ; - "browser.getClientWindows": - { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - } - ; - "browser.getUserContexts": - { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - } - ; - "browser.removeUserContext": - { - params: Bidi.Browser.RemoveUserContextParameters; - returnType: Bidi.Browser.RemoveUserContextParameters; - } - ; - "browser.setClientWindowState": - { - params: Bidi.Browser.SetClientWindowStateParameters; - returnType: Bidi.Browser.SetClientWindowStateParameters; - } - ; - "browsingContext.activate": - { - params: Bidi.BrowsingContext.ActivateParameters; - returnType: Bidi.BrowsingContext.ActivateParameters; - } - ; - "browsingContext.captureScreenshot": - { - params: Bidi.BrowsingContext.CaptureScreenshotParameters; - returnType: Bidi.BrowsingContext.CaptureScreenshotParameters; - } - ; - "browsingContext.close": - { - params: Bidi.BrowsingContext.CloseParameters; - returnType: Bidi.BrowsingContext.CloseParameters; - } - ; - "browsingContext.create": - { - params: Bidi.BrowsingContext.CreateParameters; - returnType: Bidi.BrowsingContext.CreateParameters; - } - ; - "browsingContext.getTree": - { - params: Bidi.BrowsingContext.GetTreeParameters; - returnType: Bidi.BrowsingContext.GetTreeParameters; - } - ; - "browsingContext.handleUserPrompt": - { - params: Bidi.BrowsingContext.HandleUserPromptParameters; - returnType: Bidi.BrowsingContext.HandleUserPromptParameters; - } - ; - "browsingContext.locateNodes": - { - params: Bidi.BrowsingContext.LocateNodesParameters; - returnType: Bidi.BrowsingContext.LocateNodesParameters; - } - ; - "browsingContext.navigate": - { - params: Bidi.BrowsingContext.NavigateParameters; - returnType: Bidi.BrowsingContext.NavigateParameters; - } - ; - "browsingContext.print": - { - params: Bidi.BrowsingContext.PrintParameters; - returnType: Bidi.BrowsingContext.PrintParameters; - } - ; - "browsingContext.reload": - { - params: Bidi.BrowsingContext.ReloadParameters; - returnType: Bidi.BrowsingContext.ReloadParameters; - } - ; - "browsingContext.setViewport": - { - params: Bidi.BrowsingContext.SetViewportParameters; - returnType: Bidi.BrowsingContext.SetViewportParameters; - } - ; - "browsingContext.traverseHistory": - { - params: Bidi.BrowsingContext.TraverseHistoryParameters; - returnType: Bidi.BrowsingContext.TraverseHistoryParameters; - } - ; - "emulation.setForcedColorsModeThemeOverride": - { - params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; - returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; - } - ; - "emulation.setGeolocationOverride": - { - params: Bidi.Emulation.SetGeolocationOverrideParameters; - returnType: Bidi.Emulation.SetGeolocationOverrideParameters; - } - ; - "emulation.setLocaleOverride": - { - params: Bidi.Emulation.SetLocaleOverrideParameters; - returnType: Bidi.Emulation.SetLocaleOverrideParameters; - } - ; - "emulation.setScreenOrientationOverride": - { - params: Bidi.Emulation.SetScreenOrientationOverrideParameters; - returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters; - } - ; - "emulation.setScriptingEnabled": - { - params: Bidi.Emulation.SetScriptingEnabledParameters; - returnType: Bidi.Emulation.SetScriptingEnabledParameters; - } - ; - "emulation.setTimezoneOverride": - { - params: Bidi.Emulation.SetTimezoneOverrideParameters; - returnType: Bidi.Emulation.SetTimezoneOverrideParameters; - } - ; - "emulation.setUserAgentOverride": - { - params: Bidi.Emulation.SetUserAgentOverrideParameters; - returnType: Bidi.Emulation.SetUserAgentOverrideParameters; - } - ; - "input.performActions": - { - params: Bidi.Input.PerformActionsParameters; - returnType: Bidi.Input.PerformActionsParameters; - } - ; - "input.releaseActions": - { - params: Bidi.Input.ReleaseActionsParameters; - returnType: Bidi.Input.ReleaseActionsParameters; - } - ; - "input.setFiles": - { - params: Bidi.Input.SetFilesParameters; - returnType: Bidi.Input.SetFilesParameters; - } - ; - "network.addDataCollector": - { - params: Bidi.Network.AddDataCollectorParameters; - returnType: Bidi.Network.AddDataCollectorParameters; - } - ; - "network.addIntercept": - { - params: Bidi.Network.AddInterceptParameters; - returnType: Bidi.Network.AddInterceptParameters; - } - ; - "network.continueRequest": - { - params: Bidi.Network.ContinueRequestParameters; - returnType: Bidi.Network.ContinueRequestParameters; - } - ; - "network.continueResponse": - { - params: Bidi.Network.ContinueResponseParameters; - returnType: Bidi.Network.ContinueResponseParameters; - } - ; - "network.continueWithAuth": - { - params: Bidi.Network.ContinueWithAuthParameters; - returnType: Bidi.Network.ContinueWithAuthParameters; - } - ; - "network.disownData": - { - params: Bidi.Network.DisownDataParameters; - returnType: Bidi.Network.DisownDataParameters; - } - ; - "network.failRequest": - { - params: Bidi.Network.FailRequestParameters; - returnType: Bidi.Network.FailRequestParameters; - } - ; - "network.getData": - { - params: Bidi.Network.GetDataParameters; - returnType: Bidi.Network.GetDataParameters; - } - ; - "network.provideResponse": - { - params: Bidi.Network.ProvideResponseParameters; - returnType: Bidi.Network.ProvideResponseParameters; - } - ; - "network.removeDataCollector": - { - params: Bidi.Network.RemoveDataCollectorParameters; - returnType: Bidi.Network.RemoveDataCollectorParameters; - } - ; - "network.removeIntercept": - { - params: Bidi.Network.RemoveInterceptParameters; - returnType: Bidi.Network.RemoveInterceptParameters; - } - ; - "network.setCacheBehavior": - { - params: Bidi.Network.SetCacheBehaviorParameters; - returnType: Bidi.Network.SetCacheBehaviorParameters; - } - ; - "network.setExtraHeaders": - { - params: Bidi.Network.SetExtraHeadersParameters; - returnType: Bidi.Network.SetExtraHeadersParameters; - } - ; - "permissions.setPermission": - { - params: BidiPermissions.Permissions.SetPermissionParameters; - returnType: BidiPermissions.Permissions.SetPermissionParameters; - } - ; - "script.addPreloadScript": - { - params: Bidi.Script.AddPreloadScriptParameters; - returnType: Bidi.Script.AddPreloadScriptParameters; - } - ; - "script.callFunction": - { - params: Bidi.Script.CallFunctionParameters; - returnType: Bidi.Script.CallFunctionParameters; - } - ; - "script.disown": - { - params: Bidi.Script.DisownParameters; - returnType: Bidi.Script.DisownParameters; - } - ; - "script.evaluate": - { - params: Bidi.Script.EvaluateParameters; - returnType: Bidi.Script.EvaluateParameters; - } - ; - "script.getRealms": - { - params: Bidi.Script.GetRealmsParameters; - returnType: Bidi.Script.GetRealmsParameters; - } - ; - "script.removePreloadScript": - { - params: Bidi.Script.RemovePreloadScriptParameters; - returnType: Bidi.Script.RemovePreloadScriptParameters; - } - ; - "session.end": - { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - } - ; - "session.new": - { - params: Bidi.Session.NewParameters; - returnType: Bidi.Session.NewParameters; - } - ; - "session.status": - { - params: Bidi.Extensible; - returnType: Bidi.Extensible; - } - ; - "session.subscribe": - { - params: Bidi.Session.SubscriptionRequest; - returnType: Bidi.Session.SubscriptionRequest; - } - ; - "session.unsubscribe": - { - params: Bidi.Session.UnsubscribeParameters; - returnType: Bidi.Session.UnsubscribeParameters; - } - ; - "storage.deleteCookies": - { - params: Bidi.Storage.DeleteCookiesParameters; - returnType: Bidi.Storage.DeleteCookiesParameters; - } - ; - "storage.getCookies": - { - params: Bidi.Storage.GetCookiesParameters; - returnType: Bidi.Storage.GetCookiesParameters; - } - ; - "storage.setCookie": - { - params: Bidi.Storage.SetCookieParameters; - returnType: Bidi.Storage.SetCookieParameters; - } - ; - "webExtension.install": - { - params: Bidi.WebExtension.InstallParameters; - returnType: Bidi.WebExtension.InstallParameters; - } - ; - "webExtension.uninstall": - { - params: Bidi.WebExtension.UninstallParameters; - returnType: Bidi.WebExtension.UninstallParameters; - } - ; + 'bluetooth.disableSimulation': { + params: BidiBluetooth.Bluetooth.DisableSimulationParameters; + returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters; + }; + 'bluetooth.handleRequestDevicePrompt': { + params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters; + }; + 'bluetooth.simulateAdapter': { + params: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters; + }; + 'bluetooth.simulateAdvertisement': { + params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters; + }; + 'bluetooth.simulateCharacteristic': { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters; + }; + 'bluetooth.simulateCharacteristicResponse': { + params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters; + }; + 'bluetooth.simulateDescriptor': { + params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters; + }; + 'bluetooth.simulateDescriptorResponse': { + params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters; + }; + 'bluetooth.simulateGattConnectionResponse': { + params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters; + }; + 'bluetooth.simulateGattDisconnection': { + params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters; + }; + 'bluetooth.simulatePreconnectedPeripheral': { + params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters; + }; + 'bluetooth.simulateService': { + params: BidiBluetooth.Bluetooth.SimulateServiceParameters; + returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters; + }; + 'browser.close': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'browser.createUserContext': { + params: Bidi.Browser.CreateUserContextParameters; + returnType: Bidi.Browser.CreateUserContextParameters; + }; + 'browser.getClientWindows': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'browser.getUserContexts': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'browser.removeUserContext': { + params: Bidi.Browser.RemoveUserContextParameters; + returnType: Bidi.Browser.RemoveUserContextParameters; + }; + 'browser.setClientWindowState': { + params: Bidi.Browser.SetClientWindowStateParameters; + returnType: Bidi.Browser.SetClientWindowStateParameters; + }; + 'browsingContext.activate': { + params: Bidi.BrowsingContext.ActivateParameters; + returnType: Bidi.BrowsingContext.ActivateParameters; + }; + 'browsingContext.captureScreenshot': { + params: Bidi.BrowsingContext.CaptureScreenshotParameters; + returnType: Bidi.BrowsingContext.CaptureScreenshotParameters; + }; + 'browsingContext.close': { + params: Bidi.BrowsingContext.CloseParameters; + returnType: Bidi.BrowsingContext.CloseParameters; + }; + 'browsingContext.create': { + params: Bidi.BrowsingContext.CreateParameters; + returnType: Bidi.BrowsingContext.CreateParameters; + }; + 'browsingContext.getTree': { + params: Bidi.BrowsingContext.GetTreeParameters; + returnType: Bidi.BrowsingContext.GetTreeParameters; + }; + 'browsingContext.handleUserPrompt': { + params: Bidi.BrowsingContext.HandleUserPromptParameters; + returnType: Bidi.BrowsingContext.HandleUserPromptParameters; + }; + 'browsingContext.locateNodes': { + params: Bidi.BrowsingContext.LocateNodesParameters; + returnType: Bidi.BrowsingContext.LocateNodesParameters; + }; + 'browsingContext.navigate': { + params: Bidi.BrowsingContext.NavigateParameters; + returnType: Bidi.BrowsingContext.NavigateParameters; + }; + 'browsingContext.print': { + params: Bidi.BrowsingContext.PrintParameters; + returnType: Bidi.BrowsingContext.PrintParameters; + }; + 'browsingContext.reload': { + params: Bidi.BrowsingContext.ReloadParameters; + returnType: Bidi.BrowsingContext.ReloadParameters; + }; + 'browsingContext.setViewport': { + params: Bidi.BrowsingContext.SetViewportParameters; + returnType: Bidi.BrowsingContext.SetViewportParameters; + }; + 'browsingContext.traverseHistory': { + params: Bidi.BrowsingContext.TraverseHistoryParameters; + returnType: Bidi.BrowsingContext.TraverseHistoryParameters; + }; + 'emulation.setForcedColorsModeThemeOverride': { + params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters; + }; + 'emulation.setGeolocationOverride': { + params: Bidi.Emulation.SetGeolocationOverrideParameters; + returnType: Bidi.Emulation.SetGeolocationOverrideParameters; + }; + 'emulation.setLocaleOverride': { + params: Bidi.Emulation.SetLocaleOverrideParameters; + returnType: Bidi.Emulation.SetLocaleOverrideParameters; + }; + 'emulation.setScreenOrientationOverride': { + params: Bidi.Emulation.SetScreenOrientationOverrideParameters; + returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters; + }; + 'emulation.setScriptingEnabled': { + params: Bidi.Emulation.SetScriptingEnabledParameters; + returnType: Bidi.Emulation.SetScriptingEnabledParameters; + }; + 'emulation.setTimezoneOverride': { + params: Bidi.Emulation.SetTimezoneOverrideParameters; + returnType: Bidi.Emulation.SetTimezoneOverrideParameters; + }; + 'emulation.setUserAgentOverride': { + params: Bidi.Emulation.SetUserAgentOverrideParameters; + returnType: Bidi.Emulation.SetUserAgentOverrideParameters; + }; + 'input.performActions': { + params: Bidi.Input.PerformActionsParameters; + returnType: Bidi.Input.PerformActionsParameters; + }; + 'input.releaseActions': { + params: Bidi.Input.ReleaseActionsParameters; + returnType: Bidi.Input.ReleaseActionsParameters; + }; + 'input.setFiles': { + params: Bidi.Input.SetFilesParameters; + returnType: Bidi.Input.SetFilesParameters; + }; + 'network.addDataCollector': { + params: Bidi.Network.AddDataCollectorParameters; + returnType: Bidi.Network.AddDataCollectorParameters; + }; + 'network.addIntercept': { + params: Bidi.Network.AddInterceptParameters; + returnType: Bidi.Network.AddInterceptParameters; + }; + 'network.continueRequest': { + params: Bidi.Network.ContinueRequestParameters; + returnType: Bidi.Network.ContinueRequestParameters; + }; + 'network.continueResponse': { + params: Bidi.Network.ContinueResponseParameters; + returnType: Bidi.Network.ContinueResponseParameters; + }; + 'network.continueWithAuth': { + params: Bidi.Network.ContinueWithAuthParameters; + returnType: Bidi.Network.ContinueWithAuthParameters; + }; + 'network.disownData': { + params: Bidi.Network.DisownDataParameters; + returnType: Bidi.Network.DisownDataParameters; + }; + 'network.failRequest': { + params: Bidi.Network.FailRequestParameters; + returnType: Bidi.Network.FailRequestParameters; + }; + 'network.getData': { + params: Bidi.Network.GetDataParameters; + returnType: Bidi.Network.GetDataParameters; + }; + 'network.provideResponse': { + params: Bidi.Network.ProvideResponseParameters; + returnType: Bidi.Network.ProvideResponseParameters; + }; + 'network.removeDataCollector': { + params: Bidi.Network.RemoveDataCollectorParameters; + returnType: Bidi.Network.RemoveDataCollectorParameters; + }; + 'network.removeIntercept': { + params: Bidi.Network.RemoveInterceptParameters; + returnType: Bidi.Network.RemoveInterceptParameters; + }; + 'network.setCacheBehavior': { + params: Bidi.Network.SetCacheBehaviorParameters; + returnType: Bidi.Network.SetCacheBehaviorParameters; + }; + 'network.setExtraHeaders': { + params: Bidi.Network.SetExtraHeadersParameters; + returnType: Bidi.Network.SetExtraHeadersParameters; + }; + 'permissions.setPermission': { + params: BidiPermissions.Permissions.SetPermissionParameters; + returnType: BidiPermissions.Permissions.SetPermissionParameters; + }; + 'script.addPreloadScript': { + params: Bidi.Script.AddPreloadScriptParameters; + returnType: Bidi.Script.AddPreloadScriptParameters; + }; + 'script.callFunction': { + params: Bidi.Script.CallFunctionParameters; + returnType: Bidi.Script.CallFunctionParameters; + }; + 'script.disown': { + params: Bidi.Script.DisownParameters; + returnType: Bidi.Script.DisownParameters; + }; + 'script.evaluate': { + params: Bidi.Script.EvaluateParameters; + returnType: Bidi.Script.EvaluateParameters; + }; + 'script.getRealms': { + params: Bidi.Script.GetRealmsParameters; + returnType: Bidi.Script.GetRealmsParameters; + }; + 'script.removePreloadScript': { + params: Bidi.Script.RemovePreloadScriptParameters; + returnType: Bidi.Script.RemovePreloadScriptParameters; + }; + 'session.end': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'session.new': { + params: Bidi.Session.NewParameters; + returnType: Bidi.Session.NewParameters; + }; + 'session.status': { + params: Bidi.Extensible; + returnType: Bidi.Extensible; + }; + 'session.subscribe': { + params: Bidi.Session.SubscriptionRequest; + returnType: Bidi.Session.SubscriptionRequest; + }; + 'session.unsubscribe': { + params: Bidi.Session.UnsubscribeParameters; + returnType: Bidi.Session.UnsubscribeParameters; + }; + 'storage.deleteCookies': { + params: Bidi.Storage.DeleteCookiesParameters; + returnType: Bidi.Storage.DeleteCookiesParameters; + }; + 'storage.getCookies': { + params: Bidi.Storage.GetCookiesParameters; + returnType: Bidi.Storage.GetCookiesParameters; + }; + 'storage.setCookie': { + params: Bidi.Storage.SetCookieParameters; + returnType: Bidi.Storage.SetCookieParameters; + }; + 'webExtension.install': { + params: Bidi.WebExtension.InstallParameters; + returnType: Bidi.WebExtension.InstallParameters; + }; + 'webExtension.uninstall': { + params: Bidi.WebExtension.UninstallParameters; + returnType: Bidi.WebExtension.UninstallParameters; + }; } diff --git a/src/gen/permissions.ts b/src/gen/permissions.ts index 6692483..3369343 100644 --- a/src/gen/permissions.ts +++ b/src/gen/permissions.ts @@ -1,19 +1,27 @@ -export type PermissionsCommand = (Permissions.SetPermission); +export type PermissionsCommand = Permissions.SetPermission; export namespace Permissions { -export type PermissionDescriptor = (({ -"name":(string)})); + export type PermissionDescriptor = { + name: string; + }; } export namespace Permissions { -export const enum PermissionState {Granted = "granted", -Denied = "denied", -Prompt = "prompt", -} + export const enum PermissionState { + Granted = 'granted', + Denied = 'denied', + Prompt = 'prompt', + } } export namespace Permissions { -export type SetPermission = ({ -"method":("permissions.setPermission"),"params":(Permissions.SetPermissionParameters)}); + export type SetPermission = { + method: 'permissions.setPermission'; + params: Permissions.SetPermissionParameters; + }; } export namespace Permissions { -export type SetPermissionParameters = (({ -"descriptor":(Permissions.PermissionDescriptor),"state":(Permissions.PermissionState),"origin":(string),"userContext"?:(string)})); + export type SetPermissionParameters = { + descriptor: Permissions.PermissionDescriptor; + state: Permissions.PermissionState; + origin: string; + userContext?: string; + }; } diff --git a/src/gen/web-bluetooth.ts b/src/gen/web-bluetooth.ts index ab7aaeb..f45b08e 100644 --- a/src/gen/web-bluetooth.ts +++ b/src/gen/web-bluetooth.ts @@ -1,177 +1,315 @@ export namespace Bluetooth { -export type BluetoothUuid = (string); + export type BluetoothUuid = string; } export namespace Bluetooth { -export type BluetoothManufacturerData = (({ -"key":(number),"data":(string)})); + export type BluetoothManufacturerData = { + key: number; + data: string; + }; } export namespace Bluetooth { -export type CharacteristicProperties = (({ -"broadcast"?:(boolean),"read"?:(boolean),"writeWithoutResponse"?:(boolean),"write"?:(boolean),"notify"?:(boolean),"indicate"?:(boolean),"authenticatedSignedWrites"?:(boolean),"extendedProperties"?:(boolean)})); + export type CharacteristicProperties = { + broadcast?: boolean; + read?: boolean; + writeWithoutResponse?: boolean; + write?: boolean; + notify?: boolean; + indicate?: boolean; + authenticatedSignedWrites?: boolean; + extendedProperties?: boolean; + }; } export namespace Bluetooth { -export type RequestDevice = (string); + export type RequestDevice = string; } export namespace Bluetooth { -export type RequestDeviceInfo = (({ -"id":(Bluetooth.RequestDevice),"name":(string| null)})); + export type RequestDeviceInfo = { + id: Bluetooth.RequestDevice; + name: string | null; + }; } export namespace Bluetooth { -export type RequestDevicePrompt = (string); + export type RequestDevicePrompt = string; } export namespace Bluetooth { -export type ScanRecord = (({ -"name"?:(string),"uuids"?:([ -...((Bluetooth.BluetoothUuid)[])]),"appearance"?:(number),"manufacturerData"?:([ -...((Bluetooth.BluetoothManufacturerData)[])])})); + export type ScanRecord = { + name?: string; + uuids?: [...Bluetooth.BluetoothUuid[]]; + appearance?: number; + manufacturerData?: [...Bluetooth.BluetoothManufacturerData[]]; + }; } -export type BluetoothCommand = (Bluetooth.HandleRequestDevicePrompt| Bluetooth.SimulateAdapter| Bluetooth.DisableSimulation| Bluetooth.SimulatePreconnectedPeripheral| Bluetooth.SimulateAdvertisement| Bluetooth.SimulateGattConnectionResponse| Bluetooth.SimulateGattDisconnection| Bluetooth.SimulateService| Bluetooth.SimulateCharacteristic| Bluetooth.SimulateCharacteristicResponse| Bluetooth.SimulateDescriptor| Bluetooth.SimulateDescriptorResponse| Record -); +export type BluetoothCommand = + | Bluetooth.HandleRequestDevicePrompt + | Bluetooth.SimulateAdapter + | Bluetooth.DisableSimulation + | Bluetooth.SimulatePreconnectedPeripheral + | Bluetooth.SimulateAdvertisement + | Bluetooth.SimulateGattConnectionResponse + | Bluetooth.SimulateGattDisconnection + | Bluetooth.SimulateService + | Bluetooth.SimulateCharacteristic + | Bluetooth.SimulateCharacteristicResponse + | Bluetooth.SimulateDescriptor + | Bluetooth.SimulateDescriptorResponse + | Record; export namespace Bluetooth { -export type HandleRequestDevicePrompt = ({ -"method":("bluetooth.handleRequestDevicePrompt"),"params":(Bluetooth.HandleRequestDevicePromptParameters)}); + export type HandleRequestDevicePrompt = { + method: 'bluetooth.handleRequestDevicePrompt'; + params: Bluetooth.HandleRequestDevicePromptParameters; + }; } export namespace Bluetooth { -export type HandleRequestDevicePromptParameters = (({ -"context":(string),"prompt":(Bluetooth.RequestDevicePrompt)}&(Bluetooth.HandleRequestDevicePromptAcceptParameters| Bluetooth.HandleRequestDevicePromptCancelParameters))); + export type HandleRequestDevicePromptParameters = { + context: string; + prompt: Bluetooth.RequestDevicePrompt; + } & ( + | Bluetooth.HandleRequestDevicePromptAcceptParameters + | Bluetooth.HandleRequestDevicePromptCancelParameters + ); } export namespace Bluetooth { -export type HandleRequestDevicePromptAcceptParameters = ({ -"accept":(true),"device":(Bluetooth.RequestDevice)}); + export type HandleRequestDevicePromptAcceptParameters = { + accept: true; + device: Bluetooth.RequestDevice; + }; } export namespace Bluetooth { -export type HandleRequestDevicePromptCancelParameters = ({ -"accept":(false)}); + export type HandleRequestDevicePromptCancelParameters = { + accept: false; + }; } export namespace Bluetooth { -export type SimulateAdapter = ({ -"method":("bluetooth.simulateAdapter"),"params":(Bluetooth.SimulateAdapterParameters)}); + export type SimulateAdapter = { + method: 'bluetooth.simulateAdapter'; + params: Bluetooth.SimulateAdapterParameters; + }; } export namespace Bluetooth { -export type SimulateAdapterParameters = (({ -"context":(string),"leSupported"?:(boolean),"state":("absent"| "powered-off"| "powered-on")})); + export type SimulateAdapterParameters = { + context: string; + leSupported?: boolean; + state: 'absent' | 'powered-off' | 'powered-on'; + }; } export namespace Bluetooth { -export type DisableSimulation = ({ -"method":("bluetooth.disableSimulation"),"params":(Bluetooth.DisableSimulationParameters)}); + export type DisableSimulation = { + method: 'bluetooth.disableSimulation'; + params: Bluetooth.DisableSimulationParameters; + }; } export namespace Bluetooth { -export type DisableSimulationParameters = (({ -"context":(string)})); + export type DisableSimulationParameters = { + context: string; + }; } export namespace Bluetooth { -export type SimulatePreconnectedPeripheral = ({ -"method":("bluetooth.simulatePreconnectedPeripheral"),"params":(Bluetooth.SimulatePreconnectedPeripheralParameters)}); + export type SimulatePreconnectedPeripheral = { + method: 'bluetooth.simulatePreconnectedPeripheral'; + params: Bluetooth.SimulatePreconnectedPeripheralParameters; + }; } export namespace Bluetooth { -export type SimulatePreconnectedPeripheralParameters = (({ -"context":(string),"address":(string),"name":(string),"manufacturerData":([ -...((Bluetooth.BluetoothManufacturerData)[])]),"knownServiceUuids":([ -...((Bluetooth.BluetoothUuid)[])])})); + export type SimulatePreconnectedPeripheralParameters = { + context: string; + address: string; + name: string; + manufacturerData: [...Bluetooth.BluetoothManufacturerData[]]; + knownServiceUuids: [...Bluetooth.BluetoothUuid[]]; + }; } export namespace Bluetooth { -export type SimulateAdvertisement = ({ -"method":("bluetooth.simulateAdvertisement"),"params":(Bluetooth.SimulateAdvertisementParameters)}); + export type SimulateAdvertisement = { + method: 'bluetooth.simulateAdvertisement'; + params: Bluetooth.SimulateAdvertisementParameters; + }; } export namespace Bluetooth { -export type SimulateAdvertisementParameters = (({ -"context":(string),"scanEntry":(Bluetooth.SimulateAdvertisementScanEntryParameters)})); + export type SimulateAdvertisementParameters = { + context: string; + scanEntry: Bluetooth.SimulateAdvertisementScanEntryParameters; + }; } export namespace Bluetooth { -export type SimulateAdvertisementScanEntryParameters = (({ -"deviceAddress":(string),"rssi":(number),"scanRecord":(Bluetooth.ScanRecord)})); + export type SimulateAdvertisementScanEntryParameters = { + deviceAddress: string; + rssi: number; + scanRecord: Bluetooth.ScanRecord; + }; } export namespace Bluetooth { -export type SimulateGattConnectionResponse = ({ -"method":("bluetooth.simulateGattConnectionResponse"),"params":(Bluetooth.SimulateGattConnectionResponseParameters)}); + export type SimulateGattConnectionResponse = { + method: 'bluetooth.simulateGattConnectionResponse'; + params: Bluetooth.SimulateGattConnectionResponseParameters; + }; } export namespace Bluetooth { -export type SimulateGattConnectionResponseParameters = (({ -"context":(string),"address":(string),"code":(number)})); + export type SimulateGattConnectionResponseParameters = { + context: string; + address: string; + code: number; + }; } export namespace Bluetooth { -export type SimulateGattDisconnection = ({ -"method":("bluetooth.simulateGattDisconnection"),"params":(Bluetooth.SimulateGattDisconnectionParameters)}); + export type SimulateGattDisconnection = { + method: 'bluetooth.simulateGattDisconnection'; + params: Bluetooth.SimulateGattDisconnectionParameters; + }; } export namespace Bluetooth { -export type SimulateGattDisconnectionParameters = (({ -"context":(string),"address":(string)})); + export type SimulateGattDisconnectionParameters = { + context: string; + address: string; + }; } export namespace Bluetooth { -export type SimulateService = ({ -"method":("bluetooth.simulateService"),"params":(Bluetooth.SimulateServiceParameters)}); + export type SimulateService = { + method: 'bluetooth.simulateService'; + params: Bluetooth.SimulateServiceParameters; + }; } export namespace Bluetooth { -export type SimulateServiceParameters = (({ -"context":(string),"address":(string),"uuid":(Bluetooth.BluetoothUuid),"type":("add"| "remove")})); + export type SimulateServiceParameters = { + context: string; + address: string; + uuid: Bluetooth.BluetoothUuid; + type: 'add' | 'remove'; + }; } export namespace Bluetooth { -export type SimulateCharacteristic = ({ -"method":("bluetooth.simulateCharacteristic"),"params":(Bluetooth.SimulateCharacteristicParameters)}); + export type SimulateCharacteristic = { + method: 'bluetooth.simulateCharacteristic'; + params: Bluetooth.SimulateCharacteristicParameters; + }; } export namespace Bluetooth { -export type SimulateCharacteristicParameters = (({ -"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"characteristicProperties"?:(Bluetooth.CharacteristicProperties),"type":("add"| "remove")})); + export type SimulateCharacteristicParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + characteristicProperties?: Bluetooth.CharacteristicProperties; + type: 'add' | 'remove'; + }; } export namespace Bluetooth { -export type SimulateCharacteristicResponse = ({ -"method":("bluetooth.simulateCharacteristicResponse"),"params":(Bluetooth.SimulateCharacteristicResponseParameters)}); + export type SimulateCharacteristicResponse = { + method: 'bluetooth.simulateCharacteristicResponse'; + params: Bluetooth.SimulateCharacteristicResponseParameters; + }; } export namespace Bluetooth { -export type SimulateCharacteristicResponseParameters = (({ -"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write"| "subscribe-to-notifications"| "unsubscribe-from-notifications"),"code":(number),"data"?:([ -...((number)[])])})); + export type SimulateCharacteristicResponseParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + type: + | 'read' + | 'write' + | 'subscribe-to-notifications' + | 'unsubscribe-from-notifications'; + code: number; + data?: [...number[]]; + }; } export namespace Bluetooth { -export type SimulateDescriptor = ({ -"method":("bluetooth.simulateDescriptor"),"params":(Bluetooth.SimulateDescriptorParameters)}); + export type SimulateDescriptor = { + method: 'bluetooth.simulateDescriptor'; + params: Bluetooth.SimulateDescriptorParameters; + }; } export namespace Bluetooth { -export type SimulateDescriptorParameters = (({ -"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"descriptorUuid":(Bluetooth.BluetoothUuid),"type":("add"| "remove")})); + export type SimulateDescriptorParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + descriptorUuid: Bluetooth.BluetoothUuid; + type: 'add' | 'remove'; + }; } export namespace Bluetooth { -export type SimulateDescriptorResponse = ({ -"method":("bluetooth.simulateDescriptorResponse"),"params":(Bluetooth.SimulateDescriptorResponseParameters)}); + export type SimulateDescriptorResponse = { + method: 'bluetooth.simulateDescriptorResponse'; + params: Bluetooth.SimulateDescriptorResponseParameters; + }; } export namespace Bluetooth { -export type SimulateDescriptorResponseParameters = (({ -"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"descriptorUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write"),"code":(number),"data"?:([ -...((number)[])])})); -} -export type BluetoothEvent = (Bluetooth.RequestDevicePromptUpdated| Bluetooth.GattConnectionAttempted); -export namespace Bluetooth { -export type RequestDevicePromptUpdated = ({ -"method":("bluetooth.requestDevicePromptUpdated"),"params":(Bluetooth.RequestDevicePromptUpdatedParameters)}); -} -export namespace Bluetooth { -export type RequestDevicePromptUpdatedParameters = (({ -"context":(string),"prompt":(Bluetooth.RequestDevicePrompt),"devices":([ -...((Bluetooth.RequestDeviceInfo)[])])})); -} -export namespace Bluetooth { -export type GattConnectionAttempted = ({ -"method":("bluetooth.gattConnectionAttempted"),"params":(Bluetooth.GattConnectionAttemptedParameters)}); -} -export namespace Bluetooth { -export type GattConnectionAttemptedParameters = (({ -"context":(string),"address":(string)})); -} -export namespace Bluetooth { -export type CharacteristicEventGenerated = ({ -"method":("bluetooth.characteristicEventGenerated"),"params":(Bluetooth.CharacteristicEventGeneratedParameters)}); -} -export namespace Bluetooth { -export type CharacteristicEventGeneratedParameters = (({ -"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write-with-response"| "write-without-response"| "subscribe-to-notifications"| "unsubscribe-from-notifications"),"data"?:([ -...((number)[])])})); -} -export namespace Bluetooth { -export type DescriptorEventGenerated = ({ -"method":("bluetooth.descriptorEventGenerated"),"params":(Bluetooth.DescriptorEventGeneratedParameters)}); -} -export namespace Bluetooth { -export type DescriptorEventGeneratedParameters = (({ -"context":(string),"address":(string),"serviceUuid":(Bluetooth.BluetoothUuid),"characteristicUuid":(Bluetooth.BluetoothUuid),"descriptorUuid":(Bluetooth.BluetoothUuid),"type":("read"| "write"),"data"?:([ -...((number)[])])})); + export type SimulateDescriptorResponseParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + descriptorUuid: Bluetooth.BluetoothUuid; + type: 'read' | 'write'; + code: number; + data?: [...number[]]; + }; +} +export type BluetoothEvent = + | Bluetooth.RequestDevicePromptUpdated + | Bluetooth.GattConnectionAttempted; +export namespace Bluetooth { + export type RequestDevicePromptUpdated = { + method: 'bluetooth.requestDevicePromptUpdated'; + params: Bluetooth.RequestDevicePromptUpdatedParameters; + }; +} +export namespace Bluetooth { + export type RequestDevicePromptUpdatedParameters = { + context: string; + prompt: Bluetooth.RequestDevicePrompt; + devices: [...Bluetooth.RequestDeviceInfo[]]; + }; +} +export namespace Bluetooth { + export type GattConnectionAttempted = { + method: 'bluetooth.gattConnectionAttempted'; + params: Bluetooth.GattConnectionAttemptedParameters; + }; +} +export namespace Bluetooth { + export type GattConnectionAttemptedParameters = { + context: string; + address: string; + }; +} +export namespace Bluetooth { + export type CharacteristicEventGenerated = { + method: 'bluetooth.characteristicEventGenerated'; + params: Bluetooth.CharacteristicEventGeneratedParameters; + }; +} +export namespace Bluetooth { + export type CharacteristicEventGeneratedParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + type: + | 'read' + | 'write-with-response' + | 'write-without-response' + | 'subscribe-to-notifications' + | 'unsubscribe-from-notifications'; + data?: [...number[]]; + }; +} +export namespace Bluetooth { + export type DescriptorEventGenerated = { + method: 'bluetooth.descriptorEventGenerated'; + params: Bluetooth.DescriptorEventGeneratedParameters; + }; +} +export namespace Bluetooth { + export type DescriptorEventGeneratedParameters = { + context: string; + address: string; + serviceUuid: Bluetooth.BluetoothUuid; + characteristicUuid: Bluetooth.BluetoothUuid; + descriptorUuid: Bluetooth.BluetoothUuid; + type: 'read' | 'write'; + data?: [...number[]]; + }; } From 7a3a83ec6aa91073b226d53ab6674b38f0439d51 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 20:04:30 +0200 Subject: [PATCH 3/9] fix --- out/commands.d.ts | 11 ----------- out/commands.js | 37 ------------------------------------- out/events.d.ts | 15 --------------- out/events.js | 2 -- out/index.d.ts | 20 ++++++++++++++++++-- src/commands.ts | 24 ------------------------ src/events.ts | 18 ------------------ src/index.ts | 27 ++++++++++++++++++++++++--- 8 files changed, 42 insertions(+), 112 deletions(-) delete mode 100644 out/commands.d.ts delete mode 100644 out/commands.js delete mode 100644 out/events.d.ts delete mode 100644 out/events.js delete mode 100644 src/commands.ts delete mode 100644 src/events.ts diff --git a/out/commands.d.ts b/out/commands.d.ts deleted file mode 100644 index 43fd41c..0000000 --- a/out/commands.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright 2025 Google Inc. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as Bidi from './gen/main.js'; -export * from './gen/main.js'; -export * from './gen/permissions.js'; -export * from './gen/web-bluetooth.js'; -export type Result = Bidi.ResultData; -export type Command = Bidi.Command; diff --git a/out/commands.js b/out/commands.js deleted file mode 100644 index 5cffe81..0000000 --- a/out/commands.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if ( - !desc || - ('get' in desc ? !m.__esModule : desc.writable || desc.configurable) - ) { - desc = { - enumerable: true, - get: function () { - return m[k]; - }, - }; - } - Object.defineProperty(o, k2, desc); - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) - if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) - __createBinding(exports, m, p); - }; -Object.defineProperty(exports, '__esModule', {value: true}); -__exportStar(require('./gen/main.js'), exports); -__exportStar(require('./gen/permissions.js'), exports); -__exportStar(require('./gen/web-bluetooth.js'), exports); -// | ExternalSpecCommand -// | ExternalSpecCommand; diff --git a/out/events.d.ts b/out/events.d.ts deleted file mode 100644 index b54f53e..0000000 --- a/out/events.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright 2025 Google Inc. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as Bidi from './gen/main.js'; -import * as BidiBluetooth from './gen/web-bluetooth.js'; -type ExternalSpecEvent = { - type: 'event'; -} & T & - Bidi.Extensible; -export type Event = - | Bidi.Event - | ExternalSpecEvent; -export {}; diff --git a/out/events.js b/out/events.js deleted file mode 100644 index 38813da..0000000 --- a/out/events.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/index.d.ts b/out/index.d.ts index f751c88..cf09a00 100644 --- a/out/index.d.ts +++ b/out/index.d.ts @@ -3,9 +3,25 @@ * Copyright 2024 Google Inc. * SPDX-License-Identifier: Apache-2.0 */ +import * as Bidi from './gen/main.js'; +import * as BidiPermissions from './gen/permissions.js'; +import * as BidiBluetooth from './gen/web-bluetooth.js'; export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -export {Command} from './commands.js'; -export {Event} from './events.js'; export {CommandMapping} from './gen/mapping.js'; +type ExternalSpecCommand = { + id: Bidi.JsUint; +} & T; +export type Result = Bidi.ResultData; +export type Command = + | Bidi.Command + | ExternalSpecCommand + | ExternalSpecCommand; +type ExternalSpecEvent = { + type: 'event'; +} & T & + Bidi.Extensible; +export type Event = + | Bidi.Event + | ExternalSpecEvent; diff --git a/src/commands.ts b/src/commands.ts deleted file mode 100644 index 43738a7..0000000 --- a/src/commands.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2025 Google Inc. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as Bidi from './gen/main.js'; -import * as BidiPermissions from './gen/permissions.js'; -import * as BidiBluetooth from './gen/web-bluetooth.js'; - -export * from './gen/main.js'; -export * from './gen/permissions.js'; -export * from './gen/web-bluetooth.js'; - -type ExternalSpecCommand = { - // id is defined by the main WebDriver BiDi spec and extension specs do - // not re-define it. Therefore, it's not part of generated types. - id: Bidi.JsUint; -} & T; - -export type Result = Bidi.ResultData; - -export type Command = Bidi.Command; -// | ExternalSpecCommand -// | ExternalSpecCommand; diff --git a/src/events.ts b/src/events.ts deleted file mode 100644 index 1df2a06..0000000 --- a/src/events.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2025 Google Inc. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as Bidi from './gen/main.js'; -import * as BidiBluetooth from './gen/web-bluetooth.js'; - -type ExternalSpecEvent = { - // type is defined by the main WebDriver BiDi spec and extension specs do - // not re-define it. Therefore, it's not part of generated types. - type: 'event'; -} & T & - Bidi.Extensible; - -export type Event = - | Bidi.Event - | ExternalSpecEvent; diff --git a/src/index.ts b/src/index.ts index 43af758..54ba651 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,28 @@ export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -export {Command} from './commands.js'; -export {Event} from './events.js'; - export {CommandMapping} from './gen/mapping.js'; + +type ExternalSpecCommand = { + // id is defined by the main WebDriver BiDi spec and extension specs do + // not re-define it. Therefore, it's not part of generated types. + id: Bidi.JsUint; +} & T; + +export type Result = Bidi.ResultData; + +export type Command = + | Bidi.Command + | ExternalSpecCommand + | ExternalSpecCommand; + +type ExternalSpecEvent = { + // type is defined by the main WebDriver BiDi spec and extension specs do + // not re-define it. Therefore, it's not part of generated types. + type: 'event'; +} & T & + Bidi.Extensible; + +export type Event = + | Bidi.Event + | ExternalSpecEvent; From 4174e84d8d6e12242e066d49f08da7ff5d75f3c6 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 20:06:56 +0200 Subject: [PATCH 4/9] remove gts --- .prettierrc.cjs | 7 +- package-lock.json | 1786 +-------------------------------------------- package.json | 1 - 3 files changed, 24 insertions(+), 1770 deletions(-) diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 7d4e6ef..a50c0be 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -1,4 +1,9 @@ /** * @type {import('prettier').Config} */ -module.exports = require("gts/.prettierrc.json"); +module.exports = { + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'avoid', +}; diff --git a/package-lock.json b/package-lock.json index 7ddac8e..9a05544 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "Apache-2.0", "devDependencies": { "@types/node": "^24.0.4", - "gts": "^6.0.2", "parse5": "^8.0.0", "prettier": "3.6.2", "ts-morph": "27.0.0", @@ -117,100 +116,6 @@ "node": ">=4" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", - "dev": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/@isaacs/balanced-match": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", @@ -281,19 +186,6 @@ "node": ">= 8" } }, - "node_modules/@pkgr/core": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", - "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts" - } - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -382,243 +274,6 @@ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", - "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -658,12 +313,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -682,23 +331,6 @@ "node": ">=0.10.0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", @@ -711,24 +343,6 @@ "node": ">=8" } }, - "node_modules/builtins": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", - "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", - "dev": true, - "dependencies": { - "semver": "^7.0.0" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -771,33 +385,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/code-block-writer": { "version": "13.0.3", "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", @@ -823,44 +410,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -895,12 +444,6 @@ "node": ">=0.10.0" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -922,18 +465,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -971,76 +502,6 @@ "node": ">=0.8.0" } }, - "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", - "dev": true, - "license": "MIT", - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, "node_modules/eslint-formatter-pretty": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-formatter-pretty/-/eslint-formatter-pretty-4.1.0.tgz", @@ -1063,397 +524,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-es": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", - "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "node_modules/eslint-rule-docs": { + "version": "1.1.235", + "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", + "integrity": "sha512-+TQ+x4JdTnDoFEXXb3fDvfGOwnyNV7duH8fXWTPD1ieaBmB8omj7Gw/pMBBu4uI2uJCCU8APDaQJzWuXnTsH4A==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { - "eslint-utils": "^2.0.0", - "regexpp": "^3.0.0" - }, - "engines": { - "node": ">=8.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=4.19.1" - } - }, - "node_modules/eslint-plugin-es/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-n": { - "version": "15.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", - "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", - "dev": true, - "dependencies": { - "builtins": "^5.0.1", - "eslint-plugin-es": "^4.1.0", - "eslint-utils": "^3.0.0", - "ignore": "^5.1.1", - "is-core-module": "^2.11.0", - "minimatch": "^3.1.2", - "resolve": "^1.22.1", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=12.22.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-rule-docs": { - "version": "1.1.235", - "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", - "integrity": "sha512-+TQ+x4JdTnDoFEXXb3fDvfGOwnyNV7duH8fXWTPD1ieaBmB8omj7Gw/pMBBu4uI2uJCCU8APDaQJzWuXnTsH4A==", - "dev": true - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/eslint/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { "node": ">=8.6.0" } }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -1463,33 +555,6 @@ "reusify": "^1.0.4" } }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -1515,32 +580,6 @@ "node": ">=8" } }, - "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", - "dev": true, - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -1550,39 +589,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1595,33 +601,6 @@ "node": ">= 6" } }, - "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globals/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -1642,92 +621,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, - "node_modules/gts": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/gts/-/gts-6.0.2.tgz", - "integrity": "sha512-lp9+eDzzm6TYqiBpgGY00EInxBHFTJiU5brsVp11qXCJEw7Q6WNNngja0spZeqSFWSquaRuHQUuWxdZLaxnKmw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", - "chalk": "^4.1.2", - "eslint": "8.57.1", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-n": "15.7.0", - "eslint-plugin-prettier": "5.2.1", - "execa": "^5.0.0", - "inquirer": "^7.3.3", - "json5": "^2.1.3", - "meow": "^9.0.0", - "ncp": "^2.0.0", - "prettier": "3.3.3", - "rimraf": "3.0.2", - "write-file-atomic": "^4.0.0" - }, - "bin": { - "gts": "build/src/cli.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "typescript": ">=5" - } - }, - "node_modules/gts/node_modules/eslint-plugin-prettier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", - "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", - "dev": true, - "license": "MIT", - "dependencies": { - "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.9.1" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-plugin-prettier" - }, - "peerDependencies": { - "@types/eslint": ">=8.0.0", - "eslint": ">=8.0.0", - "eslint-config-prettier": "*", - "prettier": ">=3.0.0" - }, - "peerDependenciesMeta": { - "@types/eslint": { - "optional": true - }, - "eslint-config-prettier": { - "optional": true - } - } - }, - "node_modules/gts/node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -1770,27 +663,6 @@ "node": ">=10" } }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -1800,31 +672,6 @@ "node": ">= 4" } }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -1834,47 +681,6 @@ "node": ">=8" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/irregular-plurals": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", @@ -1941,15 +747,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -1959,18 +756,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1983,12 +768,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -2019,62 +798,11 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true }, "node_modules/kind-of": { "version": "6.0.3", @@ -2085,19 +813,6 @@ "node": ">=0.10.0" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -2116,18 +831,6 @@ "node": ">=8" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -2206,12 +909,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2235,15 +932,6 @@ "node": ">=8.6" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -2253,18 +941,6 @@ "node": ">=4" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/minimist-options": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", @@ -2279,39 +955,6 @@ "node": ">= 6" } }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, - "node_modules/ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", - "dev": true, - "bin": { - "ncp": "bin/ncp" - } - }, "node_modules/normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -2327,68 +970,6 @@ "node": ">=10" } }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -2425,18 +1006,6 @@ "node": ">=6" } }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -2484,24 +1053,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -2550,15 +1101,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/prettier": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", @@ -2574,19 +1116,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-diff": "^1.1.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -2613,15 +1142,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -2747,18 +1267,6 @@ "node": ">=8" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -2776,28 +1284,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -2808,31 +1294,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -2856,24 +1317,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -2886,33 +1329,6 @@ "node": ">=10" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -2980,15 +1396,6 @@ "node": ">=8" } }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -3001,18 +1408,6 @@ "node": ">=8" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -3050,42 +1445,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/synckit": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", - "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@pkgr/core": "^0.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts" - } - }, - "node_modules/synckit/node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD" - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, "node_modules/tinyglobby": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", @@ -3134,18 +1493,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3200,39 +1547,6 @@ "node": ">=14.16" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", @@ -3266,15 +1580,6 @@ "dev": true, "license": "MIT" }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -3285,49 +1590,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -3342,18 +1604,6 @@ "engines": { "node": ">=10" } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/package.json b/package.json index fa1e171..48c9fb5 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ }, "devDependencies": { "@types/node": "^24.0.4", - "gts": "^6.0.2", "parse5": "^8.0.0", "prettier": "3.6.2", "tsd": "0.33.0", From 84a5e32d048fbba248d938202b264741c7c34df6 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 20:09:02 +0200 Subject: [PATCH 5/9] node v24 is used --- tools/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build.sh b/tools/build.sh index a463305..455ed71 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -25,7 +25,7 @@ cddlconv specs/web-bluetooth/all.cddl > src/gen/web-bluetooth.ts git submodule deinit --all -node --experimental-strip-types ./tools/generateCommandMap.ts +node ./tools/generateCommandMap.ts npx tsc -p tsconfig.json npx tsd npm run format From 0319e1f05b7128fa1c5facb70917678d2cadf3d0 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 20:15:39 +0200 Subject: [PATCH 6/9] use v24 --- .github/workflows/ci.yml | 5 +++++ .github/workflows/publish.yml | 2 +- .github/workflows/regenerate.yml | 6 ++++++ .nvmrc | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .nvmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa80ae..9dced83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,11 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 2 + - name: Set up Node.js + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + cache: npm + node-version-file: '.nvmrc' - name: Install cddlconv run: cargo install cddlconv@0.1.7 - name: Install dependencies diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aeee06f..866c4e1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: push: tags: - - "*v*" + - '*v*' jobs: npm-publish: diff --git a/.github/workflows/regenerate.yml b/.github/workflows/regenerate.yml index bd53358..efcb02e 100644 --- a/.github/workflows/regenerate.yml +++ b/.github/workflows/regenerate.yml @@ -22,6 +22,12 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 2 + + - name: Set up Node.js + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + cache: npm + node-version-file: '.nvmrc' - name: Install cddlconv run: cargo install cddlconv@0.1.7 - name: Install dependencies diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..18c92ea --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v24 \ No newline at end of file From d318cb7a9e2fcff820e7f2950fccd356fb412c05 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 20:19:31 +0200 Subject: [PATCH 7/9] f --- tools/generateCommandMap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generateCommandMap.ts b/tools/generateCommandMap.ts index 01a305f..56a6a9c 100644 --- a/tools/generateCommandMap.ts +++ b/tools/generateCommandMap.ts @@ -147,7 +147,7 @@ for (const entry of sortedCommandMappingEntries) { generatedFile.insertText( 0, - `/* eslint-disable */\n/**\n * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts\n * Do not edit this file manually.\n */\n\n`, + `/**\n * THIS FILE IS AUTO-GENERATED by tools/generateCommandMap.ts\n * Do not edit this file manually.\n */\n\n`, ); await generatedFile.save(); From 407f19dfb5d2cdbab2a0797fa5c6ecf40ce02079 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Sun, 14 Sep 2025 20:20:23 +0200 Subject: [PATCH 8/9] f --- tools/utils.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tools/utils.ts b/tools/utils.ts index 7370f3b..0259fd5 100644 --- a/tools/utils.ts +++ b/tools/utils.ts @@ -1,9 +1,7 @@ -import { +import type { ModuleDeclaration, - Project, SourceFile, TypeAliasDeclaration, - TypeFormatFlags, } from 'ts-morph'; export function getNamespaces(file: SourceFile, s: String) { @@ -18,19 +16,6 @@ export function getNamespaces(file: SourceFile, s: String) { return result; } -// // Helper to convert a camelCase string to PascalCase -// function toPascalCase(str: string): string { -// if (!str) { -// return ''; -// } -// return str -// .split('.') -// .map(s => { -// return s.charAt(0).toUpperCase() + s.slice(1); -// }) -// .join('.'); -// } - export interface SpecType { inputFile: string; commandType: string; From ab566230b7df1cc26bd025d712cb22f5e2bf2fa4 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Mon, 15 Sep 2025 14:42:48 +0200 Subject: [PATCH 9/9] fixes --- out/gen/mapping.d.ts | 4 ---- out/gen/mapping.js | 5 ----- out/index.d.ts | 2 +- src/gen/mapping.ts | 6 ------ src/index.ts | 2 +- tools/generateCommandMap.ts | 6 ------ tools/utils.ts | 6 ++++++ 7 files changed, 8 insertions(+), 23 deletions(-) diff --git a/out/gen/mapping.d.ts b/out/gen/mapping.d.ts index 1b1f1ec..fc38cb6 100644 --- a/out/gen/mapping.d.ts +++ b/out/gen/mapping.d.ts @@ -1,7 +1,3 @@ -/** - * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts - * Do not edit this file manually. - */ import type * as Bidi from './main.ts'; import type * as BidiPermissions from './permissions.ts'; import type * as BidiBluetooth from './web-bluetooth.ts'; diff --git a/out/gen/mapping.js b/out/gen/mapping.js index 5029460..38813da 100644 --- a/out/gen/mapping.js +++ b/out/gen/mapping.js @@ -1,7 +1,2 @@ 'use strict'; -/* eslint-disable */ -/** - * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts - * Do not edit this file manually. - */ Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/out/index.d.ts b/out/index.d.ts index cf09a00..4be75bf 100644 --- a/out/index.d.ts +++ b/out/index.d.ts @@ -9,7 +9,7 @@ import * as BidiBluetooth from './gen/web-bluetooth.js'; export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -export {CommandMapping} from './gen/mapping.js'; +export type {CommandMapping} from './gen/mapping.d.ts'; type ExternalSpecCommand = { id: Bidi.JsUint; } & T; diff --git a/src/gen/mapping.ts b/src/gen/mapping.ts index 76eee8d..4bab297 100644 --- a/src/gen/mapping.ts +++ b/src/gen/mapping.ts @@ -1,9 +1,3 @@ -/* eslint-disable */ -/** - * THIS FILE IS AUTO-GENERATED by scripts/generateApiMap.ts - * Do not edit this file manually. - */ - import type * as Bidi from './main.ts'; import type * as BidiPermissions from './permissions.ts'; import type * as BidiBluetooth from './web-bluetooth.ts'; diff --git a/src/index.ts b/src/index.ts index 54ba651..fd86422 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ export * from './gen/main.js'; export * from './gen/permissions.js'; export * from './gen/web-bluetooth.js'; -export {CommandMapping} from './gen/mapping.js'; +export type {CommandMapping} from './gen/mapping.d.ts'; type ExternalSpecCommand = { // id is defined by the main WebDriver BiDi spec and extension specs do diff --git a/tools/generateCommandMap.ts b/tools/generateCommandMap.ts index 56a6a9c..63b7f4b 100644 --- a/tools/generateCommandMap.ts +++ b/tools/generateCommandMap.ts @@ -113,7 +113,6 @@ for (const spec of specs) { }); } -// 11. Add the GENERATED interface const mapInterface = generatedFile.addInterface({ name: 'CommandMapping', isExported: true, @@ -145,9 +144,4 @@ for (const entry of sortedCommandMappingEntries) { }); } -generatedFile.insertText( - 0, - `/**\n * THIS FILE IS AUTO-GENERATED by tools/generateCommandMap.ts\n * Do not edit this file manually.\n */\n\n`, -); - await generatedFile.save(); diff --git a/tools/utils.ts b/tools/utils.ts index 0259fd5..358b78f 100644 --- a/tools/utils.ts +++ b/tools/utils.ts @@ -1,3 +1,9 @@ +/** + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + import type { ModuleDeclaration, SourceFile,