onchain-uikit 5.0.2-alpha4 → 5.0.2-alpha5

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ const uploader = new FileUploader({
3
+ endpoint: `${qiankunModel.config.OSS_URL}`,
4
+ getToken: () => StorageController.token.get(),
5
+ onSuccess: (file, response) => {
6
+ CommonService.toPostFileRecord({
7
+ file,
8
+ response,
9
+ type: '0',
10
+ });
11
+ },
12
+ onError: (err) => {
13
+ console.error(err);
14
+ },
15
+ });
16
+ const url = await uploader.upload(file);
17
+ */
18
+ interface UploadOptions {
19
+ endpoint: string;
20
+ getToken: () => string;
21
+ chunkSize?: number;
22
+ onSuccess?: (file: any, response: any) => void;
23
+ onError?: (error: any) => void;
24
+ }
25
+ export declare class FileUploader {
26
+ private uppy;
27
+ private options;
28
+ constructor(options: UploadOptions);
29
+ private bindEvents;
30
+ /**
31
+ * 上传文件
32
+ */
33
+ upload(file: File): Promise<string>;
34
+ /**
35
+ * 销毁实例(很重要,避免内存泄漏)
36
+ */
37
+ destroy(): void;
38
+ }
39
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "onchain-uikit",
3
3
  "private": false,
4
- "version": "5.0.2-alpha4",
4
+ "version": "5.0.2-alpha5",
5
5
  "scripts": {
6
6
  "dev": "vite",
7
7
  "build": "cross-env NODE_OPTIONS=--max_old_space_size=4096 vite build",