(node: AccessibilityNode)
| 55 | } |
| 56 | |
| 57 | function line(node: AccessibilityNode): string { |
| 58 | if (node.role === 'text') { |
| 59 | return `- text: ${node.name}` |
| 60 | } |
| 61 | let out = `- ${node.role}` |
| 62 | if (node.name !== '') { |
| 63 | out += ` ${quote(node.name)}` |
| 64 | } |
| 65 | out += states(node.states) |
| 66 | if (node.value !== undefined && node.value !== '') { |
| 67 | out += `: ${oneLine(node.value)}` |
| 68 | } |
| 69 | return out |
| 70 | } |
| 71 | |
| 72 | export function toText(node: AccessibilityNode, indent = ''): string { |
| 73 | const lines = [indent + line(node)] |