@eggjs/tegg-lifecycle 3.15.0 → 3.17.0
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EggObject, EggObjectLifeCycleContext } from '@eggjs/tegg-runtime';
|
|
1
2
|
/**
|
|
2
3
|
* lifecycle hook interface for egg object
|
|
3
4
|
*/
|
|
@@ -5,25 +6,25 @@ export interface EggObjectLifecycle {
|
|
|
5
6
|
/**
|
|
6
7
|
* call after construct
|
|
7
8
|
*/
|
|
8
|
-
postConstruct?(): Promise<void>;
|
|
9
|
+
postConstruct?(ctx: EggObjectLifeCycleContext, eggObj: EggObject): Promise<void>;
|
|
9
10
|
/**
|
|
10
11
|
* call before inject deps
|
|
11
12
|
*/
|
|
12
|
-
preInject?(): Promise<void>;
|
|
13
|
+
preInject?(ctx: EggObjectLifeCycleContext, eggObj: EggObject): Promise<void>;
|
|
13
14
|
/**
|
|
14
15
|
* call after inject deps
|
|
15
16
|
*/
|
|
16
|
-
postInject?(): Promise<void>;
|
|
17
|
+
postInject?(ctx: EggObjectLifeCycleContext, eggObj: EggObject): Promise<void>;
|
|
17
18
|
/**
|
|
18
19
|
* before object is ready
|
|
19
20
|
*/
|
|
20
|
-
init?(): Promise<void>;
|
|
21
|
+
init?(ctx: EggObjectLifeCycleContext, eggObj: EggObject): Promise<void>;
|
|
21
22
|
/**
|
|
22
23
|
* call before destroy
|
|
23
24
|
*/
|
|
24
|
-
preDestroy?(): Promise<void>;
|
|
25
|
+
preDestroy?(ctx: EggObjectLifeCycleContext, eggObj: EggObject): Promise<void>;
|
|
25
26
|
/**
|
|
26
27
|
* destroy the object
|
|
27
28
|
*/
|
|
28
|
-
destroy?(): Promise<void>;
|
|
29
|
+
destroy?(ctx: EggObjectLifeCycleContext, eggObj: EggObject): Promise<void>;
|
|
29
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EggProtoImplClass } from '@eggjs/core-decorator';
|
|
2
|
-
import { EggPrototype } from '@eggjs/tegg-metadata';
|
|
2
|
+
import type { EggPrototype } from '@eggjs/tegg-metadata';
|
|
3
3
|
import { LifecycleContext, LifecycleHook, LifecycleObject } from './LifecycleHook';
|
|
4
4
|
import { EggObjectLifecycle } from './EggObjectLifecycle';
|
|
5
5
|
export type LifecycleHookName = keyof EggObjectLifecycle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/tegg-lifecycle",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0",
|
|
4
4
|
"description": "tegg lifecycle definition",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"egg",
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@eggjs/core-decorator": "^3.
|
|
43
|
-
"@eggjs/tegg-metadata": "^3.15.0"
|
|
42
|
+
"@eggjs/core-decorator": "^3.17.0"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
45
|
+
"@eggjs/tegg-metadata": "^3.17.0",
|
|
46
|
+
"@eggjs/tegg-runtime": "^3.17.0",
|
|
46
47
|
"@types/mocha": "^10.0.1",
|
|
47
48
|
"@types/node": "^20.2.4",
|
|
48
49
|
"cross-env": "^7.0.3",
|
|
@@ -50,5 +51,5 @@
|
|
|
50
51
|
"ts-node": "^10.9.1",
|
|
51
52
|
"typescript": "^5.0.4"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f049412d99d784468f48e030dcc501c428112d63"
|
|
54
55
|
}
|