5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-06 05:10:28 +08:00
wails/v3/internal/runtime/desktop/screens.js
2023-08-27 15:54:01 +10:00

48 lines
883 B
JavaScript

/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
/* jshint esversion: 9 */
/**
* @typedef {import("./api/types").Screen} Screen
*/
import {newRuntimeCallerWithID, objectNames} from "./runtime";
let call = newRuntimeCallerWithID(objectNames.Screens);
let ScreensGetAll = 0;
let ScreensGetPrimary = 1;
let ScreensGetCurrent = 2;
/**
* Gets all screens.
* @returns {Promise<Screen[]>}
*/
export function GetAll() {
return call(ScreensGetAll);
}
/**
* Gets the primary screen.
* @returns {Promise<Screen>}
*/
export function GetPrimary() {
return call(ScreensGetPrimary);
}
/**
* Gets the current active screen.
* @returns {Promise<Screen>}
* @constructor
*/
export function GetCurrent() {
return call(ScreensGetCurrent);
}