@wailsio/runtime 3.0.0-alpha.26 → 3.0.0-alpha.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -4
- package/src/screens.js +12 -18
- package/types/screens.d.ts +21 -19
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wailsio/runtime",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "3.0.0-alpha.28",
|
|
4
5
|
"description": "Wails Runtime",
|
|
5
|
-
"
|
|
6
|
-
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"require": "./src/index.js",
|
|
10
|
+
"import": "./src/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
"repository": {
|
|
8
14
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/wailsapp/wails.git"
|
|
15
|
+
"url": "git+https://github.com/wailsapp/wails.git"
|
|
10
16
|
},
|
|
11
17
|
"scripts": {
|
|
12
18
|
"prebuild:types": "rimraf ./types",
|
package/src/screens.js
CHANGED
|
@@ -10,44 +10,38 @@ The electron alternative for Go
|
|
|
10
10
|
|
|
11
11
|
/* jshint esversion: 9 */
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {Object} Position
|
|
15
|
-
* @property {number} X - The X coordinate.
|
|
16
|
-
* @property {number} Y - The Y coordinate.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
13
|
/**
|
|
20
14
|
* @typedef {Object} Size
|
|
21
|
-
* @property {number}
|
|
22
|
-
* @property {number}
|
|
15
|
+
* @property {number} Width - The width.
|
|
16
|
+
* @property {number} Height - The height.
|
|
23
17
|
*/
|
|
24
18
|
|
|
25
|
-
|
|
26
19
|
/**
|
|
27
20
|
* @typedef {Object} Rect
|
|
28
|
-
* @property {number} X - The X coordinate of the
|
|
29
|
-
* @property {number} Y - The Y coordinate of the
|
|
21
|
+
* @property {number} X - The X coordinate of the origin.
|
|
22
|
+
* @property {number} Y - The Y coordinate of the origin.
|
|
30
23
|
* @property {number} Width - The width of the rectangle.
|
|
31
24
|
* @property {number} Height - The height of the rectangle.
|
|
32
25
|
*/
|
|
33
26
|
|
|
34
|
-
|
|
35
27
|
/**
|
|
36
28
|
* @typedef {Object} Screen
|
|
37
|
-
* @property {string}
|
|
29
|
+
* @property {string} ID - Unique identifier for the screen.
|
|
38
30
|
* @property {string} Name - Human readable name of the screen.
|
|
39
|
-
* @property {number}
|
|
40
|
-
* @property {
|
|
31
|
+
* @property {number} ScaleFactor - The scale factor of the screen (DPI/96). 1 = standard DPI, 2 = HiDPI (Retina), etc.
|
|
32
|
+
* @property {number} X - The X coordinate of the screen.
|
|
33
|
+
* @property {number} Y - The Y coordinate of the screen.
|
|
41
34
|
* @property {Size} Size - Contains the width and height of the screen.
|
|
42
35
|
* @property {Rect} Bounds - Contains the bounds of the screen in terms of X, Y, Width, and Height.
|
|
36
|
+
* @property {Rect} PhysicalBounds - Contains the physical bounds of the screen in terms of X, Y, Width, and Height (before scaling).
|
|
43
37
|
* @property {Rect} WorkArea - Contains the area of the screen that is actually usable (excluding taskbar and other system UI).
|
|
38
|
+
* @property {Rect} PhysicalWorkArea - Contains the physical WorkArea of the screen (before scaling).
|
|
44
39
|
* @property {boolean} IsPrimary - True if this is the primary monitor selected by the user in the operating system.
|
|
45
40
|
* @property {number} Rotation - The rotation of the screen.
|
|
46
41
|
*/
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const call = newRuntimeCallerWithID(objectNames.Screens, '');
|
|
43
|
+
import { newRuntimeCallerWithID, objectNames } from "./runtime";
|
|
44
|
+
const call = newRuntimeCallerWithID(objectNames.Screens, "");
|
|
51
45
|
|
|
52
46
|
const getAll = 0;
|
|
53
47
|
const getPrimary = 1;
|
package/types/screens.d.ts
CHANGED
|
@@ -14,33 +14,23 @@ export function GetPrimary(): Promise<Screen>;
|
|
|
14
14
|
* @returns {Promise<Screen>} A promise that resolves with the current active screen.
|
|
15
15
|
*/
|
|
16
16
|
export function GetCurrent(): Promise<Screen>;
|
|
17
|
-
export type Position = {
|
|
18
|
-
/**
|
|
19
|
-
* - The X coordinate.
|
|
20
|
-
*/
|
|
21
|
-
X: number;
|
|
22
|
-
/**
|
|
23
|
-
* - The Y coordinate.
|
|
24
|
-
*/
|
|
25
|
-
Y: number;
|
|
26
|
-
};
|
|
27
17
|
export type Size = {
|
|
28
18
|
/**
|
|
29
19
|
* - The width.
|
|
30
20
|
*/
|
|
31
|
-
|
|
21
|
+
Width: number;
|
|
32
22
|
/**
|
|
33
23
|
* - The height.
|
|
34
24
|
*/
|
|
35
|
-
|
|
25
|
+
Height: number;
|
|
36
26
|
};
|
|
37
27
|
export type Rect = {
|
|
38
28
|
/**
|
|
39
|
-
* - The X coordinate of the
|
|
29
|
+
* - The X coordinate of the origin.
|
|
40
30
|
*/
|
|
41
31
|
X: number;
|
|
42
32
|
/**
|
|
43
|
-
* - The Y coordinate of the
|
|
33
|
+
* - The Y coordinate of the origin.
|
|
44
34
|
*/
|
|
45
35
|
Y: number;
|
|
46
36
|
/**
|
|
@@ -56,19 +46,23 @@ export type Screen = {
|
|
|
56
46
|
/**
|
|
57
47
|
* - Unique identifier for the screen.
|
|
58
48
|
*/
|
|
59
|
-
|
|
49
|
+
ID: string;
|
|
60
50
|
/**
|
|
61
51
|
* - Human readable name of the screen.
|
|
62
52
|
*/
|
|
63
53
|
Name: string;
|
|
64
54
|
/**
|
|
65
|
-
* - The
|
|
55
|
+
* - The scale factor of the screen (DPI/96). 1 = standard DPI, 2 = HiDPI (Retina), etc.
|
|
66
56
|
*/
|
|
67
|
-
|
|
57
|
+
ScaleFactor: number;
|
|
68
58
|
/**
|
|
69
|
-
* -
|
|
59
|
+
* - The X coordinate of the screen.
|
|
70
60
|
*/
|
|
71
|
-
|
|
61
|
+
X: number;
|
|
62
|
+
/**
|
|
63
|
+
* - The Y coordinate of the screen.
|
|
64
|
+
*/
|
|
65
|
+
Y: number;
|
|
72
66
|
/**
|
|
73
67
|
* - Contains the width and height of the screen.
|
|
74
68
|
*/
|
|
@@ -77,10 +71,18 @@ export type Screen = {
|
|
|
77
71
|
* - Contains the bounds of the screen in terms of X, Y, Width, and Height.
|
|
78
72
|
*/
|
|
79
73
|
Bounds: Rect;
|
|
74
|
+
/**
|
|
75
|
+
* - Contains the physical bounds of the screen in terms of X, Y, Width, and Height (before scaling).
|
|
76
|
+
*/
|
|
77
|
+
PhysicalBounds: Rect;
|
|
80
78
|
/**
|
|
81
79
|
* - Contains the area of the screen that is actually usable (excluding taskbar and other system UI).
|
|
82
80
|
*/
|
|
83
81
|
WorkArea: Rect;
|
|
82
|
+
/**
|
|
83
|
+
* - Contains the physical WorkArea of the screen (before scaling).
|
|
84
|
+
*/
|
|
85
|
+
PhysicalWorkArea: Rect;
|
|
84
86
|
/**
|
|
85
87
|
* - True if this is the primary monitor selected by the user in the operating system.
|
|
86
88
|
*/
|