UNPKG

541 BTypeScriptView Raw
1export function parse(input: RequestLike | ResponseLike | string): ParsedMediaType;
2export function format(obj: MediaType): string;
3
4export interface ParsedMediaType {
5 type: string;
6 parameters: { [key: string]: string };
7}
8
9export interface MediaType {
10 type: string;
11 parameters?: { [key: string]: string } | undefined;
12}
13
14export interface RequestLike {
15 headers: { [header: string]: string | string[] | undefined };
16}
17
18export interface ResponseLike {
19 getHeader(name: string): number | string | string[] | undefined;
20}