@@ -21,85 +21,85 @@ import { ElementHandle } from "./JSHandle.js";
2121 */
2222export interface SerializedAXNode {
2323 /**
24- * The {@link https://www.w3.org/TR/wai-aria/#usage_intro | role} of the node.
25- */
24+ * The {@link https://www.w3.org/TR/wai-aria/#usage_intro | role} of the node.
25+ */
2626 role : string ;
2727 /**
28- * A human readable name for the node.
29- */
28+ * A human readable name for the node.
29+ */
3030 name ?: string ;
3131 /**
32- * The current value of the node.
33- */
32+ * The current value of the node.
33+ */
3434 value ?: string | number ;
3535 /**
36- * An additional human readable description of the node.
37- */
36+ * An additional human readable description of the node.
37+ */
3838 description ?: string ;
3939 /**
40- * Any keyboard shortcuts associated with this node.
41- */
40+ * Any keyboard shortcuts associated with this node.
41+ */
4242 keyshortcuts ?: string ;
4343 /**
44- * A human readable alternative to the role.
45- */
44+ * A human readable alternative to the role.
45+ */
4646 roledescription ?: string ;
4747 /**
48- * A description of the current value.
49- */
48+ * A description of the current value.
49+ */
5050 valuetext ?: string ;
5151 disabled ?: boolean ;
5252 expanded ?: boolean ;
5353 focused ?: boolean ;
5454 modal ?: boolean ;
5555 multiline ?: boolean ;
5656 /**
57- * Whether more than one child can be selected.
58- */
57+ * Whether more than one child can be selected.
58+ */
5959 multiselectable ?: boolean ;
6060 readonly ?: boolean ;
6161 required ?: boolean ;
6262 selected ?: boolean ;
6363 /**
64- * Whether the checkbox is checked, or in a
65- * {@link https://www.w3.org/TR/wai-aria-practices/examples/checkbox/checkbox-2/checkbox-2.html | mixed state}.
66- */
64+ * Whether the checkbox is checked, or in a
65+ * {@link https://www.w3.org/TR/wai-aria-practices/examples/checkbox/checkbox-2/checkbox-2.html | mixed state}.
66+ */
6767 checked ?: boolean | "mixed" ;
6868 /**
69- * Whether the node is checked or in a mixed state.
70- */
69+ * Whether the node is checked or in a mixed state.
70+ */
7171 pressed ?: boolean | "mixed" ;
7272 /**
73- * The level of a heading.
74- */
73+ * The level of a heading.
74+ */
7575 level ?: number ;
7676 valuemin ?: number ;
7777 valuemax ?: number ;
7878 autocomplete ?: string ;
7979 haspopup ?: string ;
8080 /**
81- * Whether and in what way this node's value is invalid.
82- */
81+ * Whether and in what way this node's value is invalid.
82+ */
8383 invalid ?: string ;
8484 orientation ?: string ;
8585 /**
86- * Children of this node, if there are any.
87- */
86+ * Children of this node, if there are any.
87+ */
8888 children ?: SerializedAXNode [ ] ;
8989}
9090/**
9191 * @public
9292 */
9393export interface SnapshotOptions {
9494 /**
95- * Prune uninteresting nodes from the tree.
96- * @defaultValue true
97- */
95+ * Prune uninteresting nodes from the tree.
96+ * @defaultValue true
97+ */
9898 interestingOnly ?: boolean ;
9999 /**
100- * Root node to get the accessibility tree for
101- * @defaultValue The root node of the entire page.
102- */
100+ * Root node to get the accessibility tree for
101+ * @defaultValue The root node of the entire page.
102+ */
103103 root ?: ElementHandle ;
104104}
105105/**
@@ -127,48 +127,47 @@ export interface SnapshotOptions {
127127export declare class Accessibility {
128128 private _client ;
129129 /**
130- * @internal
131- */
130+ * @internal
131+ */
132132 constructor ( client : CDPSession ) ;
133133 /**
134- * Captures the current state of the accessibility tree.
135- * The returned object represents the root accessible node of the page.
136- *
137- * @remarks
138- *
139- * **NOTE** The Chromium accessibility tree contains nodes that go unused on
140- * most platforms and by most screen readers. Puppeteer will discard them as
141- * well for an easier to process tree, unless `interestingOnly` is set to
142- * `false`.
143- *
144- * @example
145- * An example of dumping the entire accessibility tree:
146- * ```js
147- * const snapshot = await page.accessibility.snapshot();
148- * console.log(snapshot);
149- * ```
150- *
151- * @example
152- * An example of logging the focused node's name:
153- * ```js
154- * const snapshot = await page.accessibility.snapshot();
155- * const node = findFocusedNode(snapshot);
156- * console.log(node && node.name);
157- *
158- * function findFocusedNode(node) {
159- * if (node.focused)
160- * return node;
161- * for (const child of node.children || []) {
162- * const foundNode = findFocusedNode(child);
163- * return foundNode;
164- * }
165- * return null;
166- * }
167- * ```
168- *
169- * @returns An AXNode object representing the snapshot.
170- *
171- */
134+ * Captures the current state of the accessibility tree.
135+ * The returned object represents the root accessible node of the page.
136+ *
137+ * @remarks
138+ *
139+ * **NOTE** The Chromium accessibility tree contains nodes that go unused on
140+ * most platforms and by most screen readers. Puppeteer will discard them as
141+ * well for an easier to process tree, unless `interestingOnly` is set to
142+ * `false`.
143+ *
144+ * @example
145+ * An example of dumping the entire accessibility tree:
146+ * ```js
147+ * const snapshot = await page.accessibility.snapshot();
148+ * console.log(snapshot);
149+ * ```
150+ *
151+ * @example
152+ * An example of logging the focused node's name:
153+ * ```js
154+ * const snapshot = await page.accessibility.snapshot();
155+ * const node = findFocusedNode(snapshot);
156+ * console.log(node && node.name);
157+ *
158+ * function findFocusedNode(node) {
159+ * if (node.focused)
160+ * return node;
161+ * for (const child of node.children || []) {
162+ * const foundNode = findFocusedNode(child);
163+ * return foundNode;
164+ * }
165+ * return null;
166+ * }
167+ * ```
168+ *
169+ * @returns An AXNode object representing the snapshot.
170+ */
172171 snapshot ( options ?: SnapshotOptions ) : Promise < SerializedAXNode > ;
173172 private serializeTree ;
174173 private collectInterestingNodes ;
0 commit comments