@wailsnet/plugin-path 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 +21 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +35 -0
- package/package.json +33 -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,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* path 插件前端 API(命令前缀 `path.*`)。
|
|
3
|
+
* 对应后端 Wails.Net.Plugins.Path.PathPlugin 注册的命令。
|
|
4
|
+
* 所有方法返回对应系统目录的绝对路径字符串。
|
|
5
|
+
*/
|
|
6
|
+
export declare const path: {
|
|
7
|
+
/** 获取应用数据目录(AppData + 应用名)。 */
|
|
8
|
+
appDataDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
9
|
+
/** 获取应用配置目录(Windows: AppData;Unix: ~/.config + 应用名)。 */
|
|
10
|
+
appConfigDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
11
|
+
/** 获取应用日志目录(AppData + 应用名 + logs)。 */
|
|
12
|
+
appLogDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
13
|
+
/** 获取应用缓存目录(系统临时目录 + 应用名)。 */
|
|
14
|
+
appCacheDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
15
|
+
/** 获取下载目录。 */
|
|
16
|
+
downloadDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
17
|
+
/** 获取文档目录。 */
|
|
18
|
+
documentDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
19
|
+
/** 获取用户主目录。 */
|
|
20
|
+
homeDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
21
|
+
/** 获取系统临时目录。 */
|
|
22
|
+
tempDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
23
|
+
/** 获取配置根目录(AppData,不含应用名)。 */
|
|
24
|
+
configDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
25
|
+
/** 获取数据根目录(AppData + 应用名)。 */
|
|
26
|
+
dataDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
27
|
+
/** 获取运行时目录(系统临时目录)。 */
|
|
28
|
+
runtimeDir: () => import("@wailsnet/runtime").CancellablePromise<string>;
|
|
29
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @wailsnet/plugin-path — path 插件前端封装。
|
|
3
|
+
* 命令前缀 `path.*`(M3 runtime 变薄:从 @wailsnet/runtime 迁移至此,按需安装)。
|
|
4
|
+
* @platform windows,linux,macos,android 全平台通用插件。
|
|
5
|
+
*/
|
|
6
|
+
import { call } from "@wailsnet/runtime";
|
|
7
|
+
/**
|
|
8
|
+
* path 插件前端 API(命令前缀 `path.*`)。
|
|
9
|
+
* 对应后端 Wails.Net.Plugins.Path.PathPlugin 注册的命令。
|
|
10
|
+
* 所有方法返回对应系统目录的绝对路径字符串。
|
|
11
|
+
*/
|
|
12
|
+
export const path = {
|
|
13
|
+
/** 获取应用数据目录(AppData + 应用名)。 */
|
|
14
|
+
appDataDir: () => call("path.appDataDir", []),
|
|
15
|
+
/** 获取应用配置目录(Windows: AppData;Unix: ~/.config + 应用名)。 */
|
|
16
|
+
appConfigDir: () => call("path.appConfigDir", []),
|
|
17
|
+
/** 获取应用日志目录(AppData + 应用名 + logs)。 */
|
|
18
|
+
appLogDir: () => call("path.appLogDir", []),
|
|
19
|
+
/** 获取应用缓存目录(系统临时目录 + 应用名)。 */
|
|
20
|
+
appCacheDir: () => call("path.appCacheDir", []),
|
|
21
|
+
/** 获取下载目录。 */
|
|
22
|
+
downloadDir: () => call("path.downloadDir", []),
|
|
23
|
+
/** 获取文档目录。 */
|
|
24
|
+
documentDir: () => call("path.documentDir", []),
|
|
25
|
+
/** 获取用户主目录。 */
|
|
26
|
+
homeDir: () => call("path.homeDir", []),
|
|
27
|
+
/** 获取系统临时目录。 */
|
|
28
|
+
tempDir: () => call("path.tempDir", []),
|
|
29
|
+
/** 获取配置根目录(AppData,不含应用名)。 */
|
|
30
|
+
configDir: () => call("path.configDir", []),
|
|
31
|
+
/** 获取数据根目录(AppData + 应用名)。 */
|
|
32
|
+
dataDir: () => call("path.dataDir", []),
|
|
33
|
+
/** 获取运行时目录(系统临时目录)。 */
|
|
34
|
+
runtimeDir: () => call("path.runtimeDir", []),
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wailsnet/plugin-path",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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-path"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p tsconfig.json",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
35
|
+
}
|
|
6
36
|
}
|
package/README.md
DELETED