UNPKG

884 BTypeScriptView Raw
1// Type definitions for type-is 1.6
2// Project: https://github.com/jshttp/type-is#readme
3// Definitions by: BendingBender <https://github.com/BendingBender>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 2.3
6
7/// <reference types="node" />
8import { IncomingMessage } from 'http';
9
10export = typeIs;
11
12declare function typeIs(request: IncomingMessage, types: string[]): string | false | null;
13declare function typeIs(request: IncomingMessage, ...types: string[]): string | false | null;
14
15declare namespace typeIs {
16 function normalize(type: string): string | false;
17 function hasBody(request: IncomingMessage): boolean;
18 function is(mediaType: string, types: string[]): string | false;
19 function is(mediaType: string, ...types: string[]): string | false;
20 function mimeMatch(expected: false | string, actual: string): boolean;
21}