@umijs/bundler-utils 4.0.0-beta.8 → 4.0.0-canary-20240513.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/compiled/@babel/core/index.d.ts +30 -2
  2. package/compiled/@babel/generator/index.d.ts +0 -1
  3. package/compiled/@babel/parser/typings/babel-parser.d.ts +12 -1
  4. package/compiled/@babel/traverse/index.d.ts +16 -9
  5. package/compiled/@babel/types/lib/index-legacy.d.ts +88 -48
  6. package/compiled/babel/helper-module-imports.d.ts +3 -0
  7. package/compiled/babel/helper-module-imports.js +1 -0
  8. package/compiled/babel/index.js +89069 -93856
  9. package/compiled/babel/index1.js +39 -0
  10. package/compiled/babel/plugin-proposal-class-properties.js +1 -0
  11. package/compiled/babel/plugin-proposal-private-methods.js +1 -0
  12. package/compiled/babel/plugin-proposal-private-property-in-object.js +1 -0
  13. package/compiled/babel/plugin-transform-class-properties.js +1 -0
  14. package/compiled/babel/plugin-transform-export-namespace-from.js +1 -0
  15. package/compiled/babel/plugin-transform-private-methods.js +1 -0
  16. package/compiled/babel/plugin-transform-private-property-in-object copy.js +1 -0
  17. package/compiled/es-module-lexer/LICENSE +10 -10
  18. package/compiled/es-module-lexer/index.js +1 -1
  19. package/compiled/es-module-lexer/types/lexer.d.ts +86 -86
  20. package/compiled/express/LICENSE +24 -0
  21. package/compiled/express/body-parser/index.d.ts +107 -0
  22. package/compiled/express/connect/index.d.ts +93 -0
  23. package/compiled/express/express-serve-static-core/index.d.ts +1264 -0
  24. package/compiled/express/index.d.ts +133 -0
  25. package/compiled/express/index.js +308 -0
  26. package/compiled/express/mime/Mime.d.ts +11 -0
  27. package/compiled/express/mime/index.d.ts +21 -0
  28. package/compiled/express/package.json +1 -0
  29. package/compiled/express/qs/index.d.ts +62 -0
  30. package/compiled/express/range-parser/index.d.ts +35 -0
  31. package/compiled/express/serve-static/index.d.ts +107 -0
  32. package/compiled/http-proxy-middleware/LICENSE +22 -0
  33. package/compiled/http-proxy-middleware/dist/index.d.ts +4 -0
  34. package/compiled/http-proxy-middleware/dist/types.d.ts +54 -0
  35. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +233 -0
  36. package/compiled/http-proxy-middleware/index.js +66 -0
  37. package/compiled/http-proxy-middleware/package.json +1 -0
  38. package/compiled/less/index.d.ts +284 -0
  39. package/compiled/less/index.js +2 -0
  40. package/compiled/less/package.json +1 -0
  41. package/compiled/tapable/LICENSE +21 -0
  42. package/compiled/tapable/index.js +1 -0
  43. package/compiled/tapable/package.json +1 -0
  44. package/compiled/tapable/tapable.d.ts +116 -0
  45. package/dist/https.d.ts +10 -0
  46. package/dist/https.js +124 -0
  47. package/dist/index.d.ts +23 -2
  48. package/dist/index.js +107 -4
  49. package/dist/proxy.d.ts +5 -0
  50. package/dist/proxy.js +84 -0
  51. package/dist/types.d.ts +14 -0
  52. package/dist/types.js +17 -0
  53. package/package.json +71 -48
