@theokit/di 0.1.0 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -4,19 +4,19 @@
4
4
  */
5
5
  /**
6
6
  * Constructor of a class — what TypeScript emits for `class X { ... }`.
7
- * Used as a Class-token (per ADR D2).
7
+ * Used as a Class-token.
8
8
  */
9
9
  type ClassConstructor<T = unknown> = new (...args: any[]) => T;
10
10
  /**
11
11
  * Token: anything that identifies a dependency in the container.
12
12
  *
13
- * Per ADR D2: Class primary (auto-resolution via `reflect-metadata`),
13
+ * Class primary (auto-resolution via `reflect-metadata`),
14
14
  * String fallback (for primitives / interfaces). Symbol explicitly NOT
15
15
  * supported in v1 (deferred to v2 if real demand surfaces).
16
16
  */
17
17
  type Token<T = unknown> = ClassConstructor<T> | string;
18
18
  /**
19
- * Lifecycle scope (per ADR D5). The container honors three modes:
19
+ * Lifecycle scope. The container honors three modes:
20
20
  *
21
21
  * - `SINGLETON` — single instance shared across the entire container
22
22
  * - `TRANSIENT` — fresh instance per resolve
@@ -34,21 +34,62 @@ type Scope = (typeof Scope)[keyof typeof Scope];
34
34
  * Exactly one of `useClass | useFactory | useValue | useExisting` MUST be set.
35
35
  */
36
36
  type Provider<T = unknown> = ClassProvider<T> | FactoryProvider<T> | ValueProvider<T> | ExistingProvider<T>;
37
+ /**
38
+ * Bind a token to a class the container constructs, resolving its constructor parameters.
39
+ *
40
+ * The common case, and the one the bare-class shorthand expands to: passing `MyService` in
41
+ * `providers` is the same as `{ provide: MyService, useClass: MyService }`.
42
+ *
43
+ * The container built it, so the container tears it down: `dispose()` and `@PreDestroy` both run
44
+ * on `container.dispose()`, in reverse construction order.
45
+ */
37
46
  interface ClassProvider<T = unknown> {
38
47
  provide: Token<T>;
39
48
  useClass: ClassConstructor<T>;
40
49
  scope?: Scope;
41
50
  }
51
+ /**
52
+ * Bind a token to whatever a function returns, with its dependencies listed in `inject`.
53
+ *
54
+ * Use it when construction needs more than `new`: a value read from configuration, a handle built
55
+ * by a library, or anything async — a factory may return a Promise, and the token then resolves
56
+ * only through `resolveAsync`. Calling `resolve()` on such a token throws
57
+ * `AsyncProviderInSyncResolveError` rather than handing back the Promise.
58
+ *
59
+ * The container ran the factory, so it tears down what came out — unlike a `useValue`, which it
60
+ * was merely handed.
61
+ */
42
62
  interface FactoryProvider<T = unknown> {
43
63
  provide: Token<T>;
44
64
  useFactory: (...deps: any[]) => T | Promise<T>;
45
65
  inject?: ReadonlyArray<Token>;
46
66
  scope?: Scope;
47
67
  }
68
+ /**
69
+ * Bind a token to a value that already exists.
70
+ *
71
+ * The container stores it as given and constructs nothing, so it does not tear it down either:
72
+ * `container.dispose()` leaves a `useValue` alone even when it has a `dispose()` method. You
73
+ * built it and you still hold the reference, so closing it is yours — and a container that closed
74
+ * it too would make an ordinary teardown a double close, which neither side can see coming.
75
+ *
76
+ * The rule is ownership, and it is the same one that decides the other three: the container tears
77
+ * down what it constructed, because in that case nobody else has the reference.
78
+ */
48
79
  interface ValueProvider<T = unknown> {
49
80
  provide: Token<T>;
50
81
  useValue: T;
51
82
  }
