@codefast/di 0.8.0 → 0.9.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 (219) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +1 -1
  3. package/README.md +256 -164
  4. package/dist/ambient/active-container.d.ts +1 -2
  5. package/dist/ambient/active-container.js +1 -2
  6. package/dist/container/binding-builders.d.ts +12 -13
  7. package/dist/container/binding-builders.js +1 -2
  8. package/dist/container/container.d.ts +11 -12
  9. package/dist/container/container.js +23 -9
  10. package/dist/core/binding-scope.d.ts +1 -2
  11. package/dist/core/binding-scope.js +1 -2
  12. package/dist/core/binding.d.ts +20 -16
  13. package/dist/core/binding.js +1 -2
  14. package/dist/core/constraint-requirement.d.ts +20 -6
  15. package/dist/core/constraint-requirement.js +20 -11
  16. package/dist/core/constructor-type.d.ts +1 -2
  17. package/dist/core/constructor-type.js +1 -2
  18. package/dist/core/map-upsert.d.ts +1 -2
  19. package/dist/core/map-upsert.js +1 -2
  20. package/dist/core/module.d.ts +1 -2
  21. package/dist/core/module.js +1 -2
  22. package/dist/core/registry.d.ts +1 -2
  23. package/dist/core/registry.js +1 -2
  24. package/dist/core/tag.d.ts +3 -4
  25. package/dist/core/tag.js +3 -4
  26. package/dist/core/token.d.ts +25 -6
  27. package/dist/core/token.js +2 -3
  28. package/dist/core/types.d.ts +9 -4
  29. package/dist/core/types.js +1 -2
  30. package/dist/decorators/inject.d.ts +2 -3
  31. package/dist/decorators/inject.js +7 -6
  32. package/dist/decorators/injectable.d.ts +1 -2
  33. package/dist/decorators/injectable.js +1 -2
  34. package/dist/decorators/lifecycle-decorators.d.ts +1 -2
  35. package/dist/decorators/lifecycle-decorators.js +1 -2
  36. package/dist/errors/diagnostics.d.ts +1 -2
  37. package/dist/errors/diagnostics.js +1 -2
  38. package/dist/errors/errors.d.ts +5 -3
  39. package/dist/errors/errors.js +10 -5
  40. package/dist/index.d.ts +2 -3
  41. package/dist/index.js +1 -2
  42. package/dist/injection/descriptor.d.ts +12 -7
  43. package/dist/injection/descriptor.js +1 -2
  44. package/dist/injection/resolve-options.d.ts +1 -2
  45. package/dist/injection/resolve-options.js +1 -2
  46. package/dist/introspection/dependency-graph.d.ts +1 -2
  47. package/dist/introspection/dependency-graph.js +1 -2
  48. package/dist/introspection/graph-adapters/cytoscape.d.ts +1 -2
  49. package/dist/introspection/graph-adapters/cytoscape.js +1 -2
  50. package/dist/introspection/graph-adapters/dot.d.ts +1 -2
  51. package/dist/introspection/graph-adapters/dot.js +1 -2
  52. package/dist/introspection/graph-adapters/mermaid.d.ts +1 -2
  53. package/dist/introspection/graph-adapters/mermaid.js +1 -2
  54. package/dist/introspection/graph-adapters/reactflow.d.ts +1 -2
  55. package/dist/introspection/graph-adapters/reactflow.js +1 -2
  56. package/dist/introspection/inspector.d.ts +1 -2
  57. package/dist/introspection/inspector.js +1 -2
  58. package/dist/lifecycle/lifecycle-manager.d.ts +1 -2
  59. package/dist/lifecycle/lifecycle-manager.js +1 -2
  60. package/dist/lifecycle/scope-manager.d.ts +1 -2
  61. package/dist/lifecycle/scope-manager.js +1 -2
  62. package/dist/metadata/metadata-keys.d.ts +1 -2
  63. package/dist/metadata/metadata-keys.js +1 -2
  64. package/dist/metadata/metadata-reader-token.d.ts +1 -2
  65. package/dist/metadata/metadata-reader-token.js +1 -2
  66. package/dist/metadata/metadata-types.d.ts +1 -2
  67. package/dist/metadata/metadata-types.js +1 -2
  68. package/dist/metadata/symbol-metadata-reader.d.ts +1 -2
  69. package/dist/metadata/symbol-metadata-reader.js +1 -2
  70. package/dist/metadata/verifying-metadata-reader.d.ts +1 -2
  71. package/dist/metadata/verifying-metadata-reader.js +1 -2
  72. package/dist/resolution/cache/activation-need.d.ts +1 -2
  73. package/dist/resolution/cache/activation-need.js +1 -2
  74. package/dist/resolution/cache/binding-lookup-cache.d.ts +1 -2
  75. package/dist/resolution/cache/binding-lookup-cache.js +1 -2
  76. package/dist/resolution/cache/class-introspector.d.ts +1 -2
  77. package/dist/resolution/cache/class-introspector.js +1 -2
  78. package/dist/resolution/context.d.ts +1 -2
  79. package/dist/resolution/context.js +1 -2
  80. package/dist/resolution/path/resolution-path.d.ts +1 -2
  81. package/dist/resolution/path/resolution-path.js +1 -2
  82. package/dist/resolution/plan/instantiation-plan.d.ts +1 -2
  83. package/dist/resolution/plan/instantiation-plan.js +1 -2
  84. package/dist/resolution/resolver.d.ts +1 -2
  85. package/dist/resolution/resolver.js +1 -2
  86. package/dist/resolution/select/binding-select.d.ts +1 -2
  87. package/dist/resolution/select/binding-select.js +1 -2
  88. package/dist/resolution/select/constraints.d.ts +8 -6
  89. package/dist/resolution/select/constraints.js +35 -15
  90. package/package.json +6 -92
  91. package/dist/ambient/active-container.d.ts.map +0 -1
  92. package/dist/ambient/active-container.js.map +0 -1
  93. package/dist/container/binding-builders.d.ts.map +0 -1
  94. package/dist/container/binding-builders.js.map +0 -1
  95. package/dist/container/container.d.ts.map +0 -1
  96. package/dist/container/container.js.map +0 -1
  97. package/dist/core/binding-scope.d.ts.map +0 -1
  98. package/dist/core/binding-scope.js.map +0 -1
  99. package/dist/core/binding.d.ts.map +0 -1
  100. package/dist/core/binding.js.map +0 -1
  101. package/dist/core/constraint-requirement.d.ts.map +0 -1
  102. package/dist/core/constraint-requirement.js.map +0 -1
  103. package/dist/core/constructor-type.d.ts.map +0 -1
  104. package/dist/core/constructor-type.js.map +0 -1
  105. package/dist/core/map-upsert.d.ts.map +0 -1
  106. package/dist/core/map-upsert.js.map +0 -1
  107. package/dist/core/module.d.ts.map +0 -1
  108. package/dist/core/module.js.map +0 -1
  109. package/dist/core/registry.d.ts.map +0 -1
  110. package/dist/core/registry.js.map +0 -1
  111. package/dist/core/tag.d.ts.map +0 -1
  112. package/dist/core/tag.js.map +0 -1
  113. package/dist/core/token.d.ts.map +0 -1
  114. package/dist/core/token.js.map +0 -1
  115. package/dist/core/types.d.ts.map +0 -1
  116. package/dist/core/types.js.map +0 -1
  117. package/dist/decorators/inject.d.ts.map +0 -1
  118. package/dist/decorators/inject.js.map +0 -1
  119. package/dist/decorators/injectable.d.ts.map +0 -1
  120. package/dist/decorators/injectable.js.map +0 -1
  121. package/dist/decorators/lifecycle-decorators.d.ts.map +0 -1
  122. package/dist/decorators/lifecycle-decorators.js.map +0 -1
  123. package/dist/errors/diagnostics.d.ts.map +0 -1
  124. package/dist/errors/diagnostics.js.map +0 -1
  125. package/dist/errors/errors.d.ts.map +0 -1
  126. package/dist/errors/errors.js.map +0 -1
  127. package/dist/index.d.ts.map +0 -1
  128. package/dist/index.js.map +0 -1
  129. package/dist/injection/descriptor.d.ts.map +0 -1
  130. package/dist/injection/descriptor.js.map +0 -1
  131. package/dist/injection/resolve-options.d.ts.map +0 -1
  132. package/dist/injection/resolve-options.js.map +0 -1
  133. package/dist/introspection/dependency-graph.d.ts.map +0 -1
  134. package/dist/introspection/dependency-graph.js.map +0 -1
  135. package/dist/introspection/graph-adapters/cytoscape.d.ts.map +0 -1
  136. package/dist/introspection/graph-adapters/cytoscape.js.map +0 -1
  137. package/dist/introspection/graph-adapters/dot.d.ts.map +0 -1
  138. package/dist/introspection/graph-adapters/dot.js.map +0 -1
  139. package/dist/introspection/graph-adapters/mermaid.d.ts.map +0 -1
  140. package/dist/introspection/graph-adapters/mermaid.js.map +0 -1
  141. package/dist/introspection/graph-adapters/reactflow.d.ts.map +0 -1
  142. package/dist/introspection/graph-adapters/reactflow.js.map +0 -1
  143. package/dist/introspection/inspector.d.ts.map +0 -1
  144. package/dist/introspection/inspector.js.map +0 -1
  145. package/dist/lifecycle/lifecycle-manager.d.ts.map +0 -1
  146. package/dist/lifecycle/lifecycle-manager.js.map +0 -1
  147. package/dist/lifecycle/scope-manager.d.ts.map +0 -1
  148. package/dist/lifecycle/scope-manager.js.map +0 -1
  149. package/dist/metadata/metadata-keys.d.ts.map +0 -1
  150. package/dist/metadata/metadata-keys.js.map +0 -1
  151. package/dist/metadata/metadata-reader-token.d.ts.map +0 -1
  152. package/dist/metadata/metadata-reader-token.js.map +0 -1
  153. package/dist/metadata/metadata-types.d.ts.map +0 -1
  154. package/dist/metadata/metadata-types.js.map +0 -1
  155. package/dist/metadata/symbol-metadata-reader.d.ts.map +0 -1
  156. package/dist/metadata/symbol-metadata-reader.js.map +0 -1
  157. package/dist/metadata/verifying-metadata-reader.d.ts.map +0 -1
  158. package/dist/metadata/verifying-metadata-reader.js.map +0 -1
  159. package/dist/resolution/cache/activation-need.d.ts.map +0 -1
  160. package/dist/resolution/cache/activation-need.js.map +0 -1
  161. package/dist/resolution/cache/binding-lookup-cache.d.ts.map +0 -1
  162. package/dist/resolution/cache/binding-lookup-cache.js.map +0 -1
  163. package/dist/resolution/cache/class-introspector.d.ts.map +0 -1
  164. package/dist/resolution/cache/class-introspector.js.map +0 -1
  165. package/dist/resolution/context.d.ts.map +0 -1
  166. package/dist/resolution/context.js.map +0 -1
  167. package/dist/resolution/path/resolution-path.d.ts.map +0 -1
  168. package/dist/resolution/path/resolution-path.js.map +0 -1
  169. package/dist/resolution/plan/instantiation-plan.d.ts.map +0 -1
  170. package/dist/resolution/plan/instantiation-plan.js.map +0 -1
  171. package/dist/resolution/resolver.d.ts.map +0 -1
  172. package/dist/resolution/resolver.js.map +0 -1
  173. package/dist/resolution/select/binding-select.d.ts.map +0 -1
  174. package/dist/resolution/select/binding-select.js.map +0 -1
  175. package/dist/resolution/select/constraints.d.ts.map +0 -1
  176. package/dist/resolution/select/constraints.js.map +0 -1
  177. package/src/ambient/active-container.ts +0 -69
  178. package/src/container/binding-builders.ts +0 -337
  179. package/src/container/container.ts +0 -972
  180. package/src/core/binding-scope.ts +0 -15
  181. package/src/core/binding.ts +0 -505
  182. package/src/core/constraint-requirement.ts +0 -94
  183. package/src/core/constructor-type.ts +0 -18
  184. package/src/core/map-upsert.ts +0 -53
  185. package/src/core/module.ts +0 -117
  186. package/src/core/registry.ts +0 -319
  187. package/src/core/tag.ts +0 -212
  188. package/src/core/token.ts +0 -31
  189. package/src/core/types.ts +0 -149
  190. package/src/decorators/inject.ts +0 -101
  191. package/src/decorators/injectable.ts +0 -134
  192. package/src/decorators/lifecycle-decorators.ts +0 -43
  193. package/src/errors/diagnostics.ts +0 -45
  194. package/src/errors/errors.ts +0 -499
  195. package/src/index.ts +0 -139
  196. package/src/injection/descriptor.ts +0 -218
  197. package/src/injection/resolve-options.ts +0 -201
  198. package/src/introspection/dependency-graph.ts +0 -296
  199. package/src/introspection/graph-adapters/cytoscape.ts +0 -78
  200. package/src/introspection/graph-adapters/dot.ts +0 -32
  201. package/src/introspection/graph-adapters/mermaid.ts +0 -61
  202. package/src/introspection/graph-adapters/reactflow.ts +0 -84
  203. package/src/introspection/inspector.ts +0 -134
  204. package/src/lifecycle/lifecycle-manager.ts +0 -272
  205. package/src/lifecycle/scope-manager.ts +0 -158
  206. package/src/metadata/metadata-keys.ts +0 -28
  207. package/src/metadata/metadata-reader-token.ts +0 -10
  208. package/src/metadata/metadata-types.ts +0 -57
  209. package/src/metadata/symbol-metadata-reader.ts +0 -126
  210. package/src/metadata/verifying-metadata-reader.ts +0 -41
  211. package/src/resolution/cache/activation-need.ts +0 -87
  212. package/src/resolution/cache/binding-lookup-cache.ts +0 -169
  213. package/src/resolution/cache/class-introspector.ts +0 -256
  214. package/src/resolution/context.ts +0 -331
  215. package/src/resolution/path/resolution-path.ts +0 -167
  216. package/src/resolution/plan/instantiation-plan.ts +0 -592
  217. package/src/resolution/resolver.ts +0 -1654
  218. package/src/resolution/select/binding-select.ts +0 -207
  219. package/src/resolution/select/constraints.ts +0 -146
