egg 4.0.0-beta.9 → 4.0.1

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 (142) hide show
  1. package/dist/commonjs/app/extend/context.d.ts +52 -12
  2. package/dist/commonjs/app/extend/context.js +25 -24
  3. package/dist/commonjs/app/extend/request.d.ts +15 -2
  4. package/dist/commonjs/app/extend/request.js +1 -1
  5. package/dist/commonjs/app/extend/response.d.ts +6 -0
  6. package/dist/commonjs/app/middleware/meta.d.ts +2 -2
  7. package/dist/commonjs/app/middleware/meta.js +1 -1
  8. package/dist/commonjs/app/middleware/notfound.d.ts +2 -2
  9. package/dist/commonjs/app/middleware/notfound.js +1 -1
  10. package/dist/commonjs/app/middleware/site_file.d.ts +3 -3
  11. package/dist/commonjs/app/middleware/site_file.js +1 -1
  12. package/dist/commonjs/config/config.default.d.ts +1 -1
  13. package/dist/commonjs/config/plugin.js +5 -6
  14. package/dist/commonjs/index.d.ts +12 -7
  15. package/dist/commonjs/index.js +11 -22
  16. package/dist/commonjs/lib/application.d.ts +7 -3
  17. package/dist/commonjs/lib/application.js +15 -4
  18. package/dist/commonjs/lib/core/base_context_class.d.ts +6 -3
  19. package/dist/commonjs/lib/core/base_context_class.js +1 -2
  20. package/dist/commonjs/lib/core/base_hook_class.d.ts +2 -2
  21. package/dist/commonjs/lib/core/base_hook_class.js +1 -2
  22. package/dist/commonjs/lib/core/context_httpclient.d.ts +3 -3
  23. package/dist/commonjs/lib/core/context_httpclient.js +1 -1
  24. package/dist/commonjs/lib/core/httpclient.d.ts +7 -6
  25. package/dist/commonjs/lib/core/httpclient.js +10 -5
  26. package/dist/commonjs/lib/core/messenger/base.d.ts +8 -0
  27. package/dist/commonjs/lib/core/messenger/base.js +31 -0
  28. package/dist/commonjs/lib/core/messenger/index.js +3 -2
  29. package/dist/commonjs/lib/core/messenger/ipc.d.ts +2 -3
  30. package/dist/commonjs/lib/core/messenger/ipc.js +4 -6
  31. package/dist/commonjs/lib/core/messenger/local.d.ts +2 -3
  32. package/dist/commonjs/lib/core/messenger/local.js +4 -9
  33. package/dist/commonjs/lib/core/utils.d.ts +1 -1
  34. package/dist/commonjs/lib/core/utils.js +3 -3
  35. package/dist/commonjs/lib/egg.d.ts +37 -13
  36. package/dist/commonjs/lib/egg.js +21 -6
  37. package/dist/commonjs/lib/error/CookieLimitExceedError.d.ts +5 -0
  38. package/dist/commonjs/lib/error/CookieLimitExceedError.js +16 -0
  39. package/dist/commonjs/lib/error/MessageUnhandledRejectionError.d.ts +5 -0
  40. package/dist/commonjs/lib/error/MessageUnhandledRejectionError.js +16 -0
  41. package/dist/commonjs/lib/error/index.d.ts +2 -0
  42. package/dist/commonjs/lib/error/index.js +19 -0
  43. package/dist/commonjs/lib/start.d.ts +10 -1
  44. package/dist/commonjs/lib/start.js +1 -1
  45. package/dist/commonjs/lib/{type.d.ts → types.d.ts} +51 -85
  46. package/dist/commonjs/lib/types.js +9 -0
  47. package/dist/commonjs/lib/utils.js +1 -1
  48. package/dist/commonjs/urllib.d.ts +1 -0
  49. package/dist/commonjs/urllib.js +18 -0
  50. package/dist/esm/app/extend/context.d.ts +52 -12
  51. package/dist/esm/app/extend/context.js +24 -20
  52. package/dist/esm/app/extend/request.d.ts +15 -2
  53. package/dist/esm/app/extend/request.js +1 -1
  54. package/dist/esm/app/extend/response.d.ts +6 -0
  55. package/dist/esm/app/middleware/meta.d.ts +2 -2
  56. package/dist/esm/app/middleware/meta.js +1 -1
  57. package/dist/esm/app/middleware/notfound.d.ts +2 -2
  58. package/dist/esm/app/middleware/notfound.js +1 -1
  59. package/dist/esm/app/middleware/site_file.d.ts +3 -3
  60. package/dist/esm/app/middleware/site_file.js +1 -1
  61. package/dist/esm/config/config.default.d.ts +1 -1
  62. package/dist/esm/config/plugin.js +5 -6
  63. package/dist/esm/index.d.ts +12 -7
  64. package/dist/esm/index.js +13 -8
  65. package/dist/esm/lib/application.d.ts +7 -3
  66. package/dist/esm/lib/application.js +15 -4
  67. package/dist/esm/lib/core/base_context_class.d.ts +6 -3
  68. package/dist/esm/lib/core/base_context_class.js +1 -2
  69. package/dist/esm/lib/core/base_hook_class.d.ts +2 -2
  70. package/dist/esm/lib/core/base_hook_class.js +1 -2
  71. package/dist/esm/lib/core/context_httpclient.d.ts +3 -3
  72. package/dist/esm/lib/core/context_httpclient.js +1 -1
  73. package/dist/esm/lib/core/httpclient.d.ts +7 -6
  74. package/dist/esm/lib/core/httpclient.js +10 -5
  75. package/dist/esm/lib/core/messenger/base.d.ts +8 -0
  76. package/dist/esm/lib/core/messenger/base.js +27 -0
  77. package/dist/esm/lib/core/messenger/index.js +3 -2
  78. package/dist/esm/lib/core/messenger/ipc.d.ts +2 -3
  79. package/dist/esm/lib/core/messenger/ipc.js +4 -6
  80. package/dist/esm/lib/core/messenger/local.d.ts +2 -3
  81. package/dist/esm/lib/core/messenger/local.js +4 -6
  82. package/dist/esm/lib/core/utils.d.ts +1 -1
  83. package/dist/esm/lib/core/utils.js +3 -3
  84. package/dist/esm/lib/egg.d.ts +37 -13
  85. package/dist/esm/lib/egg.js +23 -7
  86. package/dist/esm/lib/error/CookieLimitExceedError.d.ts +5 -0
  87. package/dist/esm/lib/error/CookieLimitExceedError.js +12 -0
  88. package/dist/esm/lib/error/MessageUnhandledRejectionError.d.ts +5 -0
  89. package/dist/esm/lib/error/MessageUnhandledRejectionError.js +12 -0
  90. package/dist/esm/lib/error/index.d.ts +2 -0
  91. package/dist/esm/lib/error/index.js +3 -0
  92. package/dist/esm/lib/start.d.ts +10 -1
  93. package/dist/esm/lib/start.js +1 -1
  94. package/dist/esm/lib/{type.d.ts → types.d.ts} +51 -85
  95. package/dist/esm/lib/types.js +7 -0
  96. package/dist/esm/lib/utils.js +1 -1
  97. package/dist/esm/urllib.d.ts +1 -0
  98. package/dist/esm/urllib.js +2 -0
  99. package/dist/package.json +1 -1
  100. package/package.json +30 -22
  101. package/src/app/extend/context.ts +53 -34
  102. package/src/app/extend/request.ts +18 -2
  103. package/src/app/extend/response.ts +8 -0
  104. package/src/app/middleware/meta.ts +2 -2
  105. package/src/app/middleware/notfound.ts +2 -2
  106. package/src/app/middleware/site_file.ts +3 -3
  107. package/src/config/config.default.ts +1 -1
  108. package/src/config/config.local.ts +1 -1
  109. package/src/config/config.unittest.ts +1 -1
  110. package/src/config/plugin.ts +4 -6
  111. package/src/index.ts +40 -7
  112. package/src/lib/agent.ts +1 -1
  113. package/src/lib/application.ts +18 -6
  114. package/src/lib/core/base_context_class.ts +6 -3
  115. package/src/lib/core/base_hook_class.ts +2 -2
  116. package/src/lib/core/context_httpclient.ts +3 -3
  117. package/src/lib/core/httpclient.ts +21 -8
  118. package/src/lib/core/messenger/base.ts +30 -0
  119. package/src/lib/core/messenger/index.ts +2 -1
  120. package/src/lib/core/messenger/ipc.ts +3 -5
  121. package/src/lib/core/messenger/local.ts +3 -5
  122. package/src/lib/core/utils.ts +2 -2
  123. package/src/lib/egg.ts +58 -23
  124. package/src/lib/error/CookieLimitExceedError.ts +12 -0
  125. package/src/lib/error/MessageUnhandledRejectionError.ts +12 -0
  126. package/src/lib/error/index.ts +2 -0
  127. package/src/lib/start.ts +12 -2
  128. package/src/lib/{type.ts → types.ts} +65 -89
  129. package/src/lib/utils.ts +0 -1
  130. package/src/urllib.ts +1 -0
  131. package/dist/commonjs/app/extend/context.types.d.ts +0 -16
  132. package/dist/commonjs/app/extend/context.types.js +0 -3
  133. package/dist/commonjs/lib/egg.types.d.ts +0 -6
  134. package/dist/commonjs/lib/egg.types.js +0 -3
  135. package/dist/commonjs/lib/type.js +0 -3
  136. package/dist/esm/app/extend/context.types.d.ts +0 -16
  137. package/dist/esm/app/extend/context.types.js +0 -2
  138. package/dist/esm/lib/egg.types.d.ts +0 -6
  139. package/dist/esm/lib/egg.types.js +0 -2
  140. package/dist/esm/lib/type.js +0 -2
  141. package/src/app/extend/context.types.ts +0 -24
  142. package/src/lib/egg.types.ts +0 -6
