forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http-string-parser.d.ts
38 lines (33 loc) · 1.22 KB
/
http-string-parser.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
33
34
35
36
37
38
// Type definitions for http-string-parser
// Project: https://github.com/apiaryio/http-string-parser
// Definitions by: MIZUNE Pine <https://github.com/pine613>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "http-string-parser" {
interface ParseRequestResult {
method: string;
uri: string;
headers: { [key: string]: string };
body: string;
}
interface ParseResponseResult {
statusCode: string;
statusMessage: string;
headers: { [key: string]: string };
body: string;
}
interface ParseRequestLineResult {
method: string;
uri: string;
protocol: string;
}
interface ParseStatusLineResult {
protocol: string;
statusCode: string;
statusMessage: string;
}
export function parseRequest(requestString: string): ParseRequestResult;
export function parseResponse(responseString: string): ParseResponseResult;
export function parseRequestLine(requestLineString: string): ParseRequestLineResult;
export function parseStatusLine(statusLine: string): ParseStatusLineResult;
export function parseHeaders(headerLines: string[]): { [key: string]: string };
}