@@ -0,0 +1,1264 @@
1
+ // Type definitions for Express 4.17
2
+ // Project: http://expressjs.com
3
+ // Definitions by: Boris Yankov <https://github.com/borisyankov>
4
+ // Satana Charuwichitratana <https://github.com/micksatana>
5
+ // Sami Jaber <https://github.com/samijaber>
6
+ // Jose Luis Leon <https://github.com/JoseLion>
7
+ // David Stephens <https://github.com/dwrss>
8
+ // Shin Ando <https://github.com/andoshin11>
9
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
10
+ // TypeScript Version: 2.3
11
+
12
+ // This extracts the core definitions from express to prevent a circular dependency between express and serve-static
13
+ /// <reference types="node" />
14
+
15
+ declare global {
16
+ namespace Express {
17
+ // These open interfaces may be extended in an application-specific manner via declaration merging.
18
+ // See for example method-override.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/method-override/index.d.ts)
19
+ interface Request {}
20
+ interface Response {}
21
+ interface Application {}
22
+ }
23
+ }
24
+
25
+ import * as http from 'http';
26
+ import { EventEmitter } from 'events';
27
+ import { Options as RangeParserOptions, Result as RangeParserResult, Ranges as RangeParserRanges } from '../range-parser';
28
+ import { ParsedQs } from '../qs';
29
+
30
+ export {};
31
+
32
+ export type Query = ParsedQs;
33
+
34
+ export interface NextFunction {
35
+ (err?: any): void;
36
+ /**
37
+ * "Break-out" of a router by calling {next('router')};
38
+ * @see {https://expressjs.com/en/guide/using-middleware.html#middleware.router}
39
+ */
40
+ (deferToNext: 'router'): void;
41
+ /**
42
+ * "Break-out" of a route by calling {next('route')};
43
+ * @see {https://expressjs.com/en/guide/using-middleware.html#middleware.application}
44
+ */
45
+ (deferToNext: 'route'): void;
46
+ }
47
+
48
+ export interface Dictionary<T> {
49
+ [key: string]: T;
50
+ }
51
+
52
+ export interface ParamsDictionary {
53
+ [key: string]: string;
54
+ }
55
+ export type ParamsArray = string[];
56
+ export type Params = ParamsDictionary | ParamsArray;
57
+
58
+ export interface RequestHandler<
59
+ P = ParamsDictionary,
60
+ ResBody = any,
61
+ ReqBody = any,
62
+ ReqQuery = ParsedQs,
63
+ Locals extends Record<string, any> = Record<string, any>
64
+ > {
65
+ // tslint:disable-next-line callable-types (This is extended from and can't extend from a type alias in ts<2.2)
66
+ (
67
+ req: Request<P, ResBody, ReqBody, ReqQuery, Locals>,
68
+ res: Response<ResBody, Locals>,
69
+ next: NextFunction,
70
+ ): void;
71
+ }
72
+
73
+ export type ErrorRequestHandler<
74
+ P = ParamsDictionary,
75
+ ResBody = any,
76
+ ReqBody = any,
77
+ ReqQuery = ParsedQs,
78
+ Locals extends Record<string, any> = Record<string, any>
79
+ > = (
80
+ err: any,
81
+ req: Request<P, ResBody, ReqBody, ReqQuery, Locals>,
82
+ res: Response<ResBody, Locals>,
83
+ next: NextFunction,
84
+ ) => void;
85
+
86
+ export type PathParams = string | RegExp | Array<string | RegExp>;
87
+
88
+ export type RequestHandlerParams<
89
+ P = ParamsDictionary,
90
+ ResBody = any,
91
+ ReqBody = any,
92
+ ReqQuery = ParsedQs,
93
+ Locals extends Record<string, any> = Record<string, any>
94
+ > =
95
+ | RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>
96
+ | ErrorRequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>
97
+ | Array<RequestHandler<P> | ErrorRequestHandler<P>>;
98
+
99
+ type RemoveTail<S extends string, Tail extends string> = S extends `${infer P}${Tail}` ? P : S;
100
+ type GetRouteParameter<S extends string> = RemoveTail<
101
+ RemoveTail<RemoveTail<S, `/${string}`>, `-${string}`>,
102
+ `.${string}`
103
+ >;
104
+
105
+ // prettier-ignore
106
+ export type RouteParameters<Route extends string> = string extends Route
107
+ ? ParamsDictionary
108
+ : Route extends `${string}(${string}`
109
+ ? ParamsDictionary //TODO: handling for regex parameters
110
+ : Route extends `${string}:${infer Rest}`
111
+ ? (
112
+ GetRouteParameter<Rest> extends never
113
+ ? ParamsDictionary
114
+ : GetRouteParameter<Rest> extends `${infer ParamName}?`
115
+ ? { [P in ParamName]?: string }
116
+ : { [P in GetRouteParameter<Rest>]: string }
117
+ ) &
118
+ (Rest extends `${GetRouteParameter<Rest>}${infer Next}`
119
+ ? RouteParameters<Next> : unknown)
120
+ : {};
121
+
122
+ export interface IRouterMatcher<
123
+ T,
124
+ Method extends 'all' | 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head' = any
125
+ > {
126
+ <
127
+ Route extends string,
128
+ P = RouteParameters<Route>,
129
+ ResBody = any,
130
+ ReqBody = any,
131
+ ReqQuery = ParsedQs,
132
+ Locals extends Record<string, any> = Record<string, any>
133
+ >(
134
+ // (it's used as the default type parameter for P)
135
+ // eslint-disable-next-line no-unnecessary-generics
136
+ path: Route,
137
+ // (This generic is meant to be passed explicitly.)
138
+ // eslint-disable-next-line no-unnecessary-generics
139
+ ...handlers: Array<RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>>
140
+ ): T;
141
+ <
142
+ Path extends string,
143
+ P = RouteParameters<Path>,
144
+ ResBody = any,
145
+ ReqBody = any,
146
+ ReqQuery = ParsedQs,
147
+ Locals extends Record<string, any> = Record<string, any>
148
+ >(
149
+ // (it's used as the default type parameter for P)
150
+ // eslint-disable-next-line no-unnecessary-generics
151
+ path: Path,
152
+ // (This generic is meant to be passed explicitly.)
153
+ // eslint-disable-next-line no-unnecessary-generics
154
+ ...handlers: Array<RequestHandlerParams<P, ResBody, ReqBody, ReqQuery, Locals>>
155
+ ): T;
156
+ <
157
+ P = ParamsDictionary,
158
+ ResBody = any,
159
+ ReqBody = any,
160
+ ReqQuery = ParsedQs,
161
+ Locals extends Record<string, any> = Record<string, any>
162
+ >(
163
+ path: PathParams,
164
+ // (This generic is meant to be passed explicitly.)
165
+ // eslint-disable-next-line no-unnecessary-generics
166
+ ...handlers: Array<RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>>
167
+ ): T;
168
+ <
169
+ P = ParamsDictionary,
170
+ ResBody = any,
171
+ ReqBody = any,
172
+ ReqQuery = ParsedQs,
173
+ Locals extends Record<string, any> = Record<string, any>
174
+ >(
175
+ path: PathParams,
176
+ // (This generic is meant to be passed explicitly.)
177
+ // eslint-disable-next-line no-unnecessary-generics
178
+ ...handlers: Array<RequestHandlerParams<P, ResBody, ReqBody, ReqQuery, Locals>>
179
+ ): T;
180
+ (path: PathParams, subApplication: Application): T;
181
+ }
182
+
183
+ export interface IRouterHandler<T, Route extends string = string> {
184
+ (...handlers: Array<RequestHandler<RouteParameters<Route>>>): T;
185
+ (...handlers: Array<RequestHandlerParams<RouteParameters<Route>>>): T;
186
+ <
187
+ P = RouteParameters<Route>,
188
+ ResBody = any,
189
+ ReqBody = any,
190
+ ReqQuery = ParsedQs,
191
+ Locals extends Record<string, any> = Record<string, any>
192
+ >(
193
+ // (This generic is meant to be passed explicitly.)
194
+ // eslint-disable-next-line no-unnecessary-generics
195
+ ...handlers: Array<RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>>
196
+ ): T;
197
+ <
198
+ P = RouteParameters<Route>,
199
+ ResBody = any,
200
+ ReqBody = any,
201
+ ReqQuery = ParsedQs,
202
+ Locals extends Record<string, any> = Record<string, any>
203
+ >(
204
+ // (This generic is meant to be passed explicitly.)
205
+ // eslint-disable-next-line no-unnecessary-generics
206
+ ...handlers: Array<RequestHandlerParams<P, ResBody, ReqBody, ReqQuery, Locals>>
207
+ ): T;
208
+ <
209
+ P = ParamsDictionary,
210
+ ResBody = any,
211
+ ReqBody = any,
212
+ ReqQuery = ParsedQs,
213
+ Locals extends Record<string, any> = Record<string, any>
214
+ >(
215
+ // (This generic is meant to be passed explicitly.)
216
+ // eslint-disable-next-line no-unnecessary-generics
217
+ ...handlers: Array<RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>>
218
+ ): T;
219
+ <
220
+ P = ParamsDictionary,
221
+ ResBody = any,
222
+ ReqBody = any,
223
+ ReqQuery = ParsedQs,
224
+ Locals extends Record<string, any> = Record<string, any>
225
+ >(
226
+ // (This generic is meant to be passed explicitly.)
227
+ // eslint-disable-next-line no-unnecessary-generics
228
+ ...handlers: Array<RequestHandlerParams<P, ResBody, ReqBody, ReqQuery, Locals>>
229
+ ): T;
230
+ }
231
+
232
+ export interface IRouter extends RequestHandler {
233
+ /**
234
+ * Map the given param placeholder `name`(s) to the given callback(s).
235
+ *
236
+ * Parameter mapping is used to provide pre-conditions to routes
237
+ * which use normalized placeholders. For example a _:user_id_ parameter
238
+ * could automatically load a user's information from the database without
239
+ * any additional code,
240
+ *
241
+ * The callback uses the samesignature as middleware, the only differencing
242
+ * being that the value of the placeholder is passed, in this case the _id_
243
+ * of the user. Once the `next()` function is invoked, just like middleware
244
+ * it will continue on to execute the route, or subsequent parameter functions.
245
+ *
246
+ * app.param('user_id', function(req, res, next, id){
247
+ * User.find(id, function(err, user){
248
+ * if (err) {
249
+ * next(err);
250
+ * } else if (user) {
251
+ * req.user = user;
252
+ * next();
253
+ * } else {
254
+ * next(new Error('failed to load user'));
255
+ * }
256
+ * });
257
+ * });
258
+ */
259
+ param(name: string, handler: RequestParamHandler): this;
260
+
261
+ /**
262
+ * Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param()
263
+ *
264
+ * @deprecated since version 4.11
265
+ */
266
+ param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this;
267
+
268
+ /**
269
+ * Special-cased "all" method, applying the given route `path`,
270
+ * middleware, and callback to _every_ HTTP method.
271
+ */
272
+ all: IRouterMatcher<this, 'all'>;
273
+ get: IRouterMatcher<this, 'get'>;
274
+ post: IRouterMatcher<this, 'post'>;
275
+ put: IRouterMatcher<this, 'put'>;
276
+ delete: IRouterMatcher<this, 'delete'>;
277
+ patch: IRouterMatcher<this, 'patch'>;
278
+ options: IRouterMatcher<this, 'options'>;
279
+ head: IRouterMatcher<this, 'head'>;
280
+
281
+ checkout: IRouterMatcher<this>;
282
+ connect: IRouterMatcher<this>;
283
+ copy: IRouterMatcher<this>;
284
+ lock: IRouterMatcher<this>;
285
+ merge: IRouterMatcher<this>;
286
+ mkactivity: IRouterMatcher<this>;
287
+ mkcol: IRouterMatcher<this>;
288
+ move: IRouterMatcher<this>;
289
+ 'm-search': IRouterMatcher<this>;
290
+ notify: IRouterMatcher<this>;
291
+ propfind: IRouterMatcher<this>;
292
+ proppatch: IRouterMatcher<this>;
293
+ purge: IRouterMatcher<this>;
294
+ report: IRouterMatcher<this>;
295
+ search: IRouterMatcher<this>;
296
+ subscribe: IRouterMatcher<this>;
297
+ trace: IRouterMatcher<this>;
298
+ unlock: IRouterMatcher<this>;
299
+ unsubscribe: IRouterMatcher<this>;
300
+
301
+ use: IRouterHandler<this> & IRouterMatcher<this>;
302
+
303
+ route<T extends string>(prefix: T): IRoute<T>;
304
+ route(prefix: PathParams): IRoute;
305
+ /**
306
+ * Stack of configured routes
307
+ */
308
+ stack: any[];
309
+ }
310
+
311
+ export interface IRoute<Route extends string = string> {
312
+ path: string;
313
+ stack: any;
314
+ all: IRouterHandler<this, Route>;
315
+ get: IRouterHandler<this, Route>;
316
+ post: IRouterHandler<this, Route>;
317
+ put: IRouterHandler<this, Route>;
318
+ delete: IRouterHandler<this, Route>;
319
+ patch: IRouterHandler<this, Route>;
320
+ options: IRouterHandler<this, Route>;
321
+ head: IRouterHandler<this, Route>;
322
+
323
+ checkout: IRouterHandler<this, Route>;
324
+ copy: IRouterHandler<this, Route>;
325
+ lock: IRouterHandler<this, Route>;
326
+ merge: IRouterHandler<this, Route>;
327
+ mkactivity: IRouterHandler<this, Route>;
328
+ mkcol: IRouterHandler<this, Route>;
329
+ move: IRouterHandler<this, Route>;
330
+ 'm-search': IRouterHandler<this, Route>;
331
+ notify: IRouterHandler<this, Route>;
332
+ purge: IRouterHandler<this, Route>;
333
+ report: IRouterHandler<this, Route>;
334
+ search: IRouterHandler<this, Route>;
335
+ subscribe: IRouterHandler<this, Route>;
336
+ trace: IRouterHandler<this, Route>;
337
+ unlock: IRouterHandler<this, Route>;
338
+ unsubscribe: IRouterHandler<this, Route>;
339
+ }
340
+
341
+ export interface Router extends IRouter {}
342
+
343
+ export interface CookieOptions {
344
+ maxAge?: number | undefined;
345
+ signed?: boolean | undefined;
346
+ expires?: Date | undefined;
347
+ httpOnly?: boolean | undefined;
348
+ path?: string | undefined;
349
+ domain?: string | undefined;
350
+ secure?: boolean | undefined;
351
+ encode?: ((val: string) => string) | undefined;
352
+ sameSite?: boolean | 'lax' | 'strict' | 'none' | undefined;
353
+ }
354
+
355
+ export interface ByteRange {
356
+ start: number;
357
+ end: number;
358
+ }
359
+
360
+ export interface RequestRanges extends RangeParserRanges {}
361
+
362
+ export type Errback = (err: Error) => void;
363
+
364
+ /**
365
+ * @param P For most requests, this should be `ParamsDictionary`, but if you're
366
+ * using this in a route handler for a route that uses a `RegExp` or a wildcard
367
+ * `string` path (e.g. `'/user/*'`), then `req.params` will be an array, in
368
+ * which case you should use `ParamsArray` instead.
369
+ *
370
+ * @see https://expressjs.com/en/api.html#req.params
371
+ *
372
+ * @example
373
+ * app.get('/user/:id', (req, res) => res.send(req.params.id)); // implicitly `ParamsDictionary`
374
+ * app.get<ParamsArray>(/user\/(.*)/, (req, res) => res.send(req.params[0]));
375
+ * app.get<ParamsArray>('/user/*', (req, res) => res.send(req.params[0]));
376
+ */
377
+ export interface Request<
378
+ P = ParamsDictionary,
379
+ ResBody = any,
380
+ ReqBody = any,
381
+ ReqQuery = ParsedQs,
382
+ Locals extends Record<string, any> = Record<string, any>
383
+ > extends http.IncomingMessage,
384
+ Express.Request {
385
+ /**
386
+ * Return request header.
387
+ *
388
+ * The `Referrer` header field is special-cased,
389
+ * both `Referrer` and `Referer` are interchangeable.
390
+ *
391
+ * Examples:
392
+ *
393
+ * req.get('Content-Type');
394
+ * // => "text/plain"
395
+ *
396
+ * req.get('content-type');
397
+ * // => "text/plain"
398
+ *
399
+ * req.get('Something');
400
+ * // => undefined
401
+ *
402
+ * Aliased as `req.header()`.
403
+ */
404
+ get(name: 'set-cookie'): string[] | undefined;
405
+ get(name: string): string | undefined;
406
+
407
+ header(name: 'set-cookie'): string[] | undefined;
408
+ header(name: string): string | undefined;
409
+
410
+ /**
411
+ * Check if the given `type(s)` is acceptable, returning
412
+ * the best match when true, otherwise `undefined`, in which
413
+ * case you should respond with 406 "Not Acceptable".
414
+ *
415
+ * The `type` value may be a single mime type string
416
+ * such as "application/json", the extension name
417
+ * such as "json", a comma-delimted list such as "json, html, text/plain",
418
+ * or an array `["json", "html", "text/plain"]`. When a list
419
+ * or array is given the _best_ match, if any is returned.
420
+ *
421
+ * Examples:
422
+ *
423
+ * // Accept: text/html
424
+ * req.accepts('html');
425
+ * // => "html"
426
+ *
427
+ * // Accept: text/*, application/json
428
+ * req.accepts('html');
429
+ * // => "html"
430
+ * req.accepts('text/html');
431
+ * // => "text/html"
432
+ * req.accepts('json, text');
433
+ * // => "json"
434
+ * req.accepts('application/json');
435
+ * // => "application/json"
436
+ *
437
+ * // Accept: text/*, application/json
438
+ * req.accepts('image/png');
439
+ * req.accepts('png');
440
+ * // => undefined
441
+ *
442
+ * // Accept: text/*;q=.5, application/json
443
+ * req.accepts(['html', 'json']);
444
+ * req.accepts('html, json');
445
+ * // => "json"
446
+ */
447
+ accepts(): string[];
448
+ accepts(type: string): string | false;
449
+ accepts(type: string[]): string | false;
450
+ accepts(...type: string[]): string | false;
451
+
452
+ /**
453
+ * Returns the first accepted charset of the specified character sets,
454
+ * based on the request's Accept-Charset HTTP header field.
455
+ * If none of the specified charsets is accepted, returns false.
456
+ *
457
+ * For more information, or if you have issues or concerns, see accepts.
458
+ */
459
+ acceptsCharsets(): string[];
460
+ acceptsCharsets(charset: string): string | false;
461
+ acceptsCharsets(charset: string[]): string | false;
462
+ acceptsCharsets(...charset: string[]): string | false;
463
+
464
+ /**
465
+ * Returns the first accepted encoding of the specified encodings,
466
+ * based on the request's Accept-Encoding HTTP header field.
467
+ * If none of the specified encodings is accepted, returns false.
468
+ *
469
+ * For more information, or if you have issues or concerns, see accepts.
470
+ */
471
+ acceptsEncodings(): string[];
472
+ acceptsEncodings(encoding: string): string | false;
473
+ acceptsEncodings(encoding: string[]): string | false;
474
+ acceptsEncodings(...encoding: string[]): string | false;
475
+
476
+ /**
477
+ * Returns the first accepted language of the specified languages,
478
+ * based on the request's Accept-Language HTTP header field.
479
+ * If none of the specified languages is accepted, returns false.
480
+ *
481
+ * For more information, or if you have issues or concerns, see accepts.
482
+ */
483
+ acceptsLanguages(): string[];
484
+ acceptsLanguages(lang: string): string | false;
485
+ acceptsLanguages(lang: string[]): string | false;
486
+ acceptsLanguages(...lang: string[]): string | false;
487
+
488
+ /**
489
+ * Parse Range header field, capping to the given `size`.
490
+ *
491
+ * Unspecified ranges such as "0-" require knowledge of your resource length. In
492
+ * the case of a byte range this is of course the total number of bytes.
493
+ * If the Range header field is not given `undefined` is returned.
494
+ * If the Range header field is given, return value is a result of range-parser.
495
+ * See more ./types/range-parser/index.d.ts
496
+ *
497
+ * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3"
498
+ * should respond with 4 users when available, not 3.
499
+ *
500
+ */
501
+ range(size: number, options?: RangeParserOptions): RangeParserRanges | RangeParserResult | undefined;
502
+
503
+ /**
504
+ * Return an array of Accepted media types
505
+ * ordered from highest quality to lowest.
506
+ */
507
+ accepted: MediaType[];
508
+
509
+ /**
510
+ * @deprecated since 4.11 Use either req.params, req.body or req.query, as applicable.
511
+ *
512
+ * Return the value of param `name` when present or `defaultValue`.
513
+ *
514
+ * - Checks route placeholders, ex: _/user/:id_
515
+ * - Checks body params, ex: id=12, {"id":12}
516
+ * - Checks query string params, ex: ?id=12
517
+ *
518
+ * To utilize request bodies, `req.body`
519
+ * should be an object. This can be done by using
520
+ * the `connect.bodyParser()` middleware.
521
+ */
522
+ param(name: string, defaultValue?: any): string;
523
+
524
+ /**
525
+ * Check if the incoming request contains the "Content-Type"
526
+ * header field, and it contains the give mime `type`.
527
+ *
528
+ * Examples:
529
+ *
530
+ * // With Content-Type: text/html; charset=utf-8
531
+ * req.is('html');
532
+ * req.is('text/html');
533
+ * req.is('text/*');
534
+ * // => true
535
+ *
536
+ * // When Content-Type is application/json
537
+ * req.is('json');
538
+ * req.is('application/json');
539
+ * req.is('application/*');
540
+ * // => true
541
+ *
542
+ * req.is('html');
543
+ * // => false
544
+ */
545
+ is(type: string | string[]): string | false | null;
546
+
547
+ /**
548
+ * Return the protocol string "http" or "https"
549
+ * when requested with TLS. When the "trust proxy"
550
+ * setting is enabled the "X-Forwarded-Proto" header
551
+ * field will be trusted. If you're running behind
552
+ * a reverse proxy that supplies https for you this
553
+ * may be enabled.
554
+ */
555
+ protocol: string;
556
+
557
+ /**
558
+ * Short-hand for:
559
+ *
560
+ * req.protocol == 'https'
561
+ */
562
+ secure: boolean;
563
+
564
+ /**
565
+ * Return the remote address, or when
566
+ * "trust proxy" is `true` return
567
+ * the upstream addr.
568
+ */
569
+ ip: string;
570
+
571
+ /**
572
+ * When "trust proxy" is `true`, parse
573
+ * the "X-Forwarded-For" ip address list.
574
+ *
575
+ * For example if the value were "client, proxy1, proxy2"
576
+ * you would receive the array `["client", "proxy1", "proxy2"]`
577
+ * where "proxy2" is the furthest down-stream.
578
+ */
579
+ ips: string[];
580
+
581
+ /**
582
+ * Return subdomains as an array.
583
+ *
584
+ * Subdomains are the dot-separated parts of the host before the main domain of
585
+ * the app. By default, the domain of the app is assumed to be the last two
586
+ * parts of the host. This can be changed by setting "subdomain offset".
587
+ *
588
+ * For example, if the domain is "tobi.ferrets.example.com":
589
+ * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`.
590
+ * If "subdomain offset" is 3, req.subdomains is `["tobi"]`.
591
+ */
592
+ subdomains: string[];
593
+
594
+ /**
595
+ * Short-hand for `url.parse(req.url).pathname`.
596
+ */
597
+ path: string;
598
+
599
+ /**
600
+ * Parse the "Host" header field hostname.
601
+ */
602
+ hostname: string;
603
+
604
+ /**
605
+ * @deprecated Use hostname instead.
606
+ */
607
+ host: string;
608
+
609
+ /**
610
+ * Check if the request is fresh, aka
611
+ * Last-Modified and/or the ETag
612
+ * still match.
613
+ */
614
+ fresh: boolean;
615
+
616
+ /**
617
+ * Check if the request is stale, aka
618
+ * "Last-Modified" and / or the "ETag" for the
619
+ * resource has changed.
620
+ */
621
+ stale: boolean;
622
+
623
+ /**
624
+ * Check if the request was an _XMLHttpRequest_.
625
+ */
626
+ xhr: boolean;
627
+
628
+ //body: { username: string; password: string; remember: boolean; title: string; };
629
+ body: ReqBody;
630
+
631
+ //cookies: { string; remember: boolean; };
632
+ cookies: any;
633
+
634
+ method: string;
635
+
636
+ params: P;
637
+
638
+ query: ReqQuery;
639
+
640
+ route: any;
641
+
642
+ signedCookies: any;
643
+
644
+ originalUrl: string;
645
+
646
+ url: string;
647
+
648
+ baseUrl: string;
649
+
650
+ app: Application;
651
+
652
+ /**
653
+ * After middleware.init executed, Request will contain res and next properties
654
+ * See: express/lib/middleware/init.js
655
+ */
656
+ res?: Response<ResBody, Locals> | undefined;
657
+ next?: NextFunction | undefined;
658
+ }
659
+
660
+ export interface MediaType {
661
+ value: string;
662
+ quality: number;
663
+ type: string;
664
+ subtype: string;
665
+ }
666
+
667
+ export type Send<ResBody = any, T = Response<ResBody>> = (body?: ResBody) => T;
668
+
669
+ export interface Response<
670
+ ResBody = any,
671
+ Locals extends Record<string, any> = Record<string, any>,
672
+ StatusCode extends number = number
673
+ > extends http.ServerResponse,
674
+ Express.Response {
675
+ /**
676
+ * Set status `code`.
677
+ */
678
+ status(code: StatusCode): this;
679
+
680
+ /**
681
+ * Set the response HTTP status code to `statusCode` and send its string representation as the response body.
682
+ * @link http://expressjs.com/4x/api.html#res.sendStatus
683
+ *
684
+ * Examples:
685
+ *
686
+ * res.sendStatus(200); // equivalent to res.status(200).send('OK')
687
+ * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
688
+ * res.sendStatus(404); // equivalent to res.status(404).send('Not Found')
689
+ * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error')
690
+ */
691
+ sendStatus(code: StatusCode): this;
692
+
693
+ /**
694
+ * Set Link header field with the given `links`.
695
+ *
696
+ * Examples:
697
+ *
698
+ * res.links({
699
+ * next: 'http://api.example.com/users?page=2',
700
+ * last: 'http://api.example.com/users?page=5'
701
+ * });
702
+ */
703
+ links(links: any): this;
704
+
705
+ /**
706
+ * Send a response.
707
+ *
708
+ * Examples:
709
+ *
710
+ * res.send(new Buffer('wahoo'));
711
+ * res.send({ some: 'json' });
712
+ * res.send('<p>some html</p>');
713
+ * res.status(404).send('Sorry, cant find that');
714
+ */
715
+ send: Send<ResBody, this>;
716
+
717
+ /**
718
+ * Send JSON response.
719
+ *
720
+ * Examples:
721
+ *
722
+ * res.json(null);
723
+ * res.json({ user: 'tj' });
724
+ * res.status(500).json('oh noes!');
725
+ * res.status(404).json('I dont have that');
726
+ */
727
+ json: Send<ResBody, this>;
728
+
729
+ /**
730
+ * Send JSON response with JSONP callback support.
731
+ *
732
+ * Examples:
733
+ *
734
+ * res.jsonp(null);
735
+ * res.jsonp({ user: 'tj' });
736
+ * res.status(500).jsonp('oh noes!');
737
+ * res.status(404).jsonp('I dont have that');
738
+ */
739
+ jsonp: Send<ResBody, this>;
740
+
741
+ /**
742
+ * Transfer the file at the given `path`.
743
+ *
744
+ * Automatically sets the _Content-Type_ response header field.
745
+ * The callback `fn(err)` is invoked when the transfer is complete
746
+ * or when an error occurs. Be sure to check `res.headersSent`
747
+ * if you wish to attempt responding, as the header and some data
748
+ * may have already been transferred.
749
+ *
750
+ * Options:
751
+ *
752
+ * - `maxAge` defaulting to 0 (can be string converted by `ms`)
753
+ * - `root` root directory for relative filenames
754
+ * - `headers` object of headers to serve with file
755
+ * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them
756
+ *
757
+ * Other options are passed along to `send`.
758
+ *
759
+ * Examples:
760
+ *
761
+ * The following example illustrates how `res.sendFile()` may
762
+ * be used as an alternative for the `static()` middleware for
763
+ * dynamic situations. The code backing `res.sendFile()` is actually
764
+ * the same code, so HTTP cache support etc is identical.
765
+ *
766
+ * app.get('/user/:uid/photos/:file', function(req, res){
767
+ * var uid = req.params.uid
768
+ * , file = req.params.file;
769
+ *
770
+ * req.user.mayViewFilesFrom(uid, function(yes){
771
+ * if (yes) {
772
+ * res.sendFile('/uploads/' + uid + '/' + file);
773
+ * } else {
774
+ * res.send(403, 'Sorry! you cant see that.');
775
+ * }
776
+ * });
777
+ * });
778
+ *
779
+ * @api public
780
+ */
781
+ sendFile(path: string, fn?: Errback): void;
782
+ sendFile(path: string, options: any, fn?: Errback): void;
783
+
784
+ /**
785
+ * @deprecated Use sendFile instead.
786
+ */
787
+ sendfile(path: string): void;
788
+ /**
789
+ * @deprecated Use sendFile instead.
790
+ */
791
+ sendfile(path: string, options: any): void;
792
+ /**
793
+ * @deprecated Use sendFile instead.
794
+ */
795
+ sendfile(path: string, fn: Errback): void;
796
+ /**
797
+ * @deprecated Use sendFile instead.
798
+ */
799
+ sendfile(path: string, options: any, fn: Errback): void;
800
+
801
+ /**
802
+ * Transfer the file at the given `path` as an attachment.
803
+ *
804
+ * Optionally providing an alternate attachment `filename`,
805
+ * and optional callback `fn(err)`. The callback is invoked
806
+ * when the data transfer is complete, or when an error has
807
+ * ocurred. Be sure to check `res.headersSent` if you plan to respond.
808
+ *
809
+ * The optional options argument passes through to the underlying
810
+ * res.sendFile() call, and takes the exact same parameters.
811
+ *
812
+ * This method uses `res.sendfile()`.
813
+ */
814
+ download(path: string, fn?: Errback): void;
815
+ download(path: string, filename: string, fn?: Errback): void;
816
+ download(path: string, filename: string, options: any, fn?: Errback): void;
817
+
818
+ /**
819
+ * Set _Content-Type_ response header with `type` through `mime.lookup()`
820
+ * when it does not contain "/", or set the Content-Type to `type` otherwise.
821
+ *
822
+ * Examples:
823
+ *
824
+ * res.type('.html');
825
+ * res.type('html');
826
+ * res.type('json');
827
+ * res.type('application/json');
828
+ * res.type('png');
829
+ */
830
+ contentType(type: string): this;
831
+
832
+ /**
833
+ * Set _Content-Type_ response header with `type` through `mime.lookup()`
834
+ * when it does not contain "/", or set the Content-Type to `type` otherwise.
835
+ *
836
+ * Examples:
837
+ *
838
+ * res.type('.html');
839
+ * res.type('html');
840
+ * res.type('json');
841
+ * res.type('application/json');
842
+ * res.type('png');
843
+ */
844
+ type(type: string): this;
845
+
846
+ /**
847
+ * Respond to the Acceptable formats using an `obj`
848
+ * of mime-type callbacks.
849
+ *
850
+ * This method uses `req.accepted`, an array of
851
+ * acceptable types ordered by their quality values.
852
+ * When "Accept" is not present the _first_ callback
853
+ * is invoked, otherwise the first match is used. When
854
+ * no match is performed the server responds with
855
+ * 406 "Not Acceptable".
856
+ *
857
+ * Content-Type is set for you, however if you choose
858
+ * you may alter this within the callback using `res.type()`
859
+ * or `res.set('Content-Type', ...)`.
860
+ *
861
+ * res.format({
862
+ * 'text/plain': function(){
863
+ * res.send('hey');
864
+ * },
865
+ *
866
+ * 'text/html': function(){
867
+ * res.send('<p>hey</p>');
868
+ * },
869
+ *
870
+ * 'appliation/json': function(){
871
+ * res.send({ message: 'hey' });
872
+ * }
873
+ * });
874
+ *
875
+ * In addition to canonicalized MIME types you may
876
+ * also use extnames mapped to these types:
877
+ *
878
+ * res.format({
879
+ * text: function(){
880
+ * res.send('hey');
881
+ * },
882
+ *
883
+ * html: function(){
884
+ * res.send('<p>hey</p>');
885
+ * },
886
+ *
887
+ * json: function(){
888
+ * res.send({ message: 'hey' });
889
+ * }
890
+ * });
891
+ *
892
+ * By default Express passes an `Error`
893
+ * with a `.status` of 406 to `next(err)`
894
+ * if a match is not made. If you provide
895
+ * a `.default` callback it will be invoked
896
+ * instead.
897
+ */
898
+ format(obj: any): this;
899
+
900
+ /**
901
+ * Set _Content-Disposition_ header to _attachment_ with optional `filename`.
902
+ */
903
+ attachment(filename?: string): this;
904
+
905
+ /**
906
+ * Set header `field` to `val`, or pass
907
+ * an object of header fields.
908
+ *
909
+ * Examples:
910
+ *
911
+ * res.set('Foo', ['bar', 'baz']);
912
+ * res.set('Accept', 'application/json');
913
+ * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });
914
+ *
915
+ * Aliased as `res.header()`.
916
+ */
917
+ set(field: any): this;
918
+ set(field: string, value?: string | string[]): this;
919
+
920
+ header(field: any): this;
921
+ header(field: string, value?: string | string[]): this;
922
+
923
+ // Property indicating if HTTP headers has been sent for the response.
924
+ headersSent: boolean;
925
+
926
+ /** Get value for header `field`. */
927
+ get(field: string): string|undefined;
928
+
929
+ /** Clear cookie `name`. */
930
+ clearCookie(name: string, options?: CookieOptions): this;
931
+
932
+ /**
933
+ * Set cookie `name` to `val`, with the given `options`.
934
+ *
935
+ * Options:
936
+ *
937
+ * - `maxAge` max-age in milliseconds, converted to `expires`
938
+ * - `signed` sign the cookie
939
+ * - `path` defaults to "/"
940
+ *
941
+ * Examples:
942
+ *
943
+ * // "Remember Me" for 15 minutes
944
+ * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
945
+ *
946
+ * // save as above
947
+ * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
948
+ */
949
+ cookie(name: string, val: string, options: CookieOptions): this;
950
+ cookie(name: string, val: any, options: CookieOptions): this;
951
+ cookie(name: string, val: any): this;
952
+
953
+ /**
954
+ * Set the location header to `url`.
955
+ *
956
+ * The given `url` can also be the name of a mapped url, for
957
+ * example by default express supports "back" which redirects
958
+ * to the _Referrer_ or _Referer_ headers or "/".
959
+ *
960
+ * Examples:
961
+ *
962
+ * res.location('/foo/bar').;
963
+ * res.location('http://example.com');
964
+ * res.location('../login'); // /blog/post/1 -> /blog/login
965
+ *
966
+ * Mounting:
967
+ *
968
+ * When an application is mounted and `res.location()`
969
+ * is given a path that does _not_ lead with "/" it becomes
970
+ * relative to the mount-point. For example if the application
971
+ * is mounted at "/blog", the following would become "/blog/login".
972
+ *
973
+ * res.location('login');
974
+ *
975
+ * While the leading slash would result in a location of "/login":
976
+ *
977
+ * res.location('/login');
978
+ */
979
+ location(url: string): this;
980
+
981
+ /**
982
+ * Redirect to the given `url` with optional response `status`
983
+ * defaulting to 302.
984
+ *
985
+ * The resulting `url` is determined by `res.location()`, so
986
+ * it will play nicely with mounted apps, relative paths,
987
+ * `"back"` etc.
988
+ *
989
+ * Examples:
990
+ *
991
+ * res.redirect('back');
992
+ * res.redirect('/foo/bar');
993
+ * res.redirect('http://example.com');
994
+ * res.redirect(301, 'http://example.com');
995
+ * res.redirect('http://example.com', 301);
996
+ * res.redirect('../login'); // /blog/post/1 -> /blog/login
997
+ */
998
+ redirect(url: string): void;
999
+ redirect(status: number, url: string): void;
1000
+ /** @deprecated use res.redirect(status, url) instead */
1001
+ redirect(url: string, status: number): void;
1002
+
1003
+ /**
1004
+ * Render `view` with the given `options` and optional callback `fn`.
1005
+ * When a callback function is given a response will _not_ be made
1006
+ * automatically, otherwise a response of _200_ and _text/html_ is given.
1007
+ *
1008
+ * Options:
1009
+ *
1010
+ * - `cache` boolean hinting to the engine it should cache
1011
+ * - `filename` filename of the view being rendered
1012
+ */
1013
+ render(view: string, options?: object, callback?: (err: Error, html: string) => void): void;
1014
+ render(view: string, callback?: (err: Error, html: string) => void): void;
1015
+
1016
+ locals: Locals;
1017
+
1018
+ charset: string;
1019
+
1020
+ /**
1021
+ * Adds the field to the Vary response header, if it is not there already.
1022
+ * Examples:
1023
+ *
1024
+ * res.vary('User-Agent').render('docs');
1025
+ *
1026
+ */
1027
+ vary(field: string): this;
1028
+
1029
+ app: Application;
1030
+
1031
+ /**
1032
+ * Appends the specified value to the HTTP response header field.
1033
+ * If the header is not already set, it creates the header with the specified value.
1034
+ * The value parameter can be a string or an array.
1035
+ *
1036
+ * Note: calling res.set() after res.append() will reset the previously-set header value.
1037
+ *
1038
+ * @since 4.11.0
1039
+ */
1040
+ append(field: string, value?: string[] | string): this;
1041
+
1042
+ /**
1043
+ * After middleware.init executed, Response will contain req property
1044
+ * See: express/lib/middleware/init.js
1045
+ */
1046
+ req: Request;
1047
+ }
1048
+
1049
+ export interface Handler extends RequestHandler {}
1050
+
1051
+ export type RequestParamHandler = (req: Request, res: Response, next: NextFunction, value: any, name: string) => any;
1052
+
1053
+ export type ApplicationRequestHandler<T> = IRouterHandler<T> &
1054
+ IRouterMatcher<T> &
1055
+ ((...handlers: RequestHandlerParams[]) => T);
1056
+
1057
+ export interface Application<
1058
+ Locals extends Record<string, any> = Record<string, any>
1059
+ > extends EventEmitter, IRouter, Express.Application {
1060
+ /**
1061
+ * Express instance itself is a request handler, which could be invoked without
1062
+ * third argument.
1063
+ */
1064
+ (req: Request | http.IncomingMessage, res: Response | http.ServerResponse): any;
1065
+
1066
+ /**
1067
+ * Initialize the server.
1068
+ *
1069
+ * - setup default configuration
1070
+ * - setup default middleware
1071
+ * - setup route reflection methods
1072
+ */
1073
+ init(): void;
1074
+
1075
+ /**
1076
+ * Initialize application configuration.
1077
+ */
1078
+ defaultConfiguration(): void;
1079
+
1080
+ /**
1081
+ * Register the given template engine callback `fn`
1082
+ * as `ext`.
1083
+ *
1084
+ * By default will `require()` the engine based on the
1085
+ * file extension. For example if you try to render
1086
+ * a "foo.jade" file Express will invoke the following internally:
1087
+ *
1088
+ * app.engine('jade', require('jade').__express);
1089
+ *
1090
+ * For engines that do not provide `.__express` out of the box,
1091
+ * or if you wish to "map" a different extension to the template engine
1092
+ * you may use this method. For example mapping the EJS template engine to
1093
+ * ".html" files:
1094
+ *
1095
+ * app.engine('html', require('ejs').renderFile);
1096
+ *
1097
+ * In this case EJS provides a `.renderFile()` method with
1098
+ * the same signature that Express expects: `(path, options, callback)`,
1099
+ * though note that it aliases this method as `ejs.__express` internally
1100
+ * so if you're using ".ejs" extensions you dont need to do anything.
1101
+ *
1102
+ * Some template engines do not follow this convention, the
1103
+ * [Consolidate.js](https://github.com/visionmedia/consolidate.js)
1104
+ * library was created to map all of node's popular template
1105
+ * engines to follow this convention, thus allowing them to
1106
+ * work seamlessly within Express.
1107
+ */
1108
+ engine(
1109
+ ext: string,
1110
+ fn: (path: string, options: object, callback: (e: any, rendered?: string) => void) => void,
1111
+ ): this;
1112
+
1113
+ /**
1114
+ * Assign `setting` to `val`, or return `setting`'s value.
1115
+ *
1116
+ * app.set('foo', 'bar');
1117
+ * app.get('foo');
1118
+ * // => "bar"
1119
+ * app.set('foo', ['bar', 'baz']);
1120
+ * app.get('foo');
1121
+ * // => ["bar", "baz"]
1122
+ *
1123
+ * Mounted servers inherit their parent server's settings.
1124
+ */
1125
+ set(setting: string, val: any): this;
1126
+ get: ((name: string) => any) & IRouterMatcher<this>;
1127
+
1128
+ param(name: string | string[], handler: RequestParamHandler): this;
1129
+
1130
+ /**
1131
+ * Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param()
1132
+ *
1133
+ * @deprecated since version 4.11
1134
+ */
1135
+ param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this;
1136
+
1137
+ /**
1138
+ * Return the app's absolute pathname
1139
+ * based on the parent(s) that have
1140
+ * mounted it.
1141
+ *
1142
+ * For example if the application was
1143
+ * mounted as "/admin", which itself
1144
+ * was mounted as "/blog" then the
1145
+ * return value would be "/blog/admin".
1146
+ */
1147
+ path(): string;
1148
+
1149
+ /**
1150
+ * Check if `setting` is enabled (truthy).
1151
+ *
1152
+ * app.enabled('foo')
1153
+ * // => false
1154
+ *
1155
+ * app.enable('foo')
1156
+ * app.enabled('foo')
1157
+ * // => true
1158
+ */
1159
+ enabled(setting: string): boolean;
1160
+
1161
+ /**
1162
+ * Check if `setting` is disabled.
1163
+ *
1164
+ * app.disabled('foo')
1165
+ * // => true
1166
+ *
1167
+ * app.enable('foo')
1168
+ * app.disabled('foo')
1169
+ * // => false
1170
+ */
1171
+ disabled(setting: string): boolean;
1172
+
1173
+ /** Enable `setting`. */
1174
+ enable(setting: string): this;
1175
+
1176
+ /** Disable `setting`. */
1177
+ disable(setting: string): this;
1178
+
1179
+ /**
1180
+ * Render the given view `name` name with `options`
1181
+ * and a callback accepting an error and the
1182
+ * rendered template string.
1183
+ *
1184
+ * Example:
1185
+ *
1186
+ * app.render('email', { name: 'Tobi' }, function(err, html){
1187
+ * // ...
1188
+ * })
1189
+ */
1190
+ render(name: string, options?: object, callback?: (err: Error, html: string) => void): void;
1191
+ render(name: string, callback: (err: Error, html: string) => void): void;
1192
+
1193
+ /**
1194
+ * Listen for connections.
1195
+ *
1196
+ * A node `http.Server` is returned, with this
1197
+ * application (which is a `Function`) as its
1198
+ * callback. If you wish to create both an HTTP
1199
+ * and HTTPS server you may do so with the "http"
1200
+ * and "https" modules as shown here:
1201
+ *
1202
+ * var http = require('http')
1203
+ * , https = require('https')
1204
+ * , express = require('express')
1205
+ * , app = express();
1206
+ *
1207
+ * http.createServer(app).listen(80);
1208
+ * https.createServer({ ... }, app).listen(443);
1209
+ */
1210
+ listen(port: number, hostname: string, backlog: number, callback?: () => void): http.Server;
1211
+ listen(port: number, hostname: string, callback?: () => void): http.Server;
1212
+ listen(port: number, callback?: () => void): http.Server;
1213
+ listen(callback?: () => void): http.Server;
1214
+ listen(path: string, callback?: () => void): http.Server;
1215
+ listen(handle: any, listeningListener?: () => void): http.Server;
1216
+
1217
+ router: string;
1218
+
1219
+ settings: any;
1220
+
1221
+ resource: any;
1222
+
1223
+ map: any;
1224
+
1225
+ locals: Locals;
1226
+
1227
+ /**
1228
+ * The app.routes object houses all of the routes defined mapped by the
1229
+ * associated HTTP verb. This object may be used for introspection
1230
+ * capabilities, for example Express uses this internally not only for
1231
+ * routing but to provide default OPTIONS behaviour unless app.options()
1232
+ * is used. Your application or framework may also remove routes by
1233
+ * simply by removing them from this object.
1234
+ */
1235
+ routes: any;
1236
+
1237
+ /**
1238
+ * Used to get all registered routes in Express Application
1239
+ */
1240
+ _router: any;
1241
+
1242
+ use: ApplicationRequestHandler<this>;
1243
+
1244
+ /**
1245
+ * The mount event is fired on a sub-app, when it is mounted on a parent app.
1246
+ * The parent app is passed to the callback function.
1247
+ *
1248
+ * NOTE:
1249
+ * Sub-apps will:
1250
+ * - Not inherit the value of settings that have a default value. You must set the value in the sub-app.
1251
+ * - Inherit the value of settings with no default value.
1252
+ */
1253
+ on: (event: string, callback: (parent: Application) => void) => this;
1254
+
1255
+ /**
1256
+ * The app.mountpath property contains one or more path patterns on which a sub-app was mounted.
1257
+ */
1258
+ mountpath: string | string[];
1259
+ }
1260
+
1261
+ export interface Express extends Application {
1262
+ request: Request;
1263
+ response: Response;
1264
+ }