@wailsnet/plugin-os-info 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,38 @@
1
+ /**
2
+ * OS 信息插件(`os.*` 命令集,历史名,保留向后兼容)。
3
+ * 对应后端 Wails.Net.Plugins.OsInfo.OsInfoPlugin 注册的 `os.*` 命令。
4
+ */
5
+ export declare const os: {
6
+ /** 获取当前平台标识(如 `"windows"` / `"linux"`)。 */
7
+ platform: () => import("@wailsnet/runtime").CancellablePromise<string>;
8
+ /** 获取主机名。 */
9
+ hostname: () => import("@wailsnet/runtime").CancellablePromise<string>;
10
+ /** 获取 CPU 架构(小写,如 `"x64"` / `"arm64"`)。 */
11
+ arch: () => import("@wailsnet/runtime").CancellablePromise<string>;
12
+ /** 获取当前区域设置(culture 名,如 `"zh-CN"`)。 */
13
+ locale: () => import("@wailsnet/runtime").CancellablePromise<string>;
14
+ /** 获取操作系统版本字符串。 */
15
+ version: () => import("@wailsnet/runtime").CancellablePromise<string>;
16
+ /** 获取系统类型(如 `"Windows"` / `"Linux"`)。 */
17
+ type: () => import("@wailsnet/runtime").CancellablePromise<string>;
18
+ };
19
+ /**
20
+ * 系统信息 API(`system.*` 命令集,与前端 `wails.system.*` API 一致)。
21
+ * 对应后端 Wails.Net.Plugins.OsInfo.OsInfoPlugin 注册的 `system.*` 命令。
22
+ */
23
+ export declare const system: {
24
+ /** 获取当前平台标识(如 `"windows"` / `"linux"`)。 */
25
+ platform: () => import("@wailsnet/runtime").CancellablePromise<string>;
26
+ /** 获取主机名。 */
27
+ hostname: () => import("@wailsnet/runtime").CancellablePromise<string>;
28
+ /** 获取 CPU 架构(小写,如 `"x64"` / `"arm64"`)。 */
29
+ arch: () => import("@wailsnet/runtime").CancellablePromise<string>;
30
+ /** 获取当前区域设置(culture 名,如 `"zh-CN"`)。 */
31
+ locale: () => import("@wailsnet/runtime").CancellablePromise<string>;
32
+ /** 获取操作系统版本字符串。 */
33
+ version: () => import("@wailsnet/runtime").CancellablePromise<string>;
34
+ /** 获取系统类型(如 `"Windows"` / `"Linux"`)。 */
35
+ type: () => import("@wailsnet/runtime").CancellablePromise<string>;
36
+ /** 获取系统时区 ID(如 `"Asia/Shanghai"`)。 */
37
+ timezone: () => import("@wailsnet/runtime").CancellablePromise<string>;
38
+ };
package/dist/index.js ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @wailsnet/plugin-os-info — os-info 插件前端封装。
3
+ * 命令前缀 `os.*` 与 `system.*`(M3 runtime 变薄:从 @wailsnet/runtime 迁移至此,按需安装)。
4
+ * @platform windows,linux,macos,android 全平台通用插件。
5
+ */
6
+ import { call } from "@wailsnet/runtime";
7
+ /**
8
+ * OS 信息插件(`os.*` 命令集,历史名,保留向后兼容)。
9
+ * 对应后端 Wails.Net.Plugins.OsInfo.OsInfoPlugin 注册的 `os.*` 命令。
10
+ */
11
+ export const os = {
12
+ /** 获取当前平台标识(如 `"windows"` / `"linux"`)。 */
13
+ platform: () => call("os.platform", []),
14
+ /** 获取主机名。 */
15
+ hostname: () => call("os.hostname", []),
16
+ /** 获取 CPU 架构(小写,如 `"x64"` / `"arm64"`)。 */
17
+ arch: () => call("os.arch", []),
18
+ /** 获取当前区域设置(culture 名,如 `"zh-CN"`)。 */
19
+ locale: () => call("os.locale", []),
20
+ /** 获取操作系统版本字符串。 */
21
+ version: () => call("os.version", []),
22
+ /** 获取系统类型(如 `"Windows"` / `"Linux"`)。 */
23
+ type: () => call("os.type", []),
24
+ };
25
+ /**
26
+ * 系统信息 API(`system.*` 命令集,与前端 `wails.system.*` API 一致)。
27
+ * 对应后端 Wails.Net.Plugins.OsInfo.OsInfoPlugin 注册的 `system.*` 命令。
28
+ */
29
+ export const system = {
30
+ /** 获取当前平台标识(如 `"windows"` / `"linux"`)。 */
31
+ platform: () => call("system.platform", []),
32
+ /** 获取主机名。 */
33
+ hostname: () => call("system.hostname", []),
34
+ /** 获取 CPU 架构(小写,如 `"x64"` / `"arm64"`)。 */
35
+ arch: () => call("system.arch", []),
36
+ /** 获取当前区域设置(culture 名,如 `"zh-CN"`)。 */
37
+ locale: () => call("system.locale", []),
38
+ /** 获取操作系统版本字符串。 */
39
+ version: () => call("system.version", []),
40
+ /** 获取系统类型(如 `"Windows"` / `"Linux"`)。 */
41
+ type: () => call("system.type", []),
42
+ /** 获取系统时区 ID(如 `"Asia/Shanghai"`)。 */
43
+ timezone: () => call("system.timezone", []),
44
+ };
package/package.json CHANGED
@@ -1,6 +1,31 @@
1
1
  {
2
2
  "name": "@wailsnet/plugin-os-info",
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.