@@ -0,0 +1,12 @@
1
+ export class CookieLimitExceedError extends Error {
2
+ key: string;
3
+ cookie: string;
4
+
5
+ constructor(key: string, cookie: string) {
6
+ super(`cookie ${key}'s length(${cookie.length}) exceed the limit(4093)`);
7
+ this.name = this.constructor.name;
8
+ this.key = key;
9
+ this.cookie = cookie;
10
+ Error.captureStackTrace(this, this.constructor);
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ export class MessageUnhandledRejectionError extends Error {
2
+ event: string | symbol;
3
+ args: any[];
4
+
5
+ constructor(err: Error, event: string | symbol, ...args: any[]) {
6
+ super(`event: ${String(event)}, error: ${err.message}`, { cause: err });
7
+ this.name = this.constructor.name;
8
+ this.event = event;
9
+ this.args = args;
10
+ Error.captureStackTrace(this, this.constructor);
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from './CookieLimitExceedError.js';
2
+ export * from './MessageUnhandledRejectionError.js';
package/src/lib/start.ts CHANGED
@@ -3,6 +3,7 @@ import { readJSON } from 'utility';
3
3
  import { importModule } from '@eggjs/utils';
4
4
  import { Agent } from './agent.js';
5
5
  import { Application } from './application.js';
6
+ import { EggPlugin } from './types.js';
6
7
 
7
8
  export interface StartEggOptions {
8
9
  /** specify framework that can be absolute path or npm package */
@@ -13,6 +14,15 @@ export interface StartEggOptions {
13
14
  ignoreWarning?: boolean;
14
15
  mode?: 'single';
15
16
  env?: string;
17
+ plugins?: EggPlugin;
18
+ }
19
+
20
+ export interface SingleModeApplication extends Application {
21
+ agent: SingleModeAgent;
22
+ }
23
+
24
+ export interface SingleModeAgent extends Agent {
25
+ app: SingleModeApplication;
16
26
  }
17
27
 
18
28
  /**
@@ -41,11 +51,11 @@ export async function startEgg(options: StartEggOptions = {}) {
41
51
 
42
52
  const agent = new AgentClass({
43
53
  ...options,
44
- });
54
+ }) as SingleModeAgent;
45
55
  await agent.ready();
46
56
  const application = new ApplicationClass({
47
57
  ...options,
48
- });
58
+ }) as SingleModeApplication;
49
59
  application.agent = agent;
50
60
  agent.application = application;
51
61
  await application.ready();
@@ -7,18 +7,28 @@ import type {
7
7
  } from 'egg-logger';
8
8
  import type {
9
9
  FileLoaderOptions,
10
+ EggAppConfig as EggCoreAppConfig,
10
11
  } from '@eggjs/core';
11
12
  import type {
12
- EggApplicationCore, ContextDelegation,
13
+ EggApplicationCore, Context,
13
14
  } from './egg.js';
14
15
  import type { MetaMiddlewareOptions } from '../app/middleware/meta.js';
15
16
  import type { NotFoundMiddlewareOptions } from '../app/middleware/notfound.js';
16
17
  import type { SiteFileMiddlewareOptions } from '../app/middleware/site_file.js';
17
18
 
18
- // import @eggjs/watcher types
19
- // import '@eggjs/watcher';
19
+ // import plugins types
20
+ import '@eggjs/watcher';
21
+ import '@eggjs/development';
22
+ import '@eggjs/jsonp';
23
+ import '@eggjs/i18n';
24
+ import '@eggjs/static';
20
25
 
21
- type IgnoreItem = string | RegExp | ((ctx: ContextDelegation) => boolean);
26
+ export type {
27
+ EggAppInfo,
28
+ } from '@eggjs/core';
29
+
30
+
31
+ type IgnoreItem = string | RegExp | ((ctx: Context) => boolean);
22
32
  type IgnoreOrMatch = IgnoreItem | IgnoreItem[];
23
33
 
24
34
  export interface ClientErrorResponse {
@@ -56,7 +66,18 @@ export interface CustomLoaderConfig extends Omit<FileLoaderOptions, 'inject' | '
56
66
  loadunit?: boolean;
57
67
  }
58
68
 
59
- export interface EggAppConfig {
69
+ export interface HttpClientConfig {
70
+ /** Request timeout */
71
+ timeout?: number;
72
+ /** Default request args for httpclient */
73
+ request?: HttpClientRequestOptions;
74
+ /**
75
+ * @deprecated keep compatible with egg 3.x, no more used
76
+ */
77
+ useHttpClientNext?: boolean;
78
+ }
79
+
80
+ export interface EggAppConfig extends EggCoreAppConfig {
60
81
  workerStartTimeout: number;
61
82
  baseDir: string;
62
83
  middleware: string[];
@@ -103,7 +124,7 @@ export interface EggAppConfig {
103
124
  };
104
125
  /** Default is `'error'`, it will return `400` response when `Prototype-Poisoning` happen. */
105
126
  onProtoPoisoning: 'error' | 'remove' | 'ignore';
106
- onerror(err: any, ctx: ContextDelegation): void;
127
+ onerror(err: any, ctx: Context): void;
107
128
  };
108
129
 
109
130
  /**
@@ -131,50 +152,14 @@ export interface EggAppConfig {
131
152
  };
132
153
 
133
154
  /** Configuration of httpclient in egg. */
134
- httpclient: {
135
- /** Request timeout */
136
- timeout?: number;
137
- /** Default request args for httpclient */
138
- request?: HttpClientRequestOptions;
139
- };
140
-
141
- development: {
142
- /**
143
- * dirs needed watch, when files under these change, application will reload, use relative path
144
- */
145
- watchDirs: string[];
146
- /**
147
- * dirs don't need watch, including subdirectories, use relative path
148
- */
149
- ignoreDirs: string[];
150
- /**
151
- * don't wait all plugins ready, default is true.
152
- */
153
- fastReady: boolean;
154
- /**
155
- * whether reload on debug, default is true.
156
- */
157
- reloadOnDebug: boolean;
158
- /**
159
- * whether override default watchDirs, default is false.
160
- */
161
- overrideDefault: boolean;
162
- /**
163
- * whether override default ignoreDirs, default is false.
164
- */
165
- overrideIgnore: boolean;
166
- /**
167
- * whether to reload, use https://github.com/sindresorhus/multimatch
168
- */
169
- reloadPattern: string[] | string;
170
- };
155
+ httpclient: HttpClientConfig;
171
156
 
172
157
  /**
173
158
  * customLoader config
174
159
  */
175
- customLoader: {
176
- [key: string]: CustomLoaderConfig;
177
- };
160
+ // customLoader: {
161
+ // [key: string]: CustomLoaderConfig;
162
+ // };
178
163
 
179
164
  /**
180
165
  * It will ignore special keys when dumpConfig
@@ -198,32 +183,6 @@ export interface EggAppConfig {
198
183
 
199
184
  hostHeaders: string;
200
185
 
201
- /**
202
- * I18n options
203
- */
204
- i18n: {
205
- /**
206
- * default value EN_US
207
- */
208
- defaultLocale: string;
209
- /**
210
- * i18n resource file dir, not recommend to change default value
211
- */
212
- dirs: string[];
213
- /**
214
- * custom the locale value field, default `query.locale`, you can modify this config, such as `query.lang`
215
- */
216
- queryField: string;
217
- /**
218
- * The locale value key in the cookie, default is locale.
219
- */
220
- cookieField: string;
221
- /**
222
- * Locale cookie expire time, default `1y`, If pass number value, the unit will be ms
223
- */
224
- cookieMaxAge: string | number;
225
- };
226
-
227
186
  /**
228
187
  * Detect request' ip from specified headers, not case-sensitive. Only worked when config.proxy set to true.
229
188
  */
@@ -238,21 +197,6 @@ export interface EggAppConfig {
238
197
  httpOnly?: boolean;
239
198
  };
240
199
 
241
- /**
242
- * jsonp options
243
- * @member Config#jsonp
244
- * @property {String} callback - jsonp callback method key, default to `_callback`
245
- * @property {Number} limit - callback method name's max length, default to `50`
246
- * @property {Boolean} csrf - enable csrf check or not. default to false
247
- * @property {String|RegExp|Array} whiteList - referrer white list
248
- */
249
- jsonp: {
250
- limit: number;
251
- callback: string;
252
- csrf: boolean;
253
- whiteList: string | RegExp | Array<string | RegExp>;
254
- };
255
-
256
200
  /**
257
201
  * The key that signing cookies. It can contain multiple keys separated by .
258
202
  */
@@ -299,8 +243,6 @@ export interface EggAppConfig {
299
243
  allowedMethods: string[];
300
244
  };
301
245
 
302
- watcher: Record<string, any>;
303
-
304
246
  onClientError?(err: Error, socket: Socket, app: EggApplicationCore): ClientErrorResponse | Promise<ClientErrorResponse>;
305
247
 
306
248
  /**
@@ -327,3 +269,37 @@ export interface EggAppConfig {
327
269
 
328
270
  [prop: string]: any;
329
271
  }
272
+
273
+ export type RequestObjectBody = Record<string, any>;
274
+
275
+ /**
276
+ * plugin config item interface
277
+ */
278
+ export interface IEggPluginItem {
279
+ env?: EggEnvType[];
280
+ path?: string;
281
+ package?: string;
282
+ enable?: boolean;
283
+ }
284
+
285
+ export type EggPluginItem = IEggPluginItem | boolean;
286
+
287
+ /**
288
+ * build-in plugin list
289
+ */
290
+ export interface EggPlugin {
291
+ [key: string]: EggPluginItem | undefined;
292
+ onerror?: EggPluginItem;
293
+ session?: EggPluginItem;
294
+ i18n?: EggPluginItem;
295
+ watcher?: EggPluginItem;
296
+ multipart?: EggPluginItem;
297
+ security?: EggPluginItem;
298
+ development?: EggPluginItem;
299
+ logrotator?: EggPluginItem;
300
+ schedule?: EggPluginItem;
301
+ static?: EggPluginItem;
302
+ jsonp?: EggPluginItem;
303
+ view?: EggPluginItem;
304
+ }
305
+
package/src/lib/utils.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  import path from 'node:path';
3
2
  import { fileURLToPath } from 'node:url';
4
3
 
package/src/urllib.ts ADDED
@@ -0,0 +1 @@
1
+ export * from 'urllib';
@@ -1,16 +0,0 @@
1
- import type { Router } from '@eggjs/core';
2
- import type { HttpClientRequestURL, HttpClientRequestOptions, HttpClient } from '../../lib/core/httpclient.js';
3
- import type { ContextHttpClient } from '../../lib/core/context_httpclient.js';
4
- import type Helper from './helper.js';
5
- import type { EggLogger } from 'egg-logger';
6
- declare module '@eggjs/core' {
7
- interface Context {
8
- curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
9
- get router(): Router;
10
- set router(val: Router);
11
- get helper(): Helper;
12
- get httpclient(): ContextHttpClient;
13
- get httpClient(): ContextHttpClient;
14
- getLogger(name: string): EggLogger;
15
- }
16
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC50eXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvZXh0ZW5kL2NvbnRleHQudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -1,6 +0,0 @@
1
- declare module '@eggjs/core' {
2
- interface EggCore {
3
- inspect(): any;
4
- }
5
- }
6
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWdnLnR5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9lZ2cudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
@@ -1,16 +0,0 @@
1
- import type { Router } from '@eggjs/core';
2
- import type { HttpClientRequestURL, HttpClientRequestOptions, HttpClient } from '../../lib/core/httpclient.js';
3
- import type { ContextHttpClient } from '../../lib/core/context_httpclient.js';
4
- import type Helper from './helper.js';
5
- import type { EggLogger } from 'egg-logger';
6
- declare module '@eggjs/core' {
7
- interface Context {
8
- curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
9
- get router(): Router;
10
- set router(val: Router);
11
- get helper(): Helper;
12
- get httpclient(): ContextHttpClient;
13
- get httpClient(): ContextHttpClient;
14
- getLogger(name: string): EggLogger;
15
- }
16
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC50eXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvZXh0ZW5kL2NvbnRleHQudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -1,6 +0,0 @@
1
- declare module '@eggjs/core' {
2
- interface EggCore {
3
- inspect(): any;
4
- }
5
- }
6
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWdnLnR5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9lZ2cudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
@@ -1,24 +0,0 @@
1
- import type {
2
- Router,
3
- } from '@eggjs/core';
4
- import type {
5
- HttpClientRequestURL, HttpClientRequestOptions, HttpClient,
6
- } from '../../lib/core/httpclient.js';
7
- import type {
8
- ContextHttpClient,
9
- } from '../../lib/core/context_httpclient.js';
10
- import type Helper from './helper.js';
11
- import type { EggLogger } from 'egg-logger';
12
-
13
- declare module '@eggjs/core' {
14
- // add Context overrides types
15
- interface Context {
16
- curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
17
- get router(): Router;
18
- set router(val: Router);
19
- get helper(): Helper;
20
- get httpclient(): ContextHttpClient;
21
- get httpClient(): ContextHttpClient;
22
- getLogger(name: string): EggLogger;
23
- }
24
- }
@@ -1,6 +0,0 @@
1
- declare module '@eggjs/core' {
2
- // add EggApplicationCore overrides types
3
- interface EggCore {
4
- inspect(): any;
5
- }
6
- }