1 | import { FastifyLoggerInstance } from './logger'
|
2 | import { RawServerBase, RawServerDefault, RawRequestDefaultExpression, RequestBodyDefault, RequestQuerystringDefault, RequestParamsDefault, RequestHeadersDefault } from './utils'
|
3 | import { RouteGenericInterface } from './route'
|
4 |
|
5 | export interface RequestGenericInterface {
|
6 | Body?: RequestBodyDefault;
|
7 | Querystring?: RequestQuerystringDefault;
|
8 | Params?: RequestParamsDefault;
|
9 | Headers?: RequestHeadersDefault;
|
10 | }
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export interface FastifyRequest<
|
17 | RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
18 | RawServer extends RawServerBase = RawServerDefault,
|
19 | RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
20 | > {
|
21 | id: any;
|
22 | params: RouteGeneric['Params'];
|
23 | raw: RawRequest;
|
24 | query: RouteGeneric['Querystring'];
|
25 | log: FastifyLoggerInstance;
|
26 | body: RouteGeneric['Body'];
|
27 |
|
28 |
|
29 | validationError?: Error & { validation: any; validationContext: string };
|
30 |
|
31 | |
32 |
|
33 |
|
34 | readonly req: RawRequest;
|
35 | readonly headers: RawRequest['headers'] & RouteGeneric['Headers'];
|
36 | readonly ip: string;
|
37 | readonly ips?: string[];
|
38 | readonly hostname: string;
|
39 | readonly url: string;
|
40 | readonly protocol: 'http' | 'https';
|
41 | readonly method: string;
|
42 | readonly routerPath: string;
|
43 | readonly routerMethod: string;
|
44 | readonly is404: boolean;
|
45 | readonly socket: RawRequest['socket'];
|
46 |
|
47 |
|
48 |
|
49 | readonly connection: RawRequest['socket'];
|
50 | }
|