@d0paminedriven/fs 11.0.0 → 12.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.
Files changed (41) hide show
  1. package/dist/docs/index.d.ts +42 -10
  2. package/dist/docs/index.js +177 -41
  3. package/dist/extract/client.d.ts +13 -11
  4. package/dist/extract/client.js +2 -4
  5. package/dist/extract/index.d.ts +7 -10
  6. package/dist/extract/index.js +6 -8
  7. package/dist/fs/index.d.ts +7 -11
  8. package/dist/fs/index.js +15 -14
  9. package/dist/fs-atomic/index.d.ts +3 -9
  10. package/dist/fs-atomic/index.js +17 -11
  11. package/dist/fs-base/index.d.ts +8 -10
  12. package/dist/fs-base/index.js +36 -27
  13. package/dist/fs-core/index.d.ts +5 -9
  14. package/dist/fs-core/index.js +5 -6
  15. package/dist/fs-fetch/index.d.ts +6 -9
  16. package/dist/fs-fetch/index.js +64 -27
  17. package/dist/fs-size/index.d.ts +2 -6
  18. package/dist/fs-size/index.js +8 -9
  19. package/dist/fs-tmp/index.d.ts +7 -11
  20. package/dist/fs-tmp/index.js +7 -8
  21. package/dist/images/index.d.ts +44 -48
  22. package/dist/images/index.js +9 -15
  23. package/dist/images/workup.d.ts +5 -9
  24. package/dist/images/workup.js +4 -5
  25. package/dist/index.d.ts +42 -14
  26. package/dist/index.js +14 -15
  27. package/dist/ld/index.d.ts +1 -5
  28. package/dist/ld/index.js +2 -4
  29. package/dist/mime/index.d.ts +20 -20
  30. package/dist/mime/index.js +4 -4
  31. package/dist/mixins/index.d.ts +9 -13
  32. package/dist/mixins/index.js +6 -6
  33. package/dist/types/index.d.ts +105 -90
  34. package/dist/types/index.js +2 -3
  35. package/dist/types/stream.d.ts +5 -9
  36. package/dist/types/stream.js +1 -1
  37. package/dist/url/index.d.ts +6 -10
  38. package/dist/url/index.js +2 -4
  39. package/dist/utils/index.d.ts +5 -9
  40. package/dist/utils/index.js +2 -4
  41. package/package.json +18 -18
package/dist/index.js CHANGED
@@ -1,20 +1,19 @@
1
+ import Fs from "./fs/index.js";
2
+ import { FsAtomic } from "./fs-atomic/index.js";
3
+ import { FsBase } from "./fs-base/index.js";
4
+ import { FsCore } from "./fs-core/index.js";
5
+ import { FsFetch } from "./fs-fetch/index.js";
6
+ import { FsSize } from "./fs-size/index.js";
7
+ import { FsTmp } from "./fs-tmp/index.js";
8
+ import { ExtractClient } from "./extract/client.js";
9
+ import { Extract } from "./extract/index.js";
10
+ import { DocMixin, ImgMixin, create, createInstance } from "./mixins/index.js";
1
11
  import { DocMetadataExtractor } from "./docs/index.js";
2
- import { ImgMetadataExtractorWorkup } from "./images/workup.js";
3
12
  import { ImgMetadataExtractor } from "./images/index.js";
4
- import { DocMixin, ImgMixin, create, createInstance } from "./mixins/index.js";
5
- import { Extract } from "./extract/index.js";
13
+ import { ImgMetadataExtractorWorkup } from "./images/workup.js";
6
14
  import { LevenshteinDistance } from "./ld/index.js";
7
- import { UtilsService } from "./utils/index.js";
8
- import { UrlService } from "./url/index.js";
9
15
  import { MimeService, extMimeMap, mimeToExt } from "./mime/index.js";
10
- import { FsBase } from "./fs-base/index.js";
11
- import { FsAtomic } from "./fs-atomic/index.js";
12
16
  import { unitsObj } from "./types/index.js";
13
- import { FsSize } from "./fs-size/index.js";
14
- import { FsCore } from "./fs-core/index.js";
15
- import { FsTmp } from "./fs-tmp/index.js";
16
- import { FsFetch } from "./fs-fetch/index.js";
17
- import Fs from "./fs/index.js";
18
- import { ExtractClient } from "./extract/client.js";
19
-
20
- export { DocMetadataExtractor, DocMixin, Extract, ExtractClient, Fs, FsAtomic, FsBase, FsCore, FsFetch, FsSize, FsTmp, ImgMetadataExtractor, ImgMetadataExtractorWorkup, ImgMixin, LevenshteinDistance, MimeService, UrlService, UtilsService, create, createInstance, extMimeMap, mimeToExt, unitsObj };
17
+ import { UrlService } from "./url/index.js";
18
+ import { UtilsService } from "./utils/index.js";
19
+ export { DocMetadataExtractor, DocMixin, Extract, ExtractClient, Fs, FsAtomic, FsBase, FsCore, FsFetch, FsSize, FsTmp, ImgMetadataExtractor, ImgMetadataExtractorWorkup, ImgMixin, LevenshteinDistance, MimeService, UrlService, UtilsService, create, createInstance, extMimeMap, mimeToExt, unitsObj };
@@ -1,7 +1,5 @@
1
1
  import { Extract } from "../extract/index.js";