@@ -31,23 +31,23 @@ export interface BindingRegistration {
31
31
  *
32
32
  * @since 0.5.0-canary.8
33
33
  */
34
- export declare class BindingChain<Value> implements AliasBindingBuilder, BindingBuilder<Value>, BindToBuilder<Value>, ConstantBindingBuilder<Value>, ScopedBindingBuilder<Value>, SingletonBindingBuilder<Value>, SingletonLifecycleBuilder<Value>, TransientBindingBuilder<Value> {
34
+ export declare class BindingChain<Value, Names extends string = string> implements AliasBindingBuilder<Names>, BindingBuilder<Value, Names>, BindToBuilder<Value, Names>, ConstantBindingBuilder<Value, Names>, ScopedBindingBuilder<Value>, SingletonBindingBuilder<Value>, SingletonLifecycleBuilder<Value>, TransientBindingBuilder<Value> {
35
35
  #private;
36
- constructor(token: Token<Value> | Constructor<Value>, registration: BindingRegistration);
37
- to(type: Constructor<Value>): BindingBuilder<Value>;
38
- toSelf(): BindingBuilder<Value>;
39
- toConstantValue(value: Value): ConstantBindingBuilder<Value>;
40
- toDynamic(factory: (ctx: ResolutionContext) => Value): BindingBuilder<Value>;
41
- toDynamicAsync(factory: (ctx: ResolutionContext) => Promise<Value>): BindingBuilder<Value>;
36
+ constructor(token: Token<Value, Names> | Constructor<Value>, registration: BindingRegistration);
37
+ to(type: Constructor<Value>): BindingBuilder<Value, Names>;
38
+ toSelf(): BindingBuilder<Value, Names>;
39
+ toConstantValue(value: Value): ConstantBindingBuilder<Value, Names>;
40
+ toDynamic(factory: (ctx: ResolutionContext) => Value): BindingBuilder<Value, Names>;
41
+ toDynamicAsync(factory: (ctx: ResolutionContext) => Promise<Value>): BindingBuilder<Value, Names>;
42
42
  toResolved<const Deps extends ReadonlyArray<InjectableDependency>>(factory: (...args: {
43
43
  [K in keyof Deps]: ResolvedDependencyValue<NoInfer<Deps>[K]>;
44
- }) => Value, deps: Deps): BindingBuilder<Value>;
44
+ }) => Value, deps: Deps): BindingBuilder<Value, Names>;
45
45
  toResolvedAsync<const Deps extends ReadonlyArray<InjectableDependency>>(factory: (...args: {
46
46
  [K in keyof Deps]: ResolvedDependencyValue<NoInfer<Deps>[K]>;
47
- }) => Promise<Value>, deps: Deps): BindingBuilder<Value>;
48
- toAlias(target: Token<Value> | Constructor<Value>): AliasBindingBuilder;
47
+ }) => Promise<Value>, deps: Deps): BindingBuilder<Value, Names>;
48
+ toAlias(target: Token<Value> | Constructor<Value>): AliasBindingBuilder<Names>;
49
49
  when(predicate: BindingConstraint): this;
