DefinitelyTyped/content-type/index.d.ts
2016-10-27 14:23:26 +09:00

22 lines
622 B
TypeScript

// Type definitions for content-type v1.0.1
// Project: https://www.npmjs.com/package/content-type
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var ct: ct.StaticFunctions;
export = ct;
declare namespace ct {
interface StaticFunctions {
parse(string: string): MediaType;
parse(req: { headers: any; }): MediaType;
parse(res: { getHeader(key: string): string; }): MediaType;
format(obj: MediaType): string;
}
interface MediaType {
type: string;
parameters?: any;
}
}