(
udid: string,
source: AccessibilitySourcePreference = "auto",
options: { maxDepth?: number } = {},
)
| 61 | } |
| 62 | |
| 63 | export async function fetchAccessibilityTree( |
| 64 | udid: string, |
| 65 | source: AccessibilitySourcePreference = "auto", |
| 66 | options: { maxDepth?: number } = {}, |
| 67 | ): Promise<AccessibilityTreeResponse> { |
| 68 | const params = new URLSearchParams(); |
| 69 | if (source !== "auto") { |
| 70 | params.set("source", source); |
| 71 | } |
| 72 | if (options.maxDepth != null) { |
| 73 | params.set("maxDepth", String(options.maxDepth)); |
| 74 | } |
| 75 | const query = params.size > 0 ? `?${params}` : ""; |
| 76 | return apiRequest<AccessibilityTreeResponse>( |
| 77 | `/api/simulators/${udid}/accessibility-tree${query}`, |
| 78 | ); |
| 79 | } |
| 80 | |
| 81 | export async function fetchAccessibilityPoint( |
| 82 | udid: string, |
no test coverage detected