nuxt-ui-elements 0.1.27 → 0.1.28
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/dist/module.json
CHANGED
|
@@ -1,142 +1,146 @@
|
|
|
1
1
|
import type { UploaderEvents, UploadFile, UploadOptions, UploadStatus, UploadFn, GetRemoteFileFn, Plugin as UploaderPlugin } from "./types.js";
|
|
2
2
|
export declare const useUploadManager: <TUploadResult = any>(_options?: UploadOptions) => {
|
|
3
|
-
files: import("vue").Ref<{
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
size: number;
|
|
7
|
-
mimeType: string;
|
|
8
|
-
data: {
|
|
3
|
+
files: Readonly<import("vue").Ref<readonly {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly size: number;
|
|
7
|
+
readonly mimeType: string;
|
|
8
|
+
readonly data: {
|
|
9
9
|
readonly lastModified: number;
|
|
10
10
|
readonly name: string;
|
|
11
11
|
readonly webkitRelativePath: string;
|
|
12
12
|
readonly size: number;
|
|
13
13
|
readonly type: string;
|
|
14
|
-
arrayBuffer: {
|
|
14
|
+
readonly arrayBuffer: {
|
|
15
15
|
(): Promise<ArrayBuffer>;
|
|
16
16
|
(): Promise<ArrayBuffer>;
|
|
17
17
|
};
|
|
18
|
-
bytes: {
|
|
18
|
+
readonly bytes: {
|
|
19
19
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
20
20
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
21
21
|
};
|
|
22
|
-
slice: {
|
|
22
|
+
readonly slice: {
|
|
23
23
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
24
24
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
25
25
|
};
|
|
26
|
-
stream: {
|
|
26
|
+
readonly stream: {
|
|
27
27
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
28
28
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
29
29
|
};
|
|
30
|
-
text: {
|
|
30
|
+
readonly text: {
|
|
31
31
|
(): Promise<string>;
|
|
32
32
|
(): Promise<string>;
|
|
33
33
|
};
|
|
34
34
|
} | {
|
|
35
35
|
readonly size: number;
|
|
36
36
|
readonly type: string;
|
|
37
|
-
arrayBuffer: {
|
|
37
|
+
readonly arrayBuffer: {
|
|
38
38
|
(): Promise<ArrayBuffer>;
|
|
39
39
|
(): Promise<ArrayBuffer>;
|
|
40
40
|
};
|
|
41
|
-
bytes: {
|
|
41
|
+
readonly bytes: {
|
|
42
42
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
43
43
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
44
44
|
};
|
|
45
|
-
slice: {
|
|
45
|
+
readonly slice: {
|
|
46
46
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
47
47
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
48
48
|
};
|
|
49
|
-
stream: {
|
|
49
|
+
readonly stream: {
|
|
50
50
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
51
51
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
52
52
|
};
|
|
53
|
-
text: {
|
|
53
|
+
readonly text: {
|
|
54
54
|
(): Promise<string>;
|
|
55
55
|
(): Promise<string>;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
|
-
status: import("./types.js").FileStatus;
|
|
59
|
-
preview?: string | undefined;
|
|
60
|
-
progress: {
|
|
61
|
-
percentage: number;
|
|
58
|
+
readonly status: import("./types.js").FileStatus;
|
|
59
|
+
readonly preview?: string | undefined;
|
|
60
|
+
readonly progress: {
|
|
61
|
+
readonly percentage: number;
|
|
62
62
|
};
|
|
63
|
-
error?: {
|
|
64
|
-
message: string;
|
|
65
|
-
details?: unknown;
|
|
63
|
+
readonly error?: {
|
|
64
|
+
readonly message: string;
|
|
65
|
+
readonly details?: Readonly<unknown> | undefined;
|
|
66
66
|
} | undefined;
|
|
67
|
-
uploadResult?: import("vue").UnwrapRef<TUploadResult
|
|
68
|
-
isRemote?: boolean | undefined;
|
|
69
|
-
remoteUrl?: string | undefined;
|
|
70
|
-
meta:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
readonly uploadResult?: import("vue").DeepReadonly<import("vue").UnwrapRef<TUploadResult>> | undefined;
|
|
68
|
+
readonly isRemote?: boolean | undefined;
|
|
69
|
+
readonly remoteUrl?: string | undefined;
|
|
70
|
+
readonly meta: {
|
|
71
|
+
readonly [x: string]: Readonly<unknown>;
|
|
72
|
+
};
|
|
73
|
+
}[], readonly {
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly size: number;
|
|
77
|
+
readonly mimeType: string;
|
|
78
|
+
readonly data: {
|
|
77
79
|
readonly lastModified: number;
|
|
78
80
|
readonly name: string;
|
|
79
81
|
readonly webkitRelativePath: string;
|
|
80
82
|
readonly size: number;
|
|
81
83
|
readonly type: string;
|
|
82
|
-
arrayBuffer: {
|
|
84
|
+
readonly arrayBuffer: {
|
|
83
85
|
(): Promise<ArrayBuffer>;
|
|
84
86
|
(): Promise<ArrayBuffer>;
|
|
85
87
|
};
|
|
86
|
-
bytes: {
|
|
88
|
+
readonly bytes: {
|
|
87
89
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
88
90
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
89
91
|
};
|
|
90
|
-
slice: {
|
|
92
|
+
readonly slice: {
|
|
91
93
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
92
94
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
93
95
|
};
|
|
94
|
-
stream: {
|
|
96
|
+
readonly stream: {
|
|
95
97
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
96
98
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
97
99
|
};
|
|
98
|
-
text: {
|
|
100
|
+
readonly text: {
|
|
99
101
|
(): Promise<string>;
|
|
100
102
|
(): Promise<string>;
|
|
101
103
|
};
|
|
102
104
|
} | {
|
|
103
105
|
readonly size: number;
|
|
104
106
|
readonly type: string;
|
|
105
|
-
arrayBuffer: {
|
|
107
|
+
readonly arrayBuffer: {
|
|
106
108
|
(): Promise<ArrayBuffer>;
|
|
107
109
|
(): Promise<ArrayBuffer>;
|
|
108
110
|
};
|
|
109
|
-
bytes: {
|
|
111
|
+
readonly bytes: {
|
|
110
112
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
111
113
|
(): Promise<Uint8Array<ArrayBuffer>>;
|
|
112
114
|
};
|
|
113
|
-
slice: {
|
|
115
|
+
readonly slice: {
|
|
114
116
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
115
117
|
(start?: number, end?: number, contentType?: string): Blob;
|
|
116
118
|
};
|
|
117
|
-
stream: {
|
|
119
|
+
readonly stream: {
|
|
118
120
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
119
121
|
(): ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
120
122
|
};
|
|
121
|
-
text: {
|
|
123
|
+
readonly text: {
|
|
122
124
|
(): Promise<string>;
|
|
123
125
|
(): Promise<string>;
|
|
124
126
|
};
|
|
125
127
|
};
|
|
126
|
-
status: import("./types.js").FileStatus;
|
|
127
|
-
preview?: string | undefined;
|
|
128
|
-
progress: {
|
|
129
|
-
percentage: number;
|
|
128
|
+
readonly status: import("./types.js").FileStatus;
|
|
129
|
+
readonly preview?: string | undefined;
|
|
130
|
+
readonly progress: {
|
|
131
|
+
readonly percentage: number;
|
|
130
132
|
};
|
|
131
|
-
error?: {
|
|
132
|
-
message: string;
|
|
133
|
-
details?: unknown;
|
|
133
|
+
readonly error?: {
|
|
134
|
+
readonly message: string;
|
|
135
|
+
readonly details?: Readonly<unknown> | undefined;
|
|
134
136
|
} | undefined;
|
|
135
|
-
uploadResult?: import("vue").UnwrapRef<TUploadResult
|
|
136
|
-
isRemote?: boolean | undefined;
|
|
137
|
-
remoteUrl?: string | undefined;
|
|
138
|
-
meta:
|
|
139
|
-
|
|
137
|
+
readonly uploadResult?: import("vue").DeepReadonly<import("vue").UnwrapRef<TUploadResult>> | undefined;
|
|
138
|
+
readonly isRemote?: boolean | undefined;
|
|
139
|
+
readonly remoteUrl?: string | undefined;
|
|
140
|
+
readonly meta: {
|
|
141
|
+
readonly [x: string]: Readonly<unknown>;
|
|
142
|
+
};
|
|
143
|
+
}[]>>;
|
|
140
144
|
totalProgress: import("vue").ComputedRef<number>;
|
|
141
145
|
addFiles: (newFiles: File[]) => Promise<(UploadFile<any> | null)[]>;
|
|
142
146
|
addFile: (file: File) => Promise<UploadFile<any> | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import mitt from "mitt";
|
|
2
|
-
import { computed, ref } from "vue";
|
|
2
|
+
import { computed, readonly, ref } from "vue";
|
|
3
3
|
import { ValidatorAllowedFileTypes, ValidatorMaxfileSize, ValidatorMaxFiles } from "./validators/index.js";
|
|
4
4
|
import { PluginThumbnailGenerator, PluginImageCompressor } from "./plugins/index.js";
|
|
5
5
|
function getExtension(fullFileName) {
|
|
@@ -344,7 +344,7 @@ The LAST storage plugin ("${plugin.id}") will be used for uploads.
|
|
|
344
344
|
}
|
|
345
345
|
return {
|
|
346
346
|
// State
|
|
347
|
-
files,
|
|
347
|
+
files: readonly(files),
|
|
348
348
|
totalProgress,
|
|
349
349
|
// Core Methods
|
|
350
350
|
addFiles,
|
package/package.json
CHANGED