Skip to main content
Access via:io.displays

Displays API.

10 Methods

all()⚓︎

() => Promise<Display[]>

Returns all available displays.

capture()⚓︎

(options: CaptureOptions) => Promise<string>

Returns a Base64 string of the screenshot of a single display.

Parameters (1)

Name Type Required Description
options⚓︎ CaptureOptions

Options for capturing the display.

captureAll()⚓︎

(options: CaptureAllOptions) => Promise<string | string[]>

Returns a Base64 string of the screenshots of all displays. The returned value depends on the combined property specified in the options object.

Parameters (1)

Name Type Required Description
options⚓︎ CaptureAllOptions

Options for capturing the displays.

convertBounds()⚓︎

Converts display bounds between the different coordinate systems - physical (screen pixels), electron (Electron DIP pixels), and logical (location scaled by primary display scale, size - by target display scale).

io.Connect Desktop 10.2@interopio/desktop 6.20

Parameters (1)

Name Type Required Description
options⚓︎ ConvertBoundsOptions

Options for converting display bounds.

get()⚓︎

(id: number) => Promise<Display>

Returns a single display by ID.

Parameters (1)

Name Type Required Description
id⚓︎ number

ID of the desired display.

getByBounds()⚓︎

(options: GetByBoundsOptions) => Promise<Display>

Retrieves the display matching the specified bounds in the given coordinate system.

io.Connect Desktop 10.2@interopio/desktop 6.20

Parameters (1)

Name Type Required Description
options⚓︎ GetByBoundsOptions

Options for retrieving a display by provided bounds.

getByWindowId()⚓︎

(id: string) => Promise<Display>

Returns a single display by window ID.

Parameters (1)

Name Type Required Description
id⚓︎ string

Window ID of the desired display.

getMousePosition()⚓︎

() => Promise<Point>

Returns the X and Y coordinates of the mouse cursor.

getPrimary()⚓︎

() => Promise<Display>

Returns the primary display.

onDisplayChanged()⚓︎

(cb: (displays: Display[]) => void) => UnsubscribeFunction

Notifies when the display is changed.

Parameters (1)

Name Type Required Description
cb⚓︎ (displays: Display[]) => void x