diff --git a/assets/highlight.css b/assets/highlight.css index 4a4d100..7838b4d 100644 --- a/assets/highlight.css +++ b/assets/highlight.css @@ -13,6 +13,10 @@ --dark-hl-5: #569CD6; --light-hl-6: #795E26; --dark-hl-6: #DCDCAA; + --light-hl-7: #0070C1; + --dark-hl-7: #4FC1FF; + --light-hl-8: #AF00DB; + --dark-hl-8: #C586C0; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } @@ -25,6 +29,8 @@ --hl-4: var(--light-hl-4); --hl-5: var(--light-hl-5); --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); --code-background: var(--light-code-background); } } @@ -36,6 +42,8 @@ --hl-4: var(--dark-hl-4); --hl-5: var(--dark-hl-5); --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); --code-background: var(--dark-code-background); } } @@ -47,6 +55,8 @@ --hl-4: var(--light-hl-4); --hl-5: var(--light-hl-5); --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); --code-background: var(--light-code-background); } @@ -58,6 +68,8 @@ --hl-4: var(--dark-hl-4); --hl-5: var(--dark-hl-5); --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); --code-background: var(--dark-code-background); } @@ -68,4 +80,6 @@ .hl-4 { color: var(--hl-4); } .hl-5 { color: var(--hl-5); } .hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } pre, code { background: var(--code-background); } diff --git a/classes/classes_TSinjex.TSinjex.html b/classes/classes_TSinjex.TSinjex.html index 07050a5..d5c8399 100644 --- a/classes/classes_TSinjex.TSinjex.html +++ b/classes/classes_TSinjex.TSinjex.html @@ -1,4 +1,4 @@ -TSinjex | ts-injex - v1.1.0

TSinjex

The main class for the Dependency Injection Container TSinjex.

+TSinjex | ts-injex - v1.2.0

TSinjex

The main class for the Dependency Injection Container TSinjex.

  • Register for registering a class in the DI container.
  • RegisterInstance for registering an instance in the DI container.
  • @@ -9,7 +9,7 @@
  • register for registering a dependency (class or instance) as a function.
  • resolve for resolving a dependency as a function.
-

Implements

Constructors

Implements

Constructors

Properties

Methods

register @@ -18,22 +18,22 @@ register resolve

Constructors

Properties

_dependencies: Map<Identifier, IDependency> = ...

The dependencies map.

-
_instance: TSinjex

The singleton instance of the TSinjex class.

-

Methods

Properties

_dependencies: Map<Identifier, IDependency> = ...

The dependencies map.

+
_instance: TSinjex

The singleton instance of the TSinjex class.

+

Methods

  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • deprecated: boolean = false

      If true, the dependency is deprecated => a warning is logged when the dependency is resolved.

      -

    Returns void

  • Resolve a dependency

    +

Returns void

  • Resolve a dependency

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency

    • necessary: boolean = true

      If true, throws an error if the dependency is not found

    Returns undefined | T

    The resolved dependency or undefined if the dependency is not found

    A DependencyResolutionError if the dependency is not found and necessary.

    -
+
diff --git a/classes/interfaces_Exceptions.DependencyResolutionError.html b/classes/interfaces_Exceptions.DependencyResolutionError.html index ab3fe43..3440ad1 100644 --- a/classes/interfaces_Exceptions.DependencyResolutionError.html +++ b/classes/interfaces_Exceptions.DependencyResolutionError.html @@ -1,6 +1,6 @@ -DependencyResolutionError | ts-injex - v1.1.0

Error class for dependency resolution errors in ITSinjex.

+DependencyResolutionError | ts-injex - v1.2.0

Error class for dependency resolution errors in ITSinjex.

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

message name stack? @@ -9,7 +9,7 @@

Methods

Constructors

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

+

Returns DependencyResolutionError

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

+

Parameters

  • targetObject: object
  • OptionalconstructorOpt: Function

Returns void

diff --git a/classes/interfaces_Exceptions.InitializationError.html b/classes/interfaces_Exceptions.InitializationError.html index 050098a..834f287 100644 --- a/classes/interfaces_Exceptions.InitializationError.html +++ b/classes/interfaces_Exceptions.InitializationError.html @@ -1,6 +1,6 @@ -InitializationError | ts-injex - v1.1.0

Error class for errors during the initialization of a dependency in ITSinjex.

+InitializationError | ts-injex - v1.2.0

Error class for errors during the initialization of a dependency in ITSinjex.

ITSinjex.inject

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

message name stack? @@ -10,7 +10,7 @@

Constructors

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

+

Returns InitializationError

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

+

Parameters

  • targetObject: object
  • OptionalconstructorOpt: Function

Returns void

diff --git a/classes/interfaces_Exceptions.InjectorError.html b/classes/interfaces_Exceptions.InjectorError.html index 7c61186..7e95db4 100644 --- a/classes/interfaces_Exceptions.InjectorError.html +++ b/classes/interfaces_Exceptions.InjectorError.html @@ -1,6 +1,6 @@ -InjectorError | ts-injex - v1.1.0

Error class for Injector errors in ITSinjex.

+InjectorError | ts-injex - v1.2.0

Error class for Injector errors in ITSinjex.

ITSinjex.inject

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

message name stack? @@ -10,7 +10,7 @@

Constructors

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

+

Returns InjectorError

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

+

Parameters

  • targetObject: object
  • OptionalconstructorOpt: Function

Returns void

diff --git a/classes/interfaces_Exceptions.NoInstantiationMethodError.html b/classes/interfaces_Exceptions.NoInstantiationMethodError.html index 6458f27..26781b5 100644 --- a/classes/interfaces_Exceptions.NoInstantiationMethodError.html +++ b/classes/interfaces_Exceptions.NoInstantiationMethodError.html @@ -1,6 +1,6 @@ -NoInstantiationMethodError | ts-injex - v1.1.0

