Skip to main content

cdp_driver/protocol/
accessibility.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! The `Accessibility` domain.
5//!
6//! Types, command parameters and event payloads for the `Accessibility`
7//! domain. The method-name constants for the same domain are in
8//! [`crate::methods`].
9//!
10//! This domain is experimental and may change without notice.
11
12use serde::{Deserialize, Serialize};
13
14/// Unique accessibility node identifier.
15pub type AxNodeId = String;
16
17/// Enum of possible property types.
18#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
19pub enum AxValueType {
20    /// `boolean`
21    #[serde(rename = "boolean")]
22    Boolean,
23    /// `tristate`
24    #[serde(rename = "tristate")]
25    Tristate,
26    /// `booleanOrUndefined`
27    #[serde(rename = "booleanOrUndefined")]
28    BooleanOrUndefined,
29    /// `idref`
30    #[serde(rename = "idref")]
31    Idref,
32    /// `idrefList`
33    #[serde(rename = "idrefList")]
34    IdrefList,
35    /// `integer`
36    #[serde(rename = "integer")]
37    Integer,
38    /// `node`
39    #[serde(rename = "node")]
40    Node,
41    /// `nodeList`
42    #[serde(rename = "nodeList")]
43    NodeList,
44    /// `number`
45    #[serde(rename = "number")]
46    Number,
47    /// `string`
48    #[serde(rename = "string")]
49    String,
50    /// `computedString`
51    #[serde(rename = "computedString")]
52    ComputedString,
53    /// `token`
54    #[serde(rename = "token")]
55    Token,
56    /// `tokenList`
57    #[serde(rename = "tokenList")]
58    TokenList,
59    /// `domRelation`
60    #[serde(rename = "domRelation")]
61    DomRelation,
62    /// `role`
63    #[serde(rename = "role")]
64    Role,
65    /// `internalRole`
66    #[serde(rename = "internalRole")]
67    InternalRole,
68    /// `valueUndefined`
69    #[serde(rename = "valueUndefined")]
70    ValueUndefined,
71    /// A value this vendored schema does not list. Chrome adds values ahead of
72    /// the published protocol, so an unrecognised one is kept as it arrived
73    /// rather than failing the payload it came in.
74    #[serde(untagged)]
75    Unrecognized(String),
76}
77
78/// Enum of possible property sources.
79#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
80pub enum AxValueSourceType {
81    /// `attribute`
82    #[serde(rename = "attribute")]
83    Attribute,
84    /// `implicit`
85    #[serde(rename = "implicit")]
86    Implicit,
87    /// `style`
88    #[serde(rename = "style")]
89    Style,
90    /// `contents`
91    #[serde(rename = "contents")]
92    Contents,
93    /// `placeholder`
94    #[serde(rename = "placeholder")]
95    Placeholder,
96    /// `relatedElement`
97    #[serde(rename = "relatedElement")]
98    RelatedElement,
99    /// A value this vendored schema does not list. Chrome adds values ahead of
100    /// the published protocol, so an unrecognised one is kept as it arrived
101    /// rather than failing the payload it came in.
102    #[serde(untagged)]
103    Unrecognized(String),
104}
105
106/// Enum of possible native property sources (as a subtype of a particular
107/// AXValueSourceType).
108#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
109pub enum AxValueNativeSourceType {
110    /// `description`
111    #[serde(rename = "description")]
112    Description,
113    /// `figcaption`
114    #[serde(rename = "figcaption")]
115    Figcaption,
116    /// `label`
117    #[serde(rename = "label")]
118    Label,
119    /// `labelfor`
120    #[serde(rename = "labelfor")]
121    Labelfor,
122    /// `labelwrapped`
123    #[serde(rename = "labelwrapped")]
124    Labelwrapped,
125    /// `legend`
126    #[serde(rename = "legend")]
127    Legend,
128    /// `rubyannotation`
129    #[serde(rename = "rubyannotation")]
130    Rubyannotation,
131    /// `tablecaption`
132    #[serde(rename = "tablecaption")]
133    Tablecaption,
134    /// `title`
135    #[serde(rename = "title")]
136    Title,
137    /// `other`
138    #[serde(rename = "other")]
139    Other,
140    /// A value this vendored schema does not list. Chrome adds values ahead of
141    /// the published protocol, so an unrecognised one is kept as it arrived
142    /// rather than failing the payload it came in.
143    #[serde(untagged)]
144    Unrecognized(String),
145}
146
147/// A single source for a computed AX property.
148#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
149pub struct AxValueSource {
150    /// What type of source this is.
151    pub r#type: AxValueSourceType,
152    /// The value of this property source.
153    #[serde(default, skip_serializing_if = "Option::is_none")]
154    pub value: Option<AxValue>,
155    /// The name of the relevant attribute, if any.
156    #[serde(default, skip_serializing_if = "Option::is_none")]
157    pub attribute: Option<String>,
158    /// The value of the relevant attribute, if any.
159    #[serde(
160        rename = "attributeValue",
161        default,
162        skip_serializing_if = "Option::is_none"
163    )]
164    pub attribute_value: Option<AxValue>,
165    /// Whether this source is superseded by a higher priority source.
166    #[serde(default, skip_serializing_if = "Option::is_none")]
167    pub superseded: Option<bool>,
168    /// The native markup source for this value, e.g. a `\<label\>` element.
169    #[serde(
170        rename = "nativeSource",
171        default,
172        skip_serializing_if = "Option::is_none"
173    )]
174    pub native_source: Option<AxValueNativeSourceType>,
175    /// The value, such as a node or node list, of the native source.
176    #[serde(
177        rename = "nativeSourceValue",
178        default,
179        skip_serializing_if = "Option::is_none"
180    )]
181    pub native_source_value: Option<AxValue>,
182    /// Whether the value for this property is invalid.
183    #[serde(default, skip_serializing_if = "Option::is_none")]
184    pub invalid: Option<bool>,
185    /// Reason for the value being invalid, if it is.
186    #[serde(
187        rename = "invalidReason",
188        default,
189        skip_serializing_if = "Option::is_none"
190    )]
191    pub invalid_reason: Option<String>,
192}
193
194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
195pub struct AxRelatedNode {
196    /// The BackendNodeId of the related DOM node.
197    #[serde(rename = "backendDOMNodeId")]
198    pub backend_dom_node_id: crate::protocol::dom::BackendNodeId,
199    /// The IDRef value provided, if any.
200    #[serde(default, skip_serializing_if = "Option::is_none")]
201    pub idref: Option<String>,
202    /// The text alternative of this node in the current context.
203    #[serde(default, skip_serializing_if = "Option::is_none")]
204    pub text: Option<String>,
205}
206
207#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
208pub struct AxProperty {
209    /// The name of this property.
210    pub name: AxPropertyName,
211    /// The value of this property.
212    pub value: AxValue,
213}
214
215/// A single computed AX property.
216#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
217pub struct AxValue {
218    /// The type of this value.
219    pub r#type: AxValueType,
220    /// The computed value of this property.
221    #[serde(default, skip_serializing_if = "Option::is_none")]
222    pub value: Option<serde_json::Value>,
223    /// One or more related nodes, if applicable.
224    #[serde(
225        rename = "relatedNodes",
226        default,
227        skip_serializing_if = "Option::is_none"
228    )]
229    pub related_nodes: Option<Vec<AxRelatedNode>>,
230    /// The sources which contributed to the computation of this property.
231    #[serde(default, skip_serializing_if = "Option::is_none")]
232    pub sources: Option<Vec<AxValueSource>>,
233}
234
235/// Values of AXProperty name: - from 'busy' to 'roledescription': states
236/// which apply to every AX node - from 'live' to 'root': attributes which
237/// apply to nodes in live regions - from 'autocomplete' to 'valuetext':
238/// attributes which apply to widgets - from 'checked' to 'selected': states
239/// which apply to widgets - from 'activedescendant' to 'owns': relationships
240/// between elements other than parent/child/sibling - from
241/// 'activeFullscreenElement' to 'uninteresting': reasons why this noode is
242/// hidden
243#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
244pub enum AxPropertyName {
245    /// `actions`
246    #[serde(rename = "actions")]
247    Actions,
248    /// `busy`
249    #[serde(rename = "busy")]
250    Busy,
251    /// `disabled`
252    #[serde(rename = "disabled")]
253    Disabled,
254    /// `editable`
255    #[serde(rename = "editable")]
256    Editable,
257    /// `focusable`
258    #[serde(rename = "focusable")]
259    Focusable,
260    /// `focused`
261    #[serde(rename = "focused")]
262    Focused,
263    /// `hidden`
264    #[serde(rename = "hidden")]
265    Hidden,
266    /// `hiddenRoot`
267    #[serde(rename = "hiddenRoot")]
268    HiddenRoot,
269    /// `invalid`
270    #[serde(rename = "invalid")]
271    Invalid,
272    /// `keyshortcuts`
273    #[serde(rename = "keyshortcuts")]
274    Keyshortcuts,
275    /// `settable`
276    #[serde(rename = "settable")]
277    Settable,
278    /// `roledescription`
279    #[serde(rename = "roledescription")]
280    Roledescription,
281    /// `live`
282    #[serde(rename = "live")]
283    Live,
284    /// `atomic`
285    #[serde(rename = "atomic")]
286    Atomic,
287    /// `relevant`
288    #[serde(rename = "relevant")]
289    Relevant,
290    /// `root`
291    #[serde(rename = "root")]
292    Root,
293    /// `autocomplete`
294    #[serde(rename = "autocomplete")]
295    Autocomplete,
296    /// `hasPopup`
297    #[serde(rename = "hasPopup")]
298    HasPopup,
299    /// `level`
300    #[serde(rename = "level")]
301    Level,
302    /// `multiselectable`
303    #[serde(rename = "multiselectable")]
304    Multiselectable,
305    /// `orientation`
306    #[serde(rename = "orientation")]
307    Orientation,
308    /// `multiline`
309    #[serde(rename = "multiline")]
310    Multiline,
311    /// `readonly`
312    #[serde(rename = "readonly")]
313    Readonly,
314    /// `required`
315    #[serde(rename = "required")]
316    Required,
317    /// `valuemin`
318    #[serde(rename = "valuemin")]
319    Valuemin,
320    /// `valuemax`
321    #[serde(rename = "valuemax")]
322    Valuemax,
323    /// `valuetext`
324    #[serde(rename = "valuetext")]
325    Valuetext,
326    /// `checked`
327    #[serde(rename = "checked")]
328    Checked,
329    /// `expanded`
330    #[serde(rename = "expanded")]
331    Expanded,
332    /// `modal`
333    #[serde(rename = "modal")]
334    Modal,
335    /// `pressed`
336    #[serde(rename = "pressed")]
337    Pressed,
338    /// `selected`
339    #[serde(rename = "selected")]
340    Selected,
341    /// `activedescendant`
342    #[serde(rename = "activedescendant")]
343    Activedescendant,
344    /// `controls`
345    #[serde(rename = "controls")]
346    Controls,
347    /// `describedby`
348    #[serde(rename = "describedby")]
349    Describedby,
350    /// `details`
351    #[serde(rename = "details")]
352    Details,
353    /// `errormessage`
354    #[serde(rename = "errormessage")]
355    Errormessage,
356    /// `flowto`
357    #[serde(rename = "flowto")]
358    Flowto,
359    /// `labelledby`
360    #[serde(rename = "labelledby")]
361    Labelledby,
362    /// `owns`
363    #[serde(rename = "owns")]
364    Owns,
365    /// `url`
366    #[serde(rename = "url")]
367    Url,
368    /// `activeFullscreenElement`
369    #[serde(rename = "activeFullscreenElement")]
370    ActiveFullscreenElement,
371    /// `activeModalDialog`
372    #[serde(rename = "activeModalDialog")]
373    ActiveModalDialog,
374    /// `activeAriaModalDialog`
375    #[serde(rename = "activeAriaModalDialog")]
376    ActiveAriaModalDialog,
377    /// `ariaHiddenElement`
378    #[serde(rename = "ariaHiddenElement")]
379    AriaHiddenElement,
380    /// `ariaHiddenSubtree`
381    #[serde(rename = "ariaHiddenSubtree")]
382    AriaHiddenSubtree,
383    /// `emptyAlt`
384    #[serde(rename = "emptyAlt")]
385    EmptyAlt,
386    /// `emptyText`
387    #[serde(rename = "emptyText")]
388    EmptyText,
389    /// `inertElement`
390    #[serde(rename = "inertElement")]
391    InertElement,
392    /// `inertSubtree`
393    #[serde(rename = "inertSubtree")]
394    InertSubtree,
395    /// `labelContainer`
396    #[serde(rename = "labelContainer")]
397    LabelContainer,
398    /// `labelFor`
399    #[serde(rename = "labelFor")]
400    LabelFor,
401    /// `notRendered`
402    #[serde(rename = "notRendered")]
403    NotRendered,
404    /// `notVisible`
405    #[serde(rename = "notVisible")]
406    NotVisible,
407    /// `presentationalRole`
408    #[serde(rename = "presentationalRole")]
409    PresentationalRole,
410    /// `probablyPresentational`
411    #[serde(rename = "probablyPresentational")]
412    ProbablyPresentational,
413    /// `inactiveCarouselTabContent`
414    #[serde(rename = "inactiveCarouselTabContent")]
415    InactiveCarouselTabContent,
416    /// `uninteresting`
417    #[serde(rename = "uninteresting")]
418    Uninteresting,
419    /// A value this vendored schema does not list. Chrome adds values ahead of
420    /// the published protocol, so an unrecognised one is kept as it arrived
421    /// rather than failing the payload it came in.
422    #[serde(untagged)]
423    Unrecognized(String),
424}
425
426/// A node in the accessibility tree.
427#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
428pub struct AxNode {
429    /// Unique identifier for this node.
430    #[serde(rename = "nodeId")]
431    pub node_id: AxNodeId,
432    /// Whether this node is ignored for accessibility
433    pub ignored: bool,
434    /// Collection of reasons why this node is hidden.
435    #[serde(
436        rename = "ignoredReasons",
437        default,
438        skip_serializing_if = "Option::is_none"
439    )]
440    pub ignored_reasons: Option<Vec<AxProperty>>,
441    /// This `Node`'s role, whether explicit or implicit.
442    #[serde(default, skip_serializing_if = "Option::is_none")]
443    pub role: Option<AxValue>,
444    /// This `Node`'s Chrome raw role.
445    #[serde(
446        rename = "chromeRole",
447        default,
448        skip_serializing_if = "Option::is_none"
449    )]
450    pub chrome_role: Option<AxValue>,
451    /// The accessible name for this `Node`.
452    #[serde(default, skip_serializing_if = "Option::is_none")]
453    pub name: Option<AxValue>,
454    /// The accessible description for this `Node`.
455    #[serde(default, skip_serializing_if = "Option::is_none")]
456    pub description: Option<AxValue>,
457    /// The value for this `Node`.
458    #[serde(default, skip_serializing_if = "Option::is_none")]
459    pub value: Option<AxValue>,
460    /// All other properties
461    #[serde(default, skip_serializing_if = "Option::is_none")]
462    pub properties: Option<Vec<AxProperty>>,
463    /// ID for this node's parent.
464    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
465    pub parent_id: Option<AxNodeId>,
466    /// IDs for each of this node's child nodes.
467    #[serde(rename = "childIds", default, skip_serializing_if = "Option::is_none")]
468    pub child_ids: Option<Vec<AxNodeId>>,
469    /// The backend ID for the associated DOM node, if any.
470    #[serde(
471        rename = "backendDOMNodeId",
472        default,
473        skip_serializing_if = "Option::is_none"
474    )]
475    pub backend_dom_node_id: Option<crate::protocol::dom::BackendNodeId>,
476    /// The frame ID for the frame associated with this nodes document.
477    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
478    pub frame_id: Option<crate::protocol::page::FrameId>,
479}
480
481/// Disables the accessibility domain.
482///
483/// Parameters of `Accessibility.disable`.
484#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
485pub struct DisableParams {}
486
487impl crate::typed::Command for DisableParams {
488    const METHOD: &'static str = "Accessibility.disable";
489    type Returns = crate::typed::NoReturns;
490}
491
492/// Enables the accessibility domain which causes `AXNodeId`s to remain
493/// consistent between method calls. This turns on accessibility for the page,
494/// which can impact performance until accessibility is disabled.
495///
496/// Parameters of `Accessibility.enable`.
497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
498pub struct EnableParams {}
499
500impl crate::typed::Command for EnableParams {
501    const METHOD: &'static str = "Accessibility.enable";
502    type Returns = crate::typed::NoReturns;
503}
504
505/// Fetches the accessibility node and partial accessibility tree for this DOM
506/// node, if it exists.
507///
508/// Experimental: may change without notice.
509///
510/// Parameters of `Accessibility.getPartialAXTree`.
511#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
512pub struct GetPartialAxTreeParams {
513    /// Identifier of the node to get the partial accessibility tree for.
514    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
515    pub node_id: Option<crate::protocol::dom::NodeId>,
516    /// Identifier of the backend node to get the partial accessibility tree for.
517    #[serde(
518        rename = "backendNodeId",
519        default,
520        skip_serializing_if = "Option::is_none"
521    )]
522    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
523    /// JavaScript object id of the node wrapper to get the partial accessibility
524    /// tree for.
525    #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
526    pub object_id: Option<crate::protocol::runtime::RemoteObjectId>,
527    /// Whether to fetch this node's ancestors, siblings and children. Defaults to
528    /// true.
529    #[serde(
530        rename = "fetchRelatives",
531        default,
532        skip_serializing_if = "Option::is_none"
533    )]
534    pub fetch_relatives: Option<bool>,
535}
536
537/// What `Accessibility.getPartialAXTree` answers with.
538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
539pub struct GetPartialAxTreeReturns {
540    /// The `Accessibility.AXNode` for this DOM node, if it exists, plus its
541    /// ancestors, siblings and children, if requested.
542    pub nodes: Vec<AxNode>,
543}
544
545impl crate::typed::Command for GetPartialAxTreeParams {
546    const METHOD: &'static str = "Accessibility.getPartialAXTree";
547    type Returns = GetPartialAxTreeReturns;
548}
549
550/// Fetches the entire accessibility tree for the root Document
551///
552/// Experimental: may change without notice.
553///
554/// Parameters of `Accessibility.getFullAXTree`.
555#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
556pub struct GetFullAxTreeParams {
557    /// The maximum depth at which descendants of the root node should be
558    /// retrieved. If omitted, the full tree is returned.
559    #[serde(default, skip_serializing_if = "Option::is_none")]
560    pub depth: Option<i64>,
561    /// The frame for whose document the AX tree should be retrieved. If omitted,
562    /// the root frame is used.
563    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
564    pub frame_id: Option<crate::protocol::page::FrameId>,
565}
566
567/// What `Accessibility.getFullAXTree` answers with.
568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
569pub struct GetFullAxTreeReturns {
570    pub nodes: Vec<AxNode>,
571}
572
573impl crate::typed::Command for GetFullAxTreeParams {
574    const METHOD: &'static str = "Accessibility.getFullAXTree";
575    type Returns = GetFullAxTreeReturns;
576}
577
578/// Fetches the root node. Requires `enable()` to have been called previously.
579///
580/// Experimental: may change without notice.
581///
582/// Parameters of `Accessibility.getRootAXNode`.
583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
584pub struct GetRootAxNodeParams {
585    /// The frame in whose document the node resides. If omitted, the root frame
586    /// is used.
587    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
588    pub frame_id: Option<crate::protocol::page::FrameId>,
589}
590
591/// What `Accessibility.getRootAXNode` answers with.
592#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
593pub struct GetRootAxNodeReturns {
594    pub node: AxNode,
595}
596
597impl crate::typed::Command for GetRootAxNodeParams {
598    const METHOD: &'static str = "Accessibility.getRootAXNode";
599    type Returns = GetRootAxNodeReturns;
600}
601
602/// Fetches a node and all ancestors up to and including the root. Requires
603/// `enable()` to have been called previously.
604///
605/// Experimental: may change without notice.
606///
607/// Parameters of `Accessibility.getAXNodeAndAncestors`.
608#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
609pub struct GetAxNodeAndAncestorsParams {
610    /// Identifier of the node to get.
611    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
612    pub node_id: Option<crate::protocol::dom::NodeId>,
613    /// Identifier of the backend node to get.
614    #[serde(
615        rename = "backendNodeId",
616        default,
617        skip_serializing_if = "Option::is_none"
618    )]
619    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
620    /// JavaScript object id of the node wrapper to get.
621    #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
622    pub object_id: Option<crate::protocol::runtime::RemoteObjectId>,
623}
624
625/// What `Accessibility.getAXNodeAndAncestors` answers with.
626#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
627pub struct GetAxNodeAndAncestorsReturns {
628    pub nodes: Vec<AxNode>,
629}
630
631impl crate::typed::Command for GetAxNodeAndAncestorsParams {
632    const METHOD: &'static str = "Accessibility.getAXNodeAndAncestors";
633    type Returns = GetAxNodeAndAncestorsReturns;
634}
635
636/// Fetches a particular accessibility node by AXNodeId. Requires `enable()`
637/// to have been called previously.
638///
639/// Experimental: may change without notice.
640///
641/// Parameters of `Accessibility.getChildAXNodes`.
642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
643pub struct GetChildAxNodesParams {
644    pub id: AxNodeId,
645    /// The frame in whose document the node resides. If omitted, the root frame
646    /// is used.
647    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
648    pub frame_id: Option<crate::protocol::page::FrameId>,
649}
650
651/// What `Accessibility.getChildAXNodes` answers with.
652#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
653pub struct GetChildAxNodesReturns {
654    pub nodes: Vec<AxNode>,
655}
656
657impl crate::typed::Command for GetChildAxNodesParams {
658    const METHOD: &'static str = "Accessibility.getChildAXNodes";
659    type Returns = GetChildAxNodesReturns;
660}
661
662/// Query a DOM node's accessibility subtree for accessible name and role.
663/// This command computes the name and role for all nodes in the subtree,
664/// including those that are ignored for accessibility, and returns those that
665/// match the specified name and role. If no DOM node is specified, or the DOM
666/// node does not exist, the command returns an error. If neither
667/// `accessibleName` or `role` is specified, it returns all the accessibility
668/// nodes in the subtree.
669///
670/// Experimental: may change without notice.
671///
672/// Parameters of `Accessibility.queryAXTree`.
673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
674pub struct QueryAxTreeParams {
675    /// Identifier of the node for the root to query.
676    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
677    pub node_id: Option<crate::protocol::dom::NodeId>,
678    /// Identifier of the backend node for the root to query.
679    #[serde(
680        rename = "backendNodeId",
681        default,
682        skip_serializing_if = "Option::is_none"
683    )]
684    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
685    /// JavaScript object id of the node wrapper for the root to query.
686    #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
687    pub object_id: Option<crate::protocol::runtime::RemoteObjectId>,
688    /// Find nodes with this computed name.
689    #[serde(
690        rename = "accessibleName",
691        default,
692        skip_serializing_if = "Option::is_none"
693    )]
694    pub accessible_name: Option<String>,
695    /// Find nodes with this computed role.
696    #[serde(default, skip_serializing_if = "Option::is_none")]
697    pub role: Option<String>,
698}
699
700/// What `Accessibility.queryAXTree` answers with.
701#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
702pub struct QueryAxTreeReturns {
703    /// A list of `Accessibility.AXNode` matching the specified attributes,
704    /// including nodes that are ignored for accessibility.
705    pub nodes: Vec<AxNode>,
706}
707
708impl crate::typed::Command for QueryAxTreeParams {
709    const METHOD: &'static str = "Accessibility.queryAXTree";
710    type Returns = QueryAxTreeReturns;
711}
712
713/// The loadComplete event mirrors the load complete event sent by the browser
714/// to assistive technology when the web page has finished loading.
715///
716/// Experimental: may change without notice.
717///
718/// Payload of the `Accessibility.loadComplete` event.
719#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
720pub struct LoadCompleteEvent {
721    /// New document root node.
722    pub root: AxNode,
723}
724
725impl crate::typed::Event for LoadCompleteEvent {
726    const METHOD: &'static str = "Accessibility.loadComplete";
727}
728
729/// The nodesUpdated event is sent every time a previously requested node has
730/// changed the in tree.
731///
732/// Experimental: may change without notice.
733///
734/// Payload of the `Accessibility.nodesUpdated` event.
735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
736pub struct NodesUpdatedEvent {
737    /// Updated node data.
738    pub nodes: Vec<AxNode>,
739}
740
741impl crate::typed::Event for NodesUpdatedEvent {
742    const METHOD: &'static str = "Accessibility.nodesUpdated";
743}