@wailsnet/plugin-tray 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 +21 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +20 -0
- package/package.json +28 -3
- package/README.md +0 -3
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.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Menu } from "@wailsnet/runtime";
|
|
2
|
+
/** tray.setIcon 命令参数。 */
|
|
3
|
+
export interface TrayIconOptions {
|
|
4
|
+
/** 图标二进制数据(Base64 字符串,对应后端 byte[])。 */
|
|
5
|
+
iconData?: string;
|
|
6
|
+
}
|
|
7
|
+
/** tray.setLabel 命令参数。 */
|
|
8
|
+
export interface TrayLabelOptions {
|
|
9
|
+
/** 标签文本。 */
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
/** tray.setMenu 命令参数。 */
|
|
13
|
+
export interface TrayMenuOptions {
|
|
14
|
+
/** 要关联的菜单实例;省略表示清除已关联的菜单。 */
|
|
15
|
+
menu?: Menu;
|
|
16
|
+
}
|
|
17
|
+
/** tray.setTooltip 命令参数。 */
|
|
18
|
+
export interface TrayTooltipOptions {
|
|
19
|
+
/** 提示文本。 */
|
|
20
|
+
tooltip: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const tray: {
|
|
23
|
+
/** 设置当前活动托盘实例的图标。 */
|
|
24
|
+
setIcon: (opts: TrayIconOptions) => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
25
|
+
/** 设置当前活动托盘实例的标签文本。 */
|
|
26
|
+
setLabel: (opts: TrayLabelOptions) => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
27
|
+
/** 设置当前活动托盘实例关联的菜单。 */
|
|
28
|
+
setMenu: (opts: TrayMenuOptions) => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
29
|
+
/** 设置当前活动托盘实例的提示文本。 */
|
|
30
|
+
setTooltip: (opts: TrayTooltipOptions) => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
31
|
+
/** 销毁当前活动托盘实例。 */
|
|
32
|
+
destroy: () => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
33
|
+
/** 显示托盘图标。 */
|
|
34
|
+
show: () => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
35
|
+
/** 隐藏托盘图标。 */
|
|
36
|
+
hide: () => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
37
|
+
/** 查询当前活动托盘实例是否可见。 */
|
|
38
|
+
isVisible: () => import("@wailsnet/runtime").CancellablePromise<boolean>;
|
|
39
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** M3 runtime 变薄:从 @wailsnet/runtime 迁移,按需安装 */
|
|
2
|
+
import { call } from "@wailsnet/runtime";
|
|
3
|
+
export const tray = {
|
|
4
|
+
/** 设置当前活动托盘实例的图标。 */
|
|
5
|
+
setIcon: (opts) => call("tray.setIcon", [opts]),
|
|
6
|
+
/** 设置当前活动托盘实例的标签文本。 */
|
|
7
|
+
setLabel: (opts) => call("tray.setLabel", [opts]),
|
|
8
|
+
/** 设置当前活动托盘实例关联的菜单。 */
|
|
9
|
+
setMenu: (opts) => call("tray.setMenu", [opts]),
|
|
10
|
+
/** 设置当前活动托盘实例的提示文本。 */
|
|
11
|
+
setTooltip: (opts) => call("tray.setTooltip", [opts]),
|
|
12
|
+
/** 销毁当前活动托盘实例。 */
|
|
13
|
+
destroy: () => call("tray.destroy", []),
|
|
14
|
+
/** 显示托盘图标。 */
|
|
15
|
+
show: () => call("tray.show", []),
|
|
16
|
+
/** 隐藏托盘图标。 */
|
|
17
|
+
hide: () => call("tray.hide", []),
|
|
18
|
+
/** 查询当前活动托盘实例是否可见。 */
|
|
19
|
+
isVisible: () => call("tray.isVisible", []),
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wailsnet/plugin-tray",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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