50
- whenNamed(name: string): this;
50
+ whenNamed(name: Names): this;
51
51
  whenTagged(criterion: BindingTag): this;
52
52
  whenDefault(): this;
53
53
  singleton(): SingletonBindingBuilder<Value>;
@@ -56,5 +56,4 @@ export declare class BindingChain<Value> implements AliasBindingBuilder, Binding
56
56
  onActivation(fn: ActivationHandler<Value>): this;
57
57
  onDeactivation(fn: DeactivationHandler<Value>): this;
58
58
  id(): BindingIdentifier;
59
- }
60
- //# sourceMappingURL=binding-builders.d.ts.map
59
+ }
@@ -225,5 +225,4 @@ export class BindingChain {
225
225
  }
226
226
  }
227
227
  }
228
- }
229
- //# sourceMappingURL=binding-builders.js.map
228
+ }
@@ -13,12 +13,12 @@ import type { MetadataReader } from "#/metadata/metadata-types";
13
13
  */
14
14
  export interface Container {
15
15
  readonly isDisposed: boolean;
16
- bind<Value>(token: Token<Value> | Constructor<Value>): BindToBuilder<Value>;
16
+ bind<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>): BindToBuilder<Value, Names>;
17
17
  unbind(tokenOrId: Token<unknown> | Constructor | BindingIdentifier): void;