2
-
3
- //#region src/ld/index.d.ts
4
- declare class LevenshteinDistance extends Extract {
2
+ export declare class LevenshteinDistance extends Extract {
5
3
  constructor();
6
4
  private createMatrix;
7
5
  private inBounds;
@@ -14,6 +12,4 @@ declare class LevenshteinDistance extends Extract {
14
12
  */
15
13
  calculateLD(a?: string | null, b?: string | null): number;
16
14
  }
17
- //#endregion
18
- export { LevenshteinDistance };
19
15
  //# sourceMappingURL=index.d.ts.map
package/dist/ld/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Extract } from "../extract/index.js";
2
-
3
- //#region src/ld/index.ts
2
+ // src/ld/index.ts
4
3
  var LevenshteinDistance = class extends Extract {
5
4
  constructor() {
6
5
  super();
@@ -52,7 +51,6 @@ var LevenshteinDistance = class extends Extract {
52
51
  return this.getCell(dp, strA.length, strB.length);
53
52
  }
54
53
  };
55
-
56
- //#endregion
57
54
  export { LevenshteinDistance };
55
+
58
56
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,6 @@
1
1
  import { XOR } from "../types/index.js";
2
2
  import { UrlService } from "../url/index.js";
3
-
4
- //#region src/mime/index.d.ts
5
- declare const extMimeMap: {
3
+ export declare const extMimeMap: {
6
4
  readonly aac: readonly ["audio/aac"];
7
5
  readonly abw: readonly ["application/x-abiword"];
8
6
  readonly aces: readonly ["image/aces"];
@@ -34,6 +32,7 @@ declare const extMimeMap: {
34
32
  readonly gif: readonly ["image/gif"];
35
33
  readonly glb: readonly ["model/gltf-binary"];
36
34
  readonly gltf: readonly ["model/gltf+json"];
35
+ readonly go: readonly ["text/x-go"];
37
36
  readonly gz: readonly ["application/gzip", "application/x-gzip"];
38
37
  readonly heic: readonly ["image/heic"];
39
38
  readonly hjif: readonly ["haptics/hjif"];
@@ -137,7 +136,7 @@ declare const extMimeMap: {
137
136
  readonly "3g2": readonly ["video/3gpp2"];
138
137
  readonly "7z": readonly ["application/x-7z-compressed"];
139
138
  };
140
- declare const mimeToExt: {
139
+ export declare const mimeToExt: {
141
140
  readonly "application/dash+xml": readonly ["mpd"];
142
141
  readonly "application/epub+zip": readonly ["epub"];
143
142
  readonly "application/font-sfnt": readonly ["ttf"];
@@ -247,6 +246,7 @@ declare const mimeToExt: {
247
246
  readonly "text/x-c": readonly ["c"];
248
247
  readonly "text/x-c++": readonly ["cpp"];
249
248
  readonly "text/x-csharp": readonly ["cs"];
249
+ readonly "text/x-go": readonly ["go"];
250
250
  readonly "text/x-java": readonly ["java"];
251
251
  readonly "text/x-jsonl": readonly ["jsonl", "jsonlines"];
252
252
  readonly "text/x-php": readonly ["php"];
@@ -265,15 +265,15 @@ declare const mimeToExt: {
265
265
  readonly "video/webm": readonly ["weba"];
266
266
  readonly "video/x-msvideo": readonly ["avi"];
267
267
  };
268
- type FileExtension = keyof typeof extMimeMap;
269
- type MimeType = keyof typeof mimeToExt;
270
- type MimeTypeToFileExtension<T extends XOR<typeof mimeToExt, typeof extMimeMap>> = T[keyof T];
271
- type FileExtensionToMimeType<T extends FileExtension> = (typeof extMimeMap)[T][number];
272
- type AllMimeTypes = FileExtensionToMimeType<FileExtension>;
273
- type InferTopLevelPresent<T> = T extends `${infer U}/${string}` ? U : T;
274
- type PresentMimeTopLevelTypes = InferTopLevelPresent<AllMimeTypes>;
275
- type MimeTopLevelType = "text" | "haptics" | "multipart" | "image" | "font" | "video" | "audio" | "application" | "model" | "message" | "example";
276
- declare class MimeService extends UrlService {
268
+ export type FileExtension = keyof typeof extMimeMap;
269
+ export type MimeType = keyof typeof mimeToExt;
270
+ export type MimeTypeToFileExtension<T extends XOR<typeof mimeToExt, typeof extMimeMap>> = T[keyof T];
271
+ export type FileExtensionToMimeType<T extends FileExtension> = (typeof extMimeMap)[T][number];
272
+ export type AllMimeTypes = FileExtensionToMimeType<FileExtension>;
273
+ export type InferTopLevelPresent<T> = T extends `${infer U}/${string}` ? U : T;
274
+ export type PresentMimeTopLevelTypes = InferTopLevelPresent<AllMimeTypes>;
275
+ export type MimeTopLevelType = "text" | "haptics" | "multipart" | "image" | "font" | "video" | "audio" | "application" | "model" | "message" | "example";
276
+ export declare class MimeService extends UrlService {
277
277
  constructor();
278
278
  readonly mimeTypeObj: {
279
279
  readonly aac: readonly ["audio/aac"];
@@ -307,6 +307,7 @@ declare class MimeService extends UrlService {
307
307
  readonly gif: readonly ["image/gif"];
308
308
  readonly glb: readonly ["model/gltf-binary"];
309
309
  readonly gltf: readonly ["model/gltf+json"];
310
+ readonly go: readonly ["text/x-go"];
310
311
  readonly gz: readonly ["application/gzip", "application/x-gzip"];
311
312
  readonly heic: readonly ["image/heic"];
312
313
  readonly hjif: readonly ["haptics/hjif"];
@@ -520,6 +521,7 @@ declare class MimeService extends UrlService {
520
521
  readonly "text/x-c": readonly ["c"];
521
522
  readonly "text/x-c++": readonly ["cpp"];
522
523
  readonly "text/x-csharp": readonly ["cs"];
524
+ readonly "text/x-go": readonly ["go"];
523
525
  readonly "text/x-java": readonly ["java"];
524
526
  readonly "text/x-jsonl": readonly ["jsonl", "jsonlines"];
525
527
  readonly "text/x-php": readonly ["php"];
@@ -541,17 +543,15 @@ declare class MimeService extends UrlService {
541
543
  compareMimeToExt(p?: "mime" | "ext"): {
542
544
  [k: string]: number;
543
545
  };
544
- mimeToExt(mime: keyof typeof this.toExtObj): "3g2" | "3gp" | "7z" | "aac" | "abw" | "aces" | "apng" | "arc" | "avci" | "avi" | "avif" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "c" | "cda" | "cjs" | "cpp" | "cs" | "csh" | "css" | "csv" | "doc" | "docx" | "dpx" | "emf" | "eot" | "epub" | "gif" | "glb" | "gltf" | "gz" | "heic" | "hjif" | "hmpg" | "html" | "ico" | "ics" | "ivs" | "jar" | "java" | "jpg" | "json" | "json5" | "jsonc" | "jsonl" | "jsonld" | "ktx" | "ktx2" | "m3u8" | "m4a" | "md" | "mdx" | "mid" | "midi" | "mp3" | "mp4" | "mpd" | "mpeg" | "mpkg" | "ndjson" | "node" | "obj" | "odp" | "ods" | "odt" | "ogg" | "ogv" | "ogx" | "opus" | "otf" | "pdf" | "php" | "pkpass" | "png" | "ppt" | "pptx" | "py" | "pyc" | "rar" | "rb" | "rs" | "rtf" | "sh" | "sql" | "sse" | "svg" | "tar" | "tex" | "tiff" | "toml" | "ts" | "ttf" | "txt" | "usdz" | "vsd" | "vtt" | "wasm" | "wav" | "weba" | "webmanifest" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "yml" | "zip";
545
- assetType<const T extends string>(url: T): "3g2" | "3gp" | "7z" | "aac" | "abw" | "aces" | "apng" | "arc" | "avci" | "avi" | "avif" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "c" | "cda" | "cjs" | "cpp" | "cs" | "csh" | "css" | "csv" | "cur" | "doc" | "docx" | "dpx" | "emf" | "eot" | "epub" | "gif" | "glb" | "gltf" | "gz" | "heic" | "hjif" | "hmpg" | "htm" | "html" | "ico" | "ics" | "ivs" | "ivt" | "jar" | "java" | "jfif" | "jif" | "jpe" | "jpeg" | "jpg" | "js" | "json" | "json5" | "jsonc" | "jsonl" | "jsonld" | "jsonlines" | "ktx" | "ktx2" | "m3u8" | "m4a" | "m4s" | "m4v" | "md" | "mdx" | "mid" | "midi" | "mjs" | "mp3" | "mp4" | "mpd" | "mpeg" | "mpkg" | "mtlx" | "ndjson" | "node" | "obj" | "odp" | "ods" | "odt" | "oga" | "ogg" | "ogv" | "ogx" | "opus" | "otf" | "pdf" | "php" | "pjp" | "pjpeg" | "pk1" | "pkpass" | "png" | "ppt" | "pptx" | "py" | "pyc" | "rar" | "rb" | "rs" | "rtf" | "sh" | "sql" | "sse" | "svg" | "tar" | "tex" | "tif" | "tiff" | "toml" | "ts" | "ttf" | "txt" | "usdz" | "vsd" | "vtt" | "wasm" | "wav" | "weba" | "webm" | "webmanifest" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "yaml" | "yml" | "zip" | undefined;
546
- getMimes<const E extends FileExtension>(ext: E): readonly ["application/dash+xml"] | readonly ["application/epub+zip"] | readonly ["application/java-archive"] | readonly ["application/json"] | readonly ["application/ld+json"] | readonly ["application/manifest+json"] | readonly ["application/msword"] | readonly ["application/octet-stream"] | readonly ["application/ogg"] | readonly ["application/pdf"] | readonly ["application/rtf"] | readonly ["application/sql"] | readonly ["application/toml"] | readonly ["application/vnd.amazon.ebook"] | readonly ["application/vnd.apple.installer+xml"] | readonly ["application/vnd.apple.mpegurl"] | readonly ["application/vnd.apple.pkpass"] | readonly ["application/vnd.mozilla.xul+xml"] | readonly ["application/vnd.ms-excel"] | readonly ["application/vnd.ms-fontobject"] | readonly ["application/vnd.ms-powerpoint"] | readonly ["application/vnd.oasis.opendocument.presentation"] | readonly ["application/vnd.oasis.opendocument.spreadsheet"] | readonly ["application/vnd.oasis.opendocument.text"] | readonly ["application/vnd.openxmlformats-officedocument.presentationml.presentation"] | readonly ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] | readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] | readonly ["application/vnd.rar"] | readonly ["application/vnd.visio"] | readonly ["application/wasm"] | readonly ["application/x-7z-compressed"] | readonly ["application/x-abiword"] | readonly ["application/x-bzip"] | readonly ["application/x-bzip2"] | readonly ["application/x-cdf"] | readonly ["application/x-csh"] | readonly ["application/x-freearc"] | readonly ["application/x-mdx"] | readonly ["application/x-ndjson"] | readonly ["application/x-python-code"] | readonly ["application/x-sh"] | readonly ["application/x-tar"] | readonly ["application/xhtml+xml"] | readonly ["application/xml"] | readonly ["application/yaml"] | readonly ["audio/aac"] | readonly ["audio/midi"] | readonly ["audio/mp4"] | readonly ["audio/mpeg"] | readonly ["audio/ogg"] | readonly ["audio/wav"] | readonly ["audio/webm"] | readonly ["audio/x-midi"] | readonly ["font/otf"] | readonly ["font/woff"] | readonly ["font/woff2"] | readonly ["haptics/hjif"] | readonly ["haptics/hmpg"] | readonly ["haptics/ivs"] | readonly ["image/aces"] | readonly ["image/apng"] | readonly ["image/avci"] | readonly ["image/avif"] | readonly ["image/bmp"] | readonly ["image/dpx"] | readonly ["image/emf"] | readonly ["image/gif"] | readonly ["image/heic"] | readonly ["image/jpeg"] | readonly ["image/ktx"] | readonly ["image/ktx2"] | readonly ["image/png"] | readonly ["image/svg+xml"] | readonly ["image/tiff"] | readonly ["image/webp"] | readonly ["image/x-icon"] | readonly ["model/gltf+json"] | readonly ["model/gltf-binary"] | readonly ["model/vnd.usdz+zip"] | readonly ["text/calendar"] | readonly ["text/css"] | readonly ["text/csv"] | readonly ["text/event-stream"] | readonly ["text/html"] | readonly ["text/javascript"] | readonly ["text/markdown"] | readonly ["text/plain"] | readonly ["text/rust"] | readonly ["text/vtt"] | readonly ["text/x-c"] | readonly ["text/x-c++"] | readonly ["text/x-csharp"] | readonly ["text/x-java"] | readonly ["text/x-ruby"] | readonly ["text/x-tex"] | readonly ["video/3gpp"] | readonly ["video/3gpp2"] | readonly ["video/mp4"] | readonly ["video/mpeg"] | readonly ["video/ogg"] | readonly ["video/webm"] | readonly ["video/x-msvideo"] | readonly ["application/font-sfnt", "font/ttf"] | readonly ["application/gzip", "application/x-gzip"] | readonly ["application/json", "application/json5"] | readonly ["application/json", "application/jsonc"] | readonly ["application/jsonl", "text/x-jsonl"] | readonly ["application/node", "text/javascript"] | readonly ["application/octet-stream", "multipart/voice-message"] | readonly ["application/xml", "text/xml"] | readonly ["application/zip", "application/x-zip-compressed"] | readonly ["image/vnd.microsoft.icon", "image/x-icon"] | readonly ["text/javascript", "application/node"] | readonly ["text/x-php", "application/x-httpd-php"] | readonly ["text/x-python", "text/x-script.python"] | readonly ["model/obj", "application/octet-stream", "text/plain"] | readonly ["text/typescript", "application/typescript", "video/mp2t", "video/vnd.dlna.mpeg-tts"];
546
+ mimeToExt(mime: keyof typeof this.toExtObj): "aac" | "abw" | "aces" | "apng" | "arc" | "avci" | "avif" | "avi" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "c" | "cda" | "cjs" | "cpp" | "cs" | "csh" | "css" | "csv" | "doc" | "docx" | "dpx" | "emf" | "eot" | "epub" | "gif" | "glb" | "gltf" | "go" | "gz" | "heic" | "hjif" | "hmpg" | "html" | "ico" | "ics" | "ivs" | "jar" | "java" | "jpg" | "json" | "jsonl" | "jsonld" | "jsonc" | "json5" | "ktx" | "ktx2" | "m3u8" | "m4a" | "md" | "mdx" | "mid" | "midi" | "mp3" | "mp4" | "mpd" | "mpeg" | "mpkg" | "ndjson" | "node" | "obj" | "odp" | "ods" | "odt" | "ogv" | "ogx" | "opus" | "otf" | "png" | "pdf" | "php" | "pkpass" | "ppt" | "pptx" | "py" | "pyc" | "rar" | "rb" | "rs" | "rtf" | "sh" | "sql" | "sse" | "svg" | "tar" | "tex" | "tiff" | "toml" | "ts" | "ttf" | "txt" | "usdz" | "vsd" | "vtt" | "wasm" | "wav" | "weba" | "webmanifest" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "yml" | "zip" | "3gp" | "3g2" | "7z" | "ogg";
547
+ assetType<const T extends string>(url: T): "aac" | "abw" | "aces" | "apng" | "arc" | "avci" | "avif" | "avi" | "azw" | "bin" | "bmp" | "bz" | "bz2" | "c" | "cda" | "cjs" | "cpp" | "cs" | "csh" | "css" | "csv" | "cur" | "doc" | "docx" | "dpx" | "emf" | "eot" | "epub" | "gif" | "glb" | "gltf" | "go" | "gz" | "heic" | "hjif" | "hmpg" | "htm" | "html" | "ico" | "ics" | "ivs" | "ivt" | "jar" | "java" | "jfif" | "jif" | "jpe" | "jpeg" | "jpg" | "js" | "json" | "jsonl" | "jsonld" | "jsonlines" | "jsonc" | "json5" | "ktx" | "ktx2" | "m3u8" | "m4a" | "m4s" | "m4v" | "md" | "mdx" | "mid" | "midi" | "mjs" | "mp3" | "mp4" | "mpd" | "mpeg" | "mpkg" | "mtlx" | "ndjson" | "node" | "obj" | "odp" | "ods" | "odt" | "oga" | "ogg" | "ogv" | "ogx" | "opus" | "otf" | "pk1" | "png" | "pdf" | "php" | "pjp" | "pjpeg" | "pkpass" | "ppt" | "pptx" | "py" | "pyc" | "rar" | "rb" | "rs" | "rtf" | "sh" | "sql" | "sse" | "svg" | "tar" | "tex" | "tif" | "tiff" | "toml" | "ts" | "ttf" | "txt" | "usdz" | "vsd" | "vtt" | "wasm" | "wav" | "weba" | "webm" | "webmanifest" | "webp" | "woff" | "woff2" | "xhtml" | "xls" | "xlsx" | "xml" | "xul" | "yaml" | "yml" | "zip" | "3gp" | "3g2" | "7z" | undefined;
548
+ 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 ["text/x-c"] | readonly ["application/x-cdf"] | readonly ["text/javascript", "application/node"] | readonly ["text/x-c++"] | readonly ["text/x-csharp"] | readonly ["application/x-csh"] | readonly ["text/css"] | readonly ["text/csv"] | readonly ["image/x-icon"] | 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 ["text/x-go"] | readonly ["application/gzip", "application/x-gzip"] | readonly ["image/heic"] | readonly ["haptics/hjif"] | readonly ["haptics/hmpg"] | readonly ["text/html"] | readonly ["image/vnd.microsoft.icon", "image/x-icon"] | readonly ["text/calendar"] | readonly ["haptics/ivs"] | readonly ["application/java-archive"] | readonly ["text/x-java"] | readonly ["image/jpeg"] | readonly ["application/json"] | readonly ["application/jsonl", "text/x-jsonl"] | readonly ["application/ld+json"] | readonly ["application/json", "application/jsonc"] | readonly ["application/json", "application/json5"] | 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 ["application/dash+xml"] | readonly ["video/mpeg"] | readonly ["application/vnd.apple.installer+xml"] | readonly ["application/xml"] | readonly ["application/x-ndjson"] | readonly ["application/node", "text/javascript"] | 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 ["application/octet-stream"] | readonly ["image/png"] | readonly ["application/pdf"] | readonly ["text/x-php", "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", "text/x-script.python"] | readonly ["application/x-python-code"] | readonly ["application/vnd.rar"] | readonly ["text/x-ruby"] | 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 ["text/x-tex"] | readonly ["image/tiff"] | readonly ["application/toml"] | readonly ["text/typescript", "application/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 ["audio/webm"] | readonly ["video/webm"] | readonly ["application/manifest+json"] | 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", "text/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"];
547
549
  getMimeFor<const E extends FileExtension>(ext: E, opts?: {
548
550
  type?: MimeTopLevelType;
549
551
  }): FileExtensionToMimeType<E>;
550
- isMimeFor<const E extends FileExtension>(ext: E, mime: FileExtensionToMimeType<E>): "application/dash+xml" | "application/epub+zip" | "application/font-sfnt" | "application/gzip" | "application/java-archive" | "application/json" | "application/json5" | "application/jsonc" | "application/jsonl" | "application/ld+json" | "application/manifest+json" | "application/msword" | "application/node" | "application/octet-stream" | "application/ogg" | "application/pdf" | "application/rtf" | "application/sql" | "application/toml" | "application/typescript" | "application/vnd.amazon.ebook" | "application/vnd.apple.installer+xml" | "application/vnd.apple.mpegurl" | "application/vnd.apple.pkpass" | "application/vnd.mozilla.xul+xml" | "application/vnd.ms-excel" | "application/vnd.ms-fontobject" | "application/vnd.ms-powerpoint" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.text" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.rar" | "application/vnd.visio" | "application/wasm" | "application/x-7z-compressed" | "application/x-abiword" | "application/x-bzip" | "application/x-bzip2" | "application/x-cdf" | "application/x-csh" | "application/x-freearc" | "application/x-gzip" | "application/x-httpd-php" | "application/x-mdx" | "application/x-ndjson" | "application/x-python-code" | "application/x-sh" | "application/x-tar" | "application/x-zip-compressed" | "application/xhtml+xml" | "application/xml" | "application/yaml" | "application/zip" | "audio/aac" | "audio/midi" | "audio/mp4" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/x-midi" | "font/otf" | "font/ttf" | "font/woff" | "font/woff2" | "haptics/hjif" | "haptics/hmpg" | "haptics/ivs" | "image/aces" | "image/apng" | "image/avci" | "image/avif" | "image/bmp" | "image/dpx" | "image/emf" | "image/gif" | "image/heic" | "image/jpeg" | "image/ktx" | "image/ktx2" | "image/png" | "image/svg+xml" | "image/tiff" | "image/vnd.microsoft.icon" | "image/webp" | "image/x-icon" | "model/gltf+json" | "model/gltf-binary" | "model/obj" | "model/vnd.usdz+zip" | "multipart/voice-message" | "text/calendar" | "text/css" | "text/csv" | "text/event-stream" | "text/html" | "text/javascript" | "text/markdown" | "text/plain" | "text/rust" | "text/typescript" | "text/vtt" | "text/x-c" | "text/x-c++" | "text/x-csharp" | "text/x-java" | "text/x-jsonl" | "text/x-php" | "text/x-python" | "text/x-ruby" | "text/x-script.python" | "text/x-tex" | "text/xml" | "video/3gpp" | "video/3gpp2" | "video/mp2t" | "video/mp4" | "video/mpeg" | "video/ogg" | "video/vnd.dlna.mpeg-tts" | "video/webm" | "video/x-msvideo" | undefined;
552
+ 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" | "multipart/voice-message" | "image/bmp" | "application/x-bzip" | "application/x-bzip2" | "text/x-c" | "application/x-cdf" | "text/javascript" | "application/node" | "text/x-c++" | "text/x-csharp" | "application/x-csh" | "text/css" | "text/csv" | "image/x-icon" | "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" | "text/x-go" | "application/gzip" | "application/x-gzip" | "image/heic" | "haptics/hjif" | "haptics/hmpg" | "text/html" | "image/vnd.microsoft.icon" | "text/calendar" | "haptics/ivs" | "application/java-archive" | "text/x-java" | "image/jpeg" | "application/json" | "application/jsonl" | "text/x-jsonl" | "application/ld+json" | "application/jsonc" | "application/json5" | "image/ktx" | "image/ktx2" | "application/vnd.apple.mpegurl" | "audio/mp4" | "video/mp4" | "text/markdown" | "application/x-mdx" | "audio/midi" | "audio/x-midi" | "audio/mpeg" | "application/dash+xml" | "video/mpeg" | "application/vnd.apple.installer+xml" | "application/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" | "text/x-php" | "application/x-httpd-php" | "application/vnd.apple.pkpass" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "text/x-python" | "text/x-script.python" | "application/x-python-code" | "application/vnd.rar" | "text/x-ruby" | "text/rust" | "application/rtf" | "application/x-sh" | "application/sql" | "text/event-stream" | "image/svg+xml" | "application/x-tar" | "text/x-tex" | "image/tiff" | "application/toml" | "text/typescript" | "application/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" | "audio/webm" | "video/webm" | "application/manifest+json" | "image/webp" | "font/woff" | "font/woff2" | "application/xhtml+xml" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/xml" | "application/vnd.mozilla.xul+xml" | "application/yaml" | "application/zip" | "application/x-zip-compressed" | "video/3gpp" | "video/3gpp2" | "application/x-7z-compressed" | undefined;
551
553
  getMimeTypeForPath<T extends string>(path: T, opts?: {
552
554
  type?: MimeTopLevelType;
553
- }): "application/dash+xml" | "application/epub+zip" | "application/font-sfnt" | "application/gzip" | "application/java-archive" | "application/json" | "application/json5" | "application/jsonc" | "application/jsonl" | "application/ld+json" | "application/manifest+json" | "application/msword" | "application/node" | "application/octet-stream" | "application/ogg" | "application/pdf" | "application/rtf" | "application/sql" | "application/toml" | "application/typescript" | "application/vnd.amazon.ebook" | "application/vnd.apple.installer+xml" | "application/vnd.apple.mpegurl" | "application/vnd.apple.pkpass" | "application/vnd.mozilla.xul+xml" | "application/vnd.ms-excel" | "application/vnd.ms-fontobject" | "application/vnd.ms-powerpoint" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.text" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.rar" | "application/vnd.visio" | "application/wasm" | "application/x-7z-compressed" | "application/x-abiword" | "application/x-bzip" | "application/x-bzip2" | "application/x-cdf" | "application/x-csh" | "application/x-freearc" | "application/x-gzip" | "application/x-httpd-php" | "application/x-mdx" | "application/x-ndjson" | "application/x-python-code" | "application/x-sh" | "application/x-tar" | "application/x-zip-compressed" | "application/xhtml+xml" | "application/xml" | "application/yaml" | "application/zip" | "audio/aac" | "audio/midi" | "audio/mp4" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/x-midi" | "font/otf" | "font/ttf" | "font/woff" | "font/woff2" | "haptics/hjif" | "haptics/hmpg" | "haptics/ivs" | "image/aces" | "image/apng" | "image/avci" | "image/avif" | "image/bmp" | "image/dpx" | "image/emf" | "image/gif" | "image/heic" | "image/jpeg" | "image/ktx" | "image/ktx2" | "image/png" | "image/svg+xml" | "image/tiff" | "image/vnd.microsoft.icon" | "image/webp" | "image/x-icon" | "model/gltf+json" | "model/gltf-binary" | "model/obj" | "model/vnd.usdz+zip" | "multipart/voice-message" | "text/calendar" | "text/css" | "text/csv" | "text/event-stream" | "text/html" | "text/javascript" | "text/markdown" | "text/plain" | "text/rust" | "text/typescript" | "text/vtt" | "text/x-c" | "text/x-c++" | "text/x-csharp" | "text/x-java" | "text/x-jsonl" | "text/x-php" | "text/x-python" | "text/x-ruby" | "text/x-script.python" | "text/x-tex" | "text/xml" | "video/3gpp" | "video/3gpp2" | "video/mp2t" | "video/mp4" | "video/mpeg" | "video/ogg" | "video/vnd.dlna.mpeg-tts" | "video/webm" | "video/x-msvideo";
555
+ }): "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" | "multipart/voice-message" | "image/bmp" | "application/x-bzip" | "application/x-bzip2" | "text/x-c" | "application/x-cdf" | "text/javascript" | "application/node" | "text/x-c++" | "text/x-csharp" | "application/x-csh" | "text/css" | "text/csv" | "image/x-icon" | "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" | "text/x-go" | "application/gzip" | "application/x-gzip" | "image/heic" | "haptics/hjif" | "haptics/hmpg" | "text/html" | "image/vnd.microsoft.icon" | "text/calendar" | "haptics/ivs" | "application/java-archive" | "text/x-java" | "image/jpeg" | "application/json" | "application/jsonl" | "text/x-jsonl" | "application/ld+json" | "application/jsonc" | "application/json5" | "image/ktx" | "image/ktx2" | "application/vnd.apple.mpegurl" | "audio/mp4" | "video/mp4" | "text/markdown" | "application/x-mdx" | "audio/midi" | "audio/x-midi" | "audio/mpeg" | "application/dash+xml" | "video/mpeg" | "application/vnd.apple.installer+xml" | "application/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" | "text/x-php" | "application/x-httpd-php" | "application/vnd.apple.pkpass" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "text/x-python" | "text/x-script.python" | "application/x-python-code" | "application/vnd.rar" | "text/x-ruby" | "text/rust" | "application/rtf" | "application/x-sh" | "application/sql" | "text/event-stream" | "image/svg+xml" | "application/x-tar" | "text/x-tex" | "image/tiff" | "application/toml" | "text/typescript" | "application/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" | "audio/webm" | "video/webm" | "application/manifest+json" | "image/webp" | "font/woff" | "font/woff2" | "application/xhtml+xml" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/xml" | "application/vnd.mozilla.xul+xml" | "application/yaml" | "application/zip" | "application/x-zip-compressed" | "video/3gpp" | "video/3gpp2" | "application/x-7z-compressed";
554
556
  }
555
- //#endregion
556
- export { AllMimeTypes, FileExtension, FileExtensionToMimeType, InferTopLevelPresent, MimeService, MimeTopLevelType, MimeType, MimeTypeToFileExtension, PresentMimeTopLevelTypes, extMimeMap, mimeToExt };
557
557
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { UrlService } from "../url/index.js";
2
-
3
- //#region src/mime/index.ts
2
+ // src/mime/index.ts
4
3
  const extMimeMap = {
5
4
  aac: ["audio/aac"],
6
5
  abw: ["application/x-abiword"],
@@ -33,6 +32,7 @@ const extMimeMap = {
33
32
  gif: ["image/gif"],
34
33
  glb: ["model/gltf-binary"],
35
34
  gltf: ["model/gltf+json"],
35
+ go: ["text/x-go"],
36
36
  gz: ["application/gzip", "application/x-gzip"],
37
37
  heic: ["image/heic"],
38
38
  hjif: ["haptics/hjif"],
@@ -269,6 +269,7 @@ const mimeToExt = {
269
269
  "text/x-c": ["c"],
270
270
  "text/x-c++": ["cpp"],
271
271
  "text/x-csharp": ["cs"],
272
+ "text/x-go": ["go"],
272
273
  "text/x-java": ["java"],
273
274
  "text/x-jsonl": ["jsonl", "jsonlines"],
274
275
  "text/x-php": ["php"],
@@ -344,7 +345,6 @@ var MimeService = class extends UrlService {
344
345
  return this.getMimeFor(ext, opts);
345
346
  }
346
347
  };
347
-
348
- //#endregion
349
348
  export { MimeService, extMimeMap, mimeToExt };
349
+
350
350
  //# sourceMappingURL=index.js.map
@@ -1,34 +1,30 @@
1
+ import { Constructor, DocSpecs, ExpandedImgSpecs } from "../types/index.js";
1
2
  import { DocMetadataExtractor } from "../docs/index.js";
2
3
  import { ImgMetadataExtractor } from "../images/index.js";
3
- import { Constructor, ExpandedDocSpecs, ExpandedImgSpecs } from "../types/index.js";
4
-
5
- //#region src/mixins/index.d.ts
6
- declare function create<Type>(c: new () => Type): Type;
7
- declare function createInstance<A extends object>(c: new () => A): A;
4
+ export declare function create<Type>(c: new () => Type): Type;
5
+ export declare function createInstance<A extends object>(c: new () => A): A;
8
6
  /**
9
7
  * ImgMixin
10
8
  * - instance tries opts.img -> sharedImg -> new ImgMetadataExtractor()
11
9
  * - exposes prototype method getImageSpecsWorkup
12
10
  */
13
- declare function ImgMixin<TBase extends Constructor>(Base: TBase): {
11
+ export declare function ImgMixin<TBase extends Constructor>(Base: TBase): {
14
12
  new (...args: any[]): {
15
13
  img: ImgMetadataExtractor;
16
- getImageSpecsWorkup(buffer: Buffer<ArrayBufferLike>, size?: number): ExpandedImgSpecs;
14
+ getImageSpecsWorkup(buffer: Buffer, size?: number): ExpandedImgSpecs;
17
15
  };
18
- sharedImg?: ImgMetadataExtractor | undefined;
16
+ sharedImg?: ImgMetadataExtractor;
19
17
  setSharedImg(ex: ImgMetadataExtractor): void;
20
18
  } & TBase;
21
19
  /**
22
20
  * DocMixin (same pattern)
23
21
  */
24
- declare function DocMixin<TBase extends Constructor>(Base: TBase): {
22
+ export declare function DocMixin<TBase extends Constructor>(Base: TBase): {
25
23
  new (...args: any[]): {
26
24
  docs: DocMetadataExtractor;
27
- getDocumentSpecsWorkup(buffer: Buffer<ArrayBufferLike>, contentType?: string): ExpandedDocSpecs;
25
+ getDocumentSpecsWorkup(buffer: Buffer, contentType?: string): DocSpecs<unknown>;
28
26
  };
29
- sharedDocs?: DocMetadataExtractor | undefined;
27
+ sharedDocs?: DocMetadataExtractor;
30
28
  setSharedDocs(ex: DocMetadataExtractor): void;
31
29
  } & TBase;
32
- //#endregion
33
- export { DocMixin, ImgMixin, create, createInstance };
34
30
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { DocMetadataExtractor } from "../docs/index.js";
2
2
  import { ImgMetadataExtractor } from "../images/index.js";
3
-
4
- //#region src/mixins/index.ts
3
+ // src/mixins/index.ts
5
4
  function create(c) {
6
5
  return new c();
7
6
  }
@@ -19,7 +18,8 @@ function ImgMixin(Base) {
19
18
  static sharedImg;
20
19
  constructor(...args) {
21
20
  super(...args);
22
- this.img = args[0]?.img ?? this.constructor.sharedImg ?? new ImgMetadataExtractor();
21
+ const maybeOpts = args[0];
22
+ this.img = maybeOpts?.img ?? this.constructor.sharedImg ?? new ImgMetadataExtractor();
23
23
  }
24
24
  getImageSpecsWorkup(buffer, size = 16384) {
25
25
  return this.img.getImageSpecsWorkup(buffer, size);
@@ -38,7 +38,8 @@ function DocMixin(Base) {
38
38
  static sharedDocs;
39
39
  constructor(...args) {
40
40
  super(...args);
41
- this.docs = args[0]?.docs ?? this.constructor.sharedDocs ?? new DocMetadataExtractor();
41
+ const maybeOpts = args[0];
42
+ this.docs = maybeOpts?.docs ?? this.constructor.sharedDocs ?? new DocMetadataExtractor();
42
43
  }
43
44
  getDocumentSpecsWorkup(buffer, contentType = "application/pdf") {
44
45
  return this.docs.getDocumentSpecsWorkup(buffer, contentType);
@@ -48,7 +49,6 @@ function DocMixin(Base) {
48
49
  }
49
50
  };
50
51
  }
51
-
52
- //#endregion
53
52
  export { DocMixin, ImgMixin, create, createInstance };
53
+
54
54
  //# sourceMappingURL=index.js.map