@d0paminedriven/fs 0.2.0 → 2.0.0
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/{chunk-MZZJMVSV.js → chunk-J3NUWUIN.js} +213 -53
- package/dist/fs/index.cjs +211 -51
- package/dist/fs/index.d.cts +208 -13
- package/dist/fs/index.d.ts +208 -13
- package/dist/fs/index.js +1 -1
- package/dist/index.cjs +211 -51
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +7 -7
package/dist/fs/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import expand from 'dotenv-expand';
|
|
2
|
+
import sharp from 'sharp';
|
|
2
3
|
import { RemoveFields, Unenumerate, ReadDirOptions, ExecuteCommandProps, MkDirSyncOptions, WriteStreamDataShape, WriteStreamOptions, WriteFileAsyncDataUnion, WriteFileAsyncOptions, ParsedUrlInfo } from '../types/index.cjs';
|
|
3
4
|
import 'stream';
|
|
4
5
|
import 'buffer';
|
|
@@ -33,6 +34,7 @@ declare class Fs {
|
|
|
33
34
|
[k: string]: number;
|
|
34
35
|
};
|
|
35
36
|
handleBuffStrArrUnion<const T extends (string | Buffer)[] | readonly (string | Buffer)[]>(arr: T): string[];
|
|
37
|
+
isRootPathTargeted<const T extends string>(path: T): boolean;
|
|
36
38
|
readDir<const T extends string>(path: T, options?: ReadDirOptions): string[];
|
|
37
39
|
executeCommand: <const T extends string>({ command, ...options }: ExecuteCommandProps<T>) => string;
|
|
38
40
|
fileGenTimestamp<T extends InstanceType<typeof Date> = InstanceType<typeof Date>>(d: T): `/* file-autogenerated by @d0paminedriven/fs on undefined at ${string} UTC */` | `/* file-autogenerated by @d0paminedriven/fs on ${string} at undefined UTC */` | `/* file-autogenerated by @d0paminedriven/fs on ${string} at ${string} UTC */`;
|
|
@@ -47,20 +49,26 @@ declare class Fs {
|
|
|
47
49
|
writeFileAsync: <const T extends string>(path: T, data: WriteFileAsyncDataUnion, options?: WriteFileAsyncOptions) => Promise<string | void>;
|
|
48
50
|
fileToBuffer: <const T extends string>(path: T) => Buffer<ArrayBuffer>;
|
|
49
51
|
dirContainsDir<const From extends string, const To extends string>(readDir: From, targetDir: To, options?: ReadDirOptions): boolean;
|
|
50
|
-
parseJsonBuffer(p: Buffer): unknown;
|
|
51
52
|
isServerSide(): boolean;
|
|
52
53
|
isBase64(str: string): boolean;
|
|
53
54
|
previewRegex: RegExp;
|
|
54
55
|
isPreviewPath(uri: string): boolean;
|
|
55
56
|
get URL_REGEX(): RegExp;
|
|
56
57
|
parseUrl(url: string): ParsedUrlInfo;
|
|
58
|
+
get cjsVal(): "application/node" | "text/javascript";
|
|
57
59
|
get gzVal(): "application/x-gzip" | "application/gzip";
|
|
60
|
+
get jsVal(): "application/node" | "text/javascript";
|
|
61
|
+
get objVal(): "application/octet-stream" | "text/plain" | "model/obj";
|
|
62
|
+
get tsVal(): "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts";
|
|
63
|
+
get ttfVal(): "application/font-sfnt" | "font/ttf";
|
|
58
64
|
get zipVal(): "application/zip" | "application/x-zip-compressed";
|
|
59
65
|
get mimeTypeObj(): {
|
|
60
66
|
readonly aac: "audio/aac";
|
|
61
67
|
readonly abw: "application/x-abiword";
|
|
68
|
+
readonly aces: "image/aces";
|
|
62
69
|
readonly apng: "image/apng";
|
|
63
70
|
readonly arc: "application/x-freearc";
|
|
71
|
+
readonly avci: "image/avci";
|
|
64
72
|
readonly avif: "image/avif";
|
|
65
73
|
readonly avi: "video/x-msvideo";
|
|
66
74
|
readonly azw: "application/vnd.amazon.ebook";
|
|
@@ -69,27 +77,36 @@ declare class Fs {
|
|
|
69
77
|
readonly bz: "application/x-bzip";
|
|
70
78
|
readonly bz2: "application/x-bzip2";
|
|
71
79
|
readonly cda: "application/x-cdf";
|
|
72
|
-
readonly cjs: "application/javascript";
|
|
80
|
+
readonly cjs: "application/node" | "text/javascript";
|
|
73
81
|
readonly csh: "application/x-csh";
|
|
74
82
|
readonly css: "text/css";
|
|
75
83
|
readonly csv: "text/csv";
|
|
76
84
|
readonly doc: "application/msword";
|
|
77
85
|
readonly docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
86
|
+
readonly dpx: "image/dpx";
|
|
87
|
+
readonly emf: "image/emf";
|
|
78
88
|
readonly eot: "application/vnd.ms-fontobject";
|
|
79
89
|
readonly epub: "application/epub+zip";
|
|
80
90
|
readonly gif: "image/gif";
|
|
91
|
+
readonly glb: "model/gltf-binary";
|
|
92
|
+
readonly gltf: "model/gltf+json";
|
|
81
93
|
readonly gz: "application/x-gzip" | "application/gzip";
|
|
94
|
+
readonly hjif: "haptics/hjif";
|
|
95
|
+
readonly hmpg: "haptics/hmpg";
|
|
82
96
|
readonly htm: "text/html";
|
|
83
97
|
readonly html: "text/html";
|
|
84
98
|
readonly ico: "image/vnd.microsoft.icon";
|
|
85
99
|
readonly ics: "text/calendar";
|
|
100
|
+
readonly ivs: "haptics/ivs";
|
|
86
101
|
readonly jar: "application/java-archive";
|
|
87
102
|
readonly jpeg: "image/jpeg";
|
|
88
103
|
readonly jpg: "image/jpeg";
|
|
89
|
-
readonly js: "text/javascript";
|
|
104
|
+
readonly js: "application/node" | "text/javascript";
|
|
90
105
|
readonly json: "application/json";
|
|
91
106
|
readonly jsonld: "application/ld+json";
|
|
92
107
|
readonly m3u8: "application/vnd.apple.mpegurl";
|
|
108
|
+
readonly m4a: "audio/mp4";
|
|
109
|
+
readonly m4v: "video/mp4";
|
|
93
110
|
readonly md: "text/markdown";
|
|
94
111
|
readonly mdx: "application/x-mdx";
|
|
95
112
|
readonly mid: "audio/midi";
|
|
@@ -100,10 +117,12 @@ declare class Fs {
|
|
|
100
117
|
readonly mpeg: "video/mpeg";
|
|
101
118
|
readonly mpkg: "application/vnd.apple.installer+xml";
|
|
102
119
|
readonly ndjson: "application/x-ndjson";
|
|
120
|
+
readonly obj: "application/octet-stream" | "text/plain" | "model/obj";
|
|
103
121
|
readonly odp: "application/vnd.oasis.opendocument.presentation";
|
|
104
122
|
readonly ods: "application/vnd.oasis.opendocument.spreadsheet";
|
|
105
123
|
readonly odt: "application/vnd.oasis.opendocument.text";
|
|
106
124
|
readonly oga: "audio/ogg";
|
|
125
|
+
readonly ogg: "audio/ogg";
|
|
107
126
|
readonly ogv: "video/ogg";
|
|
108
127
|
readonly ogx: "application/ogg";
|
|
109
128
|
readonly opus: "audio/ogg";
|
|
@@ -114,17 +133,24 @@ declare class Fs {
|
|
|
114
133
|
readonly pkpass: "application/vnd.apple.pkpass";
|
|
115
134
|
readonly ppt: "application/vnd.ms-powerpoint";
|
|
116
135
|
readonly pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
136
|
+
readonly py: "text/x-python";
|
|
137
|
+
readonly pyc: "application/x-python-code";
|
|
117
138
|
readonly rar: "application/vnd.rar";
|
|
118
139
|
readonly rtf: "application/rtf";
|
|
119
140
|
readonly sh: "application/x-sh";
|
|
141
|
+
readonly sql: "application/sql";
|
|
120
142
|
readonly svg: "image/svg+xml";
|
|
121
143
|
readonly tar: "application/x-tar";
|
|
122
144
|
readonly tif: "image/tiff";
|
|
123
145
|
readonly tiff: "image/tiff";
|
|
124
|
-
readonly
|
|
125
|
-
readonly
|
|
146
|
+
readonly toml: "application/toml";
|
|
147
|
+
readonly ts: "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts";
|
|
148
|
+
readonly ttf: "application/font-sfnt" | "font/ttf";
|
|
126
149
|
readonly txt: "text/plain";
|
|
150
|
+
readonly usdz: "model/vnd.usdz+zip";
|
|
127
151
|
readonly vsd: "application/vnd.visio";
|
|
152
|
+
readonly vtt: "text/vtt";
|
|
153
|
+
readonly wasm: "application/wasm";
|
|
128
154
|
readonly wav: "audio/wav";
|
|
129
155
|
readonly weba: "video/webm";
|
|
130
156
|
readonly webp: "image/webp";
|
|
@@ -135,6 +161,8 @@ declare class Fs {
|
|
|
135
161
|
readonly xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
136
162
|
readonly xml: "application/xml";
|
|
137
163
|
readonly xul: "application/vnd.mozilla.xul+xml";
|
|
164
|
+
readonly yaml: "application/yaml";
|
|
165
|
+
readonly yml: "application/yaml";
|
|
138
166
|
readonly zip: "application/zip" | "application/x-zip-compressed";
|
|
139
167
|
readonly "3gp": "video/3gpp";
|
|
140
168
|
readonly "3g2": "video/3gpp2";
|
|
@@ -144,8 +172,10 @@ declare class Fs {
|
|
|
144
172
|
getMime<const S extends ReturnType<typeof this.assetType>>(input: S): {
|
|
145
173
|
readonly aac: "audio/aac";
|
|
146
174
|
readonly abw: "application/x-abiword";
|
|
175
|
+
readonly aces: "image/aces";
|
|
147
176
|
readonly apng: "image/apng";
|
|
148
177
|
readonly arc: "application/x-freearc";
|
|
178
|
+
readonly avci: "image/avci";
|
|
149
179
|
readonly avif: "image/avif";
|
|
150
180
|
readonly avi: "video/x-msvideo";
|
|
151
181
|
readonly azw: "application/vnd.amazon.ebook";
|
|
@@ -154,27 +184,36 @@ declare class Fs {
|
|
|
154
184
|
readonly bz: "application/x-bzip";
|
|
155
185
|
readonly bz2: "application/x-bzip2";
|
|
156
186
|
readonly cda: "application/x-cdf";
|
|
157
|
-
readonly cjs: "application/javascript";
|
|
187
|
+
readonly cjs: "application/node" | "text/javascript";
|
|
158
188
|
readonly csh: "application/x-csh";
|
|
159
189
|
readonly css: "text/css";
|
|
160
190
|
readonly csv: "text/csv";
|
|
161
191
|
readonly doc: "application/msword";
|
|
162
192
|
readonly docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
193
|
+
readonly dpx: "image/dpx";
|
|
194
|
+
readonly emf: "image/emf";
|
|
163
195
|
readonly eot: "application/vnd.ms-fontobject";
|
|
164
196
|
readonly epub: "application/epub+zip";
|
|
165
197
|
readonly gif: "image/gif";
|
|
198
|
+
readonly glb: "model/gltf-binary";
|
|
199
|
+
readonly gltf: "model/gltf+json";
|
|
166
200
|
readonly gz: "application/x-gzip" | "application/gzip";
|
|
201
|
+
readonly hjif: "haptics/hjif";
|
|
202
|
+
readonly hmpg: "haptics/hmpg";
|
|
167
203
|
readonly htm: "text/html";
|
|
168
204
|
readonly html: "text/html";
|
|
169
205
|
readonly ico: "image/vnd.microsoft.icon";
|
|
170
206
|
readonly ics: "text/calendar";
|
|
207
|
+
readonly ivs: "haptics/ivs";
|
|
171
208
|
readonly jar: "application/java-archive";
|
|
172
209
|
readonly jpeg: "image/jpeg";
|
|
173
210
|
readonly jpg: "image/jpeg";
|
|
174
|
-
readonly js: "text/javascript";
|
|
211
|
+
readonly js: "application/node" | "text/javascript";
|
|
175
212
|
readonly json: "application/json";
|
|
176
213
|
readonly jsonld: "application/ld+json";
|
|
177
214
|
readonly m3u8: "application/vnd.apple.mpegurl";
|
|
215
|
+
readonly m4a: "audio/mp4";
|
|
216
|
+
readonly m4v: "video/mp4";
|
|
178
217
|
readonly md: "text/markdown";
|
|
179
218
|
readonly mdx: "application/x-mdx";
|
|
180
219
|
readonly mid: "audio/midi";
|
|
@@ -185,10 +224,12 @@ declare class Fs {
|
|
|
185
224
|
readonly mpeg: "video/mpeg";
|
|
186
225
|
readonly mpkg: "application/vnd.apple.installer+xml";
|
|
187
226
|
readonly ndjson: "application/x-ndjson";
|
|
227
|
+
readonly obj: "application/octet-stream" | "text/plain" | "model/obj";
|
|
188
228
|
readonly odp: "application/vnd.oasis.opendocument.presentation";
|
|
189
229
|
readonly ods: "application/vnd.oasis.opendocument.spreadsheet";
|
|
190
230
|
readonly odt: "application/vnd.oasis.opendocument.text";
|
|
191
231
|
readonly oga: "audio/ogg";
|
|
232
|
+
readonly ogg: "audio/ogg";
|
|
192
233
|
readonly ogv: "video/ogg";
|
|
193
234
|
readonly ogx: "application/ogg";
|
|
194
235
|
readonly opus: "audio/ogg";
|
|
@@ -199,17 +240,24 @@ declare class Fs {
|
|
|
199
240
|
readonly pkpass: "application/vnd.apple.pkpass";
|
|
200
241
|
readonly ppt: "application/vnd.ms-powerpoint";
|
|
201
242
|
readonly pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
243
|
+
readonly py: "text/x-python";
|
|
244
|
+
readonly pyc: "application/x-python-code";
|
|
202
245
|
readonly rar: "application/vnd.rar";
|
|
203
246
|
readonly rtf: "application/rtf";
|
|
204
247
|
readonly sh: "application/x-sh";
|
|
248
|
+
readonly sql: "application/sql";
|
|
205
249
|
readonly svg: "image/svg+xml";
|
|
206
250
|
readonly tar: "application/x-tar";
|
|
207
251
|
readonly tif: "image/tiff";
|
|
208
252
|
readonly tiff: "image/tiff";
|
|
209
|
-
readonly
|
|
210
|
-
readonly
|
|
253
|
+
readonly toml: "application/toml";
|
|
254
|
+
readonly ts: "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts";
|
|
255
|
+
readonly ttf: "application/font-sfnt" | "font/ttf";
|
|
211
256
|
readonly txt: "text/plain";
|
|
257
|
+
readonly usdz: "model/vnd.usdz+zip";
|
|
212
258
|
readonly vsd: "application/vnd.visio";
|
|
259
|
+
readonly vtt: "text/vtt";
|
|
260
|
+
readonly wasm: "application/wasm";
|
|
213
261
|
readonly wav: "audio/wav";
|
|
214
262
|
readonly weba: "video/webm";
|
|
215
263
|
readonly webp: "image/webp";
|
|
@@ -220,18 +268,126 @@ declare class Fs {
|
|
|
220
268
|
readonly xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
221
269
|
readonly xml: "application/xml";
|
|
222
270
|
readonly xul: "application/vnd.mozilla.xul+xml";
|
|
271
|
+
readonly yaml: "application/yaml";
|
|
272
|
+
readonly yml: "application/yaml";
|
|
223
273
|
readonly zip: "application/zip" | "application/x-zip-compressed";
|
|
224
274
|
readonly "3gp": "video/3gpp";
|
|
225
275
|
readonly "3g2": "video/3gpp2";
|
|
226
276
|
readonly "7z": "application/x-7z-compressed";
|
|
227
277
|
}[S];
|
|
278
|
+
hmm: <const T extends ReturnType<typeof this.assetType>>(input: T) => {
|
|
279
|
+
readonly aac: "audio/aac";
|
|
280
|
+
readonly abw: "application/x-abiword";
|
|
281
|
+
readonly aces: "image/aces";
|
|
282
|
+
readonly apng: "image/apng";
|
|
283
|
+
readonly arc: "application/x-freearc";
|
|
284
|
+
readonly avci: "image/avci";
|
|
285
|
+
readonly avif: "image/avif";
|
|
286
|
+
readonly avi: "video/x-msvideo";
|
|
287
|
+
readonly azw: "application/vnd.amazon.ebook";
|
|
288
|
+
readonly bin: "application/octet-stream";
|
|
289
|
+
readonly bmp: "image/bmp";
|
|
290
|
+
readonly bz: "application/x-bzip";
|
|
291
|
+
readonly bz2: "application/x-bzip2";
|
|
292
|
+
readonly cda: "application/x-cdf";
|
|
293
|
+
readonly cjs: "application/node" | "text/javascript";
|
|
294
|
+
readonly csh: "application/x-csh";
|
|
295
|
+
readonly css: "text/css";
|
|
296
|
+
readonly csv: "text/csv";
|
|
297
|
+
readonly doc: "application/msword";
|
|
298
|
+
readonly docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
299
|
+
readonly dpx: "image/dpx";
|
|
300
|
+
readonly emf: "image/emf";
|
|
301
|
+
readonly eot: "application/vnd.ms-fontobject";
|
|
302
|
+
readonly epub: "application/epub+zip";
|
|
303
|
+
readonly gif: "image/gif";
|
|
304
|
+
readonly glb: "model/gltf-binary";
|
|
305
|
+
readonly gltf: "model/gltf+json";
|
|
306
|
+
readonly gz: "application/x-gzip" | "application/gzip";
|
|
307
|
+
readonly hjif: "haptics/hjif";
|
|
308
|
+
readonly hmpg: "haptics/hmpg";
|
|
309
|
+
readonly htm: "text/html";
|
|
310
|
+
readonly html: "text/html";
|
|
311
|
+
readonly ico: "image/vnd.microsoft.icon";
|
|
312
|
+
readonly ics: "text/calendar";
|
|
313
|
+
readonly ivs: "haptics/ivs";
|
|
314
|
+
readonly jar: "application/java-archive";
|
|
315
|
+
readonly jpeg: "image/jpeg";
|
|
316
|
+
readonly jpg: "image/jpeg";
|
|
317
|
+
readonly js: "application/node" | "text/javascript";
|
|
318
|
+
readonly json: "application/json";
|
|
319
|
+
readonly jsonld: "application/ld+json";
|
|
320
|
+
readonly m3u8: "application/vnd.apple.mpegurl";
|
|
321
|
+
readonly m4a: "audio/mp4";
|
|
322
|
+
readonly m4v: "video/mp4";
|
|
323
|
+
readonly md: "text/markdown";
|
|
324
|
+
readonly mdx: "application/x-mdx";
|
|
325
|
+
readonly mid: "audio/midi";
|
|
326
|
+
readonly midi: "audio/x-midi";
|
|
327
|
+
readonly mjs: "text/javascript";
|
|
328
|
+
readonly mp3: "audio/mpeg";
|
|
329
|
+
readonly mp4: "video/mp4";
|
|
330
|
+
readonly mpeg: "video/mpeg";
|
|
331
|
+
readonly mpkg: "application/vnd.apple.installer+xml";
|
|
332
|
+
readonly ndjson: "application/x-ndjson";
|
|
333
|
+
readonly obj: "application/octet-stream" | "text/plain" | "model/obj";
|
|
334
|
+
readonly odp: "application/vnd.oasis.opendocument.presentation";
|
|
335
|
+
readonly ods: "application/vnd.oasis.opendocument.spreadsheet";
|
|
336
|
+
readonly odt: "application/vnd.oasis.opendocument.text";
|
|
337
|
+
readonly oga: "audio/ogg";
|
|
338
|
+
readonly ogg: "audio/ogg";
|
|
339
|
+
readonly ogv: "video/ogg";
|
|
340
|
+
readonly ogx: "application/ogg";
|
|
341
|
+
readonly opus: "audio/ogg";
|
|
342
|
+
readonly otf: "font/otf";
|
|
343
|
+
readonly png: "image/png";
|
|
344
|
+
readonly pdf: "application/pdf";
|
|
345
|
+
readonly php: "application/x-httpd-php";
|
|
346
|
+
readonly pkpass: "application/vnd.apple.pkpass";
|
|
347
|
+
readonly ppt: "application/vnd.ms-powerpoint";
|
|
348
|
+
readonly pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
349
|
+
readonly py: "text/x-python";
|
|
350
|
+
readonly pyc: "application/x-python-code";
|
|
351
|
+
readonly rar: "application/vnd.rar";
|
|
352
|
+
readonly rtf: "application/rtf";
|
|
353
|
+
readonly sh: "application/x-sh";
|
|
354
|
+
readonly sql: "application/sql";
|
|
355
|
+
readonly svg: "image/svg+xml";
|
|
356
|
+
readonly tar: "application/x-tar";
|
|
357
|
+
readonly tif: "image/tiff";
|
|
358
|
+
readonly tiff: "image/tiff";
|
|
359
|
+
readonly toml: "application/toml";
|
|
360
|
+
readonly ts: "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts";
|
|
361
|
+
readonly ttf: "application/font-sfnt" | "font/ttf";
|
|
362
|
+
readonly txt: "text/plain";
|
|
363
|
+
readonly usdz: "model/vnd.usdz+zip";
|
|
364
|
+
readonly vsd: "application/vnd.visio";
|
|
365
|
+
readonly vtt: "text/vtt";
|
|
366
|
+
readonly wasm: "application/wasm";
|
|
367
|
+
readonly wav: "audio/wav";
|
|
368
|
+
readonly weba: "video/webm";
|
|
369
|
+
readonly webp: "image/webp";
|
|
370
|
+
readonly woff: "font/woff";
|
|
371
|
+
readonly woff2: "font/woff2";
|
|
372
|
+
readonly xhtml: "application/xhtml+xml";
|
|
373
|
+
readonly xls: "application/vnd.ms-excel";
|
|
374
|
+
readonly xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
375
|
+
readonly xml: "application/xml";
|
|
376
|
+
readonly xul: "application/vnd.mozilla.xul+xml";
|
|
377
|
+
readonly yaml: "application/yaml";
|
|
378
|
+
readonly yml: "application/yaml";
|
|
379
|
+
readonly zip: "application/zip" | "application/x-zip-compressed";
|
|
380
|
+
readonly "3gp": "video/3gpp";
|
|
381
|
+
readonly "3g2": "video/3gpp2";
|
|
382
|
+
readonly "7z": "application/x-7z-compressed";
|
|
383
|
+
}[T];
|
|
228
384
|
assetToBuffer<const T extends string>(path: T): Promise<{
|
|
229
|
-
readonly b64encodedData: `data:application/x-gzip;base64, ${string}` | `data:application/gzip;base64, ${string}` | `data:application/zip;base64, ${string}` | `data:application/x-zip-compressed;base64, ${string}` | `data:audio/aac;base64, ${string}` | `data:application/x-abiword;base64, ${string}` | `data:image/
|
|
230
|
-
readonly extension: "aac" | "abw" | "apng" | "arc" | "avif" | "avi" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "cda" | "cjs" | "csh" | "css" | "csv" | "doc" | "docx" | "eot" | "epub" | "gif" | "gz" | "htm" | "html" | "ico" | "ics" | "jar" | "jpeg" | "jpg" | "js" | "json" | "jsonld" | "m3u8" | "md" | "mdx" | "mid" | "midi" | "mjs" | "mp3" | "mp4" | "mpeg" | "mpkg" | "ndjson" | "odp" | "ods" | "odt" | "oga" | "ogv" | "ogx" | "opus" | "otf" | "png" | "pdf" | "php" | "pkpass" | "ppt" | "pptx" | "rar" | "rtf" | "sh" | "svg" | "tar" | "tif" | "tiff" | "ts" | "ttf" | "txt" | "vsd" | "wav" | "weba" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "zip" | "3gp" | "3g2" | "7z";
|
|
385
|
+
readonly b64encodedData: `data:application/node;base64, ${string}` | `data:text/javascript;base64, ${string}` | `data:application/x-gzip;base64, ${string}` | `data:application/gzip;base64, ${string}` | `data:application/octet-stream;base64, ${string}` | `data:text/plain;base64, ${string}` | `data:model/obj;base64, ${string}` | `data:text/typescript;base64, ${string}` | `data:video/mp2t;base64, ${string}` | `data:video/vnd.dlna.mpeg-tts;base64, ${string}` | `data:application/font-sfnt;base64, ${string}` | `data:font/ttf;base64, ${string}` | `data:application/zip;base64, ${string}` | `data:application/x-zip-compressed;base64, ${string}` | `data:audio/aac;base64, ${string}` | `data:application/x-abiword;base64, ${string}` | `data:image/aces;base64, ${string}` | `data:image/apng;base64, ${string}` | `data:application/x-freearc;base64, ${string}` | `data:image/avci;base64, ${string}` | `data:image/avif;base64, ${string}` | `data:video/x-msvideo;base64, ${string}` | `data:application/vnd.amazon.ebook;base64, ${string}` | `data:image/bmp;base64, ${string}` | `data:application/x-bzip;base64, ${string}` | `data:application/x-bzip2;base64, ${string}` | `data:application/x-cdf;base64, ${string}` | `data:application/x-csh;base64, ${string}` | `data:text/css;base64, ${string}` | `data:text/csv;base64, ${string}` | `data:application/msword;base64, ${string}` | `data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64, ${string}` | `data:image/dpx;base64, ${string}` | `data:image/emf;base64, ${string}` | `data:application/vnd.ms-fontobject;base64, ${string}` | `data:application/epub+zip;base64, ${string}` | `data:image/gif;base64, ${string}` | `data:model/gltf-binary;base64, ${string}` | `data:model/gltf+json;base64, ${string}` | `data:haptics/hjif;base64, ${string}` | `data:haptics/hmpg;base64, ${string}` | `data:text/html;base64, ${string}` | `data:image/vnd.microsoft.icon;base64, ${string}` | `data:text/calendar;base64, ${string}` | `data:haptics/ivs;base64, ${string}` | `data:application/java-archive;base64, ${string}` | `data:image/jpeg;base64, ${string}` | `data:application/json;base64, ${string}` | `data:application/ld+json;base64, ${string}` | `data:application/vnd.apple.mpegurl;base64, ${string}` | `data:audio/mp4;base64, ${string}` | `data:video/mp4;base64, ${string}` | `data:text/markdown;base64, ${string}` | `data:application/x-mdx;base64, ${string}` | `data:audio/midi;base64, ${string}` | `data:audio/x-midi;base64, ${string}` | `data:audio/mpeg;base64, ${string}` | `data:video/mpeg;base64, ${string}` | `data:application/vnd.apple.installer+xml;base64, ${string}` | `data:application/x-ndjson;base64, ${string}` | `data:application/vnd.oasis.opendocument.presentation;base64, ${string}` | `data:application/vnd.oasis.opendocument.spreadsheet;base64, ${string}` | `data:application/vnd.oasis.opendocument.text;base64, ${string}` | `data:audio/ogg;base64, ${string}` | `data:video/ogg;base64, ${string}` | `data:application/ogg;base64, ${string}` | `data:font/otf;base64, ${string}` | `data:image/png;base64, ${string}` | `data:application/pdf;base64, ${string}` | `data:application/x-httpd-php;base64, ${string}` | `data:application/vnd.apple.pkpass;base64, ${string}` | `data:application/vnd.ms-powerpoint;base64, ${string}` | `data:application/vnd.openxmlformats-officedocument.presentationml.presentation;base64, ${string}` | `data:text/x-python;base64, ${string}` | `data:application/x-python-code;base64, ${string}` | `data:application/vnd.rar;base64, ${string}` | `data:application/rtf;base64, ${string}` | `data:application/x-sh;base64, ${string}` | `data:application/sql;base64, ${string}` | `data:image/svg+xml;base64, ${string}` | `data:application/x-tar;base64, ${string}` | `data:image/tiff;base64, ${string}` | `data:application/toml;base64, ${string}` | `data:model/vnd.usdz+zip;base64, ${string}` | `data:application/vnd.visio;base64, ${string}` | `data:text/vtt;base64, ${string}` | `data:application/wasm;base64, ${string}` | `data:audio/wav;base64, ${string}` | `data:video/webm;base64, ${string}` | `data:image/webp;base64, ${string}` | `data:font/woff;base64, ${string}` | `data:font/woff2;base64, ${string}` | `data:application/xhtml+xml;base64, ${string}` | `data:application/vnd.ms-excel;base64, ${string}` | `data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64, ${string}` | `data:application/xml;base64, ${string}` | `data:application/vnd.mozilla.xul+xml;base64, ${string}` | `data:application/yaml;base64, ${string}` | `data:video/3gpp;base64, ${string}` | `data:video/3gpp2;base64, ${string}` | `data:application/x-7z-compressed;base64, ${string}`;
|
|
386
|
+
readonly extension: "aac" | "abw" | "aces" | "apng" | "arc" | "avci" | "avif" | "avi" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "cda" | "cjs" | "csh" | "css" | "csv" | "doc" | "docx" | "dpx" | "emf" | "eot" | "epub" | "gif" | "glb" | "gltf" | "gz" | "hjif" | "hmpg" | "htm" | "html" | "ico" | "ics" | "ivs" | "jar" | "jpeg" | "jpg" | "js" | "json" | "jsonld" | "m3u8" | "m4a" | "m4v" | "md" | "mdx" | "mid" | "midi" | "mjs" | "mp3" | "mp4" | "mpeg" | "mpkg" | "ndjson" | "obj" | "odp" | "ods" | "odt" | "oga" | "ogg" | "ogv" | "ogx" | "opus" | "otf" | "png" | "pdf" | "php" | "pkpass" | "ppt" | "pptx" | "py" | "pyc" | "rar" | "rtf" | "sh" | "sql" | "svg" | "tar" | "tif" | "tiff" | "toml" | "ts" | "ttf" | "txt" | "usdz" | "vsd" | "vtt" | "wasm" | "wav" | "weba" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "yaml" | "yml" | "zip" | "3gp" | "3g2" | "7z";
|
|
231
387
|
}>;
|
|
232
388
|
assetToBufferView<const T extends string>(path: T): Promise<{
|
|
233
|
-
readonly b64encodedData:
|
|
234
|
-
readonly extension: "aac" | "abw" | "apng" | "arc" | "avif" | "avi" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "cda" | "cjs" | "csh" | "css" | "csv" | "doc" | "docx" | "eot" | "epub" | "gif" | "gz" | "htm" | "html" | "ico" | "ics" | "jar" | "jpeg" | "jpg" | "js" | "json" | "jsonld" | "m3u8" | "md" | "mdx" | "mid" | "midi" | "mjs" | "mp3" | "mp4" | "mpeg" | "mpkg" | "ndjson" | "odp" | "ods" | "odt" | "oga" | "ogv" | "ogx" | "opus" | "otf" | "png" | "pdf" | "php" | "pkpass" | "ppt" | "pptx" | "rar" | "rtf" | "sh" | "svg" | "tar" | "tif" | "tiff" | "ts" | "ttf" | "txt" | "vsd" | "wav" | "weba" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "zip" | "3gp" | "3g2" | "7z";
|
|
389
|
+
readonly b64encodedData: string;
|
|
390
|
+
readonly extension: "aac" | "abw" | "aces" | "apng" | "arc" | "avci" | "avif" | "avi" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "cda" | "cjs" | "csh" | "css" | "csv" | "doc" | "docx" | "dpx" | "emf" | "eot" | "epub" | "gif" | "glb" | "gltf" | "gz" | "hjif" | "hmpg" | "htm" | "html" | "ico" | "ics" | "ivs" | "jar" | "jpeg" | "jpg" | "js" | "json" | "jsonld" | "m3u8" | "m4a" | "m4v" | "md" | "mdx" | "mid" | "midi" | "mjs" | "mp3" | "mp4" | "mpeg" | "mpkg" | "ndjson" | "obj" | "odp" | "ods" | "odt" | "oga" | "ogg" | "ogv" | "ogx" | "opus" | "otf" | "png" | "pdf" | "php" | "pkpass" | "ppt" | "pptx" | "py" | "pyc" | "rar" | "rtf" | "sh" | "sql" | "svg" | "tar" | "tif" | "tiff" | "toml" | "ts" | "ttf" | "txt" | "usdz" | "vsd" | "vtt" | "wasm" | "wav" | "weba" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "yaml" | "yml" | "zip" | "3gp" | "3g2" | "7z";
|
|
235
391
|
}>;
|
|
236
392
|
formatHelper<const T extends string>(f: T): string;
|
|
237
393
|
range(from: number, to: number): number[];
|
|
@@ -239,6 +395,45 @@ declare class Fs {
|
|
|
239
395
|
acceptor: (num: number) => number[];
|
|
240
396
|
chunkArray<T extends number>(arr: string[], maxChunkLength: T): string[][];
|
|
241
397
|
b64ToBlob<const T extends string>(b64Data: T): Blob;
|
|
398
|
+
cleanDataUrl<const C extends string>(props: C): string;
|
|
399
|
+
/**
|
|
400
|
+
* public cleanDataUrl<const C extends string>(props: C) {
|
|
401
|
+
return props.replace(
|
|
402
|
+
/^data:(?:image|application|video|text|font|model|audio|haptics|multipart)\/[A-Za-z0-9+-.]+(?:;[^,]+)*;base64,/i,
|
|
403
|
+
""
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
*/
|
|
408
|
+
/**
|
|
409
|
+
*
|
|
410
|
+
* @param inputUrl remote url to fetch data from
|
|
411
|
+
* @param outputPath desired output path relative to the cwd
|
|
412
|
+
* @param useDetectedExtension optional, defaults to true
|
|
413
|
+
*
|
|
414
|
+
* if `useDetectedExtension` is false you must include the file extension in your output path →
|
|
415
|
+
*
|
|
416
|
+
* 🚫 'public/assets/image-1'
|
|
417
|
+
*
|
|
418
|
+
* ✅ 'public/assets/image-1.png'
|
|
419
|
+
*/
|
|
420
|
+
fetchRemoteWriteLocal<const I extends string, const O extends string>(inputUrl: I, outputPath: O, useDetectedExtension?: boolean): Promise<void>;
|
|
421
|
+
imageTransform<const F extends "webp" | "avif" | "jpg" | "png" | "tif" | "tiff" | "jp2" | "jpeg">({ format, target, quality, tint, resize }: {
|
|
422
|
+
format: F;
|
|
423
|
+
target: Buffer<ArrayBuffer>;
|
|
424
|
+
quality?: number;
|
|
425
|
+
tint?: string | {
|
|
426
|
+
r?: number | undefined;
|
|
427
|
+
g?: number | undefined;
|
|
428
|
+
b?: number | undefined;
|
|
429
|
+
alpha?: number | undefined;
|
|
430
|
+
};
|
|
431
|
+
resize?: {
|
|
432
|
+
widthOrOptions?: number | sharp.ResizeOptions | null;
|
|
433
|
+
height?: number | null;
|
|
434
|
+
options?: sharp.ResizeOptions;
|
|
435
|
+
};
|
|
436
|
+
}): Promise<Buffer<ArrayBufferLike>>;
|
|
242
437
|
}
|
|
243
438
|
|
|
244
439
|
export = Fs;
|