18
18
  unbindAsync(tokenOrId: Token<unknown> | Constructor | BindingIdentifier): Promise<void>;
19
19
  unbindAll(): void;
20
20
  unbindAllAsync(): Promise<void>;
21
- rebind<Value>(token: Token<Value> | Constructor<Value>): BindToBuilder<Value>;
21
+ rebind<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>): BindToBuilder<Value, Names>;
22
22
  load(...modules: Array<SyncModule>): void;
23
23
  loadAsync(...modules: Array<SyncModule | AsyncModule>): Promise<void>;
24
24
  unload(...modules: Array<SyncModule>): void;
@@ -26,20 +26,20 @@ export interface Container {
26
26
  loadAutoRegistered(registry: AutoRegisterRegistry): number;
27
27
  onActivation<Value>(token: Token<Value> | Constructor<Value>, handler: ActivationHandler<Value>): void;
28
28
  onDeactivation<Value>(token: Token<Value> | Constructor<Value>, handler: DeactivationHandler<Value>): void;
29
- resolve<Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Value;
30
- resolveAsync<Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Promise<Value>;
31
- resolveOptional<Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Value | undefined;
32
- resolveOptionalAsync<Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Promise<Value | undefined>;
33
- resolveAll<Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Array<Value>;
34
- resolveAllAsync<Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Promise<Array<Value>>;
29
+ resolve<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<ResolveOptions<Names>>): Value;
30
+ resolveAsync<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<ResolveOptions<Names>>): Promise<Value>;
31
+ resolveOptional<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<ResolveOptions<Names>>): Value | undefined;
32
+ resolveOptionalAsync<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<ResolveOptions<Names>>): Promise<Value | undefined>;
33
+ resolveAll<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<ResolveOptions<Names>>): Array<Value>;
34
+ resolveAllAsync<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<ResolveOptions<Names>>): Promise<Array<Value>>;
35
35
  createChild(): Container;
36
36
  dispose(): Promise<void>;
37
37
  [Symbol.asyncDispose](): Promise<void>;
38
38
  [Symbol.dispose](): never;
39
39
  initializeAsync(): Promise<void>;
40
40
  validate(): void;
41
- has(token: Token<unknown> | Constructor, options?: ResolveOptions): boolean;
42
- hasOwn(token: Token<unknown> | Constructor, options?: ResolveOptions): boolean;
41
+ has<Names extends string = string>(token: Token<unknown, Names> | Constructor, options?: NoInfer<ResolveOptions<Names>>): boolean;
42
+ hasOwn<Names extends string = string>(token: Token<unknown, Names> | Constructor, options?: NoInfer<ResolveOptions<Names>>): boolean;
43
43
  lookupBindings<Value>(token: Token<Value> | Constructor<Value>): ReadonlyArray<BindingSnapshot>;
44
44
  inspect(): ContainerSnapshot;
45
45
  generateDependencyGraph(options?: GraphOptions): ContainerGraphJson;
