feat(spec): extend AccessibilityElement and AccessibilityTree types

- AccessibilityElement gains attrs, find(), findAll()
- find/findAll on both Tree and Element accept string | AttrSelector
- AttrSelector = Record<string, string> for object-form AND matching
This commit is contained in:
pj committed 2026-04-25 21:22:03 +07:00
1 parent 91f504fc11
commit d8aa768837
1 file changed
+6 -2
+6 -2
View File
@@ -1,4 +1,5 @@
export type Snapshots = Record<string, unknown>;
export type AttrSelector = Record<string, string>;
export interface AccessibilityElement {
id?: string;
@@ -13,11 +14,14 @@ export interface AccessibilityElement {
bounds?: { left: number; top: number; right: number; bottom: number };
x?: number;
y?: number;
attrs?: Record<string, string>;
find(selector: string | AttrSelector): AccessibilityElement | undefined;
findAll(selector: string | AttrSelector): AccessibilityElement[];
}
export interface AccessibilityTree {
find(selector: string): AccessibilityElement | undefined;
findAll(selector: string): AccessibilityElement[];
find(selector: string | AttrSelector): AccessibilityElement | undefined;
findAll(selector: string | AttrSelector): AccessibilityElement[];
}
export interface LogEntry {