1 | # Installation
|
2 | > `npm install --save @types/mime-db`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for mime-db (https://github.com/jshttp/mime-db).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime-db.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime-db/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for mime-db 1.43
|
12 | // Project: https://github.com/jshttp/mime-db
|
13 | // Definitions by: AJP <https://github.com/AJamesPhillips>
|
14 | // Linus Unnebäck <https://github.com/LinusU>
|
15 | // Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
16 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
17 |
|
18 | declare namespace database {
|
19 | /**
|
20 | * @see {@link https://github.com/jshttp/mime-db#data-structure}
|
21 | */
|
22 | interface MimeEntry {
|
23 | /**
|
24 | * Where the mime type is defined.
|
25 | * If not set, it's probably a custom media type.
|
26 | */
|
27 | readonly source?: MimeSource | undefined;
|
28 | /** Known extensions associated with this mime type. */
|
29 | readonly extensions?: ReadonlyArray<string> | undefined;
|
30 | /** Whether a file of this type can be gzipped. */
|
31 | readonly compressible?: boolean | undefined;
|
32 | /** The default charset associated with this type, if any. */
|
33 | readonly charset?: string | undefined;
|
34 | }
|
35 |
|
36 | /**
|
37 | * @see {@link https://github.com/jshttp/mime-db#data-structure}
|
38 | */
|
39 | interface MimeDatabase {
|
40 | readonly [type: string]: MimeEntry;
|
41 | }
|
42 |
|
43 | /**
|
44 | * Sources:
|
45 | * http://www.iana.org/assignments/media-types/media-types.xhtml
|
46 | * http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
47 | * http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
|
48 | */
|
49 | type MimeSource = 'iana' | 'apache' | 'nginx';
|
50 | }
|
51 |
|
52 | declare const database: database.MimeDatabase;
|
53 |
|
54 | export = database;
|
55 |
|
56 | ````
|
57 |
|
58 | ### Additional Details
|
59 | * Last updated: Tue, 06 Jul 2021 22:03:04 GMT
|
60 | * Dependencies: none
|
61 | * Global values: none
|
62 |
|
63 | # Credits
|
64 | These definitions were written by [AJP](https://github.com/AJamesPhillips), [Linus Unnebäck](https://github.com/LinusU), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
65 |
|
\ | No newline at end of file |