@xiaou66/picture-plugin 0.0.4 → 0.0.5
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IUploadFileResult {
|
|
2
2
|
/**
|
|
3
3
|
* 上传后文件访问地址
|
|
4
4
|
*/
|
|
@@ -8,20 +8,44 @@ export interface IUploadResult {
|
|
|
8
8
|
*/
|
|
9
9
|
extra: any;
|
|
10
10
|
}
|
|
11
|
+
export interface IUploadFileParams {
|
|
12
|
+
/**
|
|
13
|
+
* 上传 id
|
|
14
|
+
*/
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/**
|
|
17
|
+
* 文件路径
|
|
18
|
+
*/
|
|
19
|
+
readonly filePath: string;
|
|
20
|
+
/**
|
|
21
|
+
* 文件名称
|
|
22
|
+
*/
|
|
23
|
+
readonly fileName: string;
|
|
24
|
+
/**
|
|
25
|
+
* 文件大小
|
|
26
|
+
*/
|
|
27
|
+
readonly fileSize: number;
|
|
28
|
+
/**
|
|
29
|
+
* 文件
|
|
30
|
+
*/
|
|
31
|
+
readonly file: File;
|
|
32
|
+
}
|
|
11
33
|
/**
|
|
12
34
|
* 插件接口
|
|
13
35
|
*/
|
|
14
|
-
export interface IStoragePlugIn {
|
|
36
|
+
export interface IStoragePlugIn<C = any> {
|
|
15
37
|
/**
|
|
16
|
-
*
|
|
38
|
+
* 插件初始化调用
|
|
17
39
|
*/
|
|
18
40
|
init(): void;
|
|
19
41
|
/**
|
|
20
42
|
* 上传文件
|
|
43
|
+
* @param params 参数
|
|
44
|
+
* @param config 配置文件
|
|
21
45
|
*/
|
|
22
|
-
uploadFile():
|
|
46
|
+
uploadFile(params: IUploadFileParams, config: C): IUploadFileResult;
|
|
23
47
|
/**
|
|
24
|
-
*
|
|
48
|
+
* 插件销毁调用
|
|
25
49
|
*/
|
|
26
50
|
destroy(): void;
|
|
27
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiaou66/picture-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Picture bed plugin system",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "vite build",
|
|
16
16
|
"dev": "vite",
|
|
17
|
-
"prepare": "npm run build"
|
|
17
|
+
"prepare": "npm run build",
|
|
18
|
+
"publish": "npm publish"
|
|
18
19
|
},
|
|
19
20
|
"author": "xiaou",
|
|
20
21
|
"license": "ISC",
|