forked from sindresorhus/file-type
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
27 lines (22 loc) · 831 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// <reference types="node"/>
import {Readable as ReadableStream} from 'stream';
import * as core from './core';
export type ReadableStreamWithFileType = core.ReadableStreamWithFileType;
export type FileTypeResult = core.FileTypeResult;
export type FileExtension = core.FileExtension;
export type MimeType = core.MimeType;
/**
Detect the file type of a file path.
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
@param path - The file path to parse.
@returns The detected file type and MIME type or `undefined` when there is no match.
*/
export function fromFile(path: string): Promise<core.FileTypeResult | undefined>;
export {
fromBuffer,
fromStream,
fromTokenizer,
extensions,
mimeTypes,
stream
} from './core';