Skip to content

lightgun-poc / lib/monitors / selectMonitor

Function: selectMonitor()

selectMonitor(report, choice): MonitorRect | null

Defined in: lib/monitors.ts:80

Resolves a choice against what was detected.

primary (the default) returns null when nothing was detected — the caller degrades to the full primary screen, which is exactly the pre-flag behavior, so the default can never regress anyone (headless CI included). all and an explicit index are requests the user typed: honoring them wrongly would move the cursor on a different screen than they aim at, so an unsatisfiable one THROWS with the reason instead of degrading.

Parameters

report

MonitorsReport

choice

MonitorChoice

Returns

MonitorRect | null

Released under the MIT License.