import type { BrowserCommand, BrowserResult } from './browser.js'; import type { BrowsingContextCommand, BrowsingContextEvent, BrowsingContextResult } from './browsing_context.js'; import type { EmulationCommand, EmulationResult } from './emulation.js'; import type { InputCommand, InputEvent, InputResult } from './input.js'; import type { LogEvent } from './log.js'; import type { NetworkCommand, NetworkEvent, NetworkResult } from './network.js'; import type { ScriptCommand, ScriptEvent, ScriptResult } from './script.js'; import type { SessionCommand, SessionResult } from './session.js'; import type { StorageCommand, StorageResult } from './storage.js'; import type { WebExtensionCommand, WebExtensionResult } from './webextension.js'; export type Command = CommandData & Extensible & { id: JsUint; }; 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 = Extensible & { type: "success"; id: JsUint; result: ResultData; }; export type ErrorResponse = Extensible & { type: "error"; id: JsUint | null; error: ErrorCode; message: string; stacktrace?: string; }; export type ResultData = BrowserResult | BrowsingContextResult | EmulationResult | InputResult | NetworkResult | ScriptResult | SessionResult | StorageResult | WebExtensionResult; export type EmptyResult = Extensible; export type Event = EventData & Extensible & { type: "event"; }; export type EventData = BrowsingContextEvent | InputEvent | LogEvent | NetworkEvent | ScriptEvent; export type Extensible = Record; export type JsInt = number; export type JsUint = number; export type ErrorCode = "invalid argument" | "invalid selector" | "invalid session id" | "invalid web extension" | "move target out of bounds" | "no such alert" | "no such network collector" | "no such element" | "no such frame" | "no such handle" | "no such history entry" | "no such intercept" | "no such network data" | "no such node" | "no such request" | "no such script" | "no such storage partition" | "no such user context" | "no such web extension" | "session not created" | "unable to capture screen" | "unable to close browser" | "unable to set cookie" | "unable to set file input" | "unavailable network data" | "underspecified storage partition" | "unknown command" | "unknown error" | "unsupported operation";