@@ -74,5 +74,4 @@ export interface ContainerStatic {
74
74
  *
75
75
  * @since 0.3.16-canary.0
76
76
  */
77
- export declare const Container: ContainerStatic;
78
- //# sourceMappingURL=container.d.ts.map
77
+ export declare const Container: ContainerStatic;
@@ -2,7 +2,7 @@ import { BindingChain } from "#/container/binding-builders";
2
2
  import { NO_INSTANCE } from "#/core/binding";
3
3
  import { effectiveBindingScope } from "#/core/binding-scope";
4
4
  import { constraintRequirementsOf } from "#/core/constraint-requirement";
5
- import { getOrInsert } from "#/core/map-upsert";
5
+ import { getOrInsert, getOrInsertComputed } from "#/core/map-upsert";
6
6
  import { isSyncModule, MODULE_SETUP } from "#/core/module";
7
7
  import { BindingRegistry } from "#/core/registry";
8
8
  import { tokenName } from "#/core/token";
@@ -18,6 +18,20 @@ import { defaultMetadataReader } from "#/metadata/symbol-metadata-reader";
18
18
  import { verifyingMetadataReader } from "#/metadata/verifying-metadata-reader";
19
19
  import { ROOT_BRANCH } from "#/resolution/path/resolution-path";
20
20
  import { DependencyResolver } from "#/resolution/resolver";
21
+ /** Whether a requirement's name is declared — on its token when it names one, on any token otherwise. */
22
+ function isSlotNameDeclared(declared, requirement) {
23
+ if (requirement.tokenName !== undefined) {
24
+ return declared.get(requirement.tokenName)?.has(requirement.name) ?? false;
25
+ }
26
+ for (const names of declared.values()) {
27
+ if (names.has(requirement.name)) {
28
+ return true;
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+ /** Hoisted so the slot-name index's `getOrInsertComputed` allocates only on a miss, no closure per call. */
34
+ const newSlotNameSet = () => new Set();
21
35
  // A Record rather than an if-chain, so a new `BindingScope` is a compile error here instead of
22
36
  // silently landing in whichever branch happened to be last.
23
37
  const APPLY_BINDING_SCOPE = {
@@ -552,18 +566,19 @@ class DefaultContainer {
552
566
  }
553
567
  declaredSlotNames ??= this.#slotNamesInChain();
554
568
  for (const requirement of requirements) {
555
- if (!declaredSlotNames.has(requirement.name)) {
556
- throw new UnreachableConstraintError(tokenName(binding.token), requirement.name, requirement.helperName);
569
+ if (!isSlotNameDeclared(declaredSlotNames, requirement)) {
570
+ throw new UnreachableConstraintError(tokenName(binding.token), requirement);
557
571
  }
558
572
  }
559
573
  }
560
574
  }
561
- /** Every slot name declared anywhere a resolve through this container could reach. */
575
+ /** Every slot name declared anywhere a resolve through this container could reach, by declaring token. */
562
576
  #slotNamesInChain() {
563
- const names = this.#parent === undefined ? new Set() : this.#parent.#slotNamesInChain();
577
+ const names = this.#parent === undefined ? new Map() : this.#parent.#slotNamesInChain();
564
578
  for (const binding of this.#registry.allBindings()) {
565
- if (binding.slot.name !== undefined) {
566
- names.add(binding.slot.name);
579
+ const name = binding.slot.name;
580
+ if (name !== undefined) {
581
+ getOrInsertComputed(names, tokenName(binding.token), newSlotNameSet).add(name);
567
582
  }
568
583
  }
569
584
  return names;
@@ -743,5 +758,4 @@ export const Container = {
743
758
  await container.loadAsync(...modules);
744
759
  return container;
745
760
  },
746
- };
747
- //# sourceMappingURL=container.js.map
761
+ };
@@ -9,5 +9,4 @@ import type { BindingScope } from "#/core/types";
9
9
  *
10
10
  * @since 0.3.16-canary.0
11
11
  */
12
- export declare function effectiveBindingScope(binding: Binding): BindingScope;
13
- //# sourceMappingURL=binding-scope.d.ts.map
12
+ export declare function effectiveBindingScope(binding: Binding): BindingScope;
@@ -9,5 +9,4 @@
9
9
  */
10
10
  export function effectiveBindingScope(binding) {
11
11
  return binding.scope;
12
- }
13
- //# sourceMappingURL=binding-scope.js.map
12
+ }
@@ -248,11 +248,16 @@ export declare function clearBindingFrame<Value>(binding: Binding<Value>): void;
248
248
  *
249
249
  * @since 0.3.16-canary.0
250
250
  */
251
- export interface SlotConstrainedBuilder {
251
+ export interface SlotConstrainedBuilder<Names extends string = string> {
252
+ /** Narrows the binding to requests the predicate accepts, evaluated on every resolve. */
252
253
  when(predicate: BindingConstraint): this;
253
- whenNamed(name: string): this;
254
+ /** Declares the binding's slot name, one of the names the token declares. */
255
+ whenNamed(name: Names): this;
256
+ /** Declares one criterion of the binding's slot, replacing any earlier criterion of the same key. */
254
257
  whenTagged(criterion: BindingTag): this;
258
+ /** Keeps the binding on the default slot, the one an unconstrained request selects. */
255
259
  whenDefault(): this;
260
+ /** The identifier this binding is registered under. */
256
261
  id(): BindingIdentifier;
257
262
  }
258
263
  /**
@@ -260,26 +265,26 @@ export interface SlotConstrainedBuilder {
260
265
  *
261
266
  * @since 0.3.16-canary.0
262
267
  */
263
- export interface BindToBuilder<Value> {
264
- to(type: Constructor<Value>): BindingBuilder<Value>;
265
- toSelf(): BindingBuilder<Value>;
266
- toConstantValue(value: Value): ConstantBindingBuilder<Value>;
267
- toDynamic(factory: (ctx: ResolutionContext) => Value): BindingBuilder<Value>;
268
- toDynamicAsync(factory: (ctx: ResolutionContext) => Promise<Value>): BindingBuilder<Value>;
268
+ export interface BindToBuilder<Value, Names extends string = string> {
269
+ to(type: Constructor<Value>): BindingBuilder<Value, Names>;
270
+ toSelf(): BindingBuilder<Value, Names>;
271
+ toConstantValue(value: Value): ConstantBindingBuilder<Value, Names>;
272
+ toDynamic(factory: (ctx: ResolutionContext) => Value): BindingBuilder<Value, Names>;
273
+ toDynamicAsync(factory: (ctx: ResolutionContext) => Promise<Value>): BindingBuilder<Value, Names>;
269
274
  toResolved<const Deps extends ReadonlyArray<InjectableDependency>>(factory: (...args: {
270
275
  [K in keyof Deps]: ResolvedDependencyValue<NoInfer<Deps>[K]>;
271
- }) => Value, deps: Deps): BindingBuilder<Value>;
276
+ }) => Value, deps: Deps): BindingBuilder<Value, Names>;
272
277
  toResolvedAsync<const Deps extends ReadonlyArray<InjectableDependency>>(factory: (...args: {
273
278
  [K in keyof Deps]: ResolvedDependencyValue<NoInfer<Deps>[K]>;
274
- }) => Promise<Value>, deps: Deps): BindingBuilder<Value>;
275
- toAlias(target: Token<Value> | Constructor<Value>): AliasBindingBuilder;
279
+ }) => Promise<Value>, deps: Deps): BindingBuilder<Value, Names>;
280
+ toAlias(target: Token<Value> | Constructor<Value>): AliasBindingBuilder<Names>;
276
281
  }
277
282
  /**
278
283
  * The scope-selection step of the fluent chain.
279
284
  *
280
285
  * @since 0.3.16-canary.0
281
286
  */
