@wailsnet/plugin-window 0.0.0-stage → 0.1.0-alpha.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Wails.Net Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,79 @@
1
+ import type { Point, Size } from "@wailsnet/runtime";
2
+ /** 单个窗口控制(命令前缀 `window.*`)。 */
3
+ export declare const window: {
4
+ setTitle: (title: string) => import("@wailsnet/runtime").CancellablePromise<void>;
5
+ setSize: (width: number, height: number) => import("@wailsnet/runtime").CancellablePromise<void>;
6
+ setMinSize: (width: number, height: number) => import("@wailsnet/runtime").CancellablePromise<void>;
7
+ setMaxSize: (width: number, height: number) => import("@wailsnet/runtime").CancellablePromise<void>;
8
+ getSize: () => import("@wailsnet/runtime").CancellablePromise<Size>;
9
+ setPosition: (x: number, y: number) => import("@wailsnet/runtime").CancellablePromise<void>;
10
+ getPosition: () => import("@wailsnet/runtime").CancellablePromise<Point>;
11
+ centre: () => import("@wailsnet/runtime").CancellablePromise<void>;
12
+ show: () => import("@wailsnet/runtime").CancellablePromise<void>;
13
+ hide: () => import("@wailsnet/runtime").CancellablePromise<void>;
14
+ close: () => import("@wailsnet/runtime").CancellablePromise<void>;
15
+ focus: () => import("@wailsnet/runtime").CancellablePromise<void>;
16
+ isFocused: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
17
+ isVisible: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
18
+ minimize: () => import("@wailsnet/runtime").CancellablePromise<void>;
19
+ unminimize: () => import("@wailsnet/runtime").CancellablePromise<void>;
20
+ isMinimised: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
21
+ maximize: () => import("@wailsnet/runtime").CancellablePromise<void>;
22
+ unmaximize: () => import("@wailsnet/runtime").CancellablePromise<void>;
23
+ isMaximised: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
24
+ restore: () => import("@wailsnet/runtime").CancellablePromise<void>;
25
+ setFullscreen: (fullscreen: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
26
+ unfullscreen: () => import("@wailsnet/runtime").CancellablePromise<void>;
27
+ isFullscreen: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
28
+ setAlwaysOnTop: (onTop: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
29
+ setResizable: (resizable: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
30
+ setFrameless: (frameless: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
31
+ setSkipTaskbar: (skip: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
32
+ setIgnoreCursorEvents: (ignore: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
33
+ setVisibleOnAllWorkspaces: (visible: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
34
+ setBorderColor: (color: string | null) => import("@wailsnet/runtime").CancellablePromise<void>;
35
+ setFileDropEnabled: (enabled: boolean) => import("@wailsnet/runtime").CancellablePromise<void>;
36
+ setOpacity: (opacity: number) => import("@wailsnet/runtime").CancellablePromise<void>;
37
+ getOpacity: () => import("@wailsnet/runtime").CancellablePromise<number>;
38
+ setBadgeCount: (count: number) => import("@wailsnet/runtime").CancellablePromise<void>;
39
+ setBadgeLabel: (label: string | null) => import("@wailsnet/runtime").CancellablePromise<void>;
40
+ setURL: (url: string) => import("@wailsnet/runtime").CancellablePromise<void>;
41
+ getURL: () => import("@wailsnet/runtime").CancellablePromise<string>;
42
+ setHTML: (html: string) => import("@wailsnet/runtime").CancellablePromise<void>;
43
+ reload: () => import("@wailsnet/runtime").CancellablePromise<void>;
44
+ goBack: () => import("@wailsnet/runtime").CancellablePromise<void>;
45
+ goForward: () => import("@wailsnet/runtime").CancellablePromise<void>;
46
+ execJS: (js: string) => import("@wailsnet/runtime").CancellablePromise<void>;
47
+ injectCSS: (css: string) => import("@wailsnet/runtime").CancellablePromise<void>;
48
+ setZoom: (zoom: number) => import("@wailsnet/runtime").CancellablePromise<void>;
49
+ getZoom: () => import("@wailsnet/runtime").CancellablePromise<number>;
50
+ zoomIn: () => import("@wailsnet/runtime").CancellablePromise<void>;
51
+ zoomOut: () => import("@wailsnet/runtime").CancellablePromise<void>;
52
+ zoomReset: () => import("@wailsnet/runtime").CancellablePromise<void>;
53
+ openDevTools: () => import("@wailsnet/runtime").CancellablePromise<void>;
54
+ closeDevTools: () => import("@wailsnet/runtime").CancellablePromise<void>;
55
+ print: () => import("@wailsnet/runtime").CancellablePromise<void>;
56
+ /**
57
+ * 将当前窗口内容打印为 PDF 并写入指定路径。
58
+ * 后端签名为 `Action<ICommandContext, WindowPrintToPdfOptions>`,无返回值。
59
+ * @param path 目标 PDF 文件路径(必填)。
60
+ * @param options 可选的打印参数。
61
+ */
62
+ printToPDF: (path: string, options?: PrintToPdfOptions) => import("@wailsnet/runtime").CancellablePromise<void>;
63
+ registerCustomScheme: (scheme: string) => import("@wailsnet/runtime").CancellablePromise<void>;
64
+ };
65
+ /** `window.printToPDF` 的可选打印参数。 */
66
+ export interface PrintToPdfOptions {
67
+ /** 是否横向。 */
68
+ landscape?: boolean;
69
+ /** 是否打印背景图形。 */
70
+ printBackground?: boolean;
71
+ /** 缩放比例。 */
72
+ scale?: number;
73
+ /** 纸张宽度(英寸)。 */
74
+ paperWidth?: number;
75
+ /** 纸张高度(英寸)。 */
76
+ paperHeight?: number;
77
+ /** 其他扩展字段。 */
78
+ [key: string]: unknown;
79
+ }
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @wailsnet/plugin-window — window 插件前端封装。
3
+ * 命令前缀 `window.*`(M3 runtime 变薄:从 @wailsnet/runtime 迁移至此,按需安装)。
4
+ * @platform windows,linux,macos 桌面通用插件。
5
+ */
6
+ import { call } from "@wailsnet/runtime";
7
+ /** 单个窗口控制(命令前缀 `window.*`)。 */
8
+ export const window = {
9
+ setTitle: (title) => call("window.setTitle", [{ title }]),
10
+ setSize: (width, height) => call("window.setSize", [{ width, height }]),
11
+ setMinSize: (width, height) => call("window.setMinSize", [{ width, height }]),
12
+ setMaxSize: (width, height) => call("window.setMaxSize", [{ width, height }]),
13
+ getSize: () => call("window.getSize", []),
14
+ setPosition: (x, y) => call("window.setPosition", [{ x, y }]),
15
+ getPosition: () => call("window.getPosition", []),
16
+ centre: () => call("window.centre", []),
17
+ show: () => call("window.show", []),
18
+ hide: () => call("window.hide", []),
19
+ close: () => call("window.close", []),
20
+ focus: () => call("window.focus", []),
21
+ isFocused: () => call("window.isFocused", []),
22
+ isVisible: () => call("window.isVisible", []),
23
+ minimize: () => call("window.minimize", []),
24
+ unminimize: () => call("window.unminimize", []),
25
+ isMinimised: () => call("window.isMinimised", []),
26
+ maximize: () => call("window.maximize", []),
27
+ unmaximize: () => call("window.unmaximize", []),
28
+ isMaximised: () => call("window.isMaximised", []),
29
+ restore: () => call("window.restore", []),
30
+ setFullscreen: (fullscreen) => call("window.setFullscreen", [{ fullscreen }]),
31
+ unfullscreen: () => call("window.unfullscreen", []),
32
+ isFullscreen: () => call("window.isFullscreen", []),
33
+ setAlwaysOnTop: (onTop) => call("window.setAlwaysOnTop", [{ onTop }]),
34
+ setResizable: (resizable) => call("window.setResizable", [{ resizable }]),
35
+ setFrameless: (frameless) => call("window.setFrameless", [{ frameless }]),
36
+ setSkipTaskbar: (skip) => call("window.setSkipTaskbar", [{ skip }]),
37
+ setIgnoreCursorEvents: (ignore) => call("window.setIgnoreCursorEvents", [{ ignore }]),
38
+ setVisibleOnAllWorkspaces: (visible) => call("window.setVisibleOnAllWorkspaces", [{ visible }]),
39
+ setBorderColor: (color) => call("window.setBorderColor", [{ color }]),
40
+ setFileDropEnabled: (enabled) => call("window.setFileDropEnabled", [{ enabled }]),
41
+ setOpacity: (opacity) => call("window.setOpacity", [{ opacity }]),
42
+ getOpacity: () => call("window.getOpacity", []),
43
+ setBadgeCount: (count) => call("window.setBadgeCount", [{ count }]),
44
+ setBadgeLabel: (label) => call("window.setBadgeLabel", [{ label }]),
45
+ setURL: (url) => call("window.setURL", [{ url }]),
46
+ getURL: () => call("window.getURL", []),
47
+ setHTML: (html) => call("window.setHTML", [{ html }]),
48
+ reload: () => call("window.reload", []),
49
+ goBack: () => call("window.goBack", []),
50
+ goForward: () => call("window.goForward", []),
51
+ execJS: (js) => call("window.execJS", [{ js }]),
52
+ injectCSS: (css) => call("window.injectCSS", [{ css }]),
53
+ setZoom: (zoom) => call("window.setZoom", [{ zoom }]),
54
+ getZoom: () => call("window.getZoom", []),
55
+ zoomIn: () => call("window.zoomIn", []),
56
+ zoomOut: () => call("window.zoomOut", []),
57
+ zoomReset: () => call("window.zoomReset", []),
58
+ openDevTools: () => call("window.openDevTools", []),
59
+ closeDevTools: () => call("window.closeDevTools", []),
60
+ print: () => call("window.print", []),
61
+ /**
62
+ * 将当前窗口内容打印为 PDF 并写入指定路径。
63
+ * 后端签名为 `Action<ICommandContext, WindowPrintToPdfOptions>`,无返回值。
64
+ * @param path 目标 PDF 文件路径(必填)。
65
+ * @param options 可选的打印参数。
66
+ */
67
+ printToPDF: (path, options) => call("window.printToPDF", [{ path, options }]),
68
+ registerCustomScheme: (scheme) => call("window.registerCustomScheme", [{ scheme }]),
69
+ };
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@wailsnet/plugin-window",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.2",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./package.json": "./package.json"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@wailsnet/runtime": "0.1.0-alpha.2"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.9.3"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "registry": "https://registry.npmjs.org"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/lytree/Wails.Net.git",
30
+ "directory": "packages/wails-net-plugin-window"
31
+ },
32
+ "scripts": {
33
+ "build": "tsc -p tsconfig.json",
34
+ "typecheck": "tsc --noEmit"
35
+ }
6
36
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.