chromium-bidi
Version:
An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.
1,429 lines (1,428 loc) • 2.32 MB
TypeScript
/**
* Copyright 2024 Google LLC.
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
import z from 'zod';
export declare const CommandSchema: z.ZodLazy<z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: number;
}, {
id: number;
}>, z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.close">;
params: z.ZodLazy<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>;
}, "strip", z.ZodTypeAny, {
params: Record<string, any>;
method: "browser.close";
}, {
params: Record<string, any>;
method: "browser.close";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.createUserContext">;
params: z.ZodLazy<z.ZodObject<{
acceptInsecureCerts: z.ZodOptional<z.ZodBoolean>;
proxy: z.ZodOptional<z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodIntersection<z.ZodObject<{
proxyType: z.ZodLiteral<"autodetect">;
}, "strip", z.ZodTypeAny, {
proxyType: "autodetect";
}, {
proxyType: "autodetect";
}>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>, z.ZodLazy<z.ZodIntersection<z.ZodObject<{
proxyType: z.ZodLiteral<"direct">;
}, "strip", z.ZodTypeAny, {
proxyType: "direct";
}, {
proxyType: "direct";
}>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>, z.ZodLazy<z.ZodIntersection<z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
proxyType: z.ZodLiteral<"manual">;
httpProxy: z.ZodOptional<z.ZodString>;
sslProxy: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
proxyType: "manual";
httpProxy?: string | undefined;
sslProxy?: string | undefined;
}, {
proxyType: "manual";
httpProxy?: string | undefined;
sslProxy?: string | undefined;
}>, z.ZodUnion<[z.ZodLazy<z.ZodObject<{
socksProxy: z.ZodString;
socksVersion: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
socksProxy: string;
socksVersion: number;
}, {
socksProxy: string;
socksVersion: number;
}>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>, z.ZodObject<{
noProxy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
noProxy?: string[] | undefined;
}, {
noProxy?: string[] | undefined;
}>>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>, z.ZodLazy<z.ZodIntersection<z.ZodObject<{
proxyType: z.ZodLiteral<"pac">;
proxyAutoconfigUrl: z.ZodString;
}, "strip", z.ZodTypeAny, {
proxyType: "pac";
proxyAutoconfigUrl: string;
}, {
proxyType: "pac";
proxyAutoconfigUrl: string;
}>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>, z.ZodLazy<z.ZodIntersection<z.ZodObject<{
proxyType: z.ZodLiteral<"system">;
}, "strip", z.ZodTypeAny, {
proxyType: "system";
}, {
proxyType: "system";
}>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>]>>>;
unhandledPromptBehavior: z.ZodOptional<z.ZodLazy<z.ZodObject<{
alert: z.ZodOptional<z.ZodLazy<z.ZodEnum<["accept", "dismiss", "ignore"]>>>;
beforeUnload: z.ZodOptional<z.ZodLazy<z.ZodEnum<["accept", "dismiss", "ignore"]>>>;
confirm: z.ZodOptional<z.ZodLazy<z.ZodEnum<["accept", "dismiss", "ignore"]>>>;
default: z.ZodOptional<z.ZodLazy<z.ZodEnum<["accept", "dismiss", "ignore"]>>>;
file: z.ZodOptional<z.ZodLazy<z.ZodEnum<["accept", "dismiss", "ignore"]>>>;
prompt: z.ZodOptional<z.ZodLazy<z.ZodEnum<["accept", "dismiss", "ignore"]>>>;
}, "strip", z.ZodTypeAny, {
default?: "accept" | "dismiss" | "ignore" | undefined;
prompt?: "accept" | "dismiss" | "ignore" | undefined;
alert?: "accept" | "dismiss" | "ignore" | undefined;
confirm?: "accept" | "dismiss" | "ignore" | undefined;
beforeUnload?: "accept" | "dismiss" | "ignore" | undefined;
file?: "accept" | "dismiss" | "ignore" | undefined;
}, {
default?: "accept" | "dismiss" | "ignore" | undefined;
prompt?: "accept" | "dismiss" | "ignore" | undefined;
alert?: "accept" | "dismiss" | "ignore" | undefined;
confirm?: "accept" | "dismiss" | "ignore" | undefined;
beforeUnload?: "accept" | "dismiss" | "ignore" | undefined;
file?: "accept" | "dismiss" | "ignore" | undefined;
}>>>;
}, "strip", z.ZodTypeAny, {
proxy?: ({
proxyType: "autodetect";
} & Record<string, any>) | ({
proxyType: "direct";
} & Record<string, any>) | ((({
proxyType: "manual";
httpProxy?: string | undefined;
sslProxy?: string | undefined;
} & ({
socksProxy: string;
socksVersion: number;
} | {})) & {
noProxy?: string[] | undefined;
}) & Record<string, any>) | ({
proxyType: "pac";
proxyAutoconfigUrl: string;
} & Record<string, any>) | ({
proxyType: "system";
} & Record<string, any>) | undefined;
acceptInsecureCerts?: boolean | undefined;
unhandledPromptBehavior?: {
default?: "accept" | "dismiss" | "ignore" | undefined;
prompt?: "accept" | "dismiss" | "ignore" | undefined;
alert?: "accept" | "dismiss" | "ignore" | undefined;
confirm?: "accept" | "dismiss" | "ignore" | undefined;
beforeUnload?: "accept" | "dismiss" | "ignore" | undefined;
file?: "accept" | "dismiss" | "ignore" | undefined;
} | undefined;
}, {
proxy?: ({
proxyType: "autodetect";
} & Record<string, any>) | ({
proxyType: "direct";
} & Record<string, any>) | ((({
proxyType: "manual";
httpProxy?: string | undefined;
sslProxy?: string | undefined;
} & ({
socksProxy: string;
socksVersion: number;
} | {})) & {
noProxy?: string[] | undefined;
}) & Record<string, any>) | ({
proxyType: "pac";
proxyAutoconfigUrl: string;
} & Record<string, any>) | ({
proxyType: "system";
} & Record<string, any>) | undefined;
acceptInsecureCerts?: boolean | undefined;
unhandledPromptBehavior?: {
default?: "accept" | "dismiss" | "ignore" | undefined;
prompt?: "accept" | "dismiss" | "ignore" | undefined;
alert?: "accept" | "dismiss" | "ignore" | undefined;
confirm?: "accept" | "dismiss" | "ignore" | undefined;
beforeUnload?: "accept" | "dismiss" | "ignore" | undefined;
file?: "accept" | "dismiss" | "ignore" | undefined;
} | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
proxy?: ({
proxyType: "autodetect";
} & Record<string, any>) | ({
proxyType: "direct";
} & Record<string, any>) | ((({
proxyType: "manual";
httpProxy?: string | undefined;
sslProxy?: string | undefined;
} & ({
socksProxy: string;
socksVersion: number;
} | {})) & {
noProxy?: string[] | undefined;
}) & Record<string, any>) | ({
proxyType: "pac";
proxyAutoconfigUrl: string;
} & Record<string, any>) | ({
proxyType: "system";
} & Record<string, any>) | undefined;
acceptInsecureCerts?: boolean | undefined;
unhandledPromptBehavior?: {
default?: "accept" | "dismiss" | "ignore" | undefined;
prompt?: "accept" | "dismiss" | "ignore" | undefined;
alert?: "accept" | "dismiss" | "ignore" | undefined;
confirm?: "accept" | "dismiss" | "ignore" | undefined;
beforeUnload?: "accept" | "dismiss" | "ignore" | undefined;
file?: "accept" | "dismiss" | "ignore" | undefined;
} | undefined;
};
method: "browser.createUserContext";
}, {
params: {
proxy?: ({
proxyType: "autodetect";
} & Record<string, any>) | ({
proxyType: "direct";
} & Record<string, any>) | ((({
proxyType: "manual";
httpProxy?: string | undefined;
sslProxy?: string | undefined;
} & ({
socksProxy: string;
socksVersion: number;
} | {})) & {
noProxy?: string[] | undefined;
}) & Record<string, any>) | ({
proxyType: "pac";
proxyAutoconfigUrl: string;
} & Record<string, any>) | ({
proxyType: "system";
} & Record<string, any>) | undefined;
acceptInsecureCerts?: boolean | undefined;
unhandledPromptBehavior?: {
default?: "accept" | "dismiss" | "ignore" | undefined;
prompt?: "accept" | "dismiss" | "ignore" | undefined;
alert?: "accept" | "dismiss" | "ignore" | undefined;
confirm?: "accept" | "dismiss" | "ignore" | undefined;
beforeUnload?: "accept" | "dismiss" | "ignore" | undefined;
file?: "accept" | "dismiss" | "ignore" | undefined;
} | undefined;
};
method: "browser.createUserContext";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.getClientWindows">;
params: z.ZodLazy<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>;
}, "strip", z.ZodTypeAny, {
params: Record<string, any>;
method: "browser.getClientWindows";
}, {
params: Record<string, any>;
method: "browser.getClientWindows";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.getUserContexts">;
params: z.ZodLazy<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>;
}, "strip", z.ZodTypeAny, {
params: Record<string, any>;
method: "browser.getUserContexts";
}, {
params: Record<string, any>;
method: "browser.getUserContexts";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.removeUserContext">;
params: z.ZodLazy<z.ZodObject<{
userContext: z.ZodLazy<z.ZodString>;
}, "strip", z.ZodTypeAny, {
userContext: string;
}, {
userContext: string;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
userContext: string;
};
method: "browser.removeUserContext";
}, {
params: {
userContext: string;
};
method: "browser.removeUserContext";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.setClientWindowState">;
params: z.ZodLazy<z.ZodIntersection<z.ZodObject<{
clientWindow: z.ZodLazy<z.ZodString>;
}, "strip", z.ZodTypeAny, {
clientWindow: string;
}, {
clientWindow: string;
}>, z.ZodUnion<[z.ZodLazy<z.ZodObject<{
state: z.ZodEnum<["fullscreen", "maximized", "minimized"]>;
}, "strip", z.ZodTypeAny, {
state: "minimized" | "maximized" | "fullscreen";
}, {
state: "minimized" | "maximized" | "fullscreen";
}>>, z.ZodLazy<z.ZodObject<{
state: z.ZodLiteral<"normal">;
width: z.ZodOptional<z.ZodNumber>;
height: z.ZodOptional<z.ZodNumber>;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
state: "normal";
width?: number | undefined;
height?: number | undefined;
x?: number | undefined;
y?: number | undefined;
}, {
state: "normal";
width?: number | undefined;
height?: number | undefined;
x?: number | undefined;
y?: number | undefined;
}>>]>>>;
}, "strip", z.ZodTypeAny, {
params: {
clientWindow: string;
} & ({
state: "minimized" | "maximized" | "fullscreen";
} | {
state: "normal";
width?: number | undefined;
height?: number | undefined;
x?: number | undefined;
y?: number | undefined;
});
method: "browser.setClientWindowState";
}, {
params: {
clientWindow: string;
} & ({
state: "minimized" | "maximized" | "fullscreen";
} | {
state: "normal";
width?: number | undefined;
height?: number | undefined;
x?: number | undefined;
y?: number | undefined;
});
method: "browser.setClientWindowState";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browser.setDownloadBehavior">;
params: z.ZodLazy<z.ZodObject<{
downloadBehavior: z.ZodUnion<[z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"allowed">;
destinationFolder: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: "allowed";
destinationFolder: string;
}, {
type: "allowed";
destinationFolder: string;
}>>, z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"denied">;
}, "strip", z.ZodTypeAny, {
type: "denied";
}, {
type: "denied";
}>>]>>, z.ZodNull]>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
downloadBehavior: {
type: "allowed";
destinationFolder: string;
} | {
type: "denied";
} | null;
userContexts?: string[] | undefined;
}, {
downloadBehavior: {
type: "allowed";
destinationFolder: string;
} | {
type: "denied";
} | null;
userContexts?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
downloadBehavior: {
type: "allowed";
destinationFolder: string;
} | {
type: "denied";
} | null;
userContexts?: string[] | undefined;
};
method: "browser.setDownloadBehavior";
}, {
params: {
downloadBehavior: {
type: "allowed";
destinationFolder: string;
} | {
type: "denied";
} | null;
userContexts?: string[] | undefined;
};
method: "browser.setDownloadBehavior";
}>>]>>, z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.activate">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
}, "strip", z.ZodTypeAny, {
context: string;
}, {
context: string;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
};
method: "browsingContext.activate";
}, {
params: {
context: string;
};
method: "browsingContext.activate";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.captureScreenshot">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
origin: z.ZodOptional<z.ZodDefault<z.ZodEnum<["viewport", "document"]>>>;
format: z.ZodOptional<z.ZodLazy<z.ZodObject<{
type: z.ZodString;
quality: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: string;
quality?: number | undefined;
}, {
type: string;
quality?: number | undefined;
}>>>;
clip: z.ZodOptional<z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"box">;
x: z.ZodNumber;
y: z.ZodNumber;
width: z.ZodNumber;
height: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
type: "box";
width: number;
height: number;
x: number;
y: number;
}, {
type: "box";
width: number;
height: number;
x: number;
y: number;
}>>, z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"element">;
element: z.ZodLazy<z.ZodIntersection<z.ZodObject<{
sharedId: z.ZodLazy<z.ZodString>;
handle: z.ZodOptional<z.ZodLazy<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
sharedId: string;
handle?: string | undefined;
}, {
sharedId: string;
handle?: string | undefined;
}>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
}, "strip", z.ZodTypeAny, {
type: "element";
element: {
sharedId: string;
handle?: string | undefined;
} & Record<string, any>;
}, {
type: "element";
element: {
sharedId: string;
handle?: string | undefined;
} & Record<string, any>;
}>>]>>>;
}, "strip", z.ZodTypeAny, {
context: string;
origin?: "viewport" | "document" | undefined;
format?: {
type: string;
quality?: number | undefined;
} | undefined;
clip?: {
type: "box";
width: number;
height: number;
x: number;
y: number;
} | {
type: "element";
element: {
sharedId: string;
handle?: string | undefined;
} & Record<string, any>;
} | undefined;
}, {
context: string;
origin?: "viewport" | "document" | undefined;
format?: {
type: string;
quality?: number | undefined;
} | undefined;
clip?: {
type: "box";
width: number;
height: number;
x: number;
y: number;
} | {
type: "element";
element: {
sharedId: string;
handle?: string | undefined;
} & Record<string, any>;
} | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
origin?: "viewport" | "document" | undefined;
format?: {
type: string;
quality?: number | undefined;
} | undefined;
clip?: {
type: "box";
width: number;
height: number;
x: number;
y: number;
} | {
type: "element";
element: {
sharedId: string;
handle?: string | undefined;
} & Record<string, any>;
} | undefined;
};
method: "browsingContext.captureScreenshot";
}, {
params: {
context: string;
origin?: "viewport" | "document" | undefined;
format?: {
type: string;
quality?: number | undefined;
} | undefined;
clip?: {
type: "box";
width: number;
height: number;
x: number;
y: number;
} | {
type: "element";
element: {
sharedId: string;
handle?: string | undefined;
} & Record<string, any>;
} | undefined;
};
method: "browsingContext.captureScreenshot";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.close">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
promptUnload: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
context: string;
promptUnload?: boolean | undefined;
}, {
context: string;
promptUnload?: boolean | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
promptUnload?: boolean | undefined;
};
method: "browsingContext.close";
}, {
params: {
context: string;
promptUnload?: boolean | undefined;
};
method: "browsingContext.close";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.create">;
params: z.ZodLazy<z.ZodObject<{
type: z.ZodLazy<z.ZodEnum<["tab", "window"]>>;
referenceContext: z.ZodOptional<z.ZodLazy<z.ZodString>>;
background: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
userContext: z.ZodOptional<z.ZodLazy<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
type: "window" | "tab";
background?: boolean | undefined;
userContext?: string | undefined;
referenceContext?: string | undefined;
}, {
type: "window" | "tab";
background?: boolean | undefined;
userContext?: string | undefined;
referenceContext?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
type: "window" | "tab";
background?: boolean | undefined;
userContext?: string | undefined;
referenceContext?: string | undefined;
};
method: "browsingContext.create";
}, {
params: {
type: "window" | "tab";
background?: boolean | undefined;
userContext?: string | undefined;
referenceContext?: string | undefined;
};
method: "browsingContext.create";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.getTree">;
params: z.ZodLazy<z.ZodObject<{
maxDepth: z.ZodOptional<z.ZodNumber>;
root: z.ZodOptional<z.ZodLazy<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
root?: string | undefined;
maxDepth?: number | undefined;
}, {
root?: string | undefined;
maxDepth?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
root?: string | undefined;
maxDepth?: number | undefined;
};
method: "browsingContext.getTree";
}, {
params: {
root?: string | undefined;
maxDepth?: number | undefined;
};
method: "browsingContext.getTree";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.handleUserPrompt">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
accept: z.ZodOptional<z.ZodBoolean>;
userText: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
context: string;
accept?: boolean | undefined;
userText?: string | undefined;
}, {
context: string;
accept?: boolean | undefined;
userText?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
accept?: boolean | undefined;
userText?: string | undefined;
};
method: "browsingContext.handleUserPrompt";
}, {
params: {
context: string;
accept?: boolean | undefined;
userText?: string | undefined;
};
method: "browsingContext.handleUserPrompt";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.locateNodes">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
locator: z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"accessibility">;
value: z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
role: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
role?: string | undefined;
name?: string | undefined;
}, {
role?: string | undefined;
name?: string | undefined;
}>;
}, "strip", z.ZodTypeAny, {
type: "accessibility";
value: {
role?: string | undefined;
name?: string | undefined;
};
}, {
type: "accessibility";
value: {
role?: string | undefined;
name?: string | undefined;
};
}>>, z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"css">;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: "css";
value: string;
}, {
type: "css";
value: string;
}>>, z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"context">;
value: z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
}, "strip", z.ZodTypeAny, {
context: string;
}, {
context: string;
}>;
}, "strip", z.ZodTypeAny, {
type: "context";
value: {
context: string;
};
}, {
type: "context";
value: {
context: string;
};
}>>, z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"innerText">;
value: z.ZodString;
ignoreCase: z.ZodOptional<z.ZodBoolean>;
matchType: z.ZodOptional<z.ZodEnum<["full", "partial"]>>;
maxDepth: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: "innerText";
value: string;
maxDepth?: number | undefined;
ignoreCase?: boolean | undefined;
matchType?: "partial" | "full" | undefined;
}, {
type: "innerText";
value: string;
maxDepth?: number | undefined;
ignoreCase?: boolean | undefined;
matchType?: "partial" | "full" | undefined;
}>>, z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"xpath">;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: "xpath";
value: string;
}, {
type: "xpath";
value: string;
}>>]>>;
maxNodeCount: z.ZodOptional<z.ZodNumber>;
serializationOptions: z.ZodOptional<z.ZodLazy<z.ZodObject<{
maxDomDepth: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>>;
maxObjectDepth: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>>;
includeShadowTree: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "open", "all"]>>>;
}, "strip", z.ZodTypeAny, {
maxDomDepth?: number | null | undefined;
maxObjectDepth?: number | null | undefined;
includeShadowTree?: "none" | "all" | "open" | undefined;
}, {
maxDomDepth?: number | null | undefined;
maxObjectDepth?: number | null | undefined;
includeShadowTree?: "none" | "all" | "open" | undefined;
}>>>;
startNodes: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodIntersection<z.ZodObject<{
sharedId: z.ZodLazy<z.ZodString>;
handle: z.ZodOptional<z.ZodLazy<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
sharedId: string;
handle?: string | undefined;
}, {
sharedId: string;
handle?: string | undefined;
}>, z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodAny>>>>, "many">>;
}, "strip", z.ZodTypeAny, {
context: string;
locator: {
type: "accessibility";
value: {
role?: string | undefined;
name?: string | undefined;
};
} | {
type: "css";
value: string;
} | {
type: "context";
value: {
context: string;
};
} | {
type: "innerText";
value: string;
maxDepth?: number | undefined;
ignoreCase?: boolean | undefined;
matchType?: "partial" | "full" | undefined;
} | {
type: "xpath";
value: string;
};
serializationOptions?: {
maxDomDepth?: number | null | undefined;
maxObjectDepth?: number | null | undefined;
includeShadowTree?: "none" | "all" | "open" | undefined;
} | undefined;
maxNodeCount?: number | undefined;
startNodes?: ({
sharedId: string;
handle?: string | undefined;
} & Record<string, any>)[] | undefined;
}, {
context: string;
locator: {
type: "accessibility";
value: {
role?: string | undefined;
name?: string | undefined;
};
} | {
type: "css";
value: string;
} | {
type: "context";
value: {
context: string;
};
} | {
type: "innerText";
value: string;
maxDepth?: number | undefined;
ignoreCase?: boolean | undefined;
matchType?: "partial" | "full" | undefined;
} | {
type: "xpath";
value: string;
};
serializationOptions?: {
maxDomDepth?: number | null | undefined;
maxObjectDepth?: number | null | undefined;
includeShadowTree?: "none" | "all" | "open" | undefined;
} | undefined;
maxNodeCount?: number | undefined;
startNodes?: ({
sharedId: string;
handle?: string | undefined;
} & Record<string, any>)[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
locator: {
type: "accessibility";
value: {
role?: string | undefined;
name?: string | undefined;
};
} | {
type: "css";
value: string;
} | {
type: "context";
value: {
context: string;
};
} | {
type: "innerText";
value: string;
maxDepth?: number | undefined;
ignoreCase?: boolean | undefined;
matchType?: "partial" | "full" | undefined;
} | {
type: "xpath";
value: string;
};
serializationOptions?: {
maxDomDepth?: number | null | undefined;
maxObjectDepth?: number | null | undefined;
includeShadowTree?: "none" | "all" | "open" | undefined;
} | undefined;
maxNodeCount?: number | undefined;
startNodes?: ({
sharedId: string;
handle?: string | undefined;
} & Record<string, any>)[] | undefined;
};
method: "browsingContext.locateNodes";
}, {
params: {
context: string;
locator: {
type: "accessibility";
value: {
role?: string | undefined;
name?: string | undefined;
};
} | {
type: "css";
value: string;
} | {
type: "context";
value: {
context: string;
};
} | {
type: "innerText";
value: string;
maxDepth?: number | undefined;
ignoreCase?: boolean | undefined;
matchType?: "partial" | "full" | undefined;
} | {
type: "xpath";
value: string;
};
serializationOptions?: {
maxDomDepth?: number | null | undefined;
maxObjectDepth?: number | null | undefined;
includeShadowTree?: "none" | "all" | "open" | undefined;
} | undefined;
maxNodeCount?: number | undefined;
startNodes?: ({
sharedId: string;
handle?: string | undefined;
} & Record<string, any>)[] | undefined;
};
method: "browsingContext.locateNodes";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.navigate">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
url: z.ZodString;
wait: z.ZodOptional<z.ZodLazy<z.ZodEnum<["none", "interactive", "complete"]>>>;
}, "strip", z.ZodTypeAny, {
url: string;
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
}, {
url: string;
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
url: string;
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
};
method: "browsingContext.navigate";
}, {
params: {
url: string;
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
};
method: "browsingContext.navigate";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.print">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
background: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
margin: z.ZodOptional<z.ZodLazy<z.ZodObject<{
bottom: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
left: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
right: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
top: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
left?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
top?: number | undefined;
}, {
left?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
top?: number | undefined;
}>>>;
orientation: z.ZodOptional<z.ZodDefault<z.ZodEnum<["portrait", "landscape"]>>>;
page: z.ZodOptional<z.ZodLazy<z.ZodObject<{
height: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
width: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
width?: number | undefined;
height?: number | undefined;
}, {
width?: number | undefined;
height?: number | undefined;
}>>>;
pageRanges: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString]>, "many">>;
scale: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
shrinkToFit: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
context: string;
orientation?: "portrait" | "landscape" | undefined;
background?: boolean | undefined;
margin?: {
left?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
top?: number | undefined;
} | undefined;
page?: {
width?: number | undefined;
height?: number | undefined;
} | undefined;
pageRanges?: (string | number)[] | undefined;
scale?: number | undefined;
shrinkToFit?: boolean | undefined;
}, {
context: string;
orientation?: "portrait" | "landscape" | undefined;
background?: boolean | undefined;
margin?: {
left?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
top?: number | undefined;
} | undefined;
page?: {
width?: number | undefined;
height?: number | undefined;
} | undefined;
pageRanges?: (string | number)[] | undefined;
scale?: number | undefined;
shrinkToFit?: boolean | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
orientation?: "portrait" | "landscape" | undefined;
background?: boolean | undefined;
margin?: {
left?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
top?: number | undefined;
} | undefined;
page?: {
width?: number | undefined;
height?: number | undefined;
} | undefined;
pageRanges?: (string | number)[] | undefined;
scale?: number | undefined;
shrinkToFit?: boolean | undefined;
};
method: "browsingContext.print";
}, {
params: {
context: string;
orientation?: "portrait" | "landscape" | undefined;
background?: boolean | undefined;
margin?: {
left?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
top?: number | undefined;
} | undefined;
page?: {
width?: number | undefined;
height?: number | undefined;
} | undefined;
pageRanges?: (string | number)[] | undefined;
scale?: number | undefined;
shrinkToFit?: boolean | undefined;
};
method: "browsingContext.print";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.reload">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
ignoreCache: z.ZodOptional<z.ZodBoolean>;
wait: z.ZodOptional<z.ZodLazy<z.ZodEnum<["none", "interactive", "complete"]>>>;
}, "strip", z.ZodTypeAny, {
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
ignoreCache?: boolean | undefined;
}, {
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
ignoreCache?: boolean | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
ignoreCache?: boolean | undefined;
};
method: "browsingContext.reload";
}, {
params: {
context: string;
wait?: "none" | "interactive" | "complete" | undefined;
ignoreCache?: boolean | undefined;
};
method: "browsingContext.reload";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.setBypassCSP">;
params: z.ZodLazy<z.ZodObject<{
bypass: z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull]>;
contexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
bypass: true | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
bypass: true | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
bypass: true | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "browsingContext.setBypassCSP";
}, {
params: {
bypass: true | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "browsingContext.setBypassCSP";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.setViewport">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodOptional<z.ZodLazy<z.ZodString>>;
viewport: z.ZodOptional<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
width: z.ZodNumber;
height: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
width: number;
height: number;
}, {
width: number;
height: number;
}>>, z.ZodNull]>>;
devicePixelRatio: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
context?: string | undefined;
viewport?: {
width: number;
height: number;
} | null | undefined;
userContexts?: string[] | undefined;
devicePixelRatio?: number | null | undefined;
}, {
context?: string | undefined;
viewport?: {
width: number;
height: number;
} | null | undefined;
userContexts?: string[] | undefined;
devicePixelRatio?: number | null | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context?: string | undefined;
viewport?: {
width: number;
height: number;
} | null | undefined;
userContexts?: string[] | undefined;
devicePixelRatio?: number | null | undefined;
};
method: "browsingContext.setViewport";
}, {
params: {
context?: string | undefined;
viewport?: {
width: number;
height: number;
} | null | undefined;
userContexts?: string[] | undefined;
devicePixelRatio?: number | null | undefined;
};
method: "browsingContext.setViewport";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"browsingContext.traverseHistory">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodLazy<z.ZodString>;
delta: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
context: string;
delta: number;
}, {
context: string;
delta: number;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
context: string;
delta: number;
};
method: "browsingContext.traverseHistory";
}, {
params: {
context: string;
delta: number;
};
method: "browsingContext.traverseHistory";
}>>]>>, z.ZodLazy<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setForcedColorsModeThemeOverride">;
params: z.ZodLazy<z.ZodObject<{
theme: z.ZodUnion<[z.ZodLazy<z.ZodEnum<["light", "dark"]>>, z.ZodNull]>;
contexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
theme: "light" | "dark" | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
theme: "light" | "dark" | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
theme: "light" | "dark" | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setForcedColorsModeThemeOverride";
}, {
params: {
theme: "light" | "dark" | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setForcedColorsModeThemeOverride";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setGeolocationOverride">;
params: z.ZodLazy<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
coordinates: z.ZodUnion<[z.ZodLazy<z.ZodObject<{
latitude: z.ZodNumber;
longitude: z.ZodNumber;
accuracy: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
altitude: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDefault<z.ZodNull>]>>;
altitudeAccuracy: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDefault<z.ZodNull>]>>;
heading: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDefault<z.ZodNull>]>>;
speed: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDefault<z.ZodNull>]>>;
}, "strip", z.ZodTypeAny, {
latitude: number;
longitude: number;
accuracy?: number | undefined;
altitude?: number | null | undefined;
altitudeAccuracy?: number | null | undefined;
heading?: number | null | undefined;
speed?: number | null | undefined;
}, {
latitude: number;
longitude: number;
accuracy?: number | undefined;
altitude?: number | null | undefined;
altitudeAccuracy?: number | null | undefined;
heading?: number | null | undefined;
speed?: number | null | undefined;
}>>, z.ZodNull]>;
}, "strip", z.ZodTypeAny, {
coordinates: {
latitude: number;
longitude: number;
accuracy?: number | undefined;
altitude?: number | null | undefined;
altitudeAccuracy?: number | null | undefined;
heading?: number | null | undefined;
speed?: number | null | undefined;
} | null;
}, {
coordinates: {
latitude: number;
longitude: number;
accuracy?: number | undefined;
altitude?: number | null | undefined;
altitudeAccuracy?: number | null | undefined;
heading?: number | null | undefined;
speed?: number | null | undefined;
} | null;
}>, z.ZodObject<{
error: z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"positionUnavailable">;
}, "strip", z.ZodTypeAny, {
type: "positionUnavailable";
}, {
type: "positionUnavailable";
}>>;
}, "strip", z.ZodTypeAny, {
error: {
type: "positionUnavailable";
};
}, {
error: {
type: "positionUnavailable";
};
}>]>, z.ZodObject<{
contexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>>>;
}, "strip", z.ZodTypeAny, {
params: ({
coordinates: {
latitude: number;
longitude: number;
accuracy?: number | undefined;
altitude?: number | null | undefined;
altitudeAccuracy?: number | null | undefined;
heading?: number | null | undefined;
speed?: number | null | undefined;
} | null;
} | {
error: {
type: "positionUnavailable";
};
}) & {
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setGeolocationOverride";
}, {
params: ({
coordinates: {
latitude: number;
longitude: number;
accuracy?: number | undefined;
altitude?: number | null | undefined;
altitudeAccuracy?: number | null | undefined;
heading?: number | null | undefined;
speed?: number | null | undefined;
} | null;
} | {
error: {
type: "positionUnavailable";
};
}) & {
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setGeolocationOverride";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setLocaleOverride">;
params: z.ZodLazy<z.ZodObject<{
locale: z.ZodUnion<[z.ZodString, z.ZodNull]>;
contexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
locale: string | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
locale: string | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
locale: string | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setLocaleOverride";
}, {
params: {
locale: string | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setLocaleOverride";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setNetworkConditions">;
params: z.ZodLazy<z.ZodObject<{
networkConditions: z.ZodUnion<[z.ZodLazy<z.ZodLazy<z.ZodObject<{
type: z.ZodLiteral<"offline">;
}, "strip", z.ZodTypeAny, {
type: "offline";
}, {
type: "offline";
}>>>, z.ZodNull]>;
contexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodString>, "many">>;
}, "strip", z.ZodTypeAny, {
networkConditions: {
type: "offline";
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
networkConditions: {
type: "offline";
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
networkConditions: {
type: "offline";
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setNetworkConditions";
}, {
params: {
networkConditions: {
type: "offline";
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setNetworkConditions";
}>>, z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setScreenOrientationOverride">;
params: z.ZodLazy<z.ZodObject<{
screenOrientation: z.ZodUnion<[z.ZodLazy<z.ZodObject<{
natural: z.ZodLazy<z.ZodEnum<["portrait", "landscape"]>>;
type: z.ZodLazy<z.ZodEnum<["portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"]>>;
}, "strip", z.ZodTypeAny, {