inwire 2.1.1 → 2.1.2
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.mts +6 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -32,11 +32,11 @@ interface ScopeOptions {
|
|
|
32
32
|
* c.inspect(); // ContainerGraph
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
type Container<T extends Record<string,
|
|
35
|
+
type Container<T extends Record<string, any> = Record<string, unknown>> = T & IContainer<T>;
|
|
36
36
|
/**
|
|
37
37
|
* Container methods interface. Defines the API available on every container.
|
|
38
38
|
*/
|
|
39
|
-
interface IContainer<T extends Record<string,
|
|
39
|
+
interface IContainer<T extends Record<string, any> = Record<string, unknown>> {
|
|
40
40
|
/**
|
|
41
41
|
* Creates a child container with additional dependencies.
|
|
42
42
|
* Child inherits all parent singletons and can add/override deps.
|
|
@@ -75,7 +75,7 @@ interface IContainer<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
75
75
|
* );
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
-
module<TNew extends Record<string,
|
|
78
|
+
module<TNew extends Record<string, any>>(fn: (builder: ContainerBuilder<Record<string, unknown>, T>) => ContainerBuilder<Record<string, unknown>, TNew>): Container<TNew>;
|
|
79
79
|
/**
|
|
80
80
|
* Pre-resolves dependencies (warm-up).
|
|
81
81
|
* Call with specific keys to resolve only those, or without arguments to resolve all.
|
|
@@ -185,7 +185,7 @@ interface ContainerWarning {
|
|
|
185
185
|
* Each `.add()` call accumulates the type so that subsequent factories
|
|
186
186
|
* receive a fully-typed `c` parameter with all previously registered deps.
|
|
187
187
|
*/
|
|
188
|
-
declare class ContainerBuilder<TContract extends Record<string,
|
|
188
|
+
declare class ContainerBuilder<TContract extends Record<string, any> = Record<string, unknown>, TBuilt extends Record<string, any> = {}> {
|
|
189
189
|
private readonly factories;
|
|
190
190
|
/**
|
|
191
191
|
* Registers a dependency — factory (lazy) or instance (eager).
|
|
@@ -202,7 +202,7 @@ declare class ContainerBuilder<TContract extends Record<string, unknown> = Recor
|
|
|
202
202
|
* Applies a module — a function that chains `.add()` calls on this builder.
|
|
203
203
|
* `c` in the module's factories is fully typed with all previously registered deps.
|
|
204
204
|
*/
|
|
205
|
-
addModule<TNew extends Record<string,
|
|
205
|
+
addModule<TNew extends Record<string, any>>(module: (builder: ContainerBuilder<TContract, TBuilt>) => ContainerBuilder<TContract, TNew>): ContainerBuilder<TContract, TNew>;
|
|
206
206
|
/**
|
|
207
207
|
* Returns the accumulated factories as a plain record.
|
|
208
208
|
* @internal Used by `module()` on the container.
|
|
@@ -235,7 +235,7 @@ declare class ContainerBuilder<TContract extends Record<string, unknown> = Recor
|
|
|
235
235
|
* .build()
|
|
236
236
|
* ```
|
|
237
237
|
*/
|
|
238
|
-
declare function container<T extends Record<string,
|
|
238
|
+
declare function container<T extends Record<string, any> = Record<string, unknown>>(): ContainerBuilder<T>;
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/domain/errors.d.ts
|
|
241
241
|
/**
|
package/package.json
CHANGED