forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-type.d.ts
32 lines (28 loc) · 1021 Bytes
/
content-type.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
28
29
30
31
32
// Type definitions for content-type v0.0.1
// Project: https://github.com/deoxxa/content-type
// Definitions by: Pine Mizune <https://github.com/pine613>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ContentType {
interface MediaType {
type: string;
q?: number;
params: any;
toString(): string;
}
interface SelectOptions {
sortAvailable?: boolean;
sortAccepted?: boolean;
}
interface MediaTypeStatic {
new (s: string, p?: any): MediaType;
parseMedia(type: string): MediaType;
splitQuotedString(str: string, delimiter?: string, quote?: string): string[];
splitContentTypes(str: string): string[];
select(availableTypes: MediaType[], acceptedTypes: MediaType[], options?: SelectOptions): string;
mediaCmp(a: MediaType, b: MediaType): number;
}
}
declare module "content-type" {
var x: ContentType.MediaTypeStatic;
export = x;
}