1 | # Installation
|
2 | > `npm install --save @types/content-type`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for content-type (https://github.com/jshttp/content-type).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/content-type.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/content-type/index.d.ts)
|
10 | ````ts
|
11 | export function parse(input: RequestLike | ResponseLike | string): ParsedMediaType;
|
12 | export function format(obj: MediaType): string;
|
13 |
|
14 | export interface ParsedMediaType {
|
15 | type: string;
|
16 | parameters: { [key: string]: string };
|
17 | }
|
18 |
|
19 | export interface MediaType {
|
20 | type: string;
|
21 | parameters?: { [key: string]: string } | undefined;
|
22 | }
|
23 |
|
24 | export interface RequestLike {
|
25 | headers: { [header: string]: string | string[] | undefined };
|
26 | }
|
27 |
|
28 | export interface ResponseLike {
|
29 | getHeader(name: string): number | string | string[] | undefined;
|
30 | }
|
31 |
|
32 | ````
|
33 |
|
34 | ### Additional Details
|
35 | * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
|
36 | * Dependencies: none
|
37 |
|
38 | # Credits
|
39 | These definitions were written by [Hiroki Horiuchi](https://github.com/horiuchi), and [BendingBender](https://github.com/BendingBender).
|
40 |
|
\ | No newline at end of file |