# `Plushie.Runtime.Windows`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/runtime/windows.ex#L1)

Window lifecycle management for the Plushie runtime.

Detects window nodes in the UI tree, opens/closes/updates windows
via the bridge, and tracks the set of active window IDs on the
runtime state.

# `detect_windows`

```elixir
@spec detect_windows(map() | nil) :: MapSet.t()
```

Detects window node IDs from the tree. Searches the entire tree
recursively, matching the Rust renderer's behavior.

# `sync_windows`

```elixir
@spec sync_windows(map(), map() | nil) :: map()
```

Synchronizes the runtime's tracked windows with the current tree.

Opens windows that appeared in the new tree, closes windows that
were removed, and sends update ops for windows whose props changed.
Returns the updated state with the new window set.

# `sync_windows`

```elixir
@spec sync_windows(map(), map() | nil, MapSet.t()) :: map()
```

Same as `sync_windows/2` but accepts a pre-computed window set,
avoiding a redundant tree walk when the caller already has it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
