@d0paminedriven/fs 11.0.0 → 12.1.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/docs/index.d.ts +42 -10
- package/dist/docs/index.js +177 -41
- package/dist/extract/client.d.ts +13 -11
- package/dist/extract/client.js +2 -4
- package/dist/extract/index.d.ts +7 -10
- package/dist/extract/index.js +6 -8
- package/dist/fs/index.d.ts +7 -11
- package/dist/fs/index.js +15 -14
- package/dist/fs-atomic/index.d.ts +3 -9
- package/dist/fs-atomic/index.js +17 -11
- package/dist/fs-base/index.d.ts +8 -10
- package/dist/fs-base/index.js +36 -27
- package/dist/fs-core/index.d.ts +5 -9
- package/dist/fs-core/index.js +5 -6
- package/dist/fs-fetch/index.d.ts +6 -9
- package/dist/fs-fetch/index.js +64 -27
- package/dist/fs-size/index.d.ts +2 -6
- package/dist/fs-size/index.js +8 -9
- package/dist/fs-tmp/index.d.ts +7 -11
- package/dist/fs-tmp/index.js +7 -8
- package/dist/images/index.d.ts +44 -48
- package/dist/images/index.js +9 -15
- package/dist/images/workup.d.ts +5 -9
- package/dist/images/workup.js +4 -5
- package/dist/index.d.ts +42 -14
- package/dist/index.js +14 -15
- package/dist/ld/index.d.ts +1 -5
- package/dist/ld/index.js +2 -4
- package/dist/mime/index.d.ts +20 -20
- package/dist/mime/index.js +4 -4
- package/dist/mixins/index.d.ts +9 -13
- package/dist/mixins/index.js +6 -6
- package/dist/types/index.d.ts +105 -90
- package/dist/types/index.js +2 -3
- package/dist/types/stream.d.ts +5 -9
- package/dist/types/stream.js +1 -1
- package/dist/url/index.d.ts +6 -10
- package/dist/url/index.js +2 -4
- package/dist/utils/index.d.ts +5 -9
- package/dist/utils/index.js +2 -4
- 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 {
|
|
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 {
|
|
14
|
-
import {
|
|
15
|
-
|
|
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 };
|
package/dist/ld/index.d.ts
CHANGED
|
@@ -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
|
package/dist/mime/index.d.ts
CHANGED
|
@@ -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): "
|
|
545
|
-
assetType<const T extends string>(url: T): "
|
|
546
|
-
getMimes<const E extends FileExtension>(ext: E): readonly ["
|
|
546
|
+
mimeToExt(mime: keyof typeof this.toExtObj): "mpd" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonc" | "jsonl" | "json5" | "jsonld" | "webmanifest" | "doc" | "node" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "md" | "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" | "aac" | "mid" | "m4a" | "mp3" | "opus" | "ogg" | "wav" | "weba" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "aces" | "apng" | "avci" | "avif" | "bmp" | "dpx" | "emf" | "gif" | "heic" | "jpg" | "ktx" | "ktx2" | "png" | "svg" | "tiff" | "ico" | "webp" | "glb" | "gltf" | "usdz" | "ics" | "css" | "csv" | "sse" | "ts" | "rs" | "py" | "txt" | "html" | "cjs" | "vtt" | "c" | "cpp" | "cs" | "go" | "java" | "rb" | "tex" | "3gp" | "3g2" | "mp4" | "mpeg" | "ogv" | "avi";
|
|
547
|
+
assetType<const T extends string>(url: T): "mpd" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonc" | "jsonl" | "jsonlines" | "json5" | "jsonld" | "webmanifest" | "doc" | "node" | "js" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "md" | "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" | "weba" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "ivt" | "aces" | "apng" | "avci" | "avif" | "bmp" | "dpx" | "emf" | "gif" | "heic" | "jpg" | "jpeg" | "ktx" | "ktx2" | "png" | "svg" | "tiff" | "ico" | "webp" | "cur" | "glb" | "gltf" | "usdz" | "ics" | "css" | "csv" | "sse" | "ts" | "rs" | "py" | "txt" | "html" | "htm" | "cjs" | "mjs" | "vtt" | "c" | "cpp" | "cs" | "go" | "java" | "rb" | "tex" | "3gp" | "3g2" | "mp4" | "m4v" | "m4s" | "mpeg" | "ogv" | "avi" | "jfif" | "jif" | "jpe" | "mtlx" | "pk1" | "pjp" | "pjpeg" | "tif" | "webm" | 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>): "
|
|
552
|
+
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" | "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
|
-
}): "
|
|
555
|
+
}): "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" | "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
|
package/dist/mime/index.js
CHANGED
|
@@ -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
|
package/dist/mixins/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
14
|
+
getImageSpecsWorkup(buffer: Buffer, size?: number): ExpandedImgSpecs;
|
|
17
15
|
};
|
|
18
|
-
sharedImg?: ImgMetadataExtractor
|
|
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
|
|
25
|
+
getDocumentSpecsWorkup(buffer: Buffer, contentType?: string): DocSpecs<unknown>;
|
|
28
26
|
};
|
|
29
|
-
sharedDocs?: DocMetadataExtractor
|
|
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
|
package/dist/mixins/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|