@eggjs/core 6.4.1 → 6.6.0-beta.10

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 (87) hide show
  1. package/README.md +23 -27
  2. package/dist/base_context_class.d.ts +21 -0
  3. package/dist/base_context_class.js +40 -0
  4. package/dist/egg.d.ts +248 -0
  5. package/dist/egg.js +358 -0
  6. package/dist/index.d.ts +12 -0
  7. package/dist/index.js +12 -0
  8. package/dist/lifecycle.d.ts +84 -0
  9. package/dist/lifecycle.js +280 -0
  10. package/dist/loader/context_loader.d.ts +39 -0
  11. package/dist/loader/context_loader.js +79 -0
  12. package/dist/loader/egg_loader.d.ts +374 -0
  13. package/dist/loader/egg_loader.js +1184 -0
  14. package/dist/loader/file_loader.d.ts +105 -0
  15. package/dist/loader/file_loader.js +198 -0
  16. package/dist/singleton.d.ts +33 -0
  17. package/dist/singleton.js +107 -0
  18. package/{src/types.ts → dist/types.d.ts} +7 -7
  19. package/dist/utils/index.d.ts +19 -0
  20. package/dist/utils/index.js +103 -0
  21. package/dist/utils/sequencify.d.ts +16 -0
  22. package/dist/utils/sequencify.js +46 -0
  23. package/dist/utils/timing.d.ts +24 -0
  24. package/dist/utils/timing.js +85 -0
  25. package/package.json +39 -65
  26. package/dist/commonjs/base_context_class.d.ts +0 -16
  27. package/dist/commonjs/base_context_class.js +0 -41
  28. package/dist/commonjs/egg.d.ts +0 -247
  29. package/dist/commonjs/egg.js +0 -401
  30. package/dist/commonjs/index.d.ts +0 -12
  31. package/dist/commonjs/index.js +0 -32
  32. package/dist/commonjs/lifecycle.d.ts +0 -78
  33. package/dist/commonjs/lifecycle.js +0 -312
  34. package/dist/commonjs/loader/context_loader.d.ts +0 -35
  35. package/dist/commonjs/loader/context_loader.js +0 -110
  36. package/dist/commonjs/loader/egg_loader.d.ts +0 -369
  37. package/dist/commonjs/loader/egg_loader.js +0 -1543
  38. package/dist/commonjs/loader/file_loader.d.ts +0 -100
  39. package/dist/commonjs/loader/file_loader.js +0 -262
  40. package/dist/commonjs/package.json +0 -3
  41. package/dist/commonjs/singleton.d.ts +0 -29
  42. package/dist/commonjs/singleton.js +0 -125
  43. package/dist/commonjs/types.d.ts +0 -53
  44. package/dist/commonjs/types.js +0 -3
  45. package/dist/commonjs/utils/index.d.ts +0 -17
  46. package/dist/commonjs/utils/index.js +0 -117
  47. package/dist/commonjs/utils/sequencify.d.ts +0 -13
  48. package/dist/commonjs/utils/sequencify.js +0 -59
  49. package/dist/commonjs/utils/timing.d.ts +0 -21
  50. package/dist/commonjs/utils/timing.js +0 -100
  51. package/dist/esm/base_context_class.d.ts +0 -16
  52. package/dist/esm/base_context_class.js +0 -37
  53. package/dist/esm/egg.d.ts +0 -247
  54. package/dist/esm/egg.js +0 -388
  55. package/dist/esm/index.d.ts +0 -12
  56. package/dist/esm/index.js +0 -12
  57. package/dist/esm/lifecycle.d.ts +0 -78
  58. package/dist/esm/lifecycle.js +0 -305
  59. package/dist/esm/loader/context_loader.d.ts +0 -35
  60. package/dist/esm/loader/context_loader.js +0 -102
  61. package/dist/esm/loader/egg_loader.d.ts +0 -369
  62. package/dist/esm/loader/egg_loader.js +0 -1536
  63. package/dist/esm/loader/file_loader.d.ts +0 -100
  64. package/dist/esm/loader/file_loader.js +0 -255
  65. package/dist/esm/package.json +0 -3
  66. package/dist/esm/singleton.d.ts +0 -29
  67. package/dist/esm/singleton.js +0 -118
  68. package/dist/esm/types.d.ts +0 -53
  69. package/dist/esm/types.js +0 -2
  70. package/dist/esm/utils/index.d.ts +0 -17
  71. package/dist/esm/utils/index.js +0 -112
  72. package/dist/esm/utils/sequencify.d.ts +0 -13
  73. package/dist/esm/utils/sequencify.js +0 -56
  74. package/dist/esm/utils/timing.d.ts +0 -21
  75. package/dist/esm/utils/timing.js +0 -93
  76. package/dist/package.json +0 -4
  77. package/src/base_context_class.ts +0 -39
  78. package/src/egg.ts +0 -517
  79. package/src/index.ts +0 -14
  80. package/src/lifecycle.ts +0 -399
  81. package/src/loader/context_loader.ts +0 -121
  82. package/src/loader/egg_loader.ts +0 -1722
  83. package/src/loader/file_loader.ts +0 -308
  84. package/src/singleton.ts +0 -149
  85. package/src/utils/index.ts +0 -125
  86. package/src/utils/sequencify.ts +0 -70
  87. package/src/utils/timing.ts +0 -114
