1 | // Type definitions for mime-db 1.43
|
2 | // Project: https://github.com/jshttp/mime-db
|
3 | // Definitions by: AJP <https://github.com/AJamesPhillips>
|
4 | // Linus Unnebäck <https://github.com/LinusU>
|
5 | // Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
6 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
7 |
|
8 | declare namespace database {
|
9 | /**
|
10 | * @see {@link https://github.com/jshttp/mime-db#data-structure}
|
11 | */
|
12 | interface MimeEntry {
|
13 | /**
|
14 | * Where the mime type is defined.
|
15 | * If not set, it's probably a custom media type.
|
16 | */
|
17 | readonly source?: MimeSource;
|
18 | /** Known extensions associated with this mime type. */
|
19 | readonly extensions?: ReadonlyArray<string>;
|
20 | /** Whether a file of this type can be gzipped. */
|
21 | readonly compressible?: boolean;
|
22 | /** The default charset associated with this type, if any. */
|
23 | readonly charset?: string;
|
24 | }
|
25 |
|
26 | /**
|
27 | * @see {@link https://github.com/jshttp/mime-db#data-structure}
|
28 | */
|
29 | interface MimeDatabase {
|
30 | readonly [type: string]: MimeEntry;
|
31 | }
|
32 |
|
33 | /**
|
34 | * Sources:
|
35 | * http://www.iana.org/assignments/media-types/media-types.xhtml
|
36 | * http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
37 | * http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
|
38 | */
|
39 | type MimeSource = 'iana' | 'apache' | 'nginx';
|
40 | }
|
41 |
|
42 | declare const database: database.MimeDatabase;
|
43 |
|
44 | export = database;
|