83
+ /**
84
+ * Bind a token as an alias for another token.
85
+ *
86
+ * Both names resolve to the same instance rather than to two of it, which is what makes an alias
87
+ * different from registering the same class twice.
88
+ *
89
+ * Disposal follows from that: the instance is torn down once, by the registration that built it,
90
+ * however many aliases point at it. Counting the alias separately would close one resource once
91
+ * per name it answers to.
92
+ */
52
93
  interface ExistingProvider<T = unknown> {
53
94
  provide: Token<T>;
54
95
  useExisting: Token<T>;
@@ -78,7 +119,7 @@ interface ContainerOptions {
78
119
  * When `true`, allows `register()` / `registerModule()` calls AFTER
79
120
  * the first `resolve()`. Default `false` — fail-fast on misuse.
80
121
  *
81
- * v1.2 EC-R2-5: containers freeze after first resolve to prevent
122
+ * Containers freeze after first resolve to prevent
82
123
  * subtle bugs where a singleton is constructed with one set of
83
124
  * registrations and a different set is added later.
84
125
  */
@@ -92,7 +133,7 @@ interface Disposable {
92
133
  dispose(): void | Promise<void>;
93
134
  }
94
135
  /**
95
- * `analyze()` debug return shape (per ADR D7).
136
+ * `analyze()` debug return shape.
96
137
  */
97
138
  interface DependencyGraph {
98
139
  nodes: ReadonlyArray<{
@@ -111,7 +152,7 @@ interface DependencyGraph {
111
152
  * Dependency-graph helpers — used by `container.analyze()` for debug + by
112
153
  * the registration phase (future) for proactive cycle detection.
113
154
  *
114
- * Per v1.2 EC-11: iterative DFS, NOT recursive, so large graphs (100+ nodes)
155
+ * Iterative DFS, NOT recursive, so large graphs (100+ nodes)
115
156
  * with multiple cycles don't blow the call stack.
116
157
  */
117
158
 
@@ -130,13 +171,24 @@ interface GraphEdge {
130
171
  * - 3 scopes (SINGLETON / TRANSIENT / REQUEST via AsyncLocalStorage)
131
172
  * - 4 provider types (useClass / useFactory / useValue / useExisting)
132
173
  * - Cycle detection at resolve-time (path tracking)
133
- * - Promise-lock REQUEST cache (v1.1 EC-2) with cycle-first ordering
134
- * (v1.2 EC-R2-1) and reject cleanup (v1.2 EC-R2-2)
135
- * - Disposal lifecycle (T3.3) + freeze on first resolve (v1.2 EC-R2-5)
174
+ * - Promise-lock REQUEST cache with cycle-first ordering and reject cleanup
175
+ * - Disposal lifecycle + freeze on first resolve
136
176
  */
137
177
 
138
178
  /**
139
179
  * Lightweight DI container. See `README.md` for usage examples.
180
+ *
181
+ * **On the size of this class.** It is deliberately large: the single point
182
+ * of truth for DI resolution, covering registry lookup, the SINGLETON,
183
+ * TRANSIENT and REQUEST lifecycles, `@Injectable` metadata reads, alias
184
+ * resolution, request-scope propagation through `AsyncLocalStorage`, and the
185
+ * dispose chain. Splitting those concerns across separate classes would
186
+ * fragment cohesion and force consumers to coordinate through an internal
187
+ * micro-interface that buys neither testability nor extensibility.
188
+ *
189
+ * The complexity budget is held at the method level instead: long methods
190
+ * are broken up with Extract Method, which is why several private helpers
191
+ * below exist only to keep their caller readable.
140
192
  */
141
193
  declare class Container {
142
194
  private readonly registrations;
@@ -152,7 +204,7 @@ declare class Container {
152
204
  * - A full Provider (useClass / useFactory / useValue / useExisting)
153
205
  * - A bare class (shorthand expands to ClassProvider { provide: X, useClass: X })
154
206
  *
155
- * Per v1.1 EC-1, ClassProvider validation runs via `validateClassProvider()`
207
+ * ClassProvider validation runs via `validateClassProvider()`
156
208
  * regardless of which API path was used.
157
209
  */
158
210
  register<T>(providerOrClass: Provider<T> | ClassConstructor<T>): void;
@@ -161,9 +213,9 @@ declare class Container {
161
213
  * modules. Walks imports BFS, registers every provider, validates
162
214
  * exports.
163
215
  *
164
- * Per v1.1 EC-4: undecorated class throws `InvalidModuleError`.
165
- * Per v1.2 EC-R2-5: respects the freeze-after-first-resolve guarantee
166
- * (each child `register()` checks `assertNotFrozen`).
216
+ * An undecorated class throws `InvalidModuleError`. Respects the
217
+ * freeze-after-first-resolve guarantee — each child `register()` checks
218
+ * `assertNotFrozen`.
167
219
  */
168
220
  registerModule(moduleClass: ClassConstructor): void;
169
221
  /**
@@ -185,14 +237,14 @@ declare class Container {
185
237
  * providers resolved within `callback` (or any async continuation) share
186
238
  * a single per-request cache.
187
239
  *
188
- * v1.1 EC-3: try/finally guarantees REQUEST-scoped instances are disposed
240
+ * try/finally guarantees REQUEST-scoped instances are disposed
189
241
  * even if the callback throws.
190
242
  */
191
243
  runInRequest<R>(callback: () => R | Promise<R>): Promise<R>;
192
244
  /**
193
245
  * Debug helper — returns a snapshot of the dependency graph.
194
246
  *
195
- * Per ADR D7: detects cycles in unused providers too (resolve-time
247
+ * Detects cycles in unused providers too (resolve-time
196
248
  * detection only fires for resolves that actually traverse the cycle).
197
249
  * Use this proactively in tests / dev mode to surface latent cycles.
198
250
  */
@@ -216,13 +268,13 @@ declare class Container {
216
268
  private tokenOf;
217
269
  private validateProvider;
218
270
  /**
219
- * v1.1 EC-1: shared by both declarative providers: [] AND imperative
271
+ * Shared by both declarative providers: [] AND imperative
220
272
  * register() — every class provider must have @Injectable().
221
273
  */
222
274
  private validateClassProvider;
223
275
  private assertNotDisposed;
224
276
  /**
225
- * v1.2 EC-R2-5: container freezes on first resolve. Late registrations
277
+ * The container freezes on first resolve. Late registrations
226
278
  * require explicit `allowDynamicRegistration: true` (testing escape hatch).
227
279
  */
228
280
  private assertNotFrozen;
@@ -242,14 +294,14 @@ declare class Container {
242
294
  * Resolve constructor params + build instance. Tries sync first; if any
243
295
  * dep is async, falls back to awaiting via `resolveAsync`.
244
296
  *
245
- * Refactored via Extract Method (ADR D422): orchestrates 3 helpers:
246
- * - validateMetadata: EC-12 detect emitDecoratorMetadata off
297
+ * Refactored via Extract Method: orchestrates 3 helpers:
298
+ * - validateMetadata: detect emitDecoratorMetadata off
247
299
  * - tryResolveSync: sync resolution loop with AsyncProvider bailout
248
300
  * - resolveAllAsync: Promise.all fallback when any dep is async
249
301
  */
250
302
  private constructClassWithAsyncFallback;
251
303
  /**
252
- * EC-12 detection: zero paramTypes for a class that declares a non-empty
304
+ * Detection: zero paramTypes for a class that declares a non-empty
253
305
  * constructor strongly suggests emitDecoratorMetadata is off.
254
306
  */
255
307
  private validateMetadata;
@@ -275,6 +327,14 @@ declare class Container {
275
327
  private lookupCache;
276
328
  private storeInCache;
277
329
  private deleteFromCache;
330
+ /**
331
+ * Record an instance for teardown, when this container is the one that should tear it down.
332
+ *
333
+ * Two questions, in this order. Does the container OWN it — see `containerOwned`; a value the
334
+ * caller handed in and an instance reached through an alias are both refused here. And does it
335
+ * have any teardown at all: a class whose only teardown is `@PreDestroy` has no `dispose()`, so
336
+ * testing `isDisposable` alone would silently skip it.
337
+ */
278
338
  private trackInstance;
279
339
  private assertRequestActive;
280
340
  private createContext;
@@ -305,7 +365,7 @@ interface InjectableOptions {
305
365
  }
306
366
  /**
307
367
  * Marks a class as DI-managed. Without this decorator, the container
308
- * rejects the class at registration time (per v1.1 EC-1).
368
+ * rejects the class at registration time.
309
369
  *
310
370
  * @example
311
371
  * @Injectable()
@@ -316,6 +376,52 @@ interface InjectableOptions {
316
376
  */
317
377
  declare function Injectable(options?: InjectableOptions): ClassDecorator;
318
378
 
379
+ /**
380
+ * `@PostConstruct` — method the container calls once the instance is built and every
381
+ * constructor dependency is injected.
382
+ *
383
+ * Runs once per instance, so a SINGLETON initialises once no matter how often it is
384
+ * resolved. If the method returns a Promise, `container.resolveAsync()` awaits it before
385
+ * handing the instance back; `container.resolve()` cannot await, so it throws
386
+ * `AsyncPostConstructInSyncResolveError` rather than return a half-initialised object.
387
+ * A hook that throws propagates, for the same reason.
388
+ *
389
+ * @example
390
+ * ```ts
391
+ * @Injectable()
392
+ * class CacheService {
393
+ * private cache!: Map<string, unknown>
394
+ *
395
+ * @PostConstruct
396
+ * async init() {
397
+ * this.cache = await loadCacheFromRedis()
398
+ * }
399
+ * }
400
+ * ```
401
+ */
402
+ declare function PostConstruct(target: object, propertyKey: string | symbol): void;
403
+ /**
404
+ * `@PreDestroy` — method the container calls when the instance is torn down:
405
+ * `container.dispose()` for SINGLETON, the end of `runInRequest()` for REQUEST.
406
+ *
407
+ * Runs BEFORE `dispose()` when the class has both, and is awaited if it returns a
408
+ * Promise. A class needs no `dispose()` to be torn down — declaring this hook is enough
409
+ * for the container to track it. A hook that throws does not stop the remaining
410
+ * instances; the failures surface together as an `AggregateError`.
411
+ *
412
+ * @example
413
+ * ```ts
414
+ * @Injectable()
415
+ * class DbConnection {
416
+ * @PreDestroy
417
+ * async close() {
418
+ * await this.pool.end()
419
+ * }
420
+ * }
421
+ * ```
422
+ */
423
+ declare function PreDestroy(target: object, propertyKey: string | symbol): void;
424
+
319
425
  /**
320
426
  * Module declaration shape accepted by `@Module({...})`.
321
427
  *
@@ -361,6 +467,67 @@ declare function Module(metadata: ModuleMetadata): ClassDecorator;
361
467
  */
362
468
  declare function Optional(): ParameterDecorator;
363
469
 
470
+ /**
471
+ * `@Primary` — marks a class as the preferred implementation of a token.
472
+ *
473
+ * **This container does not read it.** The decorator records the mark under
474
+ * `METADATA_KEYS.PRIMARY` and nothing else happens: `Container` keeps one
475
+ * registration per token, so registering a second provider for the same token
476
+ * replaces the first regardless of this mark, with a warning on stderr.
477
+ *
478
+ * It stays because the metadata key is exported and the annotation is a real
479
+ * declaration of intent — code generators, module loaders and application
480
+ * wiring can act on it. What it is not is a resolution rule enforced here.
481
+ *
482
+ * Selecting between competing implementations would require the container to
483
+ * hold several registrations per token, which changes cache keys, cycle
484
+ * detection and disposal. That is a design decision, not a missing branch, and
485
+ * it has not been made. Until it is, pick your implementation at registration
486
+ * time:
487
+ *
488
+ * @example
489
+ * ```ts
490
+ * // Decide in the wiring, where the choice is visible:
491
+ * const container = new Container({
492
+ * providers: [{ provide: PAYMENTS, useClass: useStripe ? StripePayments : PayPalPayments }],
493
+ * });
494
+ *
495
+ * // Read the mark yourself if you want to drive that choice from the class:
496
+ * Reflect.getMetadata(METADATA_KEYS.PRIMARY, StripePayments); // true
497
+ * ```
498
+ */
499
+ declare function Primary(target: abstract new (...args: never) => unknown): void;
500
+
501
+ /**
502
+ * `@Qualifier(name)` — names which implementation a constructor parameter wants.
503
+ *
504
+ * **This container does not read it.** The decorator records the name under
505
+ * `METADATA_KEYS.QUALIFIER_NAMES`, keyed by parameter index, and resolution
506
+ * ignores it: `Container` holds one registration per token, so there is nothing
507
+ * for a qualifier to choose between.
508
+ *
509
+ * It stays because the metadata key is exported and the annotation is a real
510
+ * declaration of intent that surrounding tooling can act on. What it is not is a
511
+ * resolution rule enforced here.
512
+ *
513
+ * To actually select an implementation today, give each one its own token and
514
+ * inject that token — which is the same decision, made somewhere a reader can
515
+ * see it:
516
+ *
517
+ * @example
518
+ * ```ts
519
+ * const STRIPE = "payments.stripe";
520
+ *
521
+ * @Injectable()
522
+ * class OrderService {
523
+ * constructor(@Inject(STRIPE) private payments: PaymentGateway) {}
524
+ * }
525
+ * ```
526
+ *
527
+ * @see {@link Primary} — the same limitation, from the provider's side.
528
+ */
529
+ declare function Qualifier(name: string): ParameterDecorator;
530
+
364
531
  /**
365
532
  * Typed error classes. All container failure modes use these — never
366
533
  * `throw new Error(...)` from production code (per system type-safety rule).
@@ -385,9 +552,9 @@ declare class TokenNotFoundError extends Error {
385
552
  }
386
553
  /**
387
554
  * Thrown when a resolution chain contains a cycle (A → B → A).
388
- * Per ADR D7: detected at resolve-time (not register-time).
555
+ * Detected at resolve-time, not register-time.
389
556
  *
390
- * v1.2 EC-R2-1: cycle check happens BEFORE cache lookup in resolveAsync
557
+ * The cycle check happens BEFORE cache lookup in resolveAsync
391
558
  * to prevent infinite Promise await deadlocks on async REQUEST-scoped
392
559
  * cycles.
393
560
  */
@@ -405,6 +572,21 @@ declare class AsyncProviderInSyncResolveError extends Error {
405
572
  readonly name: "AsyncProviderInSyncResolveError";
406
573
  constructor(token: Token);
407
574
  }
575
+ /**
576
+ * Thrown when a class resolved through sync `resolve()` declares an async
577
+ * `@PostConstruct` hook.
578
+ *
579
+ * The synchronous path cannot await it, and returning an instance whose
580
+ * initialiser is still running would hand the caller something that looks ready
581
+ * and is not — a failure that surfaces later, somewhere else. Failing here names
582
+ * the class and the method instead.
583
+ */
584
+ declare class AsyncPostConstructInSyncResolveError extends Error {
585
+ readonly className: string;
586
+ readonly methodName: string;
587
+ readonly name: "AsyncPostConstructInSyncResolveError";
588
+ constructor(className: string, methodName: string);
589
+ }
408
590
  /**
409
591
  * Thrown when a REQUEST-scoped provider is resolved outside of
410
592
  * `container.runInRequest()`.
@@ -420,7 +602,7 @@ declare class ScopeViolationError extends Error {
420
602
  * `design:paramtypes` metadata that the container needs to auto-resolve
421
603
  * constructor parameters.
422
604
  *
423
- * v1.1 EC-1: validateClassProvider() is called by BOTH the declarative
605
+ * validateClassProvider() is called by BOTH the declarative
424
606
  * `providers: []` path AND the imperative `container.register()` path.
425
607
  */
426
608
  declare class MissingInjectableError extends Error {
@@ -442,7 +624,7 @@ declare class ContainerDisposedError extends Error {
442
624
  }
443
625
  /**
444
626
  * Thrown when `register()` or `registerModule()` is called AFTER the first
445
- * `resolve()` has materialized a singleton. Per ADR D7 + EC-R2-5, the
627
+ * `resolve()` has materialized a singleton. The
446
628
  * container freezes after first resolve unless
447
629
  * `allowDynamicRegistration: true` was passed to the constructor.
448
630
  */
@@ -462,18 +644,75 @@ declare class ReflectMetadataMissingError extends Error {
462
644
  constructor();
463
645
  }
464
646
 
647
+ /**
648
+ * Single source of truth for the metadata keys our decorators write and
649
+ * the container reads. Keeping them here means container.ts and
650
+ * decorators/*.ts agree on the wire format.
651
+ */
652
+
653
+ declare const METADATA_KEYS: {
654
+ /** Marker that a class was decorated with `@Injectable()`. */
655
+ readonly INJECTABLE: "usetheo:di:injectable";
656
+ /** Map<number, Token> from `@Inject(token)` parameter decorators. */
657
+ readonly INJECT_TOKENS: "usetheo:di:inject-tokens";
658
+ /** Set<number> from `@Optional()` parameter decorators. */
659
+ readonly OPTIONAL_FLAGS: "usetheo:di:optional";
660
+ /** TS-emitted constructor parameter types (requires `emitDecoratorMetadata`). */
661
+ readonly DESIGN_PARAMTYPES: "design:paramtypes";
662
+ /** Map<number, string> from `@Qualifier(name)` parameter decorators. */
663
+ readonly QUALIFIER_NAMES: "usetheo:di:qualifier-names";
664
+ /** boolean from `@Primary` class decorator. */
665
+ readonly PRIMARY: "usetheo:di:primary";
666
+ /** string | symbol from `@PostConstruct` method decorator. */
667
+ readonly POST_CONSTRUCT: "usetheo:di:post-construct";
668
+ /** string | symbol from `@PreDestroy` method decorator. */
669
+ readonly PRE_DESTROY: "usetheo:di:pre-destroy";
670
+ /** Map<string|symbol, SandboxOptions> from `@UseSandbox()` property decorator. */
671
+ readonly SANDBOX: "usetheo:di:sandbox";
672
+ /** Map<string|symbol, SubAgentSpec> from `@SubAgent()` property decorator. */
673
+ readonly SUBAGENT: "usetheo:di:subagent";
674
+ /** Map<string|symbol, SquadMetadata> from `@Squad()` property decorator. */
675
+ readonly SQUAD: "usetheo:di:squad";
676
+ /** Map<string|symbol, StepMetadata> from `@Step()` method decorator. */
677
+ readonly STEP: "usetheo:di:step";
678
+ /** Map<string|symbol, HitlMetadata> from `@Hitl()` method decorator. */
679
+ readonly HITL: "usetheo:di:hitl";
680
+ /** AutoSummarizeConfig from `@AutoSummarize()` class decorator. */
681
+ readonly AUTO_SUMMARIZE: "usetheo:di:auto-summarize";
682
+ /** Map<string|symbol, ToolOptions> from `@Tool()` property decorator. */
683
+ readonly TOOL: "usetheo:di:tool";
684
+ /** WorkflowOptions from `@Workflow()` class decorator. */
685
+ readonly WORKFLOW: "usetheo:di:workflow";
686
+ /** EvalOptions from `@Eval()` class decorator. */
687
+ readonly EVAL: "usetheo:di:eval";
688
+ /** Map<string|symbol, CronMetadata> from `@Cron()` method decorator. */
689
+ readonly CRON: "usetheo:di:cron";
690
+ /** Map<string|symbol, SubscriptionOptions> from `@Subscription()` property decorator. */
691
+ readonly SUBSCRIPTION: "usetheo:di:subscription";
692
+ /** AuthOptions from `@Auth()` class decorator. */
693
+ readonly AUTH: "usetheo:di:auth";
694
+ /** Map<string|symbol, RetrieverOptions> from `@Retriever()` property decorator. */
695
+ readonly RETRIEVER: "usetheo:di:retriever";
696
+ /** Map<string|symbol, RerankerOptions> from `@Reranker()` property decorator. */
697
+ readonly RERANKER: "usetheo:di:reranker";
698
+ /** Map<string|symbol, TextSplitterOptions> from `@TextSplitter()` property decorator. */
699
+ readonly TEXT_SPLITTER: "usetheo:di:text-splitter";
700
+ /** Map<string|symbol, MemoryScopeOptions> from `@MemoryScopeDecorator()` property decorator. */
701
+ readonly MEMORY_SCOPE: "usetheo:di:memory-scope";
702
+ };
703
+
465
704
  /**
466
705
  * Module-loader — walks @Module() classes in BFS order, registers their
467
706
  * providers, validates imports + exports visibility, detects cyclic imports.
468
707
  *
469
- * Per ADR D4: modules are OPT-IN. Default usage is flat container.
470
- * Per v1.1 EC-4: registerModule() rejects undecorated classes with
708
+ * Modules are OPT-IN. Default usage is flat container.
709
+ * registerModule() rejects undecorated classes with
471
710
  * InvalidModuleError pointing to the missing decorator.
472
711
  */
473
712
 
474
713
  /**
475
714
  * Thrown when a class is passed to `Container.registerModule()` without
476
- * the `@Module()` decorator (v1.1 EC-4 MUST FIX).
715
+ * the `@Module()` decorator.
477
716
  */
478
717
  declare class InvalidModuleError extends Error {
479
718
  readonly target: {
@@ -486,7 +725,7 @@ declare class InvalidModuleError extends Error {
486
725
  }
487
726
  /**
488
727
  * Thrown when a module declares an export for a token that isn't in its
489
- * own `providers` (v1.1 EC-8 SHOULD TEST — pin register-time validation).
728
+ * own `providers` — this pins register-time validation.
490
729
  */
491
730
  declare class InvalidExportError extends Error {
492
731
  readonly moduleName: string;
@@ -503,4 +742,4 @@ declare class CyclicModuleImportError extends Error {
503
742
  constructor(cycle: ReadonlyArray<string>);
504
743
  }
505
744
 
506
- export { AsyncProviderInSyncResolveError, type ClassConstructor, type ClassProvider, Container, ContainerDisposedError, ContainerFrozenError, type ContainerOptions, CyclicDependencyError, CyclicModuleImportError, type DependencyGraph, type Disposable, type ExistingProvider, type FactoryProvider, Inject, Injectable, type InjectableOptions, InvalidExportError, InvalidModuleError, MissingInjectableError, Module, type ModuleMetadata, Optional, type Provider, ReflectMetadataMissingError, type ResolutionContext, Scope, ScopeViolationError, type Token, TokenNotFoundError, type ValueProvider, describeToken };
745
+ export { AsyncPostConstructInSyncResolveError, AsyncProviderInSyncResolveError, type ClassConstructor, type ClassProvider, Container, ContainerDisposedError, ContainerFrozenError, type ContainerOptions, CyclicDependencyError, CyclicModuleImportError, type DependencyGraph, type Disposable, type ExistingProvider, type FactoryProvider, Inject, Injectable, type InjectableOptions, InvalidExportError, InvalidModuleError, METADATA_KEYS, MissingInjectableError, Module, type ModuleMetadata, Optional, PostConstruct, PreDestroy, Primary, type Provider, Qualifier, ReflectMetadataMissingError, type ResolutionContext, Scope, ScopeViolationError, type Token, TokenNotFoundError, type ValueProvider, describeToken };