@wailsnet/plugin-application 0.0.0-stage → 0.1.0-alpha.1

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,37 @@
1
+ import type { ScreenInfo } from "@wailsnet/runtime";
2
+ /** `application.setIcon` 命令参数。对应后端 `ApplicationIconOptions`(byte[] 以 Base64 字符串表示)。 */
3
+ export interface ApplicationIconOptions {
4
+ /** 图标二进制数据(Base64 字符串),可为空。 */
5
+ iconData?: string;
6
+ }
7
+ /**
8
+ * application 插件前端 API(命令前缀 `application.*`)。
9
+ * 对应后端 Wails.Net.Plugins.Application.ApplicationPlugin 注册的命令。
10
+ * 屏幕信息复用运行时共享类型 {@link ScreenInfo}。
11
+ */
12
+ export declare const application: {
13
+ /** 退出应用。 */
14
+ quit: () => import("@wailsnet/runtime").CancellablePromise<void>;
15
+ /** 隐藏主窗口。 */
16
+ hide: () => import("@wailsnet/runtime").CancellablePromise<void>;
17
+ /** 显示主窗口。 */
18
+ show: () => import("@wailsnet/runtime").CancellablePromise<void>;
19
+ /** 获取应用名称。 */
20
+ getName: () => import("@wailsnet/runtime").CancellablePromise<string>;
21
+ /** 获取应用版本。 */
22
+ getVersion: () => import("@wailsnet/runtime").CancellablePromise<string>;
23
+ /** 获取应用描述。 */
24
+ getDescription: () => import("@wailsnet/runtime").CancellablePromise<string>;
25
+ /** 设置应用图标(iconData 为 Base64 编码的图标二进制数据)。 */
26
+ setIcon: (options: ApplicationIconOptions) => import("@wailsnet/runtime").CancellablePromise<void>;
27
+ /** 查询当前是否为深色模式。 */
28
+ isDarkMode: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
29
+ /** 获取系统强调色(如 `"#FF0000"`)。 */
30
+ getAccentColor: () => import("@wailsnet/runtime").CancellablePromise<string>;
31
+ /** 获取主屏幕信息(无主屏时为 null)。 */
32
+ getPrimaryScreen: () => import("@wailsnet/runtime").CancellablePromise<ScreenInfo>;
33
+ /** 获取所有屏幕信息。 */
34
+ getScreens: () => import("@wailsnet/runtime").CancellablePromise<ScreenInfo[]>;
35
+ /** 显示"关于"对话框。 */
36
+ showAboutDialog: () => import("@wailsnet/runtime").CancellablePromise<void>;
37
+ };
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @wailsnet/plugin-application — application 插件前端封装。
3
+ * 命令前缀 `application.*`(M3 runtime 变薄:从 @wailsnet/runtime 迁移至此,按需安装)。
4
+ * @platform windows,linux,macos,android 全平台通用插件。
5
+ */
6
+ import { call } from "@wailsnet/runtime";
7
+ /**
8
+ * application 插件前端 API(命令前缀 `application.*`)。
9
+ * 对应后端 Wails.Net.Plugins.Application.ApplicationPlugin 注册的命令。
10
+ * 屏幕信息复用运行时共享类型 {@link ScreenInfo}。
11
+ */
12
+ export const application = {
13
+ /** 退出应用。 */
14
+ quit: () => call("application.quit", []),
15
+ /** 隐藏主窗口。 */
16
+ hide: () => call("application.hide", []),
17
+ /** 显示主窗口。 */
18
+ show: () => call("application.show", []),
19
+ /** 获取应用名称。 */
20
+ getName: () => call("application.getName", []),
21
+ /** 获取应用版本。 */
22
+ getVersion: () => call("application.getVersion", []),
23
+ /** 获取应用描述。 */
24
+ getDescription: () => call("application.getDescription", []),
25
+ /** 设置应用图标(iconData 为 Base64 编码的图标二进制数据)。 */
26
+ setIcon: (options) => call("application.setIcon", [options]),
27
+ /** 查询当前是否为深色模式。 */
28
+ isDarkMode: () => call("application.isDarkMode", []),
29
+ /** 获取系统强调色(如 `"#FF0000"`)。 */
30
+ getAccentColor: () => call("application.getAccentColor", []),
31
+ /** 获取主屏幕信息(无主屏时为 null)。 */
32
+ getPrimaryScreen: () => call("application.getPrimaryScreen", []),
33
+ /** 获取所有屏幕信息。 */
34
+ getScreens: () => call("application.getScreens", []),
35
+ /** 显示"关于"对话框。 */
36
+ showAboutDialog: () => call("application.showAboutDialog", []),
37
+ };
package/package.json CHANGED
@@ -1,6 +1,31 @@
1
1
  {
2
2
  "name": "@wailsnet/plugin-application",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.1",
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.1"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.9.3"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "registry": "https://registry.npmjs.org"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc -p tsconfig.json",
29
+ "typecheck": "tsc --noEmit"
30
+ }
6
31
  }
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.