1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import * as bodyParser from "body-parser";
|
12 | import * as core from "express-serve-static-core";
|
13 | import * as qs from "qs";
|
14 | import * as serveStatic from "serve-static";
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | declare function e(): core.Express;
|
20 |
|
21 | declare namespace e {
|
22 | |
23 |
|
24 |
|
25 |
|
26 | var json: typeof bodyParser.json;
|
27 |
|
28 | |
29 |
|
30 |
|
31 |
|
32 | var raw: typeof bodyParser.raw;
|
33 |
|
34 | |
35 |
|
36 |
|
37 |
|
38 | var text: typeof bodyParser.text;
|
39 |
|
40 | |
41 |
|
42 |
|
43 | var application: Application;
|
44 | var request: Request;
|
45 | var response: Response;
|
46 |
|
47 | |
48 |
|
49 |
|
50 | var static: serveStatic.RequestHandlerConstructor<Response>;
|
51 |
|
52 | |
53 |
|
54 |
|
55 |
|
56 | var urlencoded: typeof bodyParser.urlencoded;
|
57 |
|
58 | |
59 |
|
60 |
|
61 | export function query(options: qs.IParseOptions | typeof qs.parse): Handler;
|
62 |
|
63 | export function Router(options?: RouterOptions): core.Router;
|
64 |
|
65 | interface RouterOptions {
|
66 | |
67 |
|
68 |
|
69 | caseSensitive?: boolean | undefined;
|
70 |
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | mergeParams?: boolean | undefined;
|
79 |
|
80 | |
81 |
|
82 |
|
83 | strict?: boolean | undefined;
|
84 | }
|
85 |
|
86 | interface Application extends core.Application {}
|
87 | interface CookieOptions extends core.CookieOptions {}
|
88 | interface Errback extends core.Errback {}
|
89 | interface ErrorRequestHandler<
|
90 | P = core.ParamsDictionary,
|
91 | ResBody = any,
|
92 | ReqBody = any,
|
93 | ReqQuery = core.Query,
|
94 | Locals extends Record<string, any> = Record<string, any>,
|
95 | > extends core.ErrorRequestHandler<P, ResBody, ReqBody, ReqQuery, Locals> {}
|
96 | interface Express extends core.Express {}
|
97 | interface Handler extends core.Handler {}
|
98 | interface IRoute extends core.IRoute {}
|
99 | interface IRouter extends core.IRouter {}
|
100 | interface IRouterHandler<T> extends core.IRouterHandler<T> {}
|
101 | interface IRouterMatcher<T> extends core.IRouterMatcher<T> {}
|
102 | interface MediaType extends core.MediaType {}
|
103 | interface NextFunction extends core.NextFunction {}
|
104 | interface Locals extends core.Locals {}
|
105 | interface Request<
|
106 | P = core.ParamsDictionary,
|
107 | ResBody = any,
|
108 | ReqBody = any,
|
109 | ReqQuery = core.Query,
|
110 | Locals extends Record<string, any> = Record<string, any>,
|
111 | > extends core.Request<P, ResBody, ReqBody, ReqQuery, Locals> {}
|
112 | interface RequestHandler<
|
113 | P = core.ParamsDictionary,
|
114 | ResBody = any,
|
115 | ReqBody = any,
|
116 | ReqQuery = core.Query,
|
117 | Locals extends Record<string, any> = Record<string, any>,
|
118 | > extends core.RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals> {}
|
119 | interface RequestParamHandler extends core.RequestParamHandler {}
|
120 | interface Response<
|
121 | ResBody = any,
|
122 | Locals extends Record<string, any> = Record<string, any>,
|
123 | > extends core.Response<ResBody, Locals> {}
|
124 | interface Router extends core.Router {}
|
125 | interface Send extends core.Send {}
|
126 | }
|
127 |
|
128 | export = e;
|