Skip to content

Commit

Permalink
Remove markup style start and end code block declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Nov 10, 2023
1 parent ede94d9 commit 909a384
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ A smaller sample size will result in lower probability of the best file type det
@returns A `Promise` which resolves to the original readable stream argument, but with an added `fileType` property, which is an object like the one returned from `fileTypeFromFile()`.
@example
```
import got from 'got';
import {fileTypeStream} from 'file-type';
Expand All @@ -414,18 +414,18 @@ const stream2 = await fileTypeStream(stream1, {sampleSize: 1024});
if (stream2.fileType?.mime === 'image/jpeg') {
// stream2 can be used to stream the JPEG image (from the very beginning of the stream)
}
```
*/
export function fileTypeStream(readableStream: ReadableStream, options?: StreamOptions): Promise<ReadableStreamWithFileType>;

/**
Detect the file type of a [`Blob`](https://nodejs.org/api/buffer.html#class-blob) or .
Detect the file type of a [`Blob`](https://nodejs.org/api/buffer.html#class-blob) or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
@param blob [`Blob`](https://nodejs.org/api/buffer.html#class-blob) used for file detection
@returns The detected file type and MIME type, or `undefined` when there is no match.
@example
```
import {fileTypeFromBlob} from 'file-type';
const blob = new Blob(['<?xml version="1.0" encoding="ISO-8859-1" ?>'], {
Expand All @@ -435,7 +435,7 @@ const blob = new Blob(['<?xml version="1.0" encoding="ISO-8859-1" ?>'], {
console.log(await fileTypeFromBlob(blob));
//=> {ext: 'txt', mime: 'plain/text'}
```
*/
export declare function fileTypeFromBlob(blob: Blob): Promise<FileTypeResult | undefined>;

Expand All @@ -457,7 +457,6 @@ If the detector returns `undefined`, there are 2 possible scenarios:
Example detector array which can be extended and provided via the fileTypeOptions argument:
```js
import {FileTypeParser} from 'file-type';
const customDetectors = [
Expand All @@ -477,7 +476,6 @@ const buffer = Buffer.from("UNICORN");
const parser = new FileTypeParser({customDetectors});
const fileType = await parser.fromBuffer(buffer);
console.log(fileType);
```
@param tokenizer - An [`ITokenizer`](https://github.com/Borewit/strtok3#tokenizer) usable as source of the examined file.
@param fileType - FileTypeResult detected by the standard detections or a previous custom detection. Undefined if no matching fileTypeResult could be found.
Expand Down

0 comments on commit 909a384

Please sign in to comment.