Error class for missing instantiation methods in ITSinjex.

+NoInstantiationMethodError | ts-injex - v1.2.0

Error class for missing instantiation methods in ITSinjex.

ITSinjex.inject

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

message name stack? @@ -9,7 +9,7 @@

Methods

Constructors

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

+

Returns NoInstantiationMethodError

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

+

Parameters

  • targetObject: object
  • OptionalconstructorOpt: Function

Returns void

diff --git a/classes/interfaces_Exceptions.TSinjexError.html b/classes/interfaces_Exceptions.TSinjexError.html index d55f814..9ab6169 100644 --- a/classes/interfaces_Exceptions.TSinjexError.html +++ b/classes/interfaces_Exceptions.TSinjexError.html @@ -1,5 +1,5 @@ -TSinjexError | ts-injex - v1.1.0

General error class for ITSinjex interface.

-

Hierarchy (view full)

Constructors

constructor +TSinjexError | ts-injex - v1.2.0

General error class for ITSinjex interface.

+

Hierarchy (view full)

Constructors

Properties

message name stack? @@ -8,7 +8,7 @@

Methods

Constructors

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

+

Returns TSinjexError

Properties

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

+

Parameters

Returns void

diff --git a/coverage/badges/badge-branches.svg b/coverage/badges/badge-branches.svg index b7cabab..822861e 100644 --- a/coverage/badges/badge-branches.svg +++ b/coverage/badges/badge-branches.svg @@ -1 +1 @@ -branches: 90.78%branches90.78% \ No newline at end of file +branches: 91.02%branches91.02% \ No newline at end of file diff --git a/coverage/coverage-summary.json b/coverage/coverage-summary.json index 57ba23e..92e5f78 100644 --- a/coverage/coverage-summary.json +++ b/coverage/coverage-summary.json @@ -1,9 +1,9 @@ -{"total": {"lines":{"total":121,"covered":118,"skipped":0,"pct":97.52},"statements":{"total":128,"covered":124,"skipped":0,"pct":96.87},"functions":{"total":37,"covered":36,"skipped":0,"pct":97.29},"branches":{"total":76,"covered":69,"skipped":0,"pct":90.78},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} +{"total": {"lines":{"total":121,"covered":118,"skipped":0,"pct":97.52},"statements":{"total":128,"covered":124,"skipped":0,"pct":96.87},"functions":{"total":37,"covered":36,"skipped":0,"pct":97.29},"branches":{"total":78,"covered":71,"skipped":0,"pct":91.02},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/TSinjex/TSinjex/src/classes/TSinjex.ts": {"lines":{"total":19,"covered":19,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":21,"covered":21,"skipped":0,"pct":100},"branches":{"total":11,"covered":11,"skipped":0,"pct":100}} ,"/home/runner/work/TSinjex/TSinjex/src/decorators/Inject.ts": {"lines":{"total":29,"covered":28,"skipped":0,"pct":96.55},"functions":{"total":9,"covered":9,"skipped":0,"pct":100},"statements":{"total":30,"covered":29,"skipped":0,"pct":96.66},"branches":{"total":25,"covered":22,"skipped":0,"pct":88}} ,"/home/runner/work/TSinjex/TSinjex/src/decorators/Register.ts": {"lines":{"total":25,"covered":25,"skipped":0,"pct":100},"functions":{"total":8,"covered":8,"skipped":0,"pct":100},"statements":{"total":25,"covered":25,"skipped":0,"pct":100},"branches":{"total":11,"covered":10,"skipped":0,"pct":90.9}} ,"/home/runner/work/TSinjex/TSinjex/src/decorators/RegisterInstance.ts": {"lines":{"total":5,"covered":5,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":6,"covered":6,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}} -,"/home/runner/work/TSinjex/TSinjex/src/functions/inject.ts": {"lines":{"total":22,"covered":22,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":25,"covered":24,"skipped":0,"pct":96},"branches":{"total":25,"covered":22,"skipped":0,"pct":88}} +,"/home/runner/work/TSinjex/TSinjex/src/functions/inject.ts": {"lines":{"total":22,"covered":22,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":25,"covered":24,"skipped":0,"pct":96},"branches":{"total":27,"covered":24,"skipped":0,"pct":88.88}} ,"/home/runner/work/TSinjex/TSinjex/src/functions/register.ts": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/TSinjex/TSinjex/src/functions/resolve.ts": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/TSinjex/TSinjex/src/interfaces/Exceptions.ts": {"lines":{"total":15,"covered":13,"skipped":0,"pct":86.66},"functions":{"total":5,"covered":4,"skipped":0,"pct":80},"statements":{"total":15,"covered":13,"skipped":0,"pct":86.66},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} diff --git a/coverage/lcov-report/classes/TSinjex.ts.html b/coverage/lcov-report/classes/TSinjex.ts.html index b42e1eb..821c756 100644 --- a/coverage/lcov-report/classes/TSinjex.ts.html +++ b/coverage/lcov-report/classes/TSinjex.ts.html @@ -451,7 +451,7 @@ export class TSinjex implements ITSinjex {
  • A decorator to inject a dependency from a DI (Dependency Injection) container into a class property.

    +Inject | ts-injex - v1.2.0
    • A decorator to inject a dependency from a DI (Dependency Injection) container into a class property.

      Type Parameters

      • T

        The type of the dependency to be injected.

      • U

        The type of the property to be injected.

      Parameters

      • identifier: Identifier

        The identifier used to resolve the class in the DI container.

        @@ -22,4 +22,4 @@ and not found, or throws an error if the dependency is necessary and not found.<
        class MyClass {
        @Inject('ILogger_', (x: ILogger_) => x.getLogger('Tags'), false)
        private _logger?: ILogger;
        }
        -
    +
diff --git a/functions/decorators_Register.Register.html b/functions/decorators_Register.Register.html index 3879584..42b0517 100644 --- a/functions/decorators_Register.Register.html +++ b/functions/decorators_Register.Register.html @@ -1,4 +1,4 @@ -Register | ts-injex - v1.1.0
  • A decorator to register a class in the TSinjex DI (Dependency Injection) container.

    +Register | ts-injex - v1.2.0
    • A decorator to register a class in the TSinjex DI (Dependency Injection) container.

      Type Parameters

      • TargetType extends (new (...args: unknown[]) => InstanceType<TargetType>)

        The type of the class to be registered.

      Parameters

      • identifier: Identifier

        The identifier used to register the class in the DI container.

      • Optionaldeprecated: boolean

        If true, the dependency is deprecated and a warning @@ -11,7 +11,7 @@ is logged only once upon the first resolution of the dependency.

        @Register('MyClassIdentifier', true)
        class MyClass {
        // ...
        }
        -
      • A decorator to register an instance of a class in the DI (Dependency Injection) container.

        +
      • A decorator to register an instance of a class in the DI (Dependency Injection) container.

        Type Parameters

        • TargetType extends (new (..._args: unknown[]) => InstanceType<TargetType>)

          The type of the class whose instance is to be registered.

        Parameters

        • identifier: Identifier

          The identifier used to register the instance in the DI container.

        • shouldRegister: "instance"

          Set to 'instance' to register the instance in the DI container @@ -26,7 +26,7 @@ is logged only once upon the first resolution of the dependency.

          @RegisterInstance('MyClassInstanceIdentifier', 'instance', true)
          class MyClass {
          // ...
          }
          -
        • A decorator to register an instance of a class in the DI (Dependency Injection) container.

          +
        • A decorator to register an instance of a class in the DI (Dependency Injection) container.

          Type Parameters

          • TargetType extends (new (..._args: unknown[]) => InstanceType<TargetType>)

            The type of the class whose instance is to be registered.

          Parameters

          • identifier: Identifier

            The identifier used to register the instance in the DI container.

          • Optionalinit: InitDelegate<TargetType & (new (..._args: unknown[]) => InstanceType<TargetType>), InstanceType<TargetType>>

            An optional initializer function which get the constructor of the class @@ -44,4 +44,4 @@ is logged only once upon the first resolution of the dependency.

            @RegisterInstance('MyClassInstanceIdentifier', (constructor) => new constructor(), true)
            class MyClass {
            // ...
            }
            -
    +
diff --git a/functions/decorators_RegisterInstance.RegisterInstance.html b/functions/decorators_RegisterInstance.RegisterInstance.html index c71e3f6..9633651 100644 --- a/functions/decorators_RegisterInstance.RegisterInstance.html +++ b/functions/decorators_RegisterInstance.RegisterInstance.html @@ -1,4 +1,4 @@ -RegisterInstance | ts-injex - v1.1.0
  • A decorator to register an instance of a class in the DI (Dependency Injection) container.

    +RegisterInstance | ts-injex - v1.2.0
    • A decorator to register an instance of a class in the DI (Dependency Injection) container.

      Type Parameters

      • TargetType extends (new (..._args: unknown[]) => InstanceType<TargetType>)

        The type of the class whose instance is to be registered.

      Parameters

    +
diff --git a/functions/functions_inject.inject.html b/functions/functions_inject.inject.html index 5f9fb37..99012a3 100644 --- a/functions/functions_inject.inject.html +++ b/functions/functions_inject.inject.html @@ -1,25 +1,84 @@ -inject | ts-injex - v1.1.0
  • A function to inject a dependency from a DI (Dependency Injection) container into a variable.

    -

    Type Parameters

    • T

      The type of the dependency to be injected.

      -
    • U

      The type of the property to be injected.

      -

    Parameters

    • identifier: Identifier

      The identifier used to resolve the class in the DI container.

      -
    • Optionalinit: true | InitDelegate<T, U>

      Optional an initializer function to transform the dependency before injection -or true to instantiate the dependency if it has a constructor.

      -
    • isNecessary: boolean = true

      If true, throws an error if the dependency is not found.

      -

    Returns T | U | undefined

    The resolved dependency or undefined if the dependency is not necessary -and not found, or throws an error if the dependency is necessary and not found.

    -
      +inject | ts-injex - v1.2.0

      A function to inject a dependency from a DI (Dependency Injection) container into a variable. +This is the actual implementation that handles all overload variants.

      +

      The original dependency type.

      +

      The final return type after optional initialization or transformation.

      +

      The identifier used to resolve the dependency.

      + -

      Only throws errors if the dependency is necessary.

      -

      A DependencyResolutionError if the dependency is not found.

      -

      A InjectorError if an error occurs during the injection process.

      -

      A NoInstantiationMethodError if the dependency does not have a constructor.

      -

      An InitializationError if an error occurs during the initialization process.

      -
      let myDependency = inject<MyDependency>('MyDependencyIdentifier');
      +

      Optional: either true to instantiate via constructor, false to skip, or a function to transform the dependency.

      +

      If true, throws on failure; if false, returns undefined on resolution or initialization errors.

      +

      The resolved dependency or result of initialization, or undefined if not necessary and resolution fails.

      +

      A DependencyResolutionError if the dependency is not found (and necessary).

      +

      A NoInstantiationMethodError if instantiation is requested but no constructor exists.

      +

      An InitializationError if the initializer throws an error.

      +

      A InjectorError for unknown errors during resolution or transformation.

      +
      const service = inject<Service>('Service');
       
      -
      let logger = inject<ILogger>('ILogger_', (x: ILogger_) => x.getLogger('Tags'), false);
      +
      const instance = inject<Service>('Service', true);
       
      -
+
const logger = inject<ILogger>('ILogger_', (x) => x.getLogger('Module'), false);
+
+ +
  • Resolves a dependency by its identifier without initialization or instantiation.

    +

    Type Parameters

    • T

      The expected type of the dependency.

      +

    Parameters

    • identifier: Identifier

      The identifier used to resolve the dependency from the container.

      +

    Returns T

    The resolved dependency.

    +

    A DependencyResolutionError if the dependency is not found.

    +
    const logger = inject<Logger>('Logger');
    +
    + +
  • Resolves and instantiates a dependency using its constructor.

    +

    Type Parameters

    • T

      The expected class type of the dependency.

      +

    Parameters

    • identifier: Identifier

      The identifier used to resolve the dependency from the container.

      +
    • shouldInit: true

      Set to true to instantiate the dependency after resolution.

      +

    Returns T

    The resolved and instantiated dependency.

    +

    A DependencyResolutionError if the dependency is not found.

    +

    A NoInstantiationMethodError if the dependency has no constructor.

    +

    An InitializationError if instantiation fails.

    +
    const instance = inject<Service>('Service', true);
    +
    + +
  • Resolves and instantiates a dependency using its constructor, optionally failing silently.

    +

    Type Parameters

    • T

      The expected class type of the dependency.

      +

    Parameters

    • identifier: Identifier

      The identifier used to resolve the dependency from the container.

      +
    • shouldInit: true

      Set to true to instantiate the dependency.

      +
    • isNecessary: false

      If false, resolution or instantiation errors return undefined instead of throwing.

      +

    Returns T | undefined

    The resolved and instantiated dependency, or undefined if resolution or instantiation fails.

    +
    const instance = inject<Service>('OptionalService', true, false);
    if (instance) instance.doSomething(); +
    + +
  • Resolves a dependency without instantiating it, optionally failing silently.

    +

    Type Parameters

    • T

      The expected type of the dependency.

      +

    Parameters

    • identifier: Identifier

      The identifier used to resolve the dependency from the container.

      +
    • shouldInit: false

      Set to false to skip instantiation.

      +
    • isNecessary: false

      If false, resolution errors return undefined instead of throwing.

      +

    Returns T | undefined

    The resolved dependency, or undefined if not found.

    +
    const config = inject<Config>('Config', false, false) ?? getDefaultConfig();
    +
    + +
  • Resolves a dependency and applies a custom initializer function to transform the result.

    +

    Type Parameters

    • T

      The original dependency type.

      +
    • U

      The final return type after initialization.

      +

    Parameters

    • identifier: Identifier

      The identifier used to resolve the dependency.

      +
    • init: InitDelegate<T, U>

      A function to transform or initialize the dependency.

      +

    Returns U

    The transformed dependency.

    +

    A DependencyResolutionError if the dependency is not found.

    +

    An InitializationError if the initializer throws.

    +
    const client = inject<Api>('Api', (api) => api.getClient());
    +
    + +
  • Resolves a dependency and applies a custom initializer function, optionally failing silently.

    +

    Type Parameters

    • T

      The original dependency type.

      +
    • U

      The final return type after initialization.

      +

    Parameters

    • identifier: Identifier

      The identifier used to resolve the dependency.

      +
    • init: InitDelegate<T, U>

      A function to transform or initialize the dependency.

      +
    • isNecessary: false

      If false, resolution or initializer errors return undefined instead of throwing.

      +

    Returns U | undefined

    The transformed dependency, or undefined if resolution or initialization fails.

    +
    const db = inject<Database, Pool>('Database', (d) => d.getPool(), false);
    if (db) db.query('SELECT * FROM users'); +
    + +
diff --git a/functions/functions_register.register.html b/functions/functions_register.register.html index a0d48b7..21cdd44 100644 --- a/functions/functions_register.register.html +++ b/functions/functions_register.register.html @@ -1,4 +1,4 @@ -register | ts-injex - v1.1.0

Register a dependency.

+register | ts-injex - v1.2.0

Register a dependency.

The identifier used to register the class in the DI container.

Identifier for more information on identifiers.

The dependency to register.

@@ -8,9 +8,9 @@ is logged when the dependency is resolved.

Type Parameters

  • T

Parameters

  • identifier: Identifier

    The identifier used to register the class in the DI container.

  • dependency: T

    The dependency to register.

Returns void

Identifier for more information on identifiers..

-
  • Register a dependency.

    +
  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier used to register the class in the DI container.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: true

      A warning is logged when the dependency is resolved.

    Returns void

    Identifier for more information on identifiers.

    -
  • +
    diff --git a/functions/functions_resolve.resolve.html b/functions/functions_resolve.resolve.html index bd3c213..8efd333 100644 --- a/functions/functions_resolve.resolve.html +++ b/functions/functions_resolve.resolve.html @@ -1,4 +1,4 @@ -resolve | ts-injex - v1.1.0

    Resolve a dependency.

    +resolve | ts-injex - v1.2.0

    Resolve a dependency.

    The identifier used to register the class in the DI container.

    Identifier for more information on identifiers.

    If true, throws an error if the dependency is not found.

    @@ -10,9 +10,9 @@ and not found, or throws an error if the dependency is necessary and not found.<

    Returns T

    The resolved dependency.

    Identifier for more information on identifiers.

    A DependencyResolutionError if the dependency is not found.

    -
  • Resolve a dependency

    +
  • Resolve a dependency

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier used to register the class in the DI container.

    • isNecessary: false

      The dependency is not necessary.

    Returns T | undefined

    The resolved dependency or undefined if the dependency is not found.

    Identifier for more information on identifiers.

    -
  • +
    diff --git a/functions/helper_ImplementsStatic.ImplementsStatic.html b/functions/helper_ImplementsStatic.ImplementsStatic.html index 9b7282e..5a4aea9 100644 --- a/functions/helper_ImplementsStatic.ImplementsStatic.html +++ b/functions/helper_ImplementsStatic.ImplementsStatic.html @@ -1,4 +1,4 @@ -ImplementsStatic | ts-injex - v1.1.0
    • Decorator to enforce static implementation of an interface. +ImplementsStatic | ts-injex - v1.2.0

      • Decorator to enforce static implementation of an interface. Warns on compile time if the interface is not implemented.

        Type Parameters

        • I

        Returns (<T>(constructor: T, ...args: unknown[]) => void)

        A decorator function

        -
          • <T>(constructor, ...args): void
          • Type Parameters

            • T

            Parameters

            • constructor: T
            • Rest...args: unknown[]

            Returns void

      +
        • <T>(constructor, ...args): void
        • Type Parameters

          • T

          Parameters

          • constructor: T
          • Rest...args: unknown[]

          Returns void

    diff --git a/hierarchy.html b/hierarchy.html index 5b34f09..a708f82 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -1 +1 @@ -ts-injex - v1.1.0
    +ts-injex - v1.2.0
    diff --git a/index.html b/index.html index f806377..712ed83 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,8 @@ -ts-injex - v1.1.0

    ts-injex - v1.1.0

    Time

    +ts-injex - v1.2.0

    ts-injex - v1.2.0

    Time

    Statements Branches Functions Lines

    TSinjex

    Strings and symbols are possible for the identifiers.

    For the use of TSinjex with Jest, the corresponding source files can be found under ./src of the TSinjex node_module folder. To use these files, the moduleNameMapper must be configured in the Jest configuration file. The following example shows how to configure the Jest configuration file to use the source files of TSinjex.

    module.exports = {
    setupFilesAfterEnv: ['./scripts/jest.setup.js'],
    preset: 'ts-jest',
    testEnvironment: 'node',
    testMatch: ['**/__tests__/**/*.test.ts', '**/?(*.)+(test).ts'],
    moduleDirectories: ['node_modules', 'src'],
    moduleNameMapper: {
    '^src/(.*)$': '<rootDir>/src/$1', // Map src to the source folder
    '^ts-injex$': '<rootDir>/node_modules/ts-injex/src', // Map ts-injex to the source folder
    },
    transformIgnorePatterns: [
    'node_modules/(?!ts-injex)' // **Dont** ignore ts-injex on preset `ts-jest`
    ],
    };
    -
    +
    diff --git a/interfaces/interfaces_IDependency.IDependency.html b/interfaces/interfaces_IDependency.IDependency.html index 2ab2146..a6ae53b 100644 --- a/interfaces/interfaces_IDependency.IDependency.html +++ b/interfaces/interfaces_IDependency.IDependency.html @@ -1,7 +1,7 @@ -IDependency | ts-injex - v1.1.0

    Dependency Entry Interface

    -
    interface IDependency {
        dependency: unknown;
        deprecated?: boolean;
    }

    Properties

    dependency +IDependency | ts-injex - v1.2.0

    Dependency Entry Interface

    +
    interface IDependency {
        dependency: unknown;
        deprecated?: boolean;
    }

    Properties

    dependency: unknown

    The dependency itself

    -
    deprecated?: boolean

    If true, the dependency is deprecated => a warning +

    deprecated?: boolean

    If true, the dependency is deprecated => a warning is logged when the dependency is resolved

    -
    +
    diff --git a/interfaces/interfaces_ITSinjex.ITSinjex.html b/interfaces/interfaces_ITSinjex.ITSinjex.html index 2554af0..16fb52e 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjex.html +++ b/interfaces/interfaces_ITSinjex.ITSinjex.html @@ -1,31 +1,31 @@ -ITSinjex | ts-injex - v1.1.0

    Instance TSinjex Interface

    -
    interface ITSinjex {
        register<T>(identifier: Identifier, dependency: T, deprecated?: boolean): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: true): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: false): void;
        resolve<T>(identifier: Identifier, necessary?: boolean): undefined | T;
        resolve<T>(identifier: Identifier, necessary?: true): T;
        resolve<T>(identifier: Identifier, necessary?: false): undefined | T;
    }

    Hierarchy (view full)

    Implemented by

    Methods

    register +ITSinjex | ts-injex - v1.2.0

    Instance TSinjex Interface

    +
    interface ITSinjex {
        register<T>(identifier: Identifier, dependency: T, deprecated?: boolean): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: true): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: false): void;
        resolve<T>(identifier: Identifier, necessary?: boolean): undefined | T;
        resolve<T>(identifier: Identifier, necessary?: true): T;
        resolve<T>(identifier: Identifier, necessary?: false): undefined | T;
    }

    Hierarchy (view full)

    Implemented by

    Methods

    • Register a dependency.

      Type Parameters

      • T

      Parameters

      • identifier: Identifier

        The identifier of the dependency.

      • dependency: T

        The dependency to register.

      • Optionaldeprecated: boolean

        If true, the dependency is deprecated => a warning is logged when the dependency is resolved.

        -

      Returns void

    • Register a deprecated dependency.

      +

    Returns void

  • Register a deprecated dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: true

      A warning is logged when the dependency is resolved.

      -

    Returns void

  • Register a dependency.

    +
  • Returns void

  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: false

      No warning is logged when the dependency is resolved.

      -

    Returns void

    • Resolve a dependency

      +

    Returns void

    +
    diff --git a/interfaces/interfaces_ITSinjex.ITSinjexRegister.html b/interfaces/interfaces_ITSinjex.ITSinjexRegister.html index d8bed43..eeadd9e 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjexRegister.html +++ b/interfaces/interfaces_ITSinjex.ITSinjexRegister.html @@ -1,16 +1,16 @@ -ITSinjexRegister | ts-injex - v1.1.0

    Register method for static and instance Dependency Injection Container.

    -
    interface ITSinjexRegister {
        register<T>(identifier: Identifier, dependency: T, deprecated?: boolean): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: true): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: false): void;
    }

    Hierarchy (view full)

    Methods

    register +ITSinjexRegister | ts-injex - v1.2.0

    Register method for static and instance Dependency Injection Container.

    +
    interface ITSinjexRegister {
        register<T>(identifier: Identifier, dependency: T, deprecated?: boolean): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: true): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: false): void;
    }

    Hierarchy (view full)

    Methods

    Methods

    • Register a dependency.

      Type Parameters

      • T

      Parameters

      • identifier: Identifier

        The identifier of the dependency.

      • dependency: T

        The dependency to register.

      • Optionaldeprecated: boolean

        If true, the dependency is deprecated => a warning is logged when the dependency is resolved.

        -

      Returns void

    • Register a deprecated dependency.

      +

    Returns void

  • Register a deprecated dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: true

      A warning is logged when the dependency is resolved.

      -

    Returns void

  • Register a dependency.

    +
  • Returns void

  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: false

      No warning is logged when the dependency is resolved.

      -

    Returns void

  • +

    Returns void

    diff --git a/interfaces/interfaces_ITSinjex.ITSinjexResolve.html b/interfaces/interfaces_ITSinjex.ITSinjexResolve.html index f98283f..b484a9b 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjexResolve.html +++ b/interfaces/interfaces_ITSinjex.ITSinjexResolve.html @@ -1,17 +1,17 @@ -ITSinjexResolve | ts-injex - v1.1.0

    Resolve method for static and instance Dependency Injection Container.

    -
    interface ITSinjexResolve {
        resolve<T>(identifier: Identifier, necessary?: boolean): undefined | T;
        resolve<T>(identifier: Identifier, necessary?: true): T;
        resolve<T>(identifier: Identifier, necessary?: false): undefined | T;
    }

    Hierarchy (view full)

    Methods

    resolve +ITSinjexResolve | ts-injex - v1.2.0

    Resolve method for static and instance Dependency Injection Container.

    +
    interface ITSinjexResolve {
        resolve<T>(identifier: Identifier, necessary?: boolean): undefined | T;
        resolve<T>(identifier: Identifier, necessary?: true): T;
        resolve<T>(identifier: Identifier, necessary?: false): undefined | T;
    }

    Hierarchy (view full)

    Methods

    Methods

    • Resolve a dependency

      Type Parameters

      • T

      Parameters

      • identifier: Identifier

        The identifier of the dependency

      • Optionalnecessary: boolean

        If true, throws an error if the dependency is not found

      Returns undefined | T

      The resolved dependency or undefined if the dependency is not found

      A DependencyResolutionError if the dependency is not found and necessary.

      -
    • Resolve a necessary dependency.

      +
    • Resolve a necessary dependency.

      Type Parameters

      • T

      Parameters

      • identifier: Identifier

        The identifier of the dependency.

      • Optionalnecessary: true

        If true, throws an error if the dependency is not found.

      Returns T

      The resolved dependency.

      A DependencyResolutionError if the dependency is not found.

      -
    • Resolve a non necessary dependency

      +
    • Resolve a non necessary dependency

      Type Parameters

      • T

      Parameters

      • identifier: Identifier

        The identifier of the dependency

      • Optionalnecessary: false

        Not necessary, does not throw an error if the dependency is not found.

      Returns undefined | T

      The resolved dependency or undefined if the dependency is not found

      -
    +
    diff --git a/interfaces/interfaces_ITSinjex.ITSinjex_.html b/interfaces/interfaces_ITSinjex.ITSinjex_.html index 7e71e48..82608fe 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjex_.html +++ b/interfaces/interfaces_ITSinjex.ITSinjex_.html @@ -1,34 +1,34 @@ -ITSinjex_ | ts-injex - v1.1.0

    Static TSInjex Interface

    -
    interface ITSinjex_ {
        getInstance(): ITSinjex;
        register<T>(identifier: Identifier, dependency: T, deprecated?: boolean): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: true): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: false): void;
        resolve<T>(identifier: Identifier, necessary?: boolean): undefined | T;
        resolve<T>(identifier: Identifier, necessary?: true): T;
        resolve<T>(identifier: Identifier, necessary?: false): undefined | T;
    }

    Hierarchy (view full)

    Methods

    getInstance +ITSinjex_ | ts-injex - v1.2.0

    Static TSInjex Interface

    +
    interface ITSinjex_ {
        getInstance(): ITSinjex;
        register<T>(identifier: Identifier, dependency: T, deprecated?: boolean): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: true): void;
        register<T>(identifier: Identifier, dependency: T, deprecated?: false): void;
        resolve<T>(identifier: Identifier, necessary?: boolean): undefined | T;
        resolve<T>(identifier: Identifier, necessary?: true): T;
        resolve<T>(identifier: Identifier, necessary?: false): undefined | T;
    }

    Hierarchy (view full)

    Methods

    • Register a dependency.

      Type Parameters

      • T

      Parameters

      • identifier: Identifier

        The identifier of the dependency.

      • dependency: T

        The dependency to register.

      • Optionaldeprecated: boolean

        If true, the dependency is deprecated => a warning is logged when the dependency is resolved.

        -

      Returns void

    • Register a deprecated dependency.

      +

    Returns void

  • Register a deprecated dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: true

      A warning is logged when the dependency is resolved.

      -

    Returns void

  • Register a dependency.

    +
  • Returns void

  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: Identifier

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: false

      No warning is logged when the dependency is resolved.

      -

    Returns void

    • Resolve a dependency

      +

    Returns void

    +
    diff --git a/modules/classes_TSinjex.html b/modules/classes_TSinjex.html index b119c60..fd05183 100644 --- a/modules/classes_TSinjex.html +++ b/modules/classes_TSinjex.html @@ -1,2 +1,2 @@ -classes/TSinjex | ts-injex - v1.1.0

    Module classes/TSinjex

    Index

    Classes

    +classes/TSinjex | ts-injex - v1.2.0

    Module classes/TSinjex

    Index

    Classes

    diff --git a/modules/decorators_Inject.html b/modules/decorators_Inject.html index e4aae7c..6a1345e 100644 --- a/modules/decorators_Inject.html +++ b/modules/decorators_Inject.html @@ -1,2 +1,2 @@ -decorators/Inject | ts-injex - v1.1.0

    Module decorators/Inject

    Index

    Functions

    +decorators/Inject | ts-injex - v1.2.0

    Module decorators/Inject

    Index

    Functions

    diff --git a/modules/decorators_Register.html b/modules/decorators_Register.html index 91198db..b095876 100644 --- a/modules/decorators_Register.html +++ b/modules/decorators_Register.html @@ -1,2 +1,2 @@ -decorators/Register | ts-injex - v1.1.0

    Module decorators/Register

    Index

    Functions

    +decorators/Register | ts-injex - v1.2.0

    Module decorators/Register

    Index

    Functions

    diff --git a/modules/decorators_RegisterInstance.html b/modules/decorators_RegisterInstance.html index dfae70e..d8d0570 100644 --- a/modules/decorators_RegisterInstance.html +++ b/modules/decorators_RegisterInstance.html @@ -1,2 +1,2 @@ -decorators/RegisterInstance | ts-injex - v1.1.0

    Module decorators/RegisterInstance

    Index

    Functions

    +decorators/RegisterInstance | ts-injex - v1.2.0

    Module decorators/RegisterInstance

    Index

    Functions

    diff --git a/modules/functions_inject.html b/modules/functions_inject.html index 063fb5d..d83c71c 100644 --- a/modules/functions_inject.html +++ b/modules/functions_inject.html @@ -1,2 +1,2 @@ -functions/inject | ts-injex - v1.1.0

    Module functions/inject

    Index

    Functions

    +functions/inject | ts-injex - v1.2.0

    Module functions/inject

    Index

    Functions

    diff --git a/modules/functions_register.html b/modules/functions_register.html index beceea4..21376e7 100644 --- a/modules/functions_register.html +++ b/modules/functions_register.html @@ -1,2 +1,2 @@ -functions/register | ts-injex - v1.1.0

    Module functions/register

    Index

    Functions

    +functions/register | ts-injex - v1.2.0

    Module functions/register

    Index

    Functions

    diff --git a/modules/functions_resolve.html b/modules/functions_resolve.html index 836908c..f1ead33 100644 --- a/modules/functions_resolve.html +++ b/modules/functions_resolve.html @@ -1,2 +1,2 @@ -functions/resolve | ts-injex - v1.1.0

    Module functions/resolve

    Index

    Functions

    +functions/resolve | ts-injex - v1.2.0

    Module functions/resolve

    Index

    Functions

    diff --git a/modules/helper_ImplementsStatic.html b/modules/helper_ImplementsStatic.html index da2d508..cc2a4cc 100644 --- a/modules/helper_ImplementsStatic.html +++ b/modules/helper_ImplementsStatic.html @@ -1,2 +1,2 @@ -helper/ImplementsStatic | ts-injex - v1.1.0

    Module helper/ImplementsStatic

    Index

    Functions

    +helper/ImplementsStatic | ts-injex - v1.2.0

    Module helper/ImplementsStatic

    Index

    Functions

    diff --git a/modules/index.html b/modules/index.html index 2fa1cbb..d580222 100644 --- a/modules/index.html +++ b/modules/index.html @@ -1,4 +1,4 @@ -index | ts-injex - v1.1.0

    Module index

    References

    ForceConstructor +index | ts-injex - v1.2.0

    Module index

    References

    Re-exports ForceConstructor
    Re-exports GenericConstructor
    Re-exports ITSinjex
    Re-exports ITSinjexRegister
    Re-exports ITSinjexResolve
    Re-exports ITSinjex_
    Re-exports ImplementsStatic
    Re-exports InitDelegate
    Re-exports Inject
    Re-exports Register
    Re-exports RegisterInstance
    Re-exports TSinjex
    Re-exports inject
    Re-exports register
    Re-exports resolve
    +

    References

    Re-exports ForceConstructor
    Re-exports GenericConstructor
    Re-exports ITSinjex
    Re-exports ITSinjexRegister
    Re-exports ITSinjexResolve
    Re-exports ITSinjex_
    Re-exports ImplementsStatic
    Re-exports InitDelegate
    Re-exports Inject
    Re-exports Register
    Re-exports RegisterInstance
    Re-exports TSinjex
    Re-exports inject
    Re-exports register
    Re-exports resolve
    diff --git a/modules/interfaces_Exceptions.html b/modules/interfaces_Exceptions.html index 65d7cd8..d57e163 100644 --- a/modules/interfaces_Exceptions.html +++ b/modules/interfaces_Exceptions.html @@ -1,6 +1,6 @@ -interfaces/Exceptions | ts-injex - v1.1.0

    Module interfaces/Exceptions

    Index

    Classes

    DependencyResolutionError +interfaces/Exceptions | ts-injex - v1.2.0
    +
    diff --git a/modules/interfaces_IDependency.html b/modules/interfaces_IDependency.html index c2db8f1..b89ad51 100644 --- a/modules/interfaces_IDependency.html +++ b/modules/interfaces_IDependency.html @@ -1,2 +1,2 @@ -interfaces/IDependency | ts-injex - v1.1.0

    Module interfaces/IDependency

    Index

    Interfaces

    +interfaces/IDependency | ts-injex - v1.2.0

    Module interfaces/IDependency

    Index

    Interfaces

    diff --git a/modules/interfaces_ITSinjex.html b/modules/interfaces_ITSinjex.html index b8226d4..2750afc 100644 --- a/modules/interfaces_ITSinjex.html +++ b/modules/interfaces_ITSinjex.html @@ -1,5 +1,5 @@ -interfaces/ITSinjex | ts-injex - v1.1.0

    Module interfaces/ITSinjex

    Index

    Interfaces

    ITSinjex +interfaces/ITSinjex | ts-injex - v1.2.0
    +
    diff --git a/modules/types_GenericContructor.html b/modules/types_GenericContructor.html index 15c9938..81a4975 100644 --- a/modules/types_GenericContructor.html +++ b/modules/types_GenericContructor.html @@ -1,3 +1,3 @@ -types/GenericContructor | ts-injex - v1.1.0

    Module types/GenericContructor

    Index

    Type Aliases

    ForceConstructor +types/GenericContructor | ts-injex - v1.2.0
    +
    diff --git a/modules/types_Identifier.html b/modules/types_Identifier.html index 04fed14..a0024fc 100644 --- a/modules/types_Identifier.html +++ b/modules/types_Identifier.html @@ -1,2 +1,2 @@ -types/Identifier | ts-injex - v1.1.0

    Module types/Identifier

    Index

    Type Aliases

    +types/Identifier | ts-injex - v1.2.0

    Module types/Identifier

    Index

    Type Aliases

    diff --git a/modules/types_InitDelegate.html b/modules/types_InitDelegate.html index ed99d50..e0c73c3 100644 --- a/modules/types_InitDelegate.html +++ b/modules/types_InitDelegate.html @@ -1,2 +1,2 @@ -types/InitDelegate | ts-injex - v1.1.0

    Module types/InitDelegate

    Index

    Type Aliases

    +types/InitDelegate | ts-injex - v1.2.0

    Module types/InitDelegate

    Index

    Type Aliases

    diff --git a/types/types_GenericContructor.ForceConstructor.html b/types/types_GenericContructor.ForceConstructor.html index 6d069be..ac3be02 100644 --- a/types/types_GenericContructor.ForceConstructor.html +++ b/types/types_GenericContructor.ForceConstructor.html @@ -1,3 +1,3 @@ -ForceConstructor | ts-injex - v1.1.0
    ForceConstructor<T>: (new (...args: unknown[]) => T)

    Force generic constructor type. +ForceConstructor | ts-injex - v1.2.0

    ForceConstructor<T>: (new (...args: unknown[]) => T)

    Force generic constructor type. This type is used to force a class to has a constructor.

    -

    Type Parameters

    • T
    +

    Type Parameters

    • T
    diff --git a/types/types_GenericContructor.GenericConstructor.html b/types/types_GenericContructor.GenericConstructor.html index 91a3a36..61ef233 100644 --- a/types/types_GenericContructor.GenericConstructor.html +++ b/types/types_GenericContructor.GenericConstructor.html @@ -1,3 +1,3 @@ -GenericConstructor | ts-injex - v1.1.0
    GenericConstructor<T>: (new (...args: ConstructorParameters<T>) => T)

    Generic constructor type. +GenericConstructor | ts-injex - v1.2.0

    GenericConstructor<T>: (new (...args: ConstructorParameters<T>) => T)

    Generic constructor type. This type is used to define a constructor of a class.

    -

    Type Parameters

    • T extends (abstract new (...args: unknown[]) => InstanceType<T>)
    +

    Type Parameters

    • T extends (abstract new (...args: unknown[]) => InstanceType<T>)
    diff --git a/types/types_Identifier.Identifier.html b/types/types_Identifier.Identifier.html index 76566b0..9dc5084 100644 --- a/types/types_Identifier.Identifier.html +++ b/types/types_Identifier.Identifier.html @@ -1,4 +1,4 @@ -Identifier | ts-injex - v1.1.0
    Identifier: string | symbol

    The dependency identifier. +Identifier | ts-injex - v1.2.0

    Identifier: string | symbol

    The dependency identifier. You can use any string as identifier. To create order, it is also possible to provide these with a separator: GroupA.ClassZ. @@ -6,4 +6,4 @@ The convection for naming is as follows: The name should generally correspond to the interface that is relevant. I.e. a class ClassA that implements the interface IClassA and is registered as a dependent class is registered under the interface name IClassA.

    -
    +
    diff --git a/types/types_InitDelegate.InitDelegate.html b/types/types_InitDelegate.InitDelegate.html index 8f9eb31..218c905 100644 --- a/types/types_InitDelegate.InitDelegate.html +++ b/types/types_InitDelegate.InitDelegate.html @@ -1,7 +1,7 @@ -InitDelegate | ts-injex - v1.1.0

    Type Alias InitDelegate<T, U>

    InitDelegate<T, U>: ((x: T) => U)

    A function type representing an initializer that transforms an input of type T +InitDelegate | ts-injex - v1.2.0

    Type Alias InitDelegate<T, U>

    InitDelegate<T, U>: ((x: T) => U)

    A function type representing an initializer that transforms an input of type T into an output of type U.

    Type Parameters

    • T

      The type of the input parameter.

    • U

      The type of the output parameter.

    Type declaration

      • (x): U
      • Parameters

        • x: T

          The input parameter of type T.

        Returns U

        The transformed output of type U.

        -
    +