@d0paminedriven/fs 6.1.0 → 6.3.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.
@@ -1,4 +1,7 @@
1
+ import { XOR } from '../types/index.js';
1
2
  import { UrlService } from '../url/index.js';
3
+ import 'stream';
4
+ import 'buffer';
2
5
 
3
6
  declare const extMimeMap: {
4
7
  readonly aac: readonly ["audio/aac"];
@@ -10,7 +13,7 @@ declare const extMimeMap: {
10
13
  readonly avif: readonly ["image/avif"];
11
14
  readonly avi: readonly ["video/x-msvideo"];
12
15
  readonly azw: readonly ["application/vnd.amazon.ebook"];
13
- readonly bin: readonly ["application/octet-stream"];
16
+ readonly bin: readonly ["application/octet-stream", "multipart/voice-message"];
14
17
  readonly bmp: readonly ["image/bmp"];
15
18
  readonly bz: readonly ["application/x-bzip"];
16
19
  readonly bz2: readonly ["application/x-bzip2"];
@@ -28,7 +31,7 @@ declare const extMimeMap: {
28
31
  readonly gif: readonly ["image/gif"];
29
32
  readonly glb: readonly ["model/gltf-binary"];
30
33
  readonly gltf: readonly ["model/gltf+json"];
31
- readonly gz: readonly ["application/x-gzip", "application/gzip"];
34
+ readonly gz: readonly ["application/gzip", "application/x-gzip"];
32
35
  readonly hjif: readonly ["haptics/hjif"];
33
36
  readonly hmpg: readonly ["haptics/hmpg"];
34
37
  readonly htm: readonly ["text/html"];
@@ -36,6 +39,7 @@ declare const extMimeMap: {
36
39
  readonly ico: readonly ["image/vnd.microsoft.icon"];
37
40
  readonly ics: readonly ["text/calendar"];
38
41
  readonly ivs: readonly ["haptics/ivs"];
42
+ readonly ivt: readonly ["haptics/ivs"];
39
43
  readonly jar: readonly ["application/java-archive"];
40
44
  readonly jpeg: readonly ["image/jpeg"];
41
45
  readonly jpg: readonly ["image/jpeg"];
@@ -57,7 +61,8 @@ declare const extMimeMap: {
57
61
  readonly mpeg: readonly ["video/mpeg"];
58
62
  readonly mpkg: readonly ["application/vnd.apple.installer+xml"];
59
63
  readonly ndjson: readonly ["application/x-ndjson"];
60
- readonly obj: readonly ["application/octet-stream", "text/plain", "model/obj"];
64
+ readonly node: readonly ["application/node", "text/javascript"];
65
+ readonly obj: readonly ["model/obj", "application/octet-stream", "text/plain"];
61
66
  readonly odp: readonly ["application/vnd.oasis.opendocument.presentation"];
62
67
  readonly ods: readonly ["application/vnd.oasis.opendocument.spreadsheet"];
63
68
  readonly odt: readonly ["application/vnd.oasis.opendocument.text"];
@@ -76,9 +81,11 @@ declare const extMimeMap: {
76
81
  readonly py: readonly ["text/x-python"];
77
82
  readonly pyc: readonly ["application/x-python-code"];
78
83
  readonly rar: readonly ["application/vnd.rar"];
84
+ readonly rs: readonly ["text/rust"];
79
85
  readonly rtf: readonly ["application/rtf"];
80
86
  readonly sh: readonly ["application/x-sh"];
81
87
  readonly sql: readonly ["application/sql"];
88
+ readonly sse: readonly ["text/event-stream"];
82
89
  readonly svg: readonly ["image/svg+xml"];
83
90
  readonly tar: readonly ["application/x-tar"];
84
91
  readonly tif: readonly ["image/tiff"];
@@ -108,7 +115,117 @@ declare const extMimeMap: {
108
115
  readonly "3g2": readonly ["video/3gpp2"];
109
116
  readonly "7z": readonly ["application/x-7z-compressed"];
110
117
  };
118
+ declare const mimeToExt: {
119
+ readonly "application/epub+zip": readonly ["epub"];
120
+ readonly "application/font-sfnt": readonly ["ttf"];
121
+ readonly "application/gzip": readonly ["gz"];
122
+ readonly "application/java-archive": readonly ["jar"];
123
+ readonly "application/json": readonly ["json"];
124
+ readonly "application/ld+json": readonly ["jsonld"];
125
+ readonly "application/msword": readonly ["doc"];
126
+ readonly "application/node": readonly ["node", "js"];
127
+ readonly "application/octet-stream": readonly ["bin", "obj"];
128
+ readonly "application/ogg": readonly ["ogx"];
129
+ readonly "application/pdf": readonly ["pdf"];
130
+ readonly "application/rtf": readonly ["rtf"];
131
+ readonly "application/sql": readonly ["sql"];
132
+ readonly "application/toml": readonly ["toml"];
133
+ readonly "application/vnd.amazon.ebook": readonly ["azw"];
134
+ readonly "application/vnd.apple.installer+xml": readonly ["mpkg"];
135
+ readonly "application/vnd.apple.mpegurl": readonly ["m3u8"];
136
+ readonly "application/vnd.apple.pkpass": readonly ["pkpass"];
137
+ readonly "application/vnd.mozilla.xul+xml": readonly ["xul"];
138
+ readonly "application/vnd.ms-excel": readonly ["xls"];
139
+ readonly "application/vnd.ms-fontobject": readonly ["eot"];
140
+ readonly "application/vnd.ms-powerpoint": readonly ["ppt"];
141
+ readonly "application/vnd.oasis.opendocument.presentation": readonly ["odp"];
142
+ readonly "application/vnd.oasis.opendocument.spreadsheet": readonly ["ods"];
143
+ readonly "application/vnd.oasis.opendocument.text": readonly ["odt"];
144
+ readonly "application/vnd.openxmlformats-officedocument.presentationml.presentation": readonly ["pptx"];
145
+ readonly "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": readonly ["xlsx"];
146
+ readonly "application/vnd.openxmlformats-officedocument.wordprocessingml.document": readonly ["docx"];
147
+ readonly "application/vnd.rar": readonly ["rar"];
148
+ readonly "application/vnd.visio": readonly ["vsd"];
149
+ readonly "application/wasm": readonly ["wasm"];
150
+ readonly "application/x-7z-compressed": readonly ["7z"];
151
+ readonly "application/x-abiword": readonly ["abw"];
152
+ readonly "application/x-bzip": readonly ["bz"];
153
+ readonly "application/x-bzip2": readonly ["bz2"];
154
+ readonly "application/x-cdf": readonly ["cda"];
155
+ readonly "application/x-csh": readonly ["csh"];
156
+ readonly "application/x-freearc": readonly ["arc"];
157
+ readonly "application/x-gzip": readonly ["gz"];
158
+ readonly "application/x-httpd-php": readonly ["php"];
159
+ readonly "application/x-mdx": readonly ["mdx"];
160
+ readonly "application/x-ndjson": readonly ["ndjson"];
161
+ readonly "application/x-python-code": readonly ["pyc"];
162
+ readonly "application/x-sh": readonly ["sh"];
163
+ readonly "application/x-tar": readonly ["tar"];
164
+ readonly "application/x-zip-compressed": readonly ["zip"];
165
+ readonly "application/xhtml+xml": readonly ["xhtml"];
166
+ readonly "application/xml": readonly ["xml"];
167
+ readonly "application/yaml": readonly ["yml", "yaml"];
168
+ readonly "application/zip": readonly ["zip"];
169
+ readonly "audio/aac": readonly ["aac"];
170
+ readonly "audio/midi": readonly ["mid"];
171
+ readonly "audio/mp4": readonly ["m4a"];
172
+ readonly "audio/mpeg": readonly ["mp3"];
173
+ readonly "audio/ogg": readonly ["opus", "ogg", "oga"];
174
+ readonly "audio/wav": readonly ["wav"];
175
+ readonly "audio/x-midi": readonly ["midi"];
176
+ readonly "font/otf": readonly ["otf"];
177
+ readonly "font/ttf": readonly ["ttf"];
178
+ readonly "font/woff": readonly ["woff"];
179
+ readonly "font/woff2": readonly ["woff2"];
180
+ readonly "haptics/hjif": readonly ["hjif"];
181
+ readonly "haptics/hmpg": readonly ["hmpg"];
182
+ readonly "haptics/ivs": readonly ["ivs", "ivt"];
183
+ readonly "image/aces": readonly ["aces"];
184
+ readonly "image/apng": readonly ["apng"];
185
+ readonly "image/avci": readonly ["avci"];
186
+ readonly "image/avif": readonly ["avif"];
187
+ readonly "image/bmp": readonly ["bmp"];
188
+ readonly "image/dpx": readonly ["dpx"];
189
+ readonly "image/emf": readonly ["emf"];
190
+ readonly "image/gif": readonly ["gif"];
191
+ readonly "image/jpeg": readonly ["jpg", "jpeg"];
192
+ readonly "image/ktx": readonly ["ktx"];
193
+ readonly "image/ktx2": readonly ["ktx2"];
194
+ readonly "image/png": readonly ["png"];
195
+ readonly "image/svg+xml": readonly ["svg"];
196
+ readonly "image/tiff": readonly ["tiff", "tif"];
197
+ readonly "image/vnd.microsoft.icon": readonly ["ico"];
198
+ readonly "image/webp": readonly ["webp"];
199
+ readonly "model/gltf-binary": readonly ["glb"];
200
+ readonly "model/gltf+json": readonly ["gltf"];
201
+ readonly "model/obj": readonly ["obj"];
202
+ readonly "model/vnd.usdz+zip": readonly ["usdz"];
203
+ readonly "multipart/voice-message": readonly ["bin"];
204
+ readonly "text/calendar": readonly ["ics"];
205
+ readonly "text/css": readonly ["css"];
206
+ readonly "text/csv": readonly ["csv"];
207
+ readonly "text/event-stream": readonly ["sse", "ts", "rs", "py", "txt"];
208
+ readonly "text/html": readonly ["html", "htm"];
209
+ readonly "text/javascript": readonly ["cjs", "js", "mjs"];
210
+ readonly "text/markdown": readonly ["md"];
211
+ readonly "text/plain": readonly ["txt"];
212
+ readonly "text/rust": readonly ["rs"];
213
+ readonly "text/typescript": readonly ["ts"];
214
+ readonly "text/vtt": readonly ["vtt"];
215
+ readonly "text/x-python": readonly ["py"];
216
+ readonly "video/3gpp": readonly ["3gp"];
217
+ readonly "video/3gpp2": readonly ["3g2"];
218
+ readonly "video/mp2t": readonly ["ts"];
219
+ readonly "video/mp4": readonly ["mp4", "m4v"];
220
+ readonly "video/mpeg": readonly ["mpeg"];
221
+ readonly "video/ogg": readonly ["ogv"];
222
+ readonly "video/vnd.dlna.mpeg-tts": readonly ["ts"];
223
+ readonly "video/webm": readonly ["weba"];
224
+ readonly "video/x-msvideo": readonly ["avi"];
225
+ };
111
226
  type FileExtension = keyof typeof extMimeMap;
227
+ type MimeType = keyof typeof mimeToExt;
228
+ type MimeTypeToFileExtension<T extends XOR<typeof mimeToExt, typeof extMimeMap>> = T[keyof T];
112
229
  type FileExtensionToMimeType<T extends FileExtension> = (typeof extMimeMap)[T][number];
113
230
  type AllMimeTypes = FileExtensionToMimeType<FileExtension>;
114
231
  type InferTopLevelPresent<T> = T extends `${infer U}/${string}` ? U : T;
@@ -126,7 +243,7 @@ declare class MimeService extends UrlService {
126
243
  readonly avif: readonly ["image/avif"];
127
244
  readonly avi: readonly ["video/x-msvideo"];
128
245
  readonly azw: readonly ["application/vnd.amazon.ebook"];
129
- readonly bin: readonly ["application/octet-stream"];
246
+ readonly bin: readonly ["application/octet-stream", "multipart/voice-message"];
130
247
  readonly bmp: readonly ["image/bmp"];
131
248
  readonly bz: readonly ["application/x-bzip"];
132
249
  readonly bz2: readonly ["application/x-bzip2"];
@@ -144,7 +261,7 @@ declare class MimeService extends UrlService {
144
261
  readonly gif: readonly ["image/gif"];
145
262
  readonly glb: readonly ["model/gltf-binary"];
146
263
  readonly gltf: readonly ["model/gltf+json"];
147
- readonly gz: readonly ["application/x-gzip", "application/gzip"];
264
+ readonly gz: readonly ["application/gzip", "application/x-gzip"];
148
265
  readonly hjif: readonly ["haptics/hjif"];
149
266
  readonly hmpg: readonly ["haptics/hmpg"];
150
267
  readonly htm: readonly ["text/html"];
@@ -152,6 +269,7 @@ declare class MimeService extends UrlService {
152
269
  readonly ico: readonly ["image/vnd.microsoft.icon"];
153
270
  readonly ics: readonly ["text/calendar"];
154
271
  readonly ivs: readonly ["haptics/ivs"];
272
+ readonly ivt: readonly ["haptics/ivs"];
155
273
  readonly jar: readonly ["application/java-archive"];
156
274
  readonly jpeg: readonly ["image/jpeg"];
157
275
  readonly jpg: readonly ["image/jpeg"];
@@ -173,7 +291,8 @@ declare class MimeService extends UrlService {
173
291
  readonly mpeg: readonly ["video/mpeg"];
174
292
  readonly mpkg: readonly ["application/vnd.apple.installer+xml"];
175
293
  readonly ndjson: readonly ["application/x-ndjson"];
176
- readonly obj: readonly ["application/octet-stream", "text/plain", "model/obj"];
294
+ readonly node: readonly ["application/node", "text/javascript"];
295
+ readonly obj: readonly ["model/obj", "application/octet-stream", "text/plain"];
177
296
  readonly odp: readonly ["application/vnd.oasis.opendocument.presentation"];
178
297
  readonly ods: readonly ["application/vnd.oasis.opendocument.spreadsheet"];
179
298
  readonly odt: readonly ["application/vnd.oasis.opendocument.text"];
@@ -192,9 +311,11 @@ declare class MimeService extends UrlService {
192
311
  readonly py: readonly ["text/x-python"];
193
312
  readonly pyc: readonly ["application/x-python-code"];
194
313
  readonly rar: readonly ["application/vnd.rar"];
314
+ readonly rs: readonly ["text/rust"];
195
315
  readonly rtf: readonly ["application/rtf"];
196
316
  readonly sh: readonly ["application/x-sh"];
197
317
  readonly sql: readonly ["application/sql"];
318
+ readonly sse: readonly ["text/event-stream"];
198
319
  readonly svg: readonly ["image/svg+xml"];
199
320
  readonly tar: readonly ["application/x-tar"];
200
321
  readonly tif: readonly ["image/tiff"];
@@ -224,15 +345,126 @@ declare class MimeService extends UrlService {
224
345
  readonly "3g2": readonly ["video/3gpp2"];
225
346
  readonly "7z": readonly ["application/x-7z-compressed"];
226
347
  };
227
- assetType<const T extends string>(url: T): "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" | "ktx" | "ktx2" | "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" | undefined;
228
- getMimes<const E extends FileExtension>(ext: E): readonly ["audio/aac"] | readonly ["application/x-abiword"] | readonly ["image/aces"] | readonly ["image/apng"] | readonly ["application/x-freearc"] | readonly ["image/avci"] | readonly ["image/avif"] | readonly ["video/x-msvideo"] | readonly ["application/vnd.amazon.ebook"] | readonly ["application/octet-stream"] | readonly ["image/bmp"] | readonly ["application/x-bzip"] | readonly ["application/x-bzip2"] | readonly ["application/x-cdf"] | readonly ["application/node", "text/javascript"] | readonly ["application/x-csh"] | readonly ["text/css"] | readonly ["text/csv"] | readonly ["application/msword"] | readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] | readonly ["image/dpx"] | readonly ["image/emf"] | readonly ["application/vnd.ms-fontobject"] | readonly ["application/epub+zip"] | readonly ["image/gif"] | readonly ["model/gltf-binary"] | readonly ["model/gltf+json"] | readonly ["application/x-gzip", "application/gzip"] | readonly ["haptics/hjif"] | readonly ["haptics/hmpg"] | readonly ["text/html"] | readonly ["image/vnd.microsoft.icon"] | readonly ["text/calendar"] | readonly ["haptics/ivs"] | readonly ["application/java-archive"] | readonly ["image/jpeg"] | readonly ["application/json"] | readonly ["application/ld+json"] | readonly ["image/ktx"] | readonly ["image/ktx2"] | readonly ["application/vnd.apple.mpegurl"] | readonly ["audio/mp4"] | readonly ["video/mp4"] | readonly ["text/markdown"] | readonly ["application/x-mdx"] | readonly ["audio/midi"] | readonly ["audio/x-midi"] | readonly ["text/javascript"] | readonly ["audio/mpeg"] | readonly ["video/mpeg"] | readonly ["application/vnd.apple.installer+xml"] | readonly ["application/x-ndjson"] | readonly ["application/octet-stream", "text/plain", "model/obj"] | readonly ["application/vnd.oasis.opendocument.presentation"] | readonly ["application/vnd.oasis.opendocument.spreadsheet"] | readonly ["application/vnd.oasis.opendocument.text"] | readonly ["audio/ogg"] | readonly ["video/ogg"] | readonly ["application/ogg"] | readonly ["font/otf"] | readonly ["image/png"] | readonly ["application/pdf"] | readonly ["application/x-httpd-php"] | readonly ["application/vnd.apple.pkpass"] | readonly ["application/vnd.ms-powerpoint"] | readonly ["application/vnd.openxmlformats-officedocument.presentationml.presentation"] | readonly ["text/x-python"] | readonly ["application/x-python-code"] | readonly ["application/vnd.rar"] | readonly ["application/rtf"] | readonly ["application/x-sh"] | readonly ["application/sql"] | readonly ["image/svg+xml"] | readonly ["application/x-tar"] | readonly ["image/tiff"] | readonly ["application/toml"] | readonly ["text/typescript", "video/mp2t", "video/vnd.dlna.mpeg-tts"] | readonly ["application/font-sfnt", "font/ttf"] | readonly ["text/plain"] | readonly ["model/vnd.usdz+zip"] | readonly ["application/vnd.visio"] | readonly ["text/vtt"] | readonly ["application/wasm"] | readonly ["audio/wav"] | readonly ["video/webm"] | readonly ["image/webp"] | readonly ["font/woff"] | readonly ["font/woff2"] | readonly ["application/xhtml+xml"] | readonly ["application/vnd.ms-excel"] | readonly ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] | readonly ["application/xml"] | readonly ["application/vnd.mozilla.xul+xml"] | readonly ["application/yaml"] | readonly ["application/zip", "application/x-zip-compressed"] | readonly ["video/3gpp"] | readonly ["video/3gpp2"] | readonly ["application/x-7z-compressed"];
348
+ readonly toExtObj: {
349
+ readonly "application/epub+zip": readonly ["epub"];
350
+ readonly "application/font-sfnt": readonly ["ttf"];
351
+ readonly "application/gzip": readonly ["gz"];
352
+ readonly "application/java-archive": readonly ["jar"];
353
+ readonly "application/json": readonly ["json"];
354
+ readonly "application/ld+json": readonly ["jsonld"];
355
+ readonly "application/msword": readonly ["doc"];
356
+ readonly "application/node": readonly ["node", "js"];
357
+ readonly "application/octet-stream": readonly ["bin", "obj"];
358
+ readonly "application/ogg": readonly ["ogx"];
359
+ readonly "application/pdf": readonly ["pdf"];
360
+ readonly "application/rtf": readonly ["rtf"];
361
+ readonly "application/sql": readonly ["sql"];
362
+ readonly "application/toml": readonly ["toml"];
363
+ readonly "application/vnd.amazon.ebook": readonly ["azw"];
364
+ readonly "application/vnd.apple.installer+xml": readonly ["mpkg"];
365
+ readonly "application/vnd.apple.mpegurl": readonly ["m3u8"];
366
+ readonly "application/vnd.apple.pkpass": readonly ["pkpass"];
367
+ readonly "application/vnd.mozilla.xul+xml": readonly ["xul"];
368
+ readonly "application/vnd.ms-excel": readonly ["xls"];
369
+ readonly "application/vnd.ms-fontobject": readonly ["eot"];
370
+ readonly "application/vnd.ms-powerpoint": readonly ["ppt"];
371
+ readonly "application/vnd.oasis.opendocument.presentation": readonly ["odp"];
372
+ readonly "application/vnd.oasis.opendocument.spreadsheet": readonly ["ods"];
373
+ readonly "application/vnd.oasis.opendocument.text": readonly ["odt"];
374
+ readonly "application/vnd.openxmlformats-officedocument.presentationml.presentation": readonly ["pptx"];
375
+ readonly "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": readonly ["xlsx"];
376
+ readonly "application/vnd.openxmlformats-officedocument.wordprocessingml.document": readonly ["docx"];
377
+ readonly "application/vnd.rar": readonly ["rar"];
378
+ readonly "application/vnd.visio": readonly ["vsd"];
379
+ readonly "application/wasm": readonly ["wasm"];
380
+ readonly "application/x-7z-compressed": readonly ["7z"];
381
+ readonly "application/x-abiword": readonly ["abw"];
382
+ readonly "application/x-bzip": readonly ["bz"];
383
+ readonly "application/x-bzip2": readonly ["bz2"];
384
+ readonly "application/x-cdf": readonly ["cda"];
385
+ readonly "application/x-csh": readonly ["csh"];
386
+ readonly "application/x-freearc": readonly ["arc"];
387
+ readonly "application/x-gzip": readonly ["gz"];
388
+ readonly "application/x-httpd-php": readonly ["php"];
389
+ readonly "application/x-mdx": readonly ["mdx"];
390
+ readonly "application/x-ndjson": readonly ["ndjson"];
391
+ readonly "application/x-python-code": readonly ["pyc"];
392
+ readonly "application/x-sh": readonly ["sh"];
393
+ readonly "application/x-tar": readonly ["tar"];
394
+ readonly "application/x-zip-compressed": readonly ["zip"];
395
+ readonly "application/xhtml+xml": readonly ["xhtml"];
396
+ readonly "application/xml": readonly ["xml"];
397
+ readonly "application/yaml": readonly ["yml", "yaml"];
398
+ readonly "application/zip": readonly ["zip"];
399
+ readonly "audio/aac": readonly ["aac"];
400
+ readonly "audio/midi": readonly ["mid"];
401
+ readonly "audio/mp4": readonly ["m4a"];
402
+ readonly "audio/mpeg": readonly ["mp3"];
403
+ readonly "audio/ogg": readonly ["opus", "ogg", "oga"];
404
+ readonly "audio/wav": readonly ["wav"];
405
+ readonly "audio/x-midi": readonly ["midi"];
406
+ readonly "font/otf": readonly ["otf"];
407
+ readonly "font/ttf": readonly ["ttf"];
408
+ readonly "font/woff": readonly ["woff"];
409
+ readonly "font/woff2": readonly ["woff2"];
410
+ readonly "haptics/hjif": readonly ["hjif"];
411
+ readonly "haptics/hmpg": readonly ["hmpg"];
412
+ readonly "haptics/ivs": readonly ["ivs", "ivt"];
413
+ readonly "image/aces": readonly ["aces"];
414
+ readonly "image/apng": readonly ["apng"];
415
+ readonly "image/avci": readonly ["avci"];
416
+ readonly "image/avif": readonly ["avif"];
417
+ readonly "image/bmp": readonly ["bmp"];
418
+ readonly "image/dpx": readonly ["dpx"];
419
+ readonly "image/emf": readonly ["emf"];
420
+ readonly "image/gif": readonly ["gif"];
421
+ readonly "image/jpeg": readonly ["jpg", "jpeg"];
422
+ readonly "image/ktx": readonly ["ktx"];
423
+ readonly "image/ktx2": readonly ["ktx2"];
424
+ readonly "image/png": readonly ["png"];
425
+ readonly "image/svg+xml": readonly ["svg"];
426
+ readonly "image/tiff": readonly ["tiff", "tif"];
427
+ readonly "image/vnd.microsoft.icon": readonly ["ico"];
428
+ readonly "image/webp": readonly ["webp"];
429
+ readonly "model/gltf-binary": readonly ["glb"];
430
+ readonly "model/gltf+json": readonly ["gltf"];
431
+ readonly "model/obj": readonly ["obj"];
432
+ readonly "model/vnd.usdz+zip": readonly ["usdz"];
433
+ readonly "multipart/voice-message": readonly ["bin"];
434
+ readonly "text/calendar": readonly ["ics"];
435
+ readonly "text/css": readonly ["css"];
436
+ readonly "text/csv": readonly ["csv"];
437
+ readonly "text/event-stream": readonly ["sse", "ts", "rs", "py", "txt"];
438
+ readonly "text/html": readonly ["html", "htm"];
439
+ readonly "text/javascript": readonly ["cjs", "js", "mjs"];
440
+ readonly "text/markdown": readonly ["md"];
441
+ readonly "text/plain": readonly ["txt"];
442
+ readonly "text/rust": readonly ["rs"];
443
+ readonly "text/typescript": readonly ["ts"];
444
+ readonly "text/vtt": readonly ["vtt"];
445
+ readonly "text/x-python": readonly ["py"];
446
+ readonly "video/3gpp": readonly ["3gp"];
447
+ readonly "video/3gpp2": readonly ["3g2"];
448
+ readonly "video/mp2t": readonly ["ts"];
449
+ readonly "video/mp4": readonly ["mp4", "m4v"];
450
+ readonly "video/mpeg": readonly ["mpeg"];
451
+ readonly "video/ogg": readonly ["ogv"];
452
+ readonly "video/vnd.dlna.mpeg-tts": readonly ["ts"];
453
+ readonly "video/webm": readonly ["weba"];
454
+ readonly "video/x-msvideo": readonly ["avi"];
455
+ };
456
+ compareMimeToExt(p?: "mime" | "ext"): {
457
+ [k: string]: number;
458
+ };
459
+ assetType<const T extends string>(url: T): "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonld" | "doc" | "node" | "js" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "toml" | "azw" | "mpkg" | "m3u8" | "pkpass" | "xul" | "xls" | "eot" | "ppt" | "odp" | "ods" | "odt" | "pptx" | "xlsx" | "docx" | "rar" | "vsd" | "wasm" | "7z" | "abw" | "bz" | "bz2" | "cda" | "csh" | "arc" | "php" | "mdx" | "ndjson" | "pyc" | "sh" | "tar" | "zip" | "xhtml" | "xml" | "yml" | "yaml" | "aac" | "mid" | "m4a" | "mp3" | "opus" | "ogg" | "oga" | "wav" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "ivt" | "aces" | "apng" | "avci" | "dpx" | "emf" | "jpg" | "ktx" | "ktx2" | "svg" | "tiff" | "tif" | "ico" | "glb" | "gltf" | "usdz" | "ics" | "css" | "csv" | "sse" | "ts" | "rs" | "py" | "txt" | "html" | "htm" | "cjs" | "mjs" | "md" | "vtt" | "3gp" | "3g2" | "mp4" | "m4v" | "mpeg" | "ogv" | "weba" | "avi" | undefined;
460
+ getMimes<const E extends FileExtension>(ext: E): readonly ["audio/aac"] | readonly ["application/x-abiword"] | readonly ["image/aces"] | readonly ["image/apng"] | readonly ["application/x-freearc"] | readonly ["image/avci"] | readonly ["image/avif"] | readonly ["video/x-msvideo"] | readonly ["application/vnd.amazon.ebook"] | readonly ["application/octet-stream", "multipart/voice-message"] | readonly ["image/bmp"] | readonly ["application/x-bzip"] | readonly ["application/x-bzip2"] | readonly ["application/x-cdf"] | readonly ["application/node", "text/javascript"] | readonly ["application/x-csh"] | readonly ["text/css"] | readonly ["text/csv"] | readonly ["application/msword"] | readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] | readonly ["image/dpx"] | readonly ["image/emf"] | readonly ["application/vnd.ms-fontobject"] | readonly ["application/epub+zip"] | readonly ["image/gif"] | readonly ["model/gltf-binary"] | readonly ["model/gltf+json"] | readonly ["application/gzip", "application/x-gzip"] | readonly ["haptics/hjif"] | readonly ["haptics/hmpg"] | readonly ["text/html"] | readonly ["image/vnd.microsoft.icon"] | readonly ["text/calendar"] | readonly ["haptics/ivs"] | readonly ["application/java-archive"] | readonly ["image/jpeg"] | readonly ["application/json"] | readonly ["application/ld+json"] | readonly ["image/ktx"] | readonly ["image/ktx2"] | readonly ["application/vnd.apple.mpegurl"] | readonly ["audio/mp4"] | readonly ["video/mp4"] | readonly ["text/markdown"] | readonly ["application/x-mdx"] | readonly ["audio/midi"] | readonly ["audio/x-midi"] | readonly ["text/javascript"] | readonly ["audio/mpeg"] | readonly ["video/mpeg"] | readonly ["application/vnd.apple.installer+xml"] | readonly ["application/x-ndjson"] | readonly ["model/obj", "application/octet-stream", "text/plain"] | readonly ["application/vnd.oasis.opendocument.presentation"] | readonly ["application/vnd.oasis.opendocument.spreadsheet"] | readonly ["application/vnd.oasis.opendocument.text"] | readonly ["audio/ogg"] | readonly ["video/ogg"] | readonly ["application/ogg"] | readonly ["font/otf"] | readonly ["image/png"] | readonly ["application/pdf"] | readonly ["application/x-httpd-php"] | readonly ["application/vnd.apple.pkpass"] | readonly ["application/vnd.ms-powerpoint"] | readonly ["application/vnd.openxmlformats-officedocument.presentationml.presentation"] | readonly ["text/x-python"] | readonly ["application/x-python-code"] | readonly ["application/vnd.rar"] | readonly ["text/rust"] | readonly ["application/rtf"] | readonly ["application/x-sh"] | readonly ["application/sql"] | readonly ["text/event-stream"] | readonly ["image/svg+xml"] | readonly ["application/x-tar"] | readonly ["image/tiff"] | readonly ["application/toml"] | readonly ["text/typescript", "video/mp2t", "video/vnd.dlna.mpeg-tts"] | readonly ["application/font-sfnt", "font/ttf"] | readonly ["text/plain"] | readonly ["model/vnd.usdz+zip"] | readonly ["application/vnd.visio"] | readonly ["text/vtt"] | readonly ["application/wasm"] | readonly ["audio/wav"] | readonly ["video/webm"] | readonly ["image/webp"] | readonly ["font/woff"] | readonly ["font/woff2"] | readonly ["application/xhtml+xml"] | readonly ["application/vnd.ms-excel"] | readonly ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] | readonly ["application/xml"] | readonly ["application/vnd.mozilla.xul+xml"] | readonly ["application/yaml"] | readonly ["application/zip", "application/x-zip-compressed"] | readonly ["video/3gpp"] | readonly ["video/3gpp2"] | readonly ["application/x-7z-compressed"];
229
461
  getMimeFor<const E extends FileExtension>(ext: E, opts?: {
230
462
  type?: MimeTopLevelType;
231
463
  }): FileExtensionToMimeType<E>;
232
- isMimeFor<const E extends FileExtension>(ext: E, mime: FileExtensionToMimeType<E>): "application/octet-stream" | "audio/aac" | "application/x-abiword" | "image/aces" | "image/apng" | "application/x-freearc" | "image/avci" | "image/avif" | "video/x-msvideo" | "application/vnd.amazon.ebook" | "image/bmp" | "application/x-bzip" | "application/x-bzip2" | "application/x-cdf" | "application/node" | "text/javascript" | "application/x-csh" | "text/css" | "text/csv" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "image/dpx" | "image/emf" | "application/vnd.ms-fontobject" | "application/epub+zip" | "image/gif" | "model/gltf-binary" | "model/gltf+json" | "application/x-gzip" | "application/gzip" | "haptics/hjif" | "haptics/hmpg" | "text/html" | "image/vnd.microsoft.icon" | "text/calendar" | "haptics/ivs" | "application/java-archive" | "image/jpeg" | "application/json" | "application/ld+json" | "image/ktx" | "image/ktx2" | "application/vnd.apple.mpegurl" | "audio/mp4" | "video/mp4" | "text/markdown" | "application/x-mdx" | "audio/midi" | "audio/x-midi" | "audio/mpeg" | "video/mpeg" | "application/vnd.apple.installer+xml" | "application/x-ndjson" | "text/plain" | "model/obj" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.text" | "audio/ogg" | "video/ogg" | "application/ogg" | "font/otf" | "image/png" | "application/pdf" | "application/x-httpd-php" | "application/vnd.apple.pkpass" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "text/x-python" | "application/x-python-code" | "application/vnd.rar" | "application/rtf" | "application/x-sh" | "application/sql" | "image/svg+xml" | "application/x-tar" | "image/tiff" | "application/toml" | "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts" | "application/font-sfnt" | "font/ttf" | "model/vnd.usdz+zip" | "application/vnd.visio" | "text/vtt" | "application/wasm" | "audio/wav" | "video/webm" | "image/webp" | "font/woff" | "font/woff2" | "application/xhtml+xml" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/xml" | "application/vnd.mozilla.xul+xml" | "application/yaml" | "application/zip" | "application/x-zip-compressed" | "video/3gpp" | "video/3gpp2" | "application/x-7z-compressed" | undefined;
464
+ isMimeFor<const E extends FileExtension>(ext: E, mime: FileExtensionToMimeType<E>): "audio/aac" | "application/x-abiword" | "image/aces" | "image/apng" | "application/x-freearc" | "image/avci" | "image/avif" | "video/x-msvideo" | "application/vnd.amazon.ebook" | "application/octet-stream" | "multipart/voice-message" | "image/bmp" | "application/x-bzip" | "application/x-bzip2" | "application/x-cdf" | "application/node" | "text/javascript" | "application/x-csh" | "text/css" | "text/csv" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "image/dpx" | "image/emf" | "application/vnd.ms-fontobject" | "application/epub+zip" | "image/gif" | "model/gltf-binary" | "model/gltf+json" | "application/gzip" | "application/x-gzip" | "haptics/hjif" | "haptics/hmpg" | "text/html" | "image/vnd.microsoft.icon" | "text/calendar" | "haptics/ivs" | "application/java-archive" | "image/jpeg" | "application/json" | "application/ld+json" | "image/ktx" | "image/ktx2" | "application/vnd.apple.mpegurl" | "audio/mp4" | "video/mp4" | "text/markdown" | "application/x-mdx" | "audio/midi" | "audio/x-midi" | "audio/mpeg" | "video/mpeg" | "application/vnd.apple.installer+xml" | "application/x-ndjson" | "model/obj" | "text/plain" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.text" | "audio/ogg" | "video/ogg" | "application/ogg" | "font/otf" | "image/png" | "application/pdf" | "application/x-httpd-php" | "application/vnd.apple.pkpass" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "text/x-python" | "application/x-python-code" | "application/vnd.rar" | "text/rust" | "application/rtf" | "application/x-sh" | "application/sql" | "text/event-stream" | "image/svg+xml" | "application/x-tar" | "image/tiff" | "application/toml" | "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts" | "application/font-sfnt" | "font/ttf" | "model/vnd.usdz+zip" | "application/vnd.visio" | "text/vtt" | "application/wasm" | "audio/wav" | "video/webm" | "image/webp" | "font/woff" | "font/woff2" | "application/xhtml+xml" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/xml" | "application/vnd.mozilla.xul+xml" | "application/yaml" | "application/zip" | "application/x-zip-compressed" | "video/3gpp" | "video/3gpp2" | "application/x-7z-compressed" | undefined;
233
465
  getMimeTypeForPath<T extends string>(path: T, opts?: {
234
466
  type?: MimeTopLevelType;
235
- }): "application/octet-stream" | "audio/aac" | "application/x-abiword" | "image/aces" | "image/apng" | "application/x-freearc" | "image/avci" | "image/avif" | "video/x-msvideo" | "application/vnd.amazon.ebook" | "image/bmp" | "application/x-bzip" | "application/x-bzip2" | "application/x-cdf" | "application/node" | "text/javascript" | "application/x-csh" | "text/css" | "text/csv" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "image/dpx" | "image/emf" | "application/vnd.ms-fontobject" | "application/epub+zip" | "image/gif" | "model/gltf-binary" | "model/gltf+json" | "application/x-gzip" | "application/gzip" | "haptics/hjif" | "haptics/hmpg" | "text/html" | "image/vnd.microsoft.icon" | "text/calendar" | "haptics/ivs" | "application/java-archive" | "image/jpeg" | "application/json" | "application/ld+json" | "image/ktx" | "image/ktx2" | "application/vnd.apple.mpegurl" | "audio/mp4" | "video/mp4" | "text/markdown" | "application/x-mdx" | "audio/midi" | "audio/x-midi" | "audio/mpeg" | "video/mpeg" | "application/vnd.apple.installer+xml" | "application/x-ndjson" | "text/plain" | "model/obj" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.text" | "audio/ogg" | "video/ogg" | "application/ogg" | "font/otf" | "image/png" | "application/pdf" | "application/x-httpd-php" | "application/vnd.apple.pkpass" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "text/x-python" | "application/x-python-code" | "application/vnd.rar" | "application/rtf" | "application/x-sh" | "application/sql" | "image/svg+xml" | "application/x-tar" | "image/tiff" | "application/toml" | "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts" | "application/font-sfnt" | "font/ttf" | "model/vnd.usdz+zip" | "application/vnd.visio" | "text/vtt" | "application/wasm" | "audio/wav" | "video/webm" | "image/webp" | "font/woff" | "font/woff2" | "application/xhtml+xml" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/xml" | "application/vnd.mozilla.xul+xml" | "application/yaml" | "application/zip" | "application/x-zip-compressed" | "video/3gpp" | "video/3gpp2" | "application/x-7z-compressed";
467
+ }): "audio/aac" | "application/x-abiword" | "image/aces" | "image/apng" | "application/x-freearc" | "image/avci" | "image/avif" | "video/x-msvideo" | "application/vnd.amazon.ebook" | "application/octet-stream" | "multipart/voice-message" | "image/bmp" | "application/x-bzip" | "application/x-bzip2" | "application/x-cdf" | "application/node" | "text/javascript" | "application/x-csh" | "text/css" | "text/csv" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "image/dpx" | "image/emf" | "application/vnd.ms-fontobject" | "application/epub+zip" | "image/gif" | "model/gltf-binary" | "model/gltf+json" | "application/gzip" | "application/x-gzip" | "haptics/hjif" | "haptics/hmpg" | "text/html" | "image/vnd.microsoft.icon" | "text/calendar" | "haptics/ivs" | "application/java-archive" | "image/jpeg" | "application/json" | "application/ld+json" | "image/ktx" | "image/ktx2" | "application/vnd.apple.mpegurl" | "audio/mp4" | "video/mp4" | "text/markdown" | "application/x-mdx" | "audio/midi" | "audio/x-midi" | "audio/mpeg" | "video/mpeg" | "application/vnd.apple.installer+xml" | "application/x-ndjson" | "model/obj" | "text/plain" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.text" | "audio/ogg" | "video/ogg" | "application/ogg" | "font/otf" | "image/png" | "application/pdf" | "application/x-httpd-php" | "application/vnd.apple.pkpass" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "text/x-python" | "application/x-python-code" | "application/vnd.rar" | "text/rust" | "application/rtf" | "application/x-sh" | "application/sql" | "text/event-stream" | "image/svg+xml" | "application/x-tar" | "image/tiff" | "application/toml" | "text/typescript" | "video/mp2t" | "video/vnd.dlna.mpeg-tts" | "application/font-sfnt" | "font/ttf" | "model/vnd.usdz+zip" | "application/vnd.visio" | "text/vtt" | "application/wasm" | "audio/wav" | "video/webm" | "image/webp" | "font/woff" | "font/woff2" | "application/xhtml+xml" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/xml" | "application/vnd.mozilla.xul+xml" | "application/yaml" | "application/zip" | "application/x-zip-compressed" | "video/3gpp" | "video/3gpp2" | "application/x-7z-compressed";
236
468
  }
237
469
 
238
- export { type AllMimeTypes, type FileExtension, type FileExtensionToMimeType, type InferTopLevelPresent, MimeService, type MimeTopLevelType, type PresentMimeTopLevelTypes, extMimeMap };
470
+ export { type AllMimeTypes, type FileExtension, type FileExtensionToMimeType, type InferTopLevelPresent, MimeService, type MimeTopLevelType, type MimeType, type MimeTypeToFileExtension, type PresentMimeTopLevelTypes, extMimeMap, mimeToExt };
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  MimeService,
3
- extMimeMap
4
- } from "../chunk-EHOBCDHE.js";
3
+ extMimeMap,
4
+ mimeToExt
5
+ } from "../chunk-C6AZRX7V.js";
5
6
  import "../chunk-XHN56MDK.js";
6
7
  import "../chunk-7QVYU63E.js";
7
8
  export {
8
9
  MimeService,
9
- extMimeMap
10
+ extMimeMap,
11
+ mimeToExt
10
12
  };
11
13
  //# sourceMappingURL=index.js.map
@@ -170,43 +170,50 @@ interface ExecuteCommandProps<T extends string> extends ExecSyncOptionsWithBuffe
170
170
  }
171
171
  type ConditionalPromise<T> = T | Promise<T>;
172
172
  type UnwrapPromise<T> = T extends Promise<infer U> | PromiseLike<infer U> ? U : T;
173
- type RemoveFields<T, P extends keyof T = keyof T> = {
173
+ type Unenumerate<T> = T extends (infer U)[] | readonly (infer U)[] ? U : T;
174
+ type Rm<T, P extends keyof T = keyof T> = {
174
175
  [S in keyof T as Exclude<S, P>]: T[S];
175
176
  };
176
- type ConditionalToRequired<T, Z extends keyof T = keyof T> = RemoveFields<T, Z> & {
177
- [Q in Z]-?: T[Q];
177
+ /**
178
+ * helper workup for use in XOR type below
179
+ * makes properties from U optional and undefined in T, and vice versa
180
+ */
181
+ type Without<T, U> = {
182
+ [P in Exclude<keyof T, keyof U>]?: never;
178
183
  };
179
- type RequiredToConditional<T, X extends keyof T = keyof T> = RemoveFields<T, X> & {
180
- [Q in X]?: T[Q];
184
+ /**
185
+ * enforces mutual exclusivity of T | U
186
+ */
187
+ type XOR<T, U> = [
188
+ T,
189
+ U
190
+ ] extends [object, object] ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
191
+ /**
192
+ * Conditional to Required
193
+ */
194
+ type CTR<T, K extends keyof OnlyOptional<T> = keyof OnlyOptional<T>> = Rm<T, K> & {
195
+ [Q in K]-?: T[Q];
181
196
  };
182
- type FieldToConditionallyNever<T, X extends keyof T = keyof T> = RemoveFields<T, X> & {
183
- [Q in X]?: XOR<T[Q], never>;
197
+ /**
198
+ * Required to Conditional
199
+ */
200
+ type RTC<T, K extends keyof OnlyRequired<T> = keyof OnlyRequired<T>> = Rm<T, K> & {
201
+ [Q in K]?: T[Q];
184
202
  };
185
- type ExcludeFieldEnumerable<T, K extends keyof T> = RemoveFields<T, K>;
186
- type ArrayOrReadOnlyArray<T> = T[] | readonly T[];
187
- type Unenumerate<T> = T extends readonly (infer U)[] | (infer U)[] ? U : T;
188
- type Without<T, U> = {
189
- [P in Exclude<keyof T, keyof U>]?: never;
203
+ type IsExact<T, U> = [T] extends [U] ? ([U] extends [T] ? true : false) : false;
204
+ /**
205
+ * To Conditionally never
206
+ */
207
+ type TCN<T, X extends keyof T = keyof T> = Rm<T, X> & {
208
+ [Q in X]?: XOR<T[Q], never>;
190
209
  };
191
- type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
192
- type Depth<Y extends {
193
- [record: string | symbol | number]: unknown;
194
- }, X extends keyof Y = keyof Y> = {
195
- [H in keyof Y[X]]: Y[X][H][keyof Y[X][H]];
210
+ type ArrFieldReplacer<T extends unknown[] | readonly unknown[], V extends keyof Unenumerate<T>, Q extends boolean = false, P = unknown> = T extends (infer U)[] | readonly (infer U)[] ? V extends keyof U ? Q extends true ? P extends Record<infer Y, infer X> ? (Rm<U, V> & Record<Y, X>)[] : (Rm<U, V> & P)[] : Q extends false ? Rm<U, V>[] : U : T : T;
211
+ type IsOptional<T, K extends keyof T> = undefined extends T[K] ? object extends Pick<T, K> ? true : false : false;
212
+ type OnlyOptional<T> = {
213
+ [K in keyof T as IsOptional<T, K> extends true ? K : never]: T[K];
196
214
  };
197
- type InferDepth<T> = T extends Depth<infer U, infer X> ? U[X] : T;
198
- type OmitSrc<T> = T extends `src/${infer U}` ? U : T;
199
- type InjectScriptsProps<T> = {
200
- content: {
201
- scripts: {
202
- [record: string]: string;
203
- };
204
- } & {
205
- [record: string]: string | number | boolean | {
206
- [record: string]: string;
207
- };
208
- };
209
- tuplesToInject: T;
215
+ type OnlyRequired<T> = {
216
+ [K in keyof T as IsOptional<T, K> extends false ? K : never]: T[K];
210
217
  };
211
218
  /**
212
219
  * Expect that the thing passed to Expect<T> is true.
@@ -215,6 +222,9 @@ type InjectScriptsProps<T> = {
215
222
  * `Expect<false>` will error.
216
223
  */
217
224
  type Expect<T extends true> = T;
225
+ type RemoveFields<T, P extends keyof T = keyof T> = {
226
+ [S in keyof T as Exclude<S, P>]: T[S];
227
+ };
218
228
  /**
219
229
  * Checks that X and Y are exactly equal.
220
230
  *
@@ -237,6 +247,49 @@ type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ?
237
247
  * CANNOT be passed to a function which expects 'a'.
238
248
  */
239
249
  type Extends<X, Y> = Y extends X ? true : false;
250
+ type DX<Y> = {
251
+ [P in keyof Y]: Y[P];
252
+ };
253
+ type DeepPartial<T> = T extends object ? {
254
+ [P in keyof T]?: DeepPartial<T[P]>;
255
+ } : T;
256
+ type DeepPartialFields<T, K extends keyof T> = Omit<T, K> & {
257
+ [P in K]?: DeepPartial<T[P]>;
258
+ };
259
+ type DeepReplace<T, From, To> = T extends From ? To : T extends object ? {
260
+ [K in keyof T]: DeepReplace<T[K], From, To>;
261
+ } : T;
262
+ type RequireNested<T, Path extends string> = Path extends `${infer K}.${infer Rest}` ? K extends keyof T ? Rm<T, K> & Record<K, RequireNested<Required<T>[K], Rest>> : T : Path extends keyof T ? Rm<T, Path> & Record<Path, Required<T>[Path]> : T;
263
+ type ConditionalToRequired<T, Z extends keyof T = keyof T> = Rm<T, Z> & {
264
+ [Q in Z]-?: T[Q];
265
+ };
266
+ type RequiredToConditional<T, X extends keyof T = keyof T> = Rm<T, X> & {
267
+ [Q in X]?: T[Q];
268
+ };
269
+ type FieldToConditionallyNever<T, X extends keyof T = keyof T> = Rm<T, X> & {
270
+ [Q in X]?: XOR<T[Q], never>;
271
+ };
272
+ type ExcludeFieldEnumerable<T, K extends keyof T> = Rm<T, K>;
273
+ type ArrayOrReadOnlyArray<T> = T[] | readonly T[];
274
+ type Depth<Y extends {
275
+ [record: string | symbol | number]: unknown;
276
+ }, X extends keyof Y = keyof Y> = {
277
+ [H in keyof Y[X]]: Y[X][H][keyof Y[X][H]];
278
+ };
279
+ type InferDepth<T> = T extends Depth<infer U, infer X> ? U[X] : T;
280
+ type OmitSrc<T> = T extends `src/${infer U}` ? U : T;
281
+ type InjectScriptsProps<T> = {
282
+ content: {
283
+ scripts: {
284
+ [record: string]: string;
285
+ };
286
+ } & {
287
+ [record: string]: string | number | boolean | {
288
+ [record: string]: string;
289
+ };
290
+ };
291
+ tuplesToInject: T;
292
+ };
240
293
  type ParsedUrlInfo = {
241
294
  href: string;
242
295
  protocol: string;
@@ -259,5 +312,14 @@ type SizeOpts = {
259
312
  decimals?: number;
260
313
  includeUnits?: boolean;
261
314
  };
315
+ interface ImageSize {
316
+ width: number;
317
+ height: number;
318
+ type: "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "unknown";
319
+ }
320
+ interface BoxInfo {
321
+ pos: number;
322
+ size: number;
323
+ }
262
324
 
263
- export { type Abortable, type ArrayBufferView, type ArrayOrReadOnlyArray, type BashEnv, type BufferEncodingUnion, type CoercionUnion, type CommonExecOptions, type CommonOptions, type ConditionalPromise, type ConditionalToRequired, type Depth, type Dict, type Equal, type ExcludeFieldEnumerable, type ExecSyncOptions, type ExecSyncOptionsWithBufferEncoding, type ExecSyncOptionsWithStringEncoding, type ExecuteCommandProps, type Expect, type Extends, type FieldToConditionallyNever, type IOType, type InferDepth, type InjectScriptsProps, type MkDirOptions, type MkDirSyncOptions, type MkDirSyncProps, type Mode, type ObjEncodingOptions, type OmitSrc, type OpenMode, type ParsedUrlInfo, type ProcessEnv, type ProcessEnvOptions, type ReadDirOptions, type ReadDirOptionsEntity, type ReadDirProps, type RemoveFields, type RequiredToConditional, type RmDirOptions, type RmDirProps, type Signals, type SizeOpts, type StdioOptions, type TypedArray, type Unenumerate, type Unit, type UnwrapPromise, type Without, type WriteFileAsyncDataUnion, type WriteFileAsyncOptions, type WriteFileAsyncProps, type WriteStreamDataShape, type WriteStreamOptions, type WriteStreamProps, type XOR, unitsObj };
325
+ export { type Abortable, type ArrFieldReplacer, type ArrayBufferView, type ArrayOrReadOnlyArray, type BashEnv, type BoxInfo, type BufferEncodingUnion, type CTR, type CoercionUnion, type CommonExecOptions, type CommonOptions, type ConditionalPromise, type ConditionalToRequired, type DX, type DeepPartial, type DeepPartialFields, type DeepReplace, type Depth, type Dict, type Equal, type ExcludeFieldEnumerable, type ExecSyncOptions, type ExecSyncOptionsWithBufferEncoding, type ExecSyncOptionsWithStringEncoding, type ExecuteCommandProps, type Expect, type Extends, type FieldToConditionallyNever, type IOType, type ImageSize, type InferDepth, type InjectScriptsProps, type IsExact, type IsOptional, type MkDirOptions, type MkDirSyncOptions, type MkDirSyncProps, type Mode, type ObjEncodingOptions, type OmitSrc, type OnlyOptional, type OnlyRequired, type OpenMode, type ParsedUrlInfo, type ProcessEnv, type ProcessEnvOptions, type RTC, type ReadDirOptions, type ReadDirOptionsEntity, type ReadDirProps, type RemoveFields, type RequireNested, type RequiredToConditional, type Rm, type RmDirOptions, type RmDirProps, type Signals, type SizeOpts, type StdioOptions, type TCN, type TypedArray, type Unenumerate, type Unit, type UnwrapPromise, type Without, type WriteFileAsyncDataUnion, type WriteFileAsyncOptions, type WriteFileAsyncProps, type WriteStreamDataShape, type WriteStreamOptions, type WriteStreamProps, type XOR, unitsObj };