1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export interface PolymorphicEvent {
|
9 | [key: string]: unknown;
|
10 | readonly type: string;
|
11 | readonly target?: unknown;
|
12 | readonly currentTarget?: unknown;
|
13 | }
|
14 |
|
15 | export type PolymorphicRequest = BaseRequest & BrowserRequest & NodeRequest & ExpressRequest & KoaRequest & NextjsRequest;
|
16 | type BaseRequest = {
|
17 | method?: string;
|
18 | url?: string;
|
19 | };
|
20 | type BrowserRequest = BaseRequest;
|
21 | type NodeRequest = BaseRequest & {
|
22 | headers?: {
|
23 | [key: string]: string | string[] | undefined;
|
24 | };
|
25 | protocol?: string;
|
26 | socket?: {
|
27 | encrypted?: boolean;
|
28 | remoteAddress?: string;
|
29 | };
|
30 | };
|
31 | type KoaRequest = NodeRequest & {
|
32 | host?: string;
|
33 | hostname?: string;
|
34 | ip?: string;
|
35 | originalUrl?: string;
|
36 | };
|
37 | type NextjsRequest = NodeRequest & {
|
38 | cookies?: {
|
39 | [key: string]: string;
|
40 | };
|
41 | query?: {
|
42 | [key: string]: any;
|
43 | };
|
44 | };
|
45 | type ExpressRequest = NodeRequest & {
|
46 | baseUrl?: string;
|
47 | body?: string | {
|
48 | [key: string]: any;
|
49 | };
|
50 | host?: string;
|
51 | hostname?: string;
|
52 | ip?: string;
|
53 | originalUrl?: string;
|
54 | route?: {
|
55 | path: string;
|
56 | stack: [
|
57 | {
|
58 | name: string;
|
59 | }
|
60 | ];
|
61 | };
|
62 | query?: {
|
63 | [key: string]: any;
|
64 | };
|
65 | user?: {
|
66 | [key: string]: any;
|
67 | };
|
68 | _reconstructedRoute?: string;
|
69 | };
|
70 | export {};
|
71 |
|
\ | No newline at end of file |