blob: 85d44823978df57f866aa994cbe8e24967ab2706 (
plain) (
blame)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
import { Socket } from "net";
import { URL } from "url";
import Connector from "./connector";
import Dispatcher from "./dispatcher";
declare namespace DiagnosticsChannel {
interface Request {
origin?: string | URL;
completed: boolean;
method?: Dispatcher.HttpMethod;
path: string;
headers: string;
addHeader(key: string, value: string): Request;
}
interface Response {
statusCode: number;
statusText: string;
headers: Array<Buffer>;
}
type Error = unknown;
interface ConnectParams {
host: URL["host"];
hostname: URL["hostname"];
protocol: URL["protocol"];
port: URL["port"];
servername: string | null;
}
type Connector = Connector.connector;
export interface RequestCreateMessage {
request: Request;
}
export interface RequestBodySentMessage {
request: Request;
}
export interface RequestHeadersMessage {
request: Request;
response: Response;
}
export interface RequestTrailersMessage {
request: Request;
trailers: Array<Buffer>;
}
export interface RequestErrorMessage {
request: Request;
error: Error;
}
export interface ClientSendHeadersMessage {
request: Request;
headers: string;
socket: Socket;
}
export interface ClientBeforeConnectMessage {
connectParams: ConnectParams;
connector: Connector;
}
export interface ClientConnectedMessage {
socket: Socket;
connectParams: ConnectParams;
connector: Connector;
}
export interface ClientConnectErrorMessage {
error: Error;
socket: Socket;
connectParams: ConnectParams;
connector: Connector;
}
}
|