> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simular.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AccessibilityNode

> A node in the platform accessibility tree.

A node in the platform accessibility tree. Thin binding for
`simulang_rs::AXNode` (macOS `AXUIElement` / Windows UIA element /
Linux AT-SPI accessible).

Construct via the static factories or via tree-walking methods on
another node / `Instance` / `Window` (`children`, `find`,
`scoredSearch`). Properties are resolved from the underlying
accessibility framework on each access; the node itself is just a
handle.

## Constructor

```typescript
AccessibilityNode(): AccessibilityNode
```

### Returns

`AccessibilityNode`

## Properties

<ResponseField name={"automationId"} type={"string"} required>
  UIA `AutomationId` (Windows). Empty on macOS / Linux.
</ResponseField>

<ResponseField name={"className"} type={"string"} required>
  Platform class name (Windows UIA `ClassName` / macOS subrole).
</ResponseField>

<ResponseField name={"controlType"} type={"number"} required>
  Numeric control type (`UIA_ControlTypeIds` on Windows, `0` on macOS).
</ResponseField>

<ResponseField name={"description"} type={"string"} required>
  Short description (`AXDescription` / UIA `Name`-adjacent fields).
</ResponseField>

<ResponseField name={"helpText"} type={"string"} required>
  Help text / tooltip.
</ResponseField>

<ResponseField name={"isEnabled"} type={"boolean"} required>
  Whether the node accepts user input.
</ResponseField>

<ResponseField name={"localizedControlType"} type={"string"} required>
  Localized control type string.
</ResponseField>

<ResponseField name={"name"} type={"string"} required>
  Accessible name (title / label).
</ResponseField>

<ResponseField name={"overallDescription"} type={"string"} required>
  Synthetic, query-friendly description used by `scoredSearch` (combines
  the node's role, label, value, and a small amount of ancestor context).
</ResponseField>

<ResponseField name={"role"} type={"AriaRole"} required>
  Cross-platform ARIA role.
</ResponseField>

<ResponseField name={"value"} type={"string"} required>
  Current text value (textbox content, slider value as string, …).
</ResponseField>

## Methods

### activate()

```typescript
activate(): void
```

Invoke / click the element (button, link, menu item).

### boundingBox()

```typescript
boundingBox(): BoundingBox
```

Live bounding box of the element in global physical pixels.
`right` and `bottom` are exclusive (Playwright / DOM convention).

#### Returns

`BoundingBox`

### children()

```typescript
children(): AccessibilityNode[]
```

Direct child nodes. Returns an empty array if the subtree has been
torn down or the children attribute is unreadable (matching
simulang-rs's convention of treating walk failures as "no children").

#### Returns

`AccessibilityNode[]`

### expandCollapse()

```typescript
expandCollapse(): void
```

Expand or collapse a dropdown or tree item.

### focus()

```typescript
focus(): void
```

Move keyboard focus to this element (brings its window to the
foreground as a side effect on most platforms).

### fromFocusedApplication()

```typescript
fromFocusedApplication(): AccessibilityNode
```

Root node of the currently focused application's accessibility tree.

#### Returns

`AccessibilityNode`

### fromPid()

```typescript
fromPid(pid: number): AccessibilityNode
```

Root node of the application identified by `pid`.

#### Parameters

<ResponseField name={"pid"} type={"number"} required />

#### Returns

`AccessibilityNode`

### scoredSearch()

```typescript
scoredSearch(order: TraversalOrder, maxNodes: number, collapseStructural: boolean, query: string, threshold: number): AccessibilityNode[]
```

Search this subtree by *concept text*, using bag-of-words
paired-Jaccard scoring against each node's `overallDescription`
(`simulang_rs::AXNodeSynthetic::summary_with_context`).

Returns every node whose score equals the maximum found and exceeds
`threshold` — same semantics as `simulang_rs::scored_search` with
`BowJaccard::score(...).primary` as the scorer and a permissive
filter.

* `order`               – `TraversalOrder.DepthFirst` or
  `TraversalOrder.BreadthFirst`
* `max_nodes`           – upper bound on nodes visited (uses `.take()`
  over the walk)
* `collapse_structural` – hoist empty structural wrappers out of the
  walk before scoring
* `query`               – natural-language concept Jaccard-compared
  against each node's `overallDescription`
* `threshold`           – minimum score to keep a node

#### Parameters

<ResponseField name={"order"} type={"TraversalOrder"} required />

<ResponseField name={"maxNodes"} type={"number"} required />

<ResponseField name={"collapseStructural"} type={"boolean"} required />

<ResponseField name={"query"} type={"string"} required />

<ResponseField name={"threshold"} type={"number"} required />

#### Returns

`AccessibilityNode[]`

### scrollIntoView()

```typescript
scrollIntoView(): void
```

Scroll the element into view.

### select()

```typescript
select(): void
```

Select a tab, radio button, or list item.

### setValue()

```typescript
setValue(value: string): void
```

Set the text value of the element (textbox, combobox, …).

#### Parameters

<ResponseField name={"value"} type={"string"} required />

### snapshot()

```typescript
snapshot(): string
```

Render this node's accessibility subtree as an indented
Playwright-style aria snapshot string.

One line per node, two spaces of indentation per depth level, in
pre-order DFS. Roles are emitted raw (`AXWindow` on macOS,
`UIA.ControlType.*` on Windows), with title and value appended when
non-empty.

#### Returns

`string`

### supportedActions()

```typescript
supportedActions(): string[]
```

Human-readable names of the actions this node currently supports
(e.g. `"activate"`, `"toggle"`, `"scroll_into_view"`).

#### Returns

`string[]`

### toggle()

```typescript
toggle(): void
```

Toggle a checkbox or switch.