282
- export interface BindingBuilder<Value> extends SlotConstrainedBuilder {
287
+ export interface BindingBuilder<Value, Names extends string = string> extends SlotConstrainedBuilder<Names> {
283
288
  singleton(): SingletonBindingBuilder<Value>;
284
289
  transient(): TransientBindingBuilder<Value>;
285
290
  scoped(): ScopedBindingBuilder<Value>;
@@ -289,7 +294,7 @@ export interface BindingBuilder<Value> extends SlotConstrainedBuilder {
289
294
  *
290
295
  * @since 0.3.16-canary.0
291
296
  */
292
- export interface ConstantBindingBuilder<Value> extends SlotConstrainedBuilder {
297
+ export interface ConstantBindingBuilder<Value, Names extends string = string> extends SlotConstrainedBuilder<Names> {
293
298
  onActivation(fn: ActivationHandler<Value>): SingletonLifecycleBuilder<Value>;
294
299
  onDeactivation(fn: DeactivationHandler<Value>): SingletonLifecycleBuilder<Value>;
295
300
  }
@@ -298,7 +303,7 @@ export interface ConstantBindingBuilder<Value> extends SlotConstrainedBuilder {
298
303
  *
299
304
  * @since 0.3.16-canary.0
300
305
  */
301
- export interface AliasBindingBuilder extends SlotConstrainedBuilder {
306
+ export interface AliasBindingBuilder<Names extends string = string> extends SlotConstrainedBuilder<Names> {
302
307
  }
303
308
  /**
304
309
  * The fluent chain after `singleton()`, where both lifecycle hooks stay available.
@@ -336,5 +341,4 @@ export interface SingletonLifecycleBuilder<Value> {
336
341
  onDeactivation(fn: DeactivationHandler<Value>): this;
337
342
  id(): BindingIdentifier;
338
343
  }
339
- export {};
340
- //# sourceMappingURL=binding.d.ts.map
344
+ export {};
@@ -137,5 +137,4 @@ export function refinableFields(binding) {
137
137
  */
138
138
  export function clearBindingFrame(binding) {
139
139
  binding.frame = undefined;
140
- }
141
- //# sourceMappingURL=binding.js.map
140
+ }
@@ -12,23 +12,38 @@ export declare const CONSTRAINT_REQUIREMENT: unique symbol;
12
12
  /**
13
13
  * The slot name a constraint waits for on an ancestor.
14
14
  *
15
- * @remarks Only names are described. A tag criterion is interned, so a typo cannot produce one that
16
- * looks valid, while a name is a bare string that nothing checks.
15
+ * @remarks Only names are described, however spelled: a tag criterion of any other key is minted from
16
+ * a typed key, so a typo cannot produce one that looks valid, while a name is a bare string that
17
+ * nothing checks — through `whenNamed`'s reserved key included.
17
18
  *
18
19
  * @since 0.6.0
19
20
  */
20
21
  export interface ConstraintRequirement {
21
22
  readonly requires: "ancestorSlotName";
23
+ /** The token whose slot must carry the name, or `undefined` when the spelling named no token. */
24
+ readonly tokenName: string | undefined;
22
25
  readonly name: string;
23
26
  /** The helper that built the predicate, so a report can name what the caller wrote. */
24
27
  readonly helperName: string;
25
28
  }
26
29
  /**
27
- * Records what a predicate waits for. Called once, where the predicate is built.
30
+ * What a helper records about one waited-for slot name, before the discriminant is stamped on.
31
+ *
32
+ * @since 0.9.0
33
+ */
34
+ export type SlotNameRequirement = Omit<ConstraintRequirement, "requires">;
35
+ /**
36
+ * Records the one slot name a predicate waits for. Called once, where the predicate is built.
28
37
  *
29
38
  * @since 0.6.0
30
39
  */
31
- export declare function requiringAncestorSlotName(predicate: BindingConstraint, name: string, helperName: string): BindingConstraint;
40
+ export declare function requiringAncestorSlotName(predicate: BindingConstraint, requirement: SlotNameRequirement): BindingConstraint;
41
+ /**
42
+ * Records every slot name a predicate waits for — one per reserved criterion in a `…TaggedAll` list.
43
+ *
44
+ * @since 0.9.0
45
+ */
46
+ export declare function requiringAncestorSlotNames(predicate: BindingConstraint, requirements: ReadonlyArray<SlotNameRequirement>): BindingConstraint;
32
47
  /**
33
48
  * The requirement a predicate carries, if it was built by a helper that records one.
34
49
  *
@@ -49,5 +64,4 @@ export declare function constraintRequirementsOf(predicate: BindingConstraint):
49
64
  *
50
65
  * @since 0.6.1
51
66
  */
52
- export declare function mergingConstraintRequirements(composite: BindingConstraint, left: BindingConstraint, right: BindingConstraint): BindingConstraint;
53
- //# sourceMappingURL=constraint-requirement.d.ts.map
67
+ export declare function mergingConstraintRequirements(composite: BindingConstraint, left: BindingConstraint, right: BindingConstraint): BindingConstraint;
@@ -8,13 +8,27 @@
8
8
  */
9
9
  export const CONSTRAINT_REQUIREMENT = Symbol("di:constraint-requirement");
10
10
  /**
11
- * Records what a predicate waits for. Called once, where the predicate is built.
11
+ * Records the one slot name a predicate waits for. Called once, where the predicate is built.
12
12
  *
13
13
  * @since 0.6.0
14
14
  */
15
- export function requiringAncestorSlotName(predicate, name, helperName) {
16
- const requirement = { requires: "ancestorSlotName", name, helperName };
17
- Object.defineProperty(predicate, CONSTRAINT_REQUIREMENT, { value: requirement, enumerable: false });
15
+ export function requiringAncestorSlotName(predicate, requirement) {
16
+ return requiringAncestorSlotNames(predicate, [requirement]);
17
+ }
18
+ /**
19
+ * Records every slot name a predicate waits for — one per reserved criterion in a `…TaggedAll` list.
20
+ *
21
+ * @since 0.9.0
22
+ */
23
+ export function requiringAncestorSlotNames(predicate, requirements) {
24
+ return attachRequirements(predicate, requirements.map((requirement) => ({ requires: "ancestorSlotName", ...requirement })));
25
+ }
26
+ /** One non-enumerable write per predicate: a second define on the same key would throw. */
27
+ function attachRequirements(predicate, requirements) {
28
+ Object.defineProperty(predicate, CONSTRAINT_REQUIREMENT, {
29
+ value: requirements.length === 1 ? requirements[0] : requirements,
30
+ enumerable: false,
31
+ });
18
32
  return predicate;
19
33
  }
20
34
  /**
@@ -53,10 +67,5 @@ export function mergingConstraintRequirements(composite, left, right) {
53
67
  if (merged.length === 0) {
54
68
  return composite;
55
69
  }
56
- Object.defineProperty(composite, CONSTRAINT_REQUIREMENT, {
57
- value: merged.length === 1 ? merged[0] : merged,
58
- enumerable: false,
59
- });
60
- return composite;
61
- }
62
- //# sourceMappingURL=constraint-requirement.js.map
70
+ return attachRequirements(composite, merged);
71
+ }
@@ -14,5 +14,4 @@ export type Constructor<out Value = unknown> = new (...args: Array<never>) => Va
14
14
  *
15
15
  * @since 0.3.16-canary.0
16
16
  */
17
- export type ConstructorInvocation = new (...args: Array<unknown>) => unknown;
18
- //# sourceMappingURL=constructor-type.d.ts.map
17
+ export type ConstructorInvocation = new (...args: Array<unknown>) => unknown;
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=constructor-type.js.map
1
+ export {};
@@ -25,5 +25,4 @@ export declare function getOrInsert<Key, Value extends {} | null>(map: Map<Key,
25
25
  *
26
26
  * @since 0.7.0
27
27
  */
28
- export declare function getOrInsertComputed<Key, Value extends {} | null>(map: Map<Key, Value>, key: NoInfer<Key>, create: (key: NoInfer<Key>) => NoInfer<Value>): Value;
29
- //# sourceMappingURL=map-upsert.d.ts.map
28
+ export declare function getOrInsertComputed<Key, Value extends {} | null>(map: Map<Key, Value>, key: NoInfer<Key>, create: (key: NoInfer<Key>) => NoInfer<Value>): Value;
@@ -40,5 +40,4 @@ export function getOrInsertComputed(map, key, create) {
40
40
  const created = create(key);
41
41
  map.set(key, created);
42
42
  return created;
43
- }
44
- //# sourceMappingURL=map-upsert.js.map
43
+ }
@@ -79,5 +79,4 @@ export declare const Module: {
79
79
  * @since 0.3.16-canary.0
80
80
  */
81
81
  export declare function isSyncModule(module: SyncModule | AsyncModule): module is SyncModule;
82
- export {};
83
- //# sourceMappingURL=module.d.ts.map
82
+ export {};
@@ -58,5 +58,4 @@ export const Module = {
58
58
  */
59
59
  export function isSyncModule(module) {
60
60
  return module[SYNC_MODULE_BRAND] === true;
61
- }
62
- //# sourceMappingURL=module.js.map
61
+ }
@@ -60,5 +60,4 @@ export declare class BindingRegistry {
60
60
  availableSlotStrings(token: Token<unknown> | Constructor): Array<string>;
61
61
  /** Whether the deferred tagged-slot index has had to be built. */
62
62
  get isTaggedIndexBuilt(): boolean;
63
- }
64
- //# sourceMappingURL=registry.d.ts.map
63
+ }
@@ -280,5 +280,4 @@ function isDefaultSlotBinding(binding) {
280
280
  /** A predicate with no slot constraint: last-wins does not apply to it. */
281
281
  function isPurePredicateBinding(binding) {
282
282
  return binding.predicate !== undefined && binding.slot.tags.length === 0;
283
- }
284
- //# sourceMappingURL=registry.js.map
283
+ }
@@ -59,12 +59,12 @@ export interface TagKey<Value = unknown> {
59
59
  /**
60
60
  * Declares a tag key, whose `of()` builds the criteria a `whenTagged` and a resolve both take.
61
61
  *
62
- * @remarks The value type is checked at both ends: a key declared `tag<Region>("region")` refuses a
62
+ * @remarks The value type is checked at both ends: a key declared `tag<Region>("di:region")` refuses a
63
63
  * value that is not a `Region`, so a bind site and a resolve site cannot drift apart silently.
64
64
  *
65
65
  * @example
66
66
  * ```ts
67
- * const Region = tag<"eu" | "us">("region");
67
+ * const Region = tag<"eu" | "us">("di:region");
68
68
  * container.bind(Storage).to(S3).whenTagged(Region.of("eu"));
69
69
  * container.resolve(Storage, { tag: Region.of("eu") });
70
70
  * ```
@@ -102,5 +102,4 @@ export declare function tagKeyMaskOf(tags: ReadonlyArray<BindingTag>): TagKeyMas
102
102
  * @since 0.6.0
103
103
  */
104
104
  export declare function coversTagKeys(requestMask: TagKeyMask, slotMask: TagKeyMask): boolean;
105
- export {};
106
- //# sourceMappingURL=tag.d.ts.map
105
+ export {};
package/dist/core/tag.js CHANGED
@@ -27,12 +27,12 @@ function internKeyFor(value) {
27
27
  /**
28
28
  * Declares a tag key, whose `of()` builds the criteria a `whenTagged` and a resolve both take.
29
29
  *
30
- * @remarks The value type is checked at both ends: a key declared `tag<Region>("region")` refuses a
30
+ * @remarks The value type is checked at both ends: a key declared `tag<Region>("di:region")` refuses a
31
31
  * value that is not a `Region`, so a bind site and a resolve site cannot drift apart silently.
32
32
  *
33
33
  * @example
34
34
  * ```ts
35
- * const Region = tag<"eu" | "us">("region");
35
+ * const Region = tag<"eu" | "us">("di:region");
36
36
  * container.bind(Storage).to(S3).whenTagged(Region.of("eu"));
37
37
  * container.resolve(Storage, { tag: Region.of("eu") });
38
38
  * ```
@@ -135,5 +135,4 @@ export function tagKeyMaskOf(tags) {
135
135
  */
136
136
  export function coversTagKeys(requestMask, slotMask) {
137
137
  return (requestMask & slotMask) === slotMask;
138
- }
139
- //# sourceMappingURL=tag.js.map
138
+ }
@@ -1,25 +1,44 @@
1
1
  import type { Constructor } from "#/core/constructor-type";
2
2
  declare const TOKEN_BRAND: unique symbol;
3
+ declare const TOKEN_NAMES_BRAND: unique symbol;
3
4
  /**
4
- * A branded identifier carrying the value type its bindings resolve to.
5
+ * A branded identifier carrying the value type its bindings resolve to, and the slot names they may declare.
6
+ *
7
+ * @remarks `Names` exists at the type level only: `whenNamed`, and `name` in `ResolveOptions` and
8
+ * `InjectOptions`, narrow to it, so a bind site and a request site cannot drift apart silently. It
9
+ * is covariant, so a token declaring names is still a `Token<unknown>` wherever the engine erases
10
+ * the value type; the default `string` leaves a token that declares none unconstrained.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const Logger = token<Logger, "console" | "file">("di:Logger");
15
+ * container.bind(Logger).to(FileLogger).whenNamed("file");
16
+ * container.resolve(Logger, { name: "file" });
17
+ * ```
5
18
  *
6
19
  * @since 0.3.16-canary.0
7
20
  */
8
- export interface Token<out Value> {
21
+ export interface Token<out Value, out Names extends string = string> {
9
22
  readonly name: string;
10
23
  readonly [TOKEN_BRAND]: Value;
24
+ readonly [TOKEN_NAMES_BRAND]?: Names;
11
25
  }
12
26
  /**
13
- * Creates a named `Token` for the given value type.
27
+ * The slot names a dependency key declares — `string` for a class, or a token that declares none.
28
+ *
29
+ * @since 0.9.0
30
+ */
31
+ export type SlotNamesOf<Key> = Key extends Token<unknown, infer Names extends string> ? Names : string;
32
+ /**
33
+ * Creates a named `Token` for the given value type, optionally declaring the slot names its bindings may use.
14
34
  *
15
35
  * @since 0.3.16-canary.0
16
36
  */
17
- export declare function token<Value>(name: string): Token<Value>;
37
+ export declare function token<Value, Names extends string = string>(name: string): Token<Value, Names>;
18
38
  /**
19
39
  * Returns the display name of a token or class used as a dependency key.
20
40
  *
21
41
  * @since 0.3.16-canary.0
22
42
  */
23
43
  export declare function tokenName(dependency: Token<unknown> | Constructor): string;
24
- export {};
25
- //# sourceMappingURL=token.d.ts.map
44
+ export {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Creates a named `Token` for the given value type.
2
+ * Creates a named `Token` for the given value type, optionally declaring the slot names its bindings may use.
3
3
  *
4
4
  * @since 0.3.16-canary.0
5
5
  */
@@ -13,5 +13,4 @@ export function token(name) {
13
13
  */
14
14
  export function tokenName(dependency) {
15
15
  return dependency.name;
16
- }
17
- //# sourceMappingURL=token.js.map
16
+ }
@@ -47,8 +47,14 @@ export type DeactivationHandler<Value> = (instance: Value) => void | Promise<voi
47
47
  *
48
48
  * @since 0.3.16-canary.0
49
49
  */
50
- export interface ResolveOptions {
51
- name?: string | undefined;
50
+ export interface ResolveOptions<Names extends string = string> {
51
+ /**
52
+ * The slot name a binding declared with `whenNamed`.
53
+ *
54
+ * @remarks Narrowed to the names the token declares, so a request cannot ask for a name no
55
+ * binding could carry; a token declaring none takes any string.
56
+ */
57
+ name?: Names | undefined;
52
58
  /**
53
59
  * Single-tag shorthand, equivalent to listing the one pair in `tags`.
54
60
  *
@@ -112,5 +118,4 @@ export interface ResolutionContext {
112
118
  *
113
119
  * @since 0.3.16-canary.0
114
120
  */
115
- export type TokenValue<Type> = Type extends Token<infer Value> ? Value : Type extends Constructor<infer Value> ? Value : never;
116
- //# sourceMappingURL=types.d.ts.map
121
+ export type TokenValue<Type> = Type extends Token<infer Value> ? Value : Type extends Constructor<infer Value> ? Value : never;
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
1
+ export {};
@@ -8,6 +8,5 @@ type ClassAccessorDecorator<This, Value> = (target: ClassAccessorDecoratorTarget
8
8
  *
9
9
  * @since 0.3.16-canary.0
10
10
  */
11
- export declare function inject<Value>(token: Token<Value> | Constructor<Value>, options?: InjectOptions): InjectionDescriptor<Value> & ClassAccessorDecorator<unknown, Value>;
12
- export {};
13
- //# sourceMappingURL=inject.d.ts.map
11
+ export declare function inject<Value, Names extends string = string>(token: Token<Value, Names> | Constructor<Value>, options?: NoInfer<InjectOptions<Names>>): InjectionDescriptor<Value> & ClassAccessorDecorator<unknown, Value>;
12
+ export {};
@@ -30,6 +30,8 @@ export function inject(token, options) {
30
30
  // Derived from the descriptor, not from `options`: the descriptor is where the tag shorthand has
31
31
  // already been folded. Built once here rather than per constructed instance.
32
32
  const resolveOptions = injectionSlotToResolveOptions(descriptor);
33
+ // The names are checked above; the container lane only needs the value type.
34
+ const resolveKey = token;
33
35
  const decoratorFn = (_target, context) => {
34
36
  if (context.static) {
35
37
  throw new StaticMemberDecoratorError("inject", String(context.name));
@@ -50,8 +52,8 @@ export function inject(token, options) {
50
52
  const ambient = getAmbientResolution();
51
53
  if (ambient !== undefined) {
52
54
  const value = descriptor.optional
53
- ? ambient.resolveOptional(token, resolveOptions)
54
- : ambient.resolve(token, resolveOptions);
55
+ ? ambient.resolveOptional(resolveKey, resolveOptions)
56
+ : ambient.resolve(resolveKey, resolveOptions);
55
57
  context.access.set(this, value);
56
58
  return;
57
59
  }
@@ -60,8 +62,8 @@ export function inject(token, options) {
60
62
  throw new MissingContainerContextError(classNameOf(this), context.name);
61
63
  }
62
64
  const value = descriptor.optional
63
- ? container.resolveOptional(token, resolveOptions)
64
- : container.resolve(token, resolveOptions);
65
+ ? container.resolveOptional(resolveKey, resolveOptions)
66
+ : container.resolve(resolveKey, resolveOptions);
65
67
  context.access.set(this, value);
66
68
  });
67
69
  return {};
@@ -73,5 +75,4 @@ export function inject(token, options) {
73
75
  }
74
76
  Object.defineProperties(decoratorFn, props);
75
77
  return decoratorFn;
76
- }
77
- //# sourceMappingURL=inject.js.map
78
+ }
@@ -54,5 +54,4 @@ export declare function injectable(): (target: unknown, context: ClassDecoratorC
54
54
  * @since 0.3.16-canary.0
55
55
  */
56
56
  export declare function injectable<const Deps extends ReadonlyArray<InjectableDependency>>(deps: Deps, options?: InjectableOptions): <Target extends abstract new (...args: InjectedParameters<Deps>) => unknown>(target: Target & (number extends Deps["length"] ? unknown : Deps["length"] extends ConstructorParameters<Target>["length"] ? unknown : never), context: ClassDecoratorContext) => void;
57
- export type { InjectableDependency };
58
- //# sourceMappingURL=injectable.d.ts.map
57
+ export type { InjectableDependency };
@@ -52,5 +52,4 @@ export function injectable(deps, options) {
52
52
  options.autoRegister.register(target, scope);
53
53
  }
54
54
  };
55
- }
56
- //# sourceMappingURL=injectable.js.map
55
+ }