nuxt-upload-kit 0.1.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/README.md +171 -0
- package/dist/module.d.mts +14 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +29 -0
- package/dist/runtime/composables/useFFMpeg.d.ts +14 -0
- package/dist/runtime/composables/useFFMpeg.js +66 -0
- package/dist/runtime/composables/useUploadKit/index.d.ts +471 -0
- package/dist/runtime/composables/useUploadKit/index.js +486 -0
- package/dist/runtime/composables/useUploadKit/plugins/image-compressor.d.ts +56 -0
- package/dist/runtime/composables/useUploadKit/plugins/image-compressor.js +137 -0
- package/dist/runtime/composables/useUploadKit/plugins/index.d.ts +4 -0
- package/dist/runtime/composables/useUploadKit/plugins/index.js +4 -0
- package/dist/runtime/composables/useUploadKit/plugins/storage/azure-datalake.d.ts +55 -0
- package/dist/runtime/composables/useUploadKit/plugins/storage/azure-datalake.js +137 -0
- package/dist/runtime/composables/useUploadKit/plugins/storage/index.d.ts +10 -0
- package/dist/runtime/composables/useUploadKit/plugins/storage/index.js +1 -0
- package/dist/runtime/composables/useUploadKit/plugins/thumbnail-generator.d.ts +8 -0
- package/dist/runtime/composables/useUploadKit/plugins/thumbnail-generator.js +99 -0
- package/dist/runtime/composables/useUploadKit/plugins/video-compressor.d.ts +72 -0
- package/dist/runtime/composables/useUploadKit/plugins/video-compressor.js +111 -0
- package/dist/runtime/composables/useUploadKit/types.d.ts +488 -0
- package/dist/runtime/composables/useUploadKit/types.js +9 -0
- package/dist/runtime/composables/useUploadKit/utils.d.ts +23 -0
- package/dist/runtime/composables/useUploadKit/utils.js +45 -0
- package/dist/runtime/composables/useUploadKit/validators/allowed-file-types.d.ts +5 -0
- package/dist/runtime/composables/useUploadKit/validators/allowed-file-types.js +17 -0
- package/dist/runtime/composables/useUploadKit/validators/duplicate-file.d.ts +13 -0
- package/dist/runtime/composables/useUploadKit/validators/duplicate-file.js +27 -0
- package/dist/runtime/composables/useUploadKit/validators/index.d.ts +4 -0
- package/dist/runtime/composables/useUploadKit/validators/index.js +4 -0
- package/dist/runtime/composables/useUploadKit/validators/max-file-size.d.ts +5 -0
- package/dist/runtime/composables/useUploadKit/validators/max-file-size.js +17 -0
- package/dist/runtime/composables/useUploadKit/validators/max-files.d.ts +5 -0
- package/dist/runtime/composables/useUploadKit/validators/max-files.js +17 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/types.d.mts +5 -0
- package/package.json +84 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import type { UploaderEvents, UploadFile, UploadOptions, UploadStatus, UploadFn, GetRemoteFileFn, Plugin as UploaderPlugin } from "./types.js";
|
|
2
|
+
export declare const useUploadKit: <TUploadResult = any>(_options?: UploadOptions) => {
|
|
3
|
+
files: Readonly<import("@vue/reactivity").Ref<readonly ({
|
|
4
|
+
readonly source: "local";
|
|
5
|
+
readonly data: {
|
|
6
|
+
readonly lastModified: number;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly webkitRelativePath: string;
|
|
9
|
+
readonly size: number;
|
|
10
|
+
readonly type: string;
|
|
11
|
+
readonly arrayBuffer: {
|
|
12
|
+
(): Promise<ArrayBuffer>;
|
|
13
|
+
(): Promise<ArrayBuffer>;
|
|
14
|
+
};
|
|
15
|
+
readonly bytes: {
|
|
16
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
17
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
18
|
+
};
|
|
19
|
+
readonly slice: {
|
|
20
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
21
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
22
|
+
};
|
|
23
|
+
readonly stream: {
|
|
24
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
25
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
26
|
+
};
|
|
27
|
+
readonly text: {
|
|
28
|
+
(): Promise<string>;
|
|
29
|
+
(): Promise<string>;
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
readonly size: number;
|
|
33
|
+
readonly type: string;
|
|
34
|
+
readonly arrayBuffer: {
|
|
35
|
+
(): Promise<ArrayBuffer>;
|
|
36
|
+
(): Promise<ArrayBuffer>;
|
|
37
|
+
};
|
|
38
|
+
readonly bytes: {
|
|
39
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
40
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
41
|
+
};
|
|
42
|
+
readonly slice: {
|
|
43
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
44
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
45
|
+
};
|
|
46
|
+
readonly stream: {
|
|
47
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
48
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
49
|
+
};
|
|
50
|
+
readonly text: {
|
|
51
|
+
(): Promise<string>;
|
|
52
|
+
(): Promise<string>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
readonly remoteUrl?: string | undefined;
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly size: number;
|
|
59
|
+
readonly mimeType: string;
|
|
60
|
+
readonly status: import("./types.js").FileStatus;
|
|
61
|
+
readonly preview?: string | undefined;
|
|
62
|
+
readonly progress: {
|
|
63
|
+
readonly percentage: number;
|
|
64
|
+
};
|
|
65
|
+
readonly error?: {
|
|
66
|
+
readonly message: string;
|
|
67
|
+
readonly details?: Readonly<unknown> | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
readonly uploadResult?: import("@vue/reactivity").DeepReadonly<import("@vue/reactivity").UnwrapRef<TUploadResult>> | undefined;
|
|
70
|
+
readonly meta: {
|
|
71
|
+
readonly [x: string]: Readonly<unknown>;
|
|
72
|
+
};
|
|
73
|
+
} | {
|
|
74
|
+
readonly source: Exclude<import("./types.js").FileSource, "local">;
|
|
75
|
+
readonly data: null;
|
|
76
|
+
readonly remoteUrl: string;
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly name: string;
|
|
79
|
+
readonly size: number;
|
|
80
|
+
readonly mimeType: string;
|
|
81
|
+
readonly status: import("./types.js").FileStatus;
|
|
82
|
+
readonly preview?: string | undefined;
|
|
83
|
+
readonly progress: {
|
|
84
|
+
readonly percentage: number;
|
|
85
|
+
};
|
|
86
|
+
readonly error?: {
|
|
87
|
+
readonly message: string;
|
|
88
|
+
readonly details?: Readonly<unknown> | undefined;
|
|
89
|
+
} | undefined;
|
|
90
|
+
readonly uploadResult?: import("@vue/reactivity").DeepReadonly<import("@vue/reactivity").UnwrapRef<TUploadResult>> | undefined;
|
|
91
|
+
readonly meta: {
|
|
92
|
+
readonly [x: string]: Readonly<unknown>;
|
|
93
|
+
};
|
|
94
|
+
})[], readonly ({
|
|
95
|
+
readonly source: "local";
|
|
96
|
+
readonly data: {
|
|
97
|
+
readonly lastModified: number;
|
|
98
|
+
readonly name: string;
|
|
99
|
+
readonly webkitRelativePath: string;
|
|
100
|
+
readonly size: number;
|
|
101
|
+
readonly type: string;
|
|
102
|
+
readonly arrayBuffer: {
|
|
103
|
+
(): Promise<ArrayBuffer>;
|
|
104
|
+
(): Promise<ArrayBuffer>;
|
|
105
|
+
};
|
|
106
|
+
readonly bytes: {
|
|
107
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
108
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
109
|
+
};
|
|
110
|
+
readonly slice: {
|
|
111
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
112
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
113
|
+
};
|
|
114
|
+
readonly stream: {
|
|
115
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
116
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
117
|
+
};
|
|
118
|
+
readonly text: {
|
|
119
|
+
(): Promise<string>;
|
|
120
|
+
(): Promise<string>;
|
|
121
|
+
};
|
|
122
|
+
} | {
|
|
123
|
+
readonly size: number;
|
|
124
|
+
readonly type: string;
|
|
125
|
+
readonly arrayBuffer: {
|
|
126
|
+
(): Promise<ArrayBuffer>;
|
|
127
|
+
(): Promise<ArrayBuffer>;
|
|
128
|
+
};
|
|
129
|
+
readonly bytes: {
|
|
130
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
131
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
132
|
+
};
|
|
133
|
+
readonly slice: {
|
|
134
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
135
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
136
|
+
};
|
|
137
|
+
readonly stream: {
|
|
138
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
139
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
140
|
+
};
|
|
141
|
+
readonly text: {
|
|
142
|
+
(): Promise<string>;
|
|
143
|
+
(): Promise<string>;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly remoteUrl?: string | undefined;
|
|
147
|
+
readonly id: string;
|
|
148
|
+
readonly name: string;
|
|
149
|
+
readonly size: number;
|
|
150
|
+
readonly mimeType: string;
|
|
151
|
+
readonly status: import("./types.js").FileStatus;
|
|
152
|
+
readonly preview?: string | undefined;
|
|
153
|
+
readonly progress: {
|
|
154
|
+
readonly percentage: number;
|
|
155
|
+
};
|
|
156
|
+
readonly error?: {
|
|
157
|
+
readonly message: string;
|
|
158
|
+
readonly details?: Readonly<unknown> | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
readonly uploadResult?: import("@vue/reactivity").DeepReadonly<import("@vue/reactivity").UnwrapRef<TUploadResult>> | undefined;
|
|
161
|
+
readonly meta: {
|
|
162
|
+
readonly [x: string]: Readonly<unknown>;
|
|
163
|
+
};
|
|
164
|
+
} | {
|
|
165
|
+
readonly source: Exclude<import("./types.js").FileSource, "local">;
|
|
166
|
+
readonly data: null;
|
|
167
|
+
readonly remoteUrl: string;
|
|
168
|
+
readonly id: string;
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly size: number;
|
|
171
|
+
readonly mimeType: string;
|
|
172
|
+
readonly status: import("./types.js").FileStatus;
|
|
173
|
+
readonly preview?: string | undefined;
|
|
174
|
+
readonly progress: {
|
|
175
|
+
readonly percentage: number;
|
|
176
|
+
};
|
|
177
|
+
readonly error?: {
|
|
178
|
+
readonly message: string;
|
|
179
|
+
readonly details?: Readonly<unknown> | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
readonly uploadResult?: import("@vue/reactivity").DeepReadonly<import("@vue/reactivity").UnwrapRef<TUploadResult>> | undefined;
|
|
182
|
+
readonly meta: {
|
|
183
|
+
readonly [x: string]: Readonly<unknown>;
|
|
184
|
+
};
|
|
185
|
+
})[]>>;
|
|
186
|
+
totalProgress: import("@vue/reactivity").ComputedRef<number>;
|
|
187
|
+
addFiles: (newFiles: File[]) => Promise<UploadFile[]>;
|
|
188
|
+
addFile: (file: File) => Promise<UploadFile>;
|
|
189
|
+
onGetRemoteFile: (fn: GetRemoteFileFn) => void;
|
|
190
|
+
onUpload: (fn: UploadFn<TUploadResult>) => void;
|
|
191
|
+
removeFile: (fileId: string) => Promise<void>;
|
|
192
|
+
removeFiles: (fileIds: string[]) => ({
|
|
193
|
+
source: "local";
|
|
194
|
+
data: {
|
|
195
|
+
readonly lastModified: number;
|
|
196
|
+
readonly name: string;
|
|
197
|
+
readonly webkitRelativePath: string;
|
|
198
|
+
readonly size: number;
|
|
199
|
+
readonly type: string;
|
|
200
|
+
arrayBuffer: {
|
|
201
|
+
(): Promise<ArrayBuffer>;
|
|
202
|
+
(): Promise<ArrayBuffer>;
|
|
203
|
+
};
|
|
204
|
+
bytes: {
|
|
205
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
206
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
207
|
+
};
|
|
208
|
+
slice: {
|
|
209
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
210
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
211
|
+
};
|
|
212
|
+
stream: {
|
|
213
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
214
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
215
|
+
};
|
|
216
|
+
text: {
|
|
217
|
+
(): Promise<string>;
|
|
218
|
+
(): Promise<string>;
|
|
219
|
+
};
|
|
220
|
+
} | {
|
|
221
|
+
readonly size: number;
|
|
222
|
+
readonly type: string;
|
|
223
|
+
arrayBuffer: {
|
|
224
|
+
(): Promise<ArrayBuffer>;
|
|
225
|
+
(): Promise<ArrayBuffer>;
|
|
226
|
+
};
|
|
227
|
+
bytes: {
|
|
228
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
229
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
230
|
+
};
|
|
231
|
+
slice: {
|
|
232
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
233
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
234
|
+
};
|
|
235
|
+
stream: {
|
|
236
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
237
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
238
|
+
};
|
|
239
|
+
text: {
|
|
240
|
+
(): Promise<string>;
|
|
241
|
+
(): Promise<string>;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
remoteUrl?: string | undefined;
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
size: number;
|
|
248
|
+
mimeType: string;
|
|
249
|
+
status: import("./types.js").FileStatus;
|
|
250
|
+
preview?: string | undefined;
|
|
251
|
+
progress: {
|
|
252
|
+
percentage: number;
|
|
253
|
+
};
|
|
254
|
+
error?: {
|
|
255
|
+
message: string;
|
|
256
|
+
details?: unknown;
|
|
257
|
+
} | undefined;
|
|
258
|
+
uploadResult?: import("@vue/reactivity").UnwrapRef<TUploadResult> | undefined;
|
|
259
|
+
meta: Record<string, unknown>;
|
|
260
|
+
} | {
|
|
261
|
+
source: Exclude<import("./types.js").FileSource, "local">;
|
|
262
|
+
data: null;
|
|
263
|
+
remoteUrl: string;
|
|
264
|
+
id: string;
|
|
265
|
+
name: string;
|
|
266
|
+
size: number;
|
|
267
|
+
mimeType: string;
|
|
268
|
+
status: import("./types.js").FileStatus;
|
|
269
|
+
preview?: string | undefined;
|
|
270
|
+
progress: {
|
|
271
|
+
percentage: number;
|
|
272
|
+
};
|
|
273
|
+
error?: {
|
|
274
|
+
message: string;
|
|
275
|
+
details?: unknown;
|
|
276
|
+
} | undefined;
|
|
277
|
+
uploadResult?: import("@vue/reactivity").UnwrapRef<TUploadResult> | undefined;
|
|
278
|
+
meta: Record<string, unknown>;
|
|
279
|
+
})[];
|
|
280
|
+
clearFiles: () => ({
|
|
281
|
+
source: "local";
|
|
282
|
+
data: {
|
|
283
|
+
readonly lastModified: number;
|
|
284
|
+
readonly name: string;
|
|
285
|
+
readonly webkitRelativePath: string;
|
|
286
|
+
readonly size: number;
|
|
287
|
+
readonly type: string;
|
|
288
|
+
arrayBuffer: {
|
|
289
|
+
(): Promise<ArrayBuffer>;
|
|
290
|
+
(): Promise<ArrayBuffer>;
|
|
291
|
+
};
|
|
292
|
+
bytes: {
|
|
293
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
294
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
295
|
+
};
|
|
296
|
+
slice: {
|
|
297
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
298
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
299
|
+
};
|
|
300
|
+
stream: {
|
|
301
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
302
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
303
|
+
};
|
|
304
|
+
text: {
|
|
305
|
+
(): Promise<string>;
|
|
306
|
+
(): Promise<string>;
|
|
307
|
+
};
|
|
308
|
+
} | {
|
|
309
|
+
readonly size: number;
|
|
310
|
+
readonly type: string;
|
|
311
|
+
arrayBuffer: {
|
|
312
|
+
(): Promise<ArrayBuffer>;
|
|
313
|
+
(): Promise<ArrayBuffer>;
|
|
314
|
+
};
|
|
315
|
+
bytes: {
|
|
316
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
317
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
318
|
+
};
|
|
319
|
+
slice: {
|
|
320
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
321
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
322
|
+
};
|
|
323
|
+
stream: {
|
|
324
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
325
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
326
|
+
};
|
|
327
|
+
text: {
|
|
328
|
+
(): Promise<string>;
|
|
329
|
+
(): Promise<string>;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
remoteUrl?: string | undefined;
|
|
333
|
+
id: string;
|
|
334
|
+
name: string;
|
|
335
|
+
size: number;
|
|
336
|
+
mimeType: string;
|
|
337
|
+
status: import("./types.js").FileStatus;
|
|
338
|
+
preview?: string | undefined;
|
|
339
|
+
progress: {
|
|
340
|
+
percentage: number;
|
|
341
|
+
};
|
|
342
|
+
error?: {
|
|
343
|
+
message: string;
|
|
344
|
+
details?: unknown;
|
|
345
|
+
} | undefined;
|
|
346
|
+
uploadResult?: import("@vue/reactivity").UnwrapRef<TUploadResult> | undefined;
|
|
347
|
+
meta: Record<string, unknown>;
|
|
348
|
+
} | {
|
|
349
|
+
source: Exclude<import("./types.js").FileSource, "local">;
|
|
350
|
+
data: null;
|
|
351
|
+
remoteUrl: string;
|
|
352
|
+
id: string;
|
|
353
|
+
name: string;
|
|
354
|
+
size: number;
|
|
355
|
+
mimeType: string;
|
|
356
|
+
status: import("./types.js").FileStatus;
|
|
357
|
+
preview?: string | undefined;
|
|
358
|
+
progress: {
|
|
359
|
+
percentage: number;
|
|
360
|
+
};
|
|
361
|
+
error?: {
|
|
362
|
+
message: string;
|
|
363
|
+
details?: unknown;
|
|
364
|
+
} | undefined;
|
|
365
|
+
uploadResult?: import("@vue/reactivity").UnwrapRef<TUploadResult> | undefined;
|
|
366
|
+
meta: Record<string, unknown>;
|
|
367
|
+
})[];
|
|
368
|
+
reorderFile: (oldIndex: number, newIndex: number) => void;
|
|
369
|
+
getFile: (fileId: string) => {
|
|
370
|
+
source: "local";
|
|
371
|
+
data: {
|
|
372
|
+
readonly lastModified: number;
|
|
373
|
+
readonly name: string;
|
|
374
|
+
readonly webkitRelativePath: string;
|
|
375
|
+
readonly size: number;
|
|
376
|
+
readonly type: string;
|
|
377
|
+
arrayBuffer: {
|
|
378
|
+
(): Promise<ArrayBuffer>;
|
|
379
|
+
(): Promise<ArrayBuffer>;
|
|
380
|
+
};
|
|
381
|
+
bytes: {
|
|
382
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
383
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
384
|
+
};
|
|
385
|
+
slice: {
|
|
386
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
387
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
388
|
+
};
|
|
389
|
+
stream: {
|
|
390
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
391
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
392
|
+
};
|
|
393
|
+
text: {
|
|
394
|
+
(): Promise<string>;
|
|
395
|
+
(): Promise<string>;
|
|
396
|
+
};
|
|
397
|
+
} | {
|
|
398
|
+
readonly size: number;
|
|
399
|
+
readonly type: string;
|
|
400
|
+
arrayBuffer: {
|
|
401
|
+
(): Promise<ArrayBuffer>;
|
|
402
|
+
(): Promise<ArrayBuffer>;
|
|
403
|
+
};
|
|
404
|
+
bytes: {
|
|
405
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
406
|
+
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
407
|
+
};
|
|
408
|
+
slice: {
|
|
409
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
410
|
+
(start?: number, end?: number, contentType?: string): Blob;
|
|
411
|
+
};
|
|
412
|
+
stream: {
|
|
413
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
414
|
+
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
415
|
+
};
|
|
416
|
+
text: {
|
|
417
|
+
(): Promise<string>;
|
|
418
|
+
(): Promise<string>;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
remoteUrl?: string | undefined;
|
|
422
|
+
id: string;
|
|
423
|
+
name: string;
|
|
424
|
+
size: number;
|
|
425
|
+
mimeType: string;
|
|
426
|
+
status: import("./types.js").FileStatus;
|
|
427
|
+
preview?: string | undefined;
|
|
428
|
+
progress: {
|
|
429
|
+
percentage: number;
|
|
430
|
+
};
|
|
431
|
+
error?: {
|
|
432
|
+
message: string;
|
|
433
|
+
details?: unknown;
|
|
434
|
+
} | undefined;
|
|
435
|
+
uploadResult?: import("@vue/reactivity").UnwrapRef<TUploadResult> | undefined;
|
|
436
|
+
meta: Record<string, unknown>;
|
|
437
|
+
} | {
|
|
438
|
+
source: Exclude<import("./types.js").FileSource, "local">;
|
|
439
|
+
data: null;
|
|
440
|
+
remoteUrl: string;
|
|
441
|
+
id: string;
|
|
442
|
+
name: string;
|
|
443
|
+
size: number;
|
|
444
|
+
mimeType: string;
|
|
445
|
+
status: import("./types.js").FileStatus;
|
|
446
|
+
preview?: string | undefined;
|
|
447
|
+
progress: {
|
|
448
|
+
percentage: number;
|
|
449
|
+
};
|
|
450
|
+
error?: {
|
|
451
|
+
message: string;
|
|
452
|
+
details?: unknown;
|
|
453
|
+
} | undefined;
|
|
454
|
+
uploadResult?: import("@vue/reactivity").UnwrapRef<TUploadResult> | undefined;
|
|
455
|
+
meta: Record<string, unknown>;
|
|
456
|
+
};
|
|
457
|
+
upload: () => Promise<void>;
|
|
458
|
+
reset: () => void;
|
|
459
|
+
status: import("@vue/reactivity").Ref<UploadStatus, UploadStatus>;
|
|
460
|
+
getFileData: (fileId: string) => Promise<Blob>;
|
|
461
|
+
getFileURL: (fileId: string) => Promise<string>;
|
|
462
|
+
getFileStream: (fileId: string) => Promise<ReadableStream<Uint8Array>>;
|
|
463
|
+
replaceFileData: (fileId: string, newData: Blob, newName?: string, shouldAutoUpload?: boolean) => Promise<UploadFile>;
|
|
464
|
+
updateFile: (fileId: string, updatedFile: Partial<UploadFile<TUploadResult>>) => void;
|
|
465
|
+
initializeExistingFiles: (initialFiles: Array<Partial<UploadFile>>) => Promise<void>;
|
|
466
|
+
addPlugin: (plugin: UploaderPlugin<any, any>) => void;
|
|
467
|
+
on: {
|
|
468
|
+
<K extends keyof UploaderEvents<TUploadResult>>(type: K, handler: (event: UploaderEvents<TUploadResult>[K]) => void): void;
|
|
469
|
+
(type: string, handler: (event: any) => void): void;
|
|
470
|
+
};
|
|
471
|
+
};
|