diff --git a/core.d.ts b/core.d.ts index 25c5aca6..d67ee617 100644 --- a/core.d.ts +++ b/core.d.ts @@ -114,12 +114,9 @@ console.log(await fileTypeFromBlob(blob)); export declare function fileTypeFromBlob(blob: Blob): Promise; /** -A custom detector is a function that allows specifying custom detection mechanisms. +A custom file type detector. -An array of detectors can be provided via the `fileTypeOptions` argument for the `FileTypeParser` constructor. -In Node.js, you should use `NodeFileTypeParser`, which extends `FileTypeParser` and provides access to Node.js specific functions. - -Detectors can be added via the constructor options, or by adding it directly to `FileTypeParser.detectors`. +Detectors can be added via the constructor options, or by adding it directly to `FileTypeParser#detectors`. The detectors provided via the constructor options, are called before the default detectors are called. @@ -184,8 +181,9 @@ export function fileTypeStream(webStream: AnyWebReadableStream, opti export declare class FileTypeParser { /** - File-type detectors, initialized with a single entry holding the build in detector function. - The array is used to iterate over all detectors, as long as the function returns `undefined`. + File type detectors. + + Initialized with a single entry holding the built-in detector function. */ detectors: Detector[]; diff --git a/readme.md b/readme.md index 35579972..e416b466 100644 --- a/readme.md +++ b/readme.md @@ -342,9 +342,7 @@ Returns a `Set` of supported MIME types. A custom detector is a function that allows specifying custom detection mechanisms. -An iterable of detectors can be provided via the `fileTypeOptions` argument for the `FileTypeParser` constructor. - -Detectors can be added via the constructor options, or by adding it directly to `FileTypeParser.detectors`. +Detectors can be added via the constructor options, or by adding it directly to `FileTypeParser#detectors`. The detectors provided via the constructor options, are called before the default detectors are called.