aboutsummaryrefslogtreecommitdiff
path: root/src/cdp/commands.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/cdp/commands.ts')
-rw-r--r--src/cdp/commands.ts29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/cdp/commands.ts b/src/cdp/commands.ts
index 95c8be2..e6d744d 100644
--- a/src/cdp/commands.ts
+++ b/src/cdp/commands.ts
@@ -50,6 +50,33 @@ const ExceptionDetails = Type.Object(
{ additionalProperties: true },
);
+const AxValue = Type.Object({ value: Type.Optional(Type.Unknown()) }, { additionalProperties: true });
+
+const AxNode = Type.Object(
+ {
+ nodeId: Type.String(),
+ parentId: Type.Optional(Type.String()),
+ childIds: Type.Optional(Type.Array(Type.String())),
+ ignored: Type.Optional(Type.Boolean()),
+ role: Type.Optional(AxValue),
+ name: Type.Optional(AxValue),
+ value: Type.Optional(AxValue),
+ description: Type.Optional(AxValue),
+ properties: Type.Optional(
+ Type.Array(
+ Type.Object(
+ { name: Type.Optional(Type.String()), value: Type.Optional(AxValue) },
+ { additionalProperties: true },
+ ),
+ ),
+ ),
+ backendDOMNodeId: Type.Optional(Type.Number()),
+ },
+ { additionalProperties: true },
+);
+
+export type AxNodeResult = Static<typeof AxNode>;
+
export const COMMANDS = {
// --- Target ---
"Target.attachToTarget": cmd(
@@ -211,7 +238,7 @@ export const COMMANDS = {
"Emulation.setDeviceMetricsOverride": cmd(Type.Object({}, { additionalProperties: true }), Empty),
"Accessibility.getFullAXTree": cmd(
Type.Object({ depth: Type.Optional(Type.Number()) }, { additionalProperties: true }),
- Type.Object({ nodes: Type.Array(Type.Unknown()) }),
+ Type.Object({ nodes: Type.Array(AxNode) }),
),
};