> ## 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.

# Window

# Class: Window

Defined in: [index.d.ts:1013](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1013)

Handle to an on-screen window. Constructed via \[`Window.all`] or
\[`Window.allForPid`] and exposes read-only metadata (`title`, `pid`)
alongside basic actions (`minimize`, `maximize`, `close`).

## Constructors

### Constructor

> **new Window**(): `Window`

#### Returns

`Window`

## Accessors

### pid

#### Get Signature

> **get** **pid**(): `number`

Defined in: [index.d.ts:1021](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1021)

Process ID that owns this window.

##### Returns

`number`

***

### title

#### Get Signature

> **get** **title**(): `string`

Defined in: [index.d.ts:1019](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1019)

Window title (may be empty).

##### Returns

`string`

## Methods

### close()

> **close**(): `void`

Defined in: [index.d.ts:1030](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1030)

Close the window (user-equivalent to clicking the close button /
pressing Alt+F4 / Cmd+W).

#### Returns

`void`

***

### maximize()

> **maximize**(): `void`

Defined in: [index.d.ts:1025](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1025)

Maximize / zoom the window.

#### Returns

`void`

***

### minimize()

> **minimize**(): `void`

Defined in: [index.d.ts:1023](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1023)

Minimize the window (hide to taskbar / Dock).

#### Returns

`void`

***

### scoredSearch()

> **scoredSearch**(`order`, `maxNodes`, `collapseStructural`, `query`, `threshold`): [`AccessibilityNode`](AccessibilityNode.mdx)\[]

Defined in: [index.d.ts:1068](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1068)

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

Mirrors `simulang_rs::Window::scored_search` (macOS / Linux) — on
Windows we use the same underlying primitive via
`WindowTrait::node().scored_search(...)`, which prebuilds the cached
UIA subtree so the walk costs a single IPC. Returns every node whose
score equals the maximum found and exceeds `threshold`.

* `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

Returned nodes are full `AccessibilityNode` handles — call action
methods (`activate`, `setValue`, …) directly on them, walk children
with `.children()`, or render a snapshot with `.snapshot()`.

#### Parameters

##### order

[`TraversalOrder`](../enumerations/TraversalOrder.mdx)

##### maxNodes

`number`

##### collapseStructural

`boolean`

##### query

`string`

##### threshold

`number`

#### Returns

[`AccessibilityNode`](AccessibilityNode.mdx)\[]

***

### snapshot()

> **snapshot**(): `string`

Defined in: [index.d.ts:1041](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1041)

Render the window's accessibility subtree as an indented
Playwright-style aria snapshot.

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. No refs are assigned — for ref-based interaction use
\[`AccessibilityTree.snapshot`] instead.

#### Returns

`string`

***

### all()

> `static` **all**(): `Window`\[]

Defined in: [index.d.ts:1017](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1017)

All visible top-level windows across every process.

#### Returns

`Window`\[]

***

### allForPid()

> `static` **allForPid**(`pid`): `Window`\[]

Defined in: [index.d.ts:1015](https://github.com/simular-ai/simulang-js-internal/blob/d2b85c3277cbb16ce50c0781e1db8ad2c8a5690e/index.d.ts#L1015)

All visible top-level windows for a given process.

#### Parameters

##### pid

`number`

#### Returns

`Window`\[]
