Rename DIContainer to TSInjex and refactor interfaces
- Renamed DIContainer class and related references to TSInjex to better indicate its purpose as a TypeScript-based dependency injection container. - Extracted IDependency interface to a separate file to improve modularity. - Split the ITSInjex interface into ITSInjexRegister and ITSInjexResolve, then extended them in a new ITSInjex interface to clarify the separation of concerns. - Updated tests and decorators to reflect the renaming and interface changes. - Adjusted helper, functions, and index export to align with the new TSInjex structure.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { DIContainer } from '../DIContainer';
|
||||
import { TSInjex } from '../TSInjex';
|
||||
import { InitDelegate } from '../types/InitDelegate';
|
||||
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ import { InitDelegate } from '../types/InitDelegate';
|
||||
* - If `true`, an error will be thrown if the dependency cannot be resolved.
|
||||
* - If `false`, `undefined` will be returned if the dependency cannot be resolved.
|
||||
* @returns A decorator function to be applied on the class property.
|
||||
* @see {@link DIContainer}
|
||||
* @see {@link TSInjex}
|
||||
* @example
|
||||
* ```ts
|
||||
* class MyClass {
|
||||
@@ -37,7 +37,7 @@ export function Inject<T, U>(
|
||||
// Unique symbol to store the private property
|
||||
const privatePropertyKey: unique symbol = Symbol();
|
||||
// Get the DI container instance
|
||||
const diContainer = DIContainer.getInstance();
|
||||
const diContainer = TSInjex.getInstance();
|
||||
|
||||
// Function to evaluate the dependency lazily
|
||||
// to avoid circular dependencies, not found dependencies, etc.
|
||||
|
Reference in New Issue
Block a user