@asenajs/ioc 0.0.0-stage → 0.1.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.
Files changed (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +219 -2
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +2 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/CircularDependencyDetector.d.ts +49 -0
  7. package/dist/lib/CircularDependencyDetector.js +69 -0
  8. package/dist/lib/CircularDependencyDetector.js.map +1 -0
  9. package/dist/lib/Container.d.ts +247 -0
  10. package/dist/lib/Container.js +563 -0
  11. package/dist/lib/Container.js.map +1 -0
  12. package/dist/lib/IocApplication.d.ts +88 -0
  13. package/dist/lib/IocApplication.js +110 -0
  14. package/dist/lib/IocApplication.js.map +1 -0
  15. package/dist/lib/IocEngine.d.ts +173 -0
  16. package/dist/lib/IocEngine.js +725 -0
  17. package/dist/lib/IocEngine.js.map +1 -0
  18. package/dist/lib/component/Scope.d.ts +4 -0
  19. package/dist/lib/component/Scope.js +6 -0
  20. package/dist/lib/component/Scope.js.map +1 -0
  21. package/dist/lib/component/componentRegistry.d.ts +34 -0
  22. package/dist/lib/component/componentRegistry.js +134 -0
  23. package/dist/lib/component/componentRegistry.js.map +1 -0
  24. package/dist/lib/component/componentUtils.d.ts +16 -0
  25. package/dist/lib/component/componentUtils.js +44 -0
  26. package/dist/lib/component/componentUtils.js.map +1 -0
  27. package/dist/lib/component/decorators/Component.d.ts +8 -0
  28. package/dist/lib/component/decorators/Component.js +12 -0
  29. package/dist/lib/component/decorators/Component.js.map +1 -0
  30. package/dist/lib/component/decorators/Implements.d.ts +7 -0
  31. package/dist/lib/component/decorators/Implements.js +14 -0
  32. package/dist/lib/component/decorators/Implements.js.map +1 -0
  33. package/dist/lib/component/decorators/Inject.d.ts +29 -0
  34. package/dist/lib/component/decorators/Inject.js +82 -0
  35. package/dist/lib/component/decorators/Inject.js.map +1 -0
  36. package/dist/lib/component/decorators/OnStart.d.ts +20 -0
  37. package/dist/lib/component/decorators/OnStart.js +33 -0
  38. package/dist/lib/component/decorators/OnStart.js.map +1 -0
  39. package/dist/lib/component/decorators/OnStop.d.ts +15 -0
  40. package/dist/lib/component/decorators/OnStop.js +28 -0
  41. package/dist/lib/component/decorators/OnStop.js.map +1 -0
  42. package/dist/lib/component/decorators/PostConstruct.d.ts +14 -0
  43. package/dist/lib/component/decorators/PostConstruct.js +16 -0
  44. package/dist/lib/component/decorators/PostConstruct.js.map +1 -0
  45. package/dist/lib/component/decorators/PostProcessor.d.ts +25 -0
  46. package/dist/lib/component/decorators/PostProcessor.js +29 -0
  47. package/dist/lib/component/decorators/PostProcessor.js.map +1 -0
  48. package/dist/lib/component/decorators/Service.d.ts +8 -0
  49. package/dist/lib/component/decorators/Service.js +12 -0
  50. package/dist/lib/component/decorators/Service.js.map +1 -0
  51. package/dist/lib/component/decorators/Strategy.d.ts +9 -0
  52. package/dist/lib/component/decorators/Strategy.js +29 -0
  53. package/dist/lib/component/decorators/Strategy.js.map +1 -0
  54. package/dist/lib/component/decorators/Value.d.ts +29 -0
  55. package/dist/lib/component/decorators/Value.js +41 -0
  56. package/dist/lib/component/decorators/Value.js.map +1 -0
  57. package/dist/lib/component/decorators/index.d.ts +11 -0
  58. package/dist/lib/component/decorators/index.js +12 -0
  59. package/dist/lib/component/decorators/index.js.map +1 -0
  60. package/dist/lib/component/decorators/legacyDecorator.d.ts +15 -0
  61. package/dist/lib/component/decorators/legacyDecorator.js +24 -0
  62. package/dist/lib/component/decorators/legacyDecorator.js.map +1 -0
  63. package/dist/lib/component/index.d.ts +3 -0
  64. package/dist/lib/component/index.js +4 -0
  65. package/dist/lib/component/index.js.map +1 -0
  66. package/dist/lib/constants/ComponentConstants.d.ts +21 -0
  67. package/dist/lib/constants/ComponentConstants.js +25 -0
  68. package/dist/lib/constants/ComponentConstants.js.map +1 -0
  69. package/dist/lib/constants/index.d.ts +1 -0
  70. package/dist/lib/constants/index.js +2 -0
  71. package/dist/lib/constants/index.js.map +1 -0
  72. package/dist/lib/decorators/CoreService.d.ts +11 -0
  73. package/dist/lib/decorators/CoreService.js +30 -0
  74. package/dist/lib/decorators/CoreService.js.map +1 -0
  75. package/dist/lib/decorators/index.d.ts +1 -0
  76. package/dist/lib/decorators/index.js +2 -0
  77. package/dist/lib/decorators/index.js.map +1 -0
  78. package/dist/lib/helper/fileHelper.d.ts +1 -0
  79. package/dist/lib/helper/fileHelper.js +29 -0
  80. package/dist/lib/helper/fileHelper.js.map +1 -0
  81. package/dist/lib/helper/iocHelper.d.ts +2 -0
  82. package/dist/lib/helper/iocHelper.js +12 -0
  83. package/dist/lib/helper/iocHelper.js.map +1 -0
  84. package/dist/lib/helper/valueResolver.d.ts +24 -0
  85. package/dist/lib/helper/valueResolver.js +37 -0
  86. package/dist/lib/helper/valueResolver.js.map +1 -0
  87. package/dist/lib/index.d.ts +12 -0
  88. package/dist/lib/index.js +13 -0
  89. package/dist/lib/index.js.map +1 -0
  90. package/dist/lib/lifecycle/LifecycleService.d.ts +78 -0
  91. package/dist/lib/lifecycle/LifecycleService.js +181 -0
  92. package/dist/lib/lifecycle/LifecycleService.js.map +1 -0
  93. package/dist/lib/lifecycle/LifecycleState.d.ts +20 -0
  94. package/dist/lib/lifecycle/LifecycleState.js +22 -0
  95. package/dist/lib/lifecycle/LifecycleState.js.map +1 -0
  96. package/dist/lib/lifecycle/index.d.ts +2 -0
  97. package/dist/lib/lifecycle/index.js +3 -0
  98. package/dist/lib/lifecycle/index.js.map +1 -0
  99. package/dist/lib/logger/IocLogger.d.ts +35 -0
  100. package/dist/lib/logger/IocLogger.js +2 -0
  101. package/dist/lib/logger/IocLogger.js.map +1 -0
  102. package/dist/lib/logger/index.d.ts +1 -0
  103. package/dist/lib/logger/index.js +2 -0
  104. package/dist/lib/logger/index.js.map +1 -0
  105. package/dist/lib/types/Class.d.ts +1 -0
  106. package/dist/lib/types/Class.js +2 -0
  107. package/dist/lib/types/Class.js.map +1 -0
  108. package/dist/lib/types/ComponentPostProcessor.d.ts +30 -0
  109. package/dist/lib/types/ComponentPostProcessor.js +2 -0
  110. package/dist/lib/types/ComponentPostProcessor.js.map +1 -0
  111. package/dist/lib/types/ContainerService.d.ts +6 -0
  112. package/dist/lib/types/ContainerService.js +2 -0
  113. package/dist/lib/types/ContainerService.js.map +1 -0
  114. package/dist/lib/types/ICoreService.d.ts +9 -0
  115. package/dist/lib/types/ICoreService.js +2 -0
  116. package/dist/lib/types/ICoreService.js.map +1 -0
  117. package/dist/lib/types/ICoreServiceNames.d.ts +10 -0
  118. package/dist/lib/types/ICoreServiceNames.js +12 -0
  119. package/dist/lib/types/ICoreServiceNames.js.map +1 -0
  120. package/dist/lib/types/InjectableComponent.d.ts +42 -0
  121. package/dist/lib/types/InjectableComponent.js +2 -0
  122. package/dist/lib/types/InjectableComponent.js.map +1 -0
  123. package/dist/lib/types/IocConfig.d.ts +11 -0
  124. package/dist/lib/types/IocConfig.js +2 -0
  125. package/dist/lib/types/IocConfig.js.map +1 -0
  126. package/dist/lib/types/LifecycleComponent.d.ts +29 -0
  127. package/dist/lib/types/LifecycleComponent.js +2 -0
  128. package/dist/lib/types/LifecycleComponent.js.map +1 -0
  129. package/dist/lib/types/decorators/ComponentParams.d.ts +5 -0
  130. package/dist/lib/types/decorators/ComponentParams.js +2 -0
  131. package/dist/lib/types/decorators/ComponentParams.js.map +1 -0
  132. package/dist/lib/types/decorators/ComponentType.d.ts +14 -0
  133. package/dist/lib/types/decorators/ComponentType.js +10 -0
  134. package/dist/lib/types/decorators/ComponentType.js.map +1 -0
  135. package/dist/lib/types/decorators/ServiceParams.d.ts +2 -0
  136. package/dist/lib/types/decorators/ServiceParams.js +2 -0
  137. package/dist/lib/types/decorators/ServiceParams.js.map +1 -0
  138. package/dist/lib/types/index.d.ts +11 -0
  139. package/dist/lib/types/index.js +12 -0
  140. package/dist/lib/types/index.js.map +1 -0
  141. package/dist/lib/utils/errorChain.d.ts +4 -0
  142. package/dist/lib/utils/errorChain.js +29 -0
  143. package/dist/lib/utils/errorChain.js.map +1 -0
  144. package/dist/lib/utils/typedMetadata.d.ts +54 -0
  145. package/dist/lib/utils/typedMetadata.js +97 -0
  146. package/dist/lib/utils/typedMetadata.js.map +1 -0
  147. package/package.json +73 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IocEngine.js","sourceRoot":"","sources":["../../lib/IocEngine.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAGL,aAAa,EAGb,iBAAiB,GAIlB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAGvE;;;GAGG;AACH;;;GAGG;AACH,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAG/B,IAAM,SAAS,GAAf,MAAM,SAAS;IACb,WAAW,GAAG,WAAW,CAAC;IAGzB,UAAU,CAAY;IAGtB,MAAM,CAAY;IAElB,WAAW,GAA0B,EAAE,CAAC;IAExC,MAAM,CAAa;IAE3B,2EAA2E;IACnE,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAEvC,sEAAsE;IAC9D,eAAe,GAAG,IAAI,GAAG,EAAS,CAAC;IAE3C;;;;OAIG;IACI,SAAS,CAAC,MAAkB;QACjC,IAAI,CAAC,M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WAAW,EAAE,WAAW,CAAC,CAAC;gBAEhF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;YAClE,CAAC;YAED,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF,CAAA;AAj4BS;IADP,MAAM,CAAC,WAAW,CAAC;;6CACU;AAGtB;IADP,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC;;yCACP;AAPf,SAAS;IADrB,WAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC;GAC7B,SAAS,CAq4BrB"}
@@ -0,0 +1,4 @@
1
+ export declare enum Scope {
2
+ SINGLETON = 0,
3
+ PROTOTYPE = 1
4
+ }
@@ -0,0 +1,6 @@
1
+ export var Scope;
2
+ (function (Scope) {
3
+ Scope[Scope["SINGLETON"] = 0] = "SINGLETON";
4
+ Scope[Scope["PROTOTYPE"] = 1] = "PROTOTYPE";
5
+ })(Scope || (Scope = {}));
6
+ //# sourceMappingURL=Scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../../lib/component/Scope.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,2CAAS,CAAA;IACT,2CAAS,CAAA;AACX,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB"}
@@ -0,0 +1,34 @@
1
+ import type { Class } from '../types';
2
+ /**
3
+ * @description Treat the frames under another source tree like this package's own: never a
4
+ * declaration site.
5
+ *
6
+ * For a framework whose decorators wrap the one `defineComponent` returns in a function of their
7
+ * own. That function's frame sits between the package and the class, so without this the
8
+ * component is attributed to the framework's file - and one declared in the entry file is never
9
+ * found.
10
+ * @param {string} root - Absolute path of the directory that holds the wrapping decorators
11
+ * @returns {void}
12
+ */
13
+ export declare const skipDeclarationFramesUnder: (root: string) => void;
14
+ /**
15
+ * @description Record a decorated class along with the file it was declared in.
16
+ * Called from `defineComponent`, the single place that marks a class as an IoC
17
+ * component.
18
+ * @param {Class} target - The decorated class
19
+ * @returns {void}
20
+ */
21
+ export declare const registerDeclaredComponent: (target: Class) => void;
22
+ /**
23
+ * @description Every registered class that was declared in one of the given files.
24
+ * @param {ReadonlySet<string>} sourceFiles - Absolute, resolved file paths
25
+ * @returns {Class[]} Classes declared in those files
26
+ */
27
+ export declare const getComponentsDeclaredIn: (sourceFiles: ReadonlySet<string>) => Class[];
28
+ /**
29
+ * @description Clear the registry. The registry outlives any single application,
30
+ * so tests that boot more than one app in the same process use this to keep
31
+ * components from one run leaking into the next.
32
+ * @returns {void}
33
+ */
34
+ export declare const resetComponentRegistry: () => void;
@@ -0,0 +1,134 @@
1
+ import * as path from 'node:path';
2
+ /**
3
+ * @description Registry of every class a component decorator has been applied to,
4
+ * keyed by the class itself and valued by the file it was declared in.
5
+ *
6
+ * The IoC scan cannot import the application entry file. While the entry awaits
7
+ * the bootstrap call at module scope it sits in the *evaluating-async*
8
+ * state, so importing it is a cyclic dynamic import that never settles - Bun
9
+ * >= 1.3.14 follows the spec here and waits on an evaluation that can only finish
10
+ * once the scan returns. Declaring components directly in the entry file is still
11
+ * supported: their decorators have already run by the time the scan starts, so the
12
+ * scan reads them from this registry instead of from a module namespace.
13
+ *
14
+ * Stored under `Symbol.for` so a project that ends up with two copies of
15
+ * `@asenajs/ioc` still shares a single registry.
16
+ */
17
+ const REGISTRY_KEY = Symbol.for('asena.ioc.componentRegistry');
18
+ const getRegistry = () => {
19
+ const store = globalThis;
20
+ if (!store[REGISTRY_KEY]) {
21
+ store[REGISTRY_KEY] = new Map();
22
+ }
23
+ return store[REGISTRY_KEY];
24
+ };
25
+ /**
26
+ * This package's own source tree - `<pkg>/lib` when running from source,
27
+ * `<pkg>/dist/lib` when running the build. Frames below it belong to the package itself
28
+ * (the decorator factory, this file) and are never a declaration site.
29
+ *
30
+ * Deliberately narrower than the package root: test fixtures and example apps live
31
+ * beside `lib`, and skipping the whole package would swallow them too.
32
+ */
33
+ const SOURCE_ROOT = path.resolve(import.meta.dir, '..');
34
+ const skippedRoots = [SOURCE_ROOT];
35
+ /**
36
+ * @description Treat the frames under another source tree like this package's own: never a
37
+ * declaration site.
38
+ *
39
+ * For a framework whose decorators wrap the one `defineComponent` returns in a function of their
40
+ * own. That function's frame sits between the package and the class, so without this the
41
+ * component is attributed to the framework's file - and one declared in the entry file is never
42
+ * found.
43
+ * @param {string} root - Absolute path of the directory that holds the wrapping decorators
44
+ * @returns {void}
45
+ */
46
+ export const skipDeclarationFramesUnder = (root) => {
47
+ skippedRoots.push(root);
48
+ };
49
+ /**
50
+ * Matches the trailing `/abs/path/file.ts:12:34` of a stack frame, with or without
51
+ * parens. The column is optional: the module-level frame that a top-level class
52
+ * declaration produces carries only a line number.
53
+ */
54
+ const STACK_FRAME = /\(?((?:\/|[A-Za-z]:\\)[^()]+?):\d+(?::\d+)?\)?\s*$/;
55
+ /**
56
+ * `reflect-metadata` installs `Reflect.decorate`, which TypeScript's `__decorate`
57
+ * helper uses to apply decorators - so it sits between us and the declaring file.
58
+ * Matches both a `node_modules/reflect-metadata/` layout and Bun's flattened
59
+ * install cache (`reflect-metadata@0.2.2@@@1/`).
60
+ */
61
+ const DECORATOR_PLUMBING = /[/\\]reflect-metadata[@/\\]/;
62
+ /**
63
+ * @description Resolve the file a decorator was applied in, by walking the call
64
+ * stack past this package's own frames, past the decorator plumbing, and past runtime
65
+ * internals (`bun:*`, `node:*`, which carry no absolute path and therefore never
66
+ * match `STACK_FRAME`).
67
+ *
68
+ * Skipping only these - rather than everything under `node_modules` - keeps a
69
+ * component declared inside a third-party package attributed to *that* package's
70
+ * file. It then never matches an entry path, so importing such a package from the
71
+ * entry file does not silently pull its components into the container.
72
+ *
73
+ * Returns null when the site cannot be determined; such a component is simply
74
+ * never treated as entry-declared, which is the safe direction - it means the
75
+ * file scan stays the only source for it.
76
+ */
77
+ const declarationSite = () => {
78
+ const previousLimit = Error.stackTraceLimit;
79
+ // The package's own frames plus the decorator plumbing put the declaring frame around
80
+ // 6 levels up; a small limit keeps the capture cheap
81
+ Error.stackTraceLimit = 20;
82
+ const stack = new Error().stack;
83
+ Error.stackTraceLimit = previousLimit;
84
+ if (!stack) {
85
+ return null;
86
+ }
87
+ for (const line of stack.split('\n')) {
88
+ const match = STACK_FRAME.exec(line);
89
+ if (!match)
90
+ continue;
91
+ const file = match[1];
92
+ if (skippedRoots.some((root) => file.startsWith(root)) || DECORATOR_PLUMBING.test(file))
93
+ continue;
94
+ return file;
95
+ }
96
+ return null;
97
+ };
98
+ /**
99
+ * @description Record a decorated class along with the file it was declared in.
100
+ * Called from `defineComponent`, the single place that marks a class as an IoC
101
+ * component.
102
+ * @param {Class} target - The decorated class
103
+ * @returns {void}
104
+ */
105
+ export const registerDeclaredComponent = (target) => {
106
+ getRegistry().set(target, declarationSite());
107
+ };
108
+ /**
109
+ * @description Every registered class that was declared in one of the given files.
110
+ * @param {ReadonlySet<string>} sourceFiles - Absolute, resolved file paths
111
+ * @returns {Class[]} Classes declared in those files
112
+ */
113
+ export const getComponentsDeclaredIn = (sourceFiles) => {
114
+ if (!sourceFiles.size) {
115
+ return [];
116
+ }
117
+ const components = [];
118
+ for (const [target, file] of getRegistry()) {
119
+ if (file !== null && sourceFiles.has(file)) {
120
+ components.push(target);
121
+ }
122
+ }
123
+ return components;
124
+ };
125
+ /**
126
+ * @description Clear the registry. The registry outlives any single application,
127
+ * so tests that boot more than one app in the same process use this to keep
128
+ * components from one run leaking into the next.
129
+ * @returns {void}
130
+ */
131
+ export const resetComponentRegistry = () => {
132
+ getRegistry().clear();
133
+ };
134
+ //# sourceMappingURL=componentRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentRegistry.js","sourceRoot":"","sources":["../../../lib/component/component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C,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ComponentKind, ComponentParams } from '../types';
2
+ /**
3
+ * Builds the class decorator behind every component decorator, the built-in ones included.
4
+ *
5
+ * A string `params` is the component name. A decorator whose own string argument means something
6
+ * else has to turn it into an object before calling this.
7
+ *
8
+ * A decorator that wraps the returned one in a function of its own puts that function's stack
9
+ * frame where the declaring file is looked for - see `skipDeclarationFramesUnder`.
10
+ *
11
+ * @param {ComponentKind} componentType - The kind to mark the class as, readable through `Container.resolveAll`
12
+ * @param {ComponentParams | string} params - Name and scope, or just the name
13
+ * @param {Function} extra - Runs on the class once it carries its name and scope
14
+ * @returns {ClassDecorator} - The class decorator for the component.
15
+ */
16
+ export declare const defineComponent: <T extends ComponentParams>(componentType: ComponentKind, params: T | string, extra?: (target: Function) => void) => ClassDecorator;
@@ -0,0 +1,44 @@
1
+ import { ComponentConstants } from '../constants';
2
+ import { defineTypedMetadata, getOwnTypedMetadata } from '../utils/typedMetadata';
3
+ import { Scope } from './Scope';
4
+ import { registerDeclaredComponent } from './componentRegistry';
5
+ /**
6
+ * Builds the class decorator behind every component decorator, the built-in ones included.
7
+ *
8
+ * A string `params` is the component name. A decorator whose own string argument means something
9
+ * else has to turn it into an object before calling this.
10
+ *
11
+ * A decorator that wraps the returned one in a function of its own puts that function's stack
12
+ * frame where the declaring file is looked for - see `skipDeclarationFramesUnder`.
13
+ *
14
+ * @param {ComponentKind} componentType - The kind to mark the class as, readable through `Container.resolveAll`
15
+ * @param {ComponentParams | string} params - Name and scope, or just the name
16
+ * @param {Function} extra - Runs on the class once it carries its name and scope
17
+ * @returns {ClassDecorator} - The class decorator for the component.
18
+ */
19
+ export const defineComponent = (componentType, params, extra) => {
20
+ return (target) => {
21
+ const { scope = Scope.SINGLETON, name = target.name } = paramsGenerator(params);
22
+ defineTypedMetadata(componentType, true, target);
23
+ defineTypedMetadata(ComponentConstants.IOCObjectKey, true, target);
24
+ // Records the declaring file too, so components written directly in the entry
25
+ // file stay discoverable - the scan has to skip that file (see componentRegistry)
26
+ registerDeclaredComponent(target);
27
+ defineTypedMetadata(ComponentConstants.ScopeKey, scope, target);
28
+ defineTypedMetadata(ComponentConstants.NameKey, name, target);
29
+ if (extra) {
30
+ extra(target);
31
+ }
32
+ if (getOwnTypedMetadata(ComponentConstants.DependencyKey, target) === undefined) {
33
+ defineTypedMetadata(ComponentConstants.DependencyKey, {}, target);
34
+ }
35
+ if (getOwnTypedMetadata(ComponentConstants.StrategyKey, target) === undefined) {
36
+ defineTypedMetadata(ComponentConstants.StrategyKey, {}, target);
37
+ }
38
+ };
39
+ };
40
+ const paramsGenerator = (params) => {
41
+ const defaultParam = { name: undefined, scope: undefined };
42
+ return typeof params === 'string' ? { name: params } : params || defaultParam;
43
+ };
44
+ //# sourceMappingURL=componentUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentUtils.js","sourceRoot":"","sources":["../../../lib/component/componentUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,aAA4B,EAC5B,MAAkB,EAClB,KAAkC,EAClB,EAAE;IAClB,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAEhF,mBAAmB,CAAU,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAE1D,mBAAmB,CAAU,kBAAkB,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAE5E,8EAA8E;QAC9E,kFAAkF;QAClF,yBAAyB,CAAC,MAAe,CAAC,CAAC;QAE3C,mBAAmB,CAAQ,kBAAkB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAEvE,mBAAmB,CAAS,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAEtE,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,CAAC,MAAM,CAAC,CAAC;QAChB,CAAC;QAED,IAAI,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9F,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAClF,CAAC;QAED,IAAI,mBAAmB,CAAa,kBAAkB,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1F,mBAAmB,CAAa,kBAAkB,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,MAAgC,EAAmB,EAAE;IAC5E,MAAM,YAAY,GAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE5E,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,YAAY,CAAC;AAChF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ComponentParams } from '../../types';
2
+ /**
3
+ * Decorator for defining a generic Component.
4
+ *
5
+ * @param {ComponentParams | string} [params] - Optional parameters for the component. A string can be used for defining the name.
6
+ * @returns {ClassDecorator} - The class decorator for the component.
7
+ */
8
+ export declare const Component: (params?: ComponentParams | string) => ClassDecorator;
@@ -0,0 +1,12 @@
1
+ import { ComponentType } from '../../types';
2
+ import { defineComponent } from '../componentUtils';
3
+ /**
4
+ * Decorator for defining a generic Component.
5
+ *
6
+ * @param {ComponentParams | string} [params] - Optional parameters for the component. A string can be used for defining the name.
7
+ * @returns {ClassDecorator} - The class decorator for the component.
8
+ */
9
+ export const Component = (params) => {
10
+ return defineComponent(ComponentType.COMPONENT, params);
11
+ };
12
+ //# sourceMappingURL=Component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Component.js","sourceRoot":"","sources":["../../../../lib/component/decorators/Component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAiC,EAAkB,EAAE;IAC7E,OAAO,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A class decorator that adds metadata to the target class.
3
+ *
4
+ * @param {string} implement - The name of the interface to implement.
5
+ * @returns {ClassDecorator} - The class decorator function.
6
+ */
7
+ export declare function Implements(implement: string): ClassDecorator;
@@ -0,0 +1,14 @@
1
+ import { ComponentConstants } from '../../constants';
2
+ import { defineTypedMetadata } from '../../utils/typedMetadata';
3
+ /**
4
+ * A class decorator that adds metadata to the target class.
5
+ *
6
+ * @param {string} implement - The name of the interface to implement.
7
+ * @returns {ClassDecorator} - The class decorator function.
8
+ */
9
+ export function Implements(implement) {
10
+ return (target) => {
11
+ defineTypedMetadata(ComponentConstants.InterfaceKey, implement, target);
12
+ };
13
+ }
14
+ //# sourceMappingURL=Implements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Implements.js","sourceRoot":"","sources":["../../../../lib/component/decorators/Implements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,mBAAmB,CAAS,kBAAkB,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAClF,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Class } from '../../types';
2
+ /**
3
+ * Property decorator to inject a dependency.
4
+ *
5
+ * Supports three syntaxes:
6
+ * 1. Class injection: `@Inject(UserService)`
7
+ * 2. String injection with expression: `@Inject('UserService', (s) => s.getUsers())`
8
+ * 3. Tuple injection (helper pattern): `@Inject(channel('chat'))` where channel() returns [serviceName, expression]
9
+ *
10
+ * @param {Class | string | readonly [string, (injectedClass: any) => any]} Injection - The dependency to inject
11
+ * @param expression - Optional expression to evaluate on the injected class (only used with Class or string)
12
+ * @returns {PropertyDecorator} - The property decorator function
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * // Class injection
17
+ * @Inject(UserService)
18
+ * private userService: UserService;
19
+ *
20
+ * // String injection with expression
21
+ * @Inject('UserService', (s) => s.getAllUsers())
22
+ * private users: User[];
23
+ *
24
+ * // Tuple injection (helper pattern)
25
+ * @Inject(channel('chat'))
26
+ * private chat: Channel<'chat'>;
27
+ * ```
28
+ */
29
+ export declare const Inject: (Injection: Class | string | readonly [string | Class, (injectedClass: any) => any], expression?: (injectedClass: any) => any) => PropertyDecorator;
@@ -0,0 +1,82 @@
1
+ import { ComponentConstants } from '../../constants';
2
+ import { defineTypedMetadata, getOwnTypedMetadata, getTypedMetadata } from '../../utils/typedMetadata';
3
+ import { assertLegacyDecorator } from './legacyDecorator';
4
+ /**
5
+ * Property decorator to inject a dependency.
6
+ *
7
+ * Supports three syntaxes:
8
+ * 1. Class injection: `@Inject(UserService)`
9
+ * 2. String injection with expression: `@Inject('UserService', (s) => s.getUsers())`
10
+ * 3. Tuple injection (helper pattern): `@Inject(channel('chat'))` where channel() returns [serviceName, expression]
11
+ *
12
+ * @param {Class | string | readonly [string, (injectedClass: any) => any]} Injection - The dependency to inject
13
+ * @param expression - Optional expression to evaluate on the injected class (only used with Class or string)
14
+ * @returns {PropertyDecorator} - The property decorator function
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Class injection
19
+ * @Inject(UserService)
20
+ * private userService: UserService;
21
+ *
22
+ * // String injection with expression
23
+ * @Inject('UserService', (s) => s.getAllUsers())
24
+ * private users: User[];
25
+ *
26
+ * // Tuple injection (helper pattern)
27
+ * @Inject(channel('chat'))
28
+ * private chat: Channel<'chat'>;
29
+ * ```
30
+ */
31
+ export const Inject = (Injection, expression) => {
32
+ return (target, propertyKey) => {
33
+ assertLegacyDecorator('Inject', propertyKey);
34
+ let dependencyName;
35
+ let resolvedExpression = expression;
36
+ // Kept only for class-based injections - string injections carry no class reference
37
+ let dependencyClass;
38
+ // Check if Injection is a tuple [serviceName, expression]
39
+ if (Array.isArray(Injection) && Injection.length === 2) {
40
+ const [name, tupleExpression] = Injection;
41
+ // Check Name type, it can be a Class or String
42
+ dependencyName = typeof name === 'string' ? name : getTypedMetadata(ComponentConstants.NameKey, name);
43
+ if (typeof name !== 'string') {
44
+ dependencyClass = name;
45
+ }
46
+ resolvedExpression = tupleExpression;
47
+ }
48
+ else if (typeof Injection === 'string') {
49
+ dependencyName = Injection;
50
+ }
51
+ else {
52
+ // Injection is a Class
53
+ dependencyName = getTypedMetadata(ComponentConstants.NameKey, Injection);
54
+ // The `length === 2` guard above stops TS narrowing the tuple out of this branch
55
+ dependencyClass = Injection;
56
+ }
57
+ // Store dependency
58
+ const dependencies = getOwnTypedMetadata(ComponentConstants.DependencyKey, target.constructor) || {};
59
+ if (!dependencies[propertyKey]) {
60
+ dependencies[propertyKey] = dependencyName;
61
+ }
62
+ defineTypedMetadata(ComponentConstants.DependencyKey, dependencies, target.constructor);
63
+ // Store the class reference (class-based injections only) so tooling can
64
+ // derive the real method shape without instantiating the dependency
65
+ if (dependencyClass) {
66
+ const dependencyClasses = getOwnTypedMetadata(ComponentConstants.DependencyClassKey, target.constructor) || {};
67
+ if (!dependencyClasses[propertyKey]) {
68
+ dependencyClasses[propertyKey] = dependencyClass;
69
+ }
70
+ defineTypedMetadata(ComponentConstants.DependencyClassKey, dependencyClasses, target.constructor);
71
+ }
72
+ // Store expression if provided
73
+ if (resolvedExpression) {
74
+ const expressions = getOwnTypedMetadata(ComponentConstants.ExpressionKey, target.constructor) || {};
75
+ if (!expressions[propertyKey]) {
76
+ expressions[propertyKey] = resolvedExpression;
77
+ }
78
+ defineTypedMetadata(ComponentConstants.ExpressionKey, expressions, target.constructor);
79
+ }
80
+ };
81
+ };
82
+ //# sourceMappingURL=Inject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Inject.js","sourceRoot":"","sources":["../../../../lib/component/decorators/Inject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,SAAkF,EAClF,UAAwC,EACrB,EAAE;IACrB,OAAO,CAAC,MAAc,EAAE,WAAmB,EAAQ,EAAE;QACnD,qBAAqB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAE7C,IAAI,cAAsB,CAAC;QAC3B,IAAI,kBAAkB,GAA8C,UAAU,CAAC;QAC/E,oFAAoF;QACpF,IAAI,eAAkC,CAAC;QAEvC,0DAA0D;QAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvD,MAAM,CA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CACjB,kBAAkB,CAAC,kBAAkB,EACrC,iBAAiB,EACjB,MAAM,CAAC,WAAW,CACnB,CAAC;QACJ,CAAC;QAED,+BAA+B;QAC/B,IAAI,kBAAkB,EAAE,CAAC;YACvB,MAAM,WAAW,GACf,mBAAmB,CAAc,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAE/F,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC9B,WAAW,CAAC,WAAW,CAAC,GAAG,kBAAkB,CAAC;YAChD,CAAC;YAED,mBAAmB,CAAc,kBAAkB,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACtG,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A decorator that marks a method to be called when the application starts.
3
+ *
4
+ * Runs during `start()`, after every component has been constructed and wired, so a hook
5
+ * sees the finished graph.
6
+ *
7
+ * Hooks run in registration order, which is the topological order the IoC engine computed:
8
+ * a component's dependencies have already started when its own hook runs. A throwing hook
9
+ * aborts the start and rolls back the components that already started.
10
+ *
11
+ * The hook must return. A component that runs for the process's lifetime should start its
12
+ * loop here and keep the handle for {@link OnStop} - an `@OnStart` that never resolves is an
13
+ * application that never finishes starting.
14
+ *
15
+ * Only singletons take part; a transient is constructed per resolve and has no lifecycle to
16
+ * hang a start hook on.
17
+ *
18
+ * @returns {PropertyDecorator} The property decorator function.
19
+ */
20
+ export declare const OnStart: () => PropertyDecorator;
@@ -0,0 +1,33 @@
1
+ import { ComponentConstants } from '../../constants';
2
+ import { defineTypedMetadata, getOwnTypedMetadata } from '../../utils/typedMetadata';
3
+ import { assertLegacyDecorator } from './legacyDecorator';
4
+ /**
5
+ * A decorator that marks a method to be called when the application starts.
6
+ *
7
+ * Runs during `start()`, after every component has been constructed and wired, so a hook
8
+ * sees the finished graph.
9
+ *
10
+ * Hooks run in registration order, which is the topological order the IoC engine computed:
11
+ * a component's dependencies have already started when its own hook runs. A throwing hook
12
+ * aborts the start and rolls back the components that already started.
13
+ *
14
+ * The hook must return. A component that runs for the process's lifetime should start its
15
+ * loop here and keep the handle for {@link OnStop} - an `@OnStart` that never resolves is an
16
+ * application that never finishes starting.
17
+ *
18
+ * Only singletons take part; a transient is constructed per resolve and has no lifecycle to
19
+ * hang a start hook on.
20
+ *
21
+ * @returns {PropertyDecorator} The property decorator function.
22
+ */
23
+ export const OnStart = () => {
24
+ return (target, propertyKey) => {
25
+ assertLegacyDecorator('OnStart', propertyKey);
26
+ const hooks = getOwnTypedMetadata(ComponentConstants.PostConstructKey, target.constructor) || [];
27
+ if (!hooks.includes(propertyKey)) {
28
+ hooks.push(propertyKey);
29
+ }
30
+ defineTypedMetadata(ComponentConstants.PostConstructKey, hooks, target.constructor);
31
+ };
32
+ };
33
+ //# sourceMappingURL=OnStart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnStart.js","sourceRoot":"","sources":["../../../../lib/component/decorators/OnStart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,GAAsB,EAAE;IAC7C,OAAO,CAAC,MAAc,EAAE,WAAmB,EAAQ,EAAE;QACnD,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAE9C,MAAM,KAAK,GACT,mBAAmB,CAAW,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAE/F,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;QAED,mBAAmB,CAAW,kBAAkB,CAAC,gBAAgB,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAChG,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A decorator that marks a method to be called when the application stops.
3
+ *
4
+ * The counterpart to {@link OnStart}. Runs during `stop()`, in the reverse of start
5
+ * order, so a component still has its dependencies while it releases its own resources.
6
+ *
7
+ * A hook that throws or exceeds the shutdown timeout is logged and skipped - shutdown
8
+ * continues. One component failing to let go must not strand the rest.
9
+ *
10
+ * Only components whose start hook completed are stopped. A `stop()` on an application that
11
+ * never started, or that failed while starting, runs nothing that never ran.
12
+ *
13
+ * @returns {PropertyDecorator} The property decorator function.
14
+ */
15
+ export declare const OnStop: () => PropertyDecorator;
@@ -0,0 +1,28 @@
1
+ import { ComponentConstants } from '../../constants';
2
+ import { defineTypedMetadata, getOwnTypedMetadata } from '../../utils/typedMetadata';
3
+ import { assertLegacyDecorator } from './legacyDecorator';
4
+ /**
5
+ * A decorator that marks a method to be called when the application stops.
6
+ *
7
+ * The counterpart to {@link OnStart}. Runs during `stop()`, in the reverse of start
8
+ * order, so a component still has its dependencies while it releases its own resources.
9
+ *
10
+ * A hook that throws or exceeds the shutdown timeout is logged and skipped - shutdown
11
+ * continues. One component failing to let go must not strand the rest.
12
+ *
13
+ * Only components whose start hook completed are stopped. A `stop()` on an application that
14
+ * never started, or that failed while starting, runs nothing that never ran.
15
+ *
16
+ * @returns {PropertyDecorator} The property decorator function.
17
+ */
18
+ export const OnStop = () => {
19
+ return (target, propertyKey) => {
20
+ assertLegacyDecorator('OnStop', propertyKey);
21
+ const hooks = getOwnTypedMetadata(ComponentConstants.OnStopKey, target.constructor) || [];
22
+ if (!hooks.includes(propertyKey)) {
23
+ hooks.push(propertyKey);
24
+ }
25
+ defineTypedMetadata(ComponentConstants.OnStopKey, hooks, target.constructor);
26
+ };
27
+ };
28
+ //# sourceMappingURL=OnStop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnStop.js","sourceRoot":"","sources":["../../../../lib/component/decorators/OnStop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAsB,EAAE;IAC5C,OAAO,CAAC,MAAc,EAAE,WAAmB,EAAQ,EAAE;QACnD,qBAAqB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAE7C,MAAM,KAAK,GAAa,mBAAmB,CAAW,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAE9G,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;QAED,mBAAmB,CAAW,kBAAkB,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACzF,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A decorator that marks a method to be called after the component's construction.
3
+ *
4
+ * @deprecated Renamed to {@link OnStart}. Same metadata key, same behaviour - only the name
5
+ * changed, so no migration is needed beyond the import.
6
+ *
7
+ * The rename came with a timing change worth knowing about: the hook used to run inside
8
+ * `Container.register()`, i.e. mid-scan, while other components were still being constructed.
9
+ * It now runs from `start()` once the whole graph exists. A component resolved from an
10
+ * application that was created but never started is therefore no longer initialised.
11
+ *
12
+ * @returns {PropertyDecorator} The property decorator function.
13
+ */
14
+ export declare const PostConstruct: () => PropertyDecorator;
@@ -0,0 +1,16 @@
1
+ import { OnStart } from './OnStart';
2
+ /**
3
+ * A decorator that marks a method to be called after the component's construction.
4
+ *
5
+ * @deprecated Renamed to {@link OnStart}. Same metadata key, same behaviour - only the name
6
+ * changed, so no migration is needed beyond the import.
7
+ *
8
+ * The rename came with a timing change worth knowing about: the hook used to run inside
9
+ * `Container.register()`, i.e. mid-scan, while other components were still being constructed.
10
+ * It now runs from `start()` once the whole graph exists. A component resolved from an
11
+ * application that was created but never started is therefore no longer initialised.
12
+ *
13
+ * @returns {PropertyDecorator} The property decorator function.
14
+ */
15
+ export const PostConstruct = OnStart;
16
+ //# sourceMappingURL=PostConstruct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostConstruct.js","sourceRoot":"","sources":["../../../../lib/component/decorators/PostConstruct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC"}