package/dist/egg.js ADDED
@@ -0,0 +1,358 @@
1
+ import utils_default from "./utils/index.js";
2
+ import { BaseContextClass } from "./base_context_class.js";
3
+ import { Timing } from "./utils/timing.js";
4
+ import { Lifecycle } from "./lifecycle.js";
5
+ import { EggLoader } from "./loader/egg_loader.js";
6
+ import { Singleton } from "./singleton.js";
7
+ import { debuglog } from "node:util";
8
+ import assert from "node:assert";
9
+ import { Application as KoaApplication, Context as KoaContext, Request as KoaRequest, Response as KoaResponse } from "@eggjs/koa";
10
+ import { EggConsoleLogger } from "egg-logger";
11
+ import { EggRouter as Router } from "@eggjs/router";
12
+
13
+ //#region src/egg.ts
14
+ const debug = debuglog("egg/core/egg");
15
+ const EGG_LOADER = Symbol.for("egg#loader");
16
+ var Request$1 = class extends KoaRequest {};
17
+ var Response$1 = class extends KoaResponse {};
18
+ var Context$1 = class extends KoaContext {
19
+ /**
20
+ * Returns map of URL parameters for given `path` and `paramNames`.
21
+ * @example
22
+ * ##### ctx.params.id {string}
23
+ *
24
+ * `GET /api/users/1` => `'1'`
25
+ *
26
+ * ##### ctx.params.per_page {string}
27
+ *
28
+ * The number of every page, `GET /api/users?per_page=20` => `20`
29
+ */
30
+ params;
31
+ /**
32
+ * Returns array of router regexp url path captures.
33
+ */
34
+ captures;
35
+ /**
36
+ * Returns the name of the matched router.
37
+ */
38
+ routerName;
39
+ /**
40
+ * Returns the path of the matched router.
41
+ */
42
+ routerPath;
43
+ };
44
+ var EggCore = class EggCore extends KoaApplication {
45
+ options;
46
+ timing;
47
+ console;
48
+ BaseContextClass;
49
+ Controller;
50
+ Service;
51
+ Helper;
52
+ lifecycle;
53
+ loader;
54
+ #closePromise;
55
+ #router;
56
+ /** auto inject on loadService() */
57
+ serviceClasses = {};
58
+ /** auto inject on loadController() */
59
+ controller = {};
60
+ /** auto inject on loadMiddleware() */
61
+ middlewares = {};
62
+ /**
63
+ * @class
64
+ * @param {Object} options - options
65
+ * @param {String} [options.baseDir] - the directory of application
66
+ * @param {String} [options.type] - whether it's running in app worker or agent worker
67
+ * @param {Object} [options.plugins] - custom plugins
68
+ * @since 1.0.0
69
+ */
70
+ constructor(options = {}) {
71
+ options.baseDir = options.baseDir ?? process.cwd();
72
+ options.type = options.type ?? "application";
73
+ assert(typeof options.baseDir === "string", "options.baseDir required, and must be a string");
74
+ assert(options.type === "application" || options.type === "agent", "options.type should be application or agent");
75
+ super();
76
+ this.timing = new Timing();
77
+ /**
78
+ * @member {Object} EggCore#options
79
+ * @private
80
+ * @since 1.0.0
81
+ */
82
+ this.options = options;
83
+ /**
84
+ * logging for EggCore, avoid using console directly
85
+ * @member {Logger} EggCore#console
86
+ * @private
87
+ * @since 1.0.0
88
+ */
89
+ this.console = new EggConsoleLogger();
90
+ /**
91
+ * @member {BaseContextClass} EggCore#BaseContextClass
92
+ * @since 1.0.0
93
+ */
94
+ this.BaseContextClass = BaseContextClass;
95
+ /**
96
+ * Retrieve base controller
97
+ * @member {Controller} EggCore#Controller
98
+ * @since 1.0.0
99
+ */
100
+ this.Controller = this.BaseContextClass;
101
+ /**
102
+ * Retrieve base service
103
+ * @member {Service} EggCore#Service
104
+ * @since 1.0.0
105
+ */
106
+ this.Service = this.BaseContextClass;
107
+ this.lifecycle = new Lifecycle({
108
+ baseDir: options.baseDir,
109
+ app: this,
110
+ logger: this.console
111
+ });
112
+ this.lifecycle.on("error", (err) => this.emit("error", err));
113
+ this.lifecycle.on("ready_timeout", (id) => this.emit("ready_timeout", id));
114
+ this.lifecycle.on("ready_stat", (data) => this.emit("ready_stat", data));
115
+ /**
116
+ * The loader instance, the default class is {@link EggLoader}.
117
+ * If you want define
118
+ * @member {EggLoader} EggCore#loader
119
+ * @since 1.0.0
120
+ */
121
+ const Loader = this[EGG_LOADER];
122
+ assert(Loader, "Symbol.for('egg#loader') is required");
123
+ this.loader = new Loader({
124
+ baseDir: options.baseDir,
125
+ app: this,
126
+ plugins: options.plugins,
127
+ logger: this.console,
128
+ serverScope: options.serverScope,
129
+ env: options.env ?? "",
130
+ EggCoreClass: EggCore
131
+ });
132
+ }
133
+ get logger() {
134
+ return this.console;
135
+ }
136
+ get coreLogger() {
137
+ return this.console;
138
+ }
139
+ /**
140
+ * create a singleton instance
141
+ * @param {String} name - unique name for singleton
142
+ * @param {Function|AsyncFunction} create - method will be invoked when singleton instance create
143
+ */
144
+ addSingleton(name, create) {
145
+ const initPromise = new Singleton({
146
+ name,
147
+ create,
148
+ app: this
149
+ }).init();
150
+ if (initPromise) this.lifecycle.registerBeforeStart(async () => {
151
+ await initPromise;
152
+ }, `${name}-singleton-init`);
153
+ }
154
+ /**
155
+ * override koa's app.use, support generator function
156
+ * @since 1.0.0
157
+ */
158
+ use(fn) {
159
+ assert(typeof fn === "function", "app.use() requires a function");
160
+ debug("[use] add middleware: %o", fn._name || fn.name || "-");
161
+ this.middleware.push(fn);
162
+ return this;
163
+ }
164
+ /**
165
+ * Whether `application` or `agent`
166
+ * @member {String}
167
+ * @since 1.0.0
168
+ */
169
+ get type() {
170
+ return this.options.type;
171
+ }
172
+ /**
173
+ * The current directory of application
174
+ * @member {String}
175
+ * @see {@link AppInfo#baseDir}
176
+ * @since 1.0.0
177
+ */
178
+ get baseDir() {
179
+ return this.options.baseDir;
180
+ }
181
+ /**
182
+ * Alias to {@link https://npmjs.com/package/depd}
183
+ * @member {Function}
184
+ * @since 1.0.0
185
+ */
186
+ get deprecate() {
187
+ return utils_default.deprecated;
188
+ }
189
+ /**
190
+ * The name of application
191
+ * @member {String}
192
+ * @see {@link AppInfo#name}
193
+ * @since 1.0.0
194
+ */
195
+ get name() {
196
+ return this.loader ? this.loader.pkg.name : "";
197
+ }
198
+ /**
199
+ * Retrieve enabled plugins
200
+ * @member {Object}
201
+ * @since 1.0.0
202
+ */
203
+ get plugins() {
204
+ return this.loader ? this.loader.plugins : {};
205
+ }
206
+ /**
207
+ * The configuration of application
208
+ * @member {Config}
209
+ * @since 1.0.0
210
+ */
211
+ get config() {
212
+ return this.loader ? this.loader.config : {};
213
+ }
214
+ /**
215
+ * Execute scope after loaded and before app start.
216
+ *
217
+ * Notice:
218
+ * This method is now NOT recommended and regarded as a deprecated one,
219
+ * For plugin development, we should use `didLoad` instead.
220
+ * For application development, we should use `willReady` instead.
221
+ *
222
+ * @see https://eggjs.org/en/advanced/loader.html#beforestart
223
+ *
224
+ * @param {Function} scope function will execute before app start
225
+ * @param {string} [name] scope name, default is empty string
226
+ */
227
+ beforeStart(scope, name) {
228
+ this.deprecate("`beforeStart` was deprecated, please use \"Life Cycles\" instead, see https://www.eggjs.org/advanced/loader#life-cycles");
229
+ this.lifecycle.registerBeforeStart(scope, name ?? "");
230
+ }
231
+ ready(flagOrFunction) {
232
+ if (flagOrFunction === void 0) return this.lifecycle.ready();
233
+ return this.lifecycle.ready(flagOrFunction);
234
+ }
235
+ /**
236
+ * If a client starts asynchronously, you can register `readyCallback`,
237
+ * then the application will wait for the callback to ready
238
+ *
239
+ * It will log when the callback is not invoked after 10s
240
+ *
241
+ * Recommend to use {@link EggCore#beforeStart}
242
+ * @since 1.0.0
243
+ *
244
+ * @param {String} name - readyCallback task name
245
+ * @param {object} opts -
246
+ * - {Number} [timeout=10000] - emit `ready_timeout` when it doesn't finish but reach the timeout
247
+ * - {Boolean} [isWeakDep=false] - whether it's a weak dependency
248
+ * @returns {Function} - a callback
249
+ * @example
250
+ * const done = app.readyCallback('mysql');
251
+ * mysql.ready(done);
252
+ */
253
+ readyCallback(name, opts) {
254
+ this.deprecate("`readyCallback` was deprecated, please use \"Life Cycles\" instead, see https://www.eggjs.org/advanced/loader#life-cycles");
255
+ return this.lifecycle.legacyReadyCallback(name, opts);
256
+ }
257
+ /**
258
+ * Register a function that will be called when app close.
259
+ *
260
+ * Notice:
261
+ * This method is now NOT recommended directly used,
262
+ * Developers SHOULDN'T use app.beforeClose directly now,
263
+ * but in the form of class to implement beforeClose instead.
264
+ *
265
+ * @see https://eggjs.org/en/advanced/loader.html#beforeclose
266
+ *
267
+ * @param {Function} fn - the function that can be generator function or async function.
268
+ */
269
+ beforeClose(fn, name) {
270
+ this.deprecate("`beforeClose` was deprecated, please use \"Life Cycles\" instead, see https://www.eggjs.org/advanced/loader#life-cycles");
271
+ this.lifecycle.registerBeforeClose(fn, name);
272
+ }
273
+ /**
274
+ * Close all, it will close
275
+ * - callbacks registered by beforeClose
276
+ * - emit `close` event
277
+ * - remove add listeners
278
+ *
279
+ * If error is thrown when it's closing, the promise will reject.
280
+ * It will also reject after following call.
281
+ * @returns {Promise} promise
282
+ * @since 1.0.0
283
+ */
284
+ async close() {
285
+ if (this.#closePromise) return this.#closePromise;
286
+ this.#closePromise = this.lifecycle.close();
287
+ return this.#closePromise;
288
+ }
289
+ /**
290
+ * get router
291
+ * @member {Router} EggCore#router
292
+ * @since 1.0.0
293
+ */
294
+ get router() {
295
+ if (this.#router) return this.#router;
296
+ this.#router = new Router({ sensitive: true }, this);
297
+ return this.#router;
298
+ }
299
+ /**
300
+ * Alias to {@link Router#url}
301
+ * @param {String} name - Router name
302
+ * @param {Object} params - more parameters
303
+ * @returns {String} url
304
+ */
305
+ url(name, params) {
306
+ return this.router.url(name, params);
307
+ }
308
+ head(...args) {
309
+ this.router.head.apply(this.router, args);
310
+ return this;
311
+ }
312
+ get(...args) {
313
+ this.router.get.apply(this.router, args);
314
+ return this;
315
+ }
316
+ put(...args) {
317
+ this.router.put.apply(this.router, args);
318
+ return this;
319
+ }
320
+ patch(...args) {
321
+ this.router.patch.apply(this.router, args);
322
+ return this;
323
+ }
324
+ post(...args) {
325
+ this.router.post.apply(this.router, args);
326
+ return this;
327
+ }
328
+ delete(...args) {
329
+ this.router.delete.apply(this.router, args);
330
+ return this;
331
+ }
332
+ del(...args) {
333
+ this.router.del.apply(this.router, args);
334
+ return this;
335
+ }
336
+ all(...args) {
337
+ this.router.all.apply(this.router, args);
338
+ return this;
339
+ }
340
+ resources(...args) {
341
+ this.router.resources.apply(this.router, args);
342
+ return this;
343
+ }
344
+ redirect(source, destination, status = 301) {
345
+ this.router.redirect(source, destination, status);
346
+ return this;
347
+ }
348
+ register(path, methods, middleware, opts) {
349
+ this.router.register(path, methods, middleware, opts);
350
+ return this;
351
+ }
352
+ get [EGG_LOADER]() {
353
+ return EggLoader;
354
+ }
355
+ };
356
+
357
+ //#endregion
358
+ export { Context$1 as Context, EGG_LOADER, EggCore, KoaApplication, KoaContext, KoaRequest, KoaResponse, Request$1 as Request, Response$1 as Response, Router };
@@ -0,0 +1,12 @@
1
+ import { _default } from "./utils/index.js";
2
+ import { CustomLoaderConfigItem, EggAppConfig, EggAppInfo, EggPluginInfo } from "./types.js";
3
+ import { BaseContextClass } from "./base_context_class.js";
4
+ import { Timing, TimingItem } from "./utils/timing.js";
5
+ import { BootImplClass, FunWithFullPath, ILifecycleBoot, Lifecycle, LifecycleOptions } from "./lifecycle.js";
6
+ import { CaseStyle, CaseStyleFunction, EXPORTS, FULLPATH, FileLoader, FileLoaderFilter, FileLoaderInitializer, FileLoaderOptions, FileLoaderParseItem } from "./loader/file_loader.js";
7
+ import { ClassLoader, ClassLoaderOptions, ContextLoader, ContextLoaderOptions } from "./loader/context_loader.js";
8
+ import { EggDirInfo, EggDirInfoType, EggLoader, EggLoaderOptions } from "./loader/egg_loader.js";
9
+ import { Singleton, SingletonCreateMethod, SingletonOptions } from "./singleton.js";
10
+ import { Context, EGG_LOADER, EggCore, EggCoreInitOptions, EggCoreOptions, KoaApplication, KoaContext, KoaMiddlewareFunc, KoaRequest, KoaResponse, MiddlewareFunc, Next, Request, Response, Router } from "./egg.js";
11
+ import { SequencifyResult, SequencifyTask, sequencify } from "./utils/sequencify.js";
12
+ export { BaseContextClass, BootImplClass, CaseStyle, CaseStyleFunction, ClassLoader, ClassLoaderOptions, Context, ContextLoader, ContextLoaderOptions, CustomLoaderConfigItem, EGG_LOADER, EXPORTS, EggAppConfig, EggAppInfo, EggCore, EggCoreInitOptions, EggCoreOptions, EggDirInfo, EggDirInfoType, EggLoader, EggLoaderOptions, EggPluginInfo, FULLPATH, FileLoader, FileLoaderFilter, FileLoaderInitializer, FileLoaderOptions, FileLoaderParseItem, FunWithFullPath, ILifecycleBoot, KoaApplication, KoaContext, KoaMiddlewareFunc, KoaRequest, KoaResponse, Lifecycle, LifecycleOptions, MiddlewareFunc, Next, Request, Response, Router, SequencifyResult, SequencifyTask, Singleton, SingletonCreateMethod, SingletonOptions, Timing, TimingItem, sequencify, _default as utils };
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import utils_default from "./utils/index.js";
2
+ import { BaseContextClass } from "./base_context_class.js";
3
+ import { Timing } from "./utils/timing.js";
4
+ import { Lifecycle } from "./lifecycle.js";
5
+ import { CaseStyle, EXPORTS, FULLPATH, FileLoader } from "./loader/file_loader.js";
6
+ import { ClassLoader, ContextLoader } from "./loader/context_loader.js";
7
+ import { sequencify } from "./utils/sequencify.js";
8
+ import { EggLoader } from "./loader/egg_loader.js";
9
+ import { Singleton } from "./singleton.js";
10
+ import { Context, EGG_LOADER, EggCore, KoaApplication, KoaContext, KoaRequest, KoaResponse, Request, Response, Router } from "./egg.js";
11
+
12
+ export { BaseContextClass, CaseStyle, ClassLoader, Context, ContextLoader, EGG_LOADER, EXPORTS, EggCore, EggLoader, FULLPATH, FileLoader, KoaApplication, KoaContext, KoaRequest, KoaResponse, Lifecycle, Request, Response, Router, Singleton, Timing, sequencify, utils_default as utils };
@@ -0,0 +1,84 @@
1
+ import { Fun } from "./utils/index.js";
2
+ import { Timing } from "./utils/timing.js";
3
+ import { EggCore } from "./egg.js";
4
+ import * as egg_logger0 from "egg-logger";
5
+ import { EggConsoleLogger } from "egg-logger";
6
+ import { EventEmitter } from "node:events";
7
+ import { ReadyFunctionArg } from "get-ready";
8
+ import { Ready as Ready$1 } from "ready-callback";
9
+
10
+ //#region src/lifecycle.d.ts
11
+ interface ILifecycleBoot {
12
+ fullPath?: string;
13
+ /**
14
+ * Ready to call configDidLoad,
15
+ * Config, plugin files are referred,
16
+ * this is the last chance to modify the config.
17
+ */
18
+ configWillLoad?(): void;
19
+ /**
20
+ * Config, plugin files have loaded
21
+ */
22
+ configDidLoad?(): void;
23
+ /**
24
+ * All files have loaded, start plugin here
25
+ */
26
+ didLoad?(): Promise<void>;
27
+ /**
28
+ * All plugins have started, can do some thing before app ready
29
+ */
30
+ willReady?(): Promise<void>;
31
+ /**
32
+ * Worker is ready, can do some things,
33
+ * don't need to block the app boot
34
+ */
35
+ didReady?(err?: Error): Promise<void>;
36
+ /**
37
+ * Server is listening
38
+ */
39
+ serverDidReady?(): Promise<void>;
40
+ /**
41
+ * Do some thing before app close
42
+ */
43
+ beforeClose?(): Promise<void>;
44
+ }
45
+ type BootImplClass<T = ILifecycleBoot> = new (...args: any[]) => T;
46
+ interface LifecycleOptions {
47
+ baseDir: string;
48
+ app: EggCore;
49
+ logger: EggConsoleLogger;
50
+ }
51
+ type FunWithFullPath = Fun & {
52
+ fullPath?: string;
53
+ };
54
+ declare class Lifecycle extends EventEmitter {
55
+ #private;
56
+ loadReady: Ready$1;
57
+ bootReady: Ready$1;
58
+ options: LifecycleOptions;
59
+ readyTimeout: number;
60
+ constructor(options: Partial<LifecycleOptions>);
61
+ ready(): Promise<void>;
62
+ ready(flagOrFunction: ReadyFunctionArg): void;
63
+ get app(): EggCore;
64
+ get logger(): EggConsoleLogger<egg_logger0.LoggerOptions>;
65
+ get timing(): Timing;
66
+ legacyReadyCallback(name: string, opt?: object): (...args: unknown[]) => void;
67
+ addBootHook(bootHootOrBootClass: BootImplClass | ILifecycleBoot): void;
68
+ addFunctionAsBootHook<T = EggCore>(hook: (app: T) => void, fullPath?: string): void;
69
+ /**
70
+ * init boots and trigger config did config
71
+ */
72
+ init(): void;
73
+ registerBeforeStart(scope: Fun, name: string): void;
74
+ registerBeforeClose(fn: FunWithFullPath, fullPath?: string): void;
75
+ close(): Promise<void>;
76
+ triggerConfigWillLoad(): void;
77
+ triggerConfigDidLoad(): void;
78
+ triggerDidLoad(): void;
79
+ triggerWillReady(): void;
80
+ triggerDidReady(err?: Error): Promise<void>;
81
+ triggerServerDidReady(): Promise<void>;
82
+ }
83
+ //#endregion
84
+ export { BootImplClass, FunWithFullPath, ILifecycleBoot, Lifecycle, LifecycleOptions };