diff --git a/classes/TSinjex.TSinjex.html b/classes/TSinjex.TSinjex.html index 0957d2e..6d7e7d6 100644 --- a/classes/TSinjex.TSinjex.html +++ b/classes/TSinjex.TSinjex.html @@ -1,5 +1,5 @@ TSinjex | ts-injex - v0.0.9

TSInjex: Dependency Injection Container

-

Implements

Constructors

Implements

Constructors

Properties

Methods

register @@ -8,17 +8,17 @@ register resolve

Constructors

Properties

_dependencies: Map<string, IDependency> = ...
_instance: TSinjex

Methods

Properties

_dependencies: Map<string, IDependency> = ...
_instance: TSinjex

Methods

  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: string

      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: string

      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

    -
  • Type Parameters

    • T

    Parameters

    • identifier: string
    • dependency: T
    • deprecated: boolean = false

    Returns void

    ITSinjex.register

    -
  • Type Parameters

    • T

    Parameters

    • identifier: string
    • necessary: boolean = true

    Returns undefined | T

    ITSinjex.resolve

    -
+
diff --git a/classes/interfaces_Exceptions.DependencyResolutionError.html b/classes/interfaces_Exceptions.DependencyResolutionError.html index fd26b9a..ae43a17 100644 --- a/classes/interfaces_Exceptions.DependencyResolutionError.html +++ b/classes/interfaces_Exceptions.DependencyResolutionError.html @@ -1,6 +1,6 @@ DependencyResolutionError | ts-injex - v0.0.9

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

diff --git a/classes/interfaces_Exceptions.TSinjexError.html b/classes/interfaces_Exceptions.TSinjexError.html index 477018a..d6640bc 100644 --- a/classes/interfaces_Exceptions.TSinjexError.html +++ b/classes/interfaces_Exceptions.TSinjexError.html @@ -1,5 +1,5 @@ TSinjexError | ts-injex - v0.0.9

General error class for ITSinjex interface.

-

Hierarchy (view full)

Constructors

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

diff --git a/coverage/badges/badge-branches.svg b/coverage/badges/badge-branches.svg new file mode 100644 index 0000000..bcc0d15 --- /dev/null +++ b/coverage/badges/badge-branches.svg @@ -0,0 +1 @@ +branches: 45%branches45% \ No newline at end of file diff --git a/coverage/badges/badge-functions.svg b/coverage/badges/badge-functions.svg new file mode 100644 index 0000000..c64ca46 --- /dev/null +++ b/coverage/badges/badge-functions.svg @@ -0,0 +1 @@ +functions: 58.62%functions58.62% \ No newline at end of file diff --git a/coverage/badges/badge-lines.svg b/coverage/badges/badge-lines.svg new file mode 100644 index 0000000..4c1908a --- /dev/null +++ b/coverage/badges/badge-lines.svg @@ -0,0 +1 @@ +lines: 45.26%lines45.26% \ No newline at end of file diff --git a/coverage/badges/badge-statements.svg b/coverage/badges/badge-statements.svg new file mode 100644 index 0000000..6098d3e --- /dev/null +++ b/coverage/badges/badge-statements.svg @@ -0,0 +1 @@ +statements: 46.93%statements46.93% \ No newline at end of file diff --git a/coverage/coverage-summary.json b/coverage/coverage-summary.json new file mode 100644 index 0000000..da092e1 --- /dev/null +++ b/coverage/coverage-summary.json @@ -0,0 +1,12 @@ +{"total": {"lines":{"total":95,"covered":43,"skipped":0,"pct":45.26},"statements":{"total":98,"covered":46,"skipped":0,"pct":46.93},"functions":{"total":29,"covered":17,"skipped":0,"pct":58.62},"branches":{"total":20,"covered":9,"skipped":0,"pct":45},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/TSinjex.ts": {"lines":{"total":19,"covered":16,"skipped":0,"pct":84.21},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":21,"covered":18,"skipped":0,"pct":85.71},"branches":{"total":11,"covered":9,"skipped":0,"pct":81.81}} +,"/home/runner/work/TSinjex/TSinjex/src/index.ts": {"lines":{"total":6,"covered":0,"skipped":0,"pct":0},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":6,"covered":0,"skipped":0,"pct":0},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/__tests__/IDIContainer.spec.ts": {"lines":{"total":19,"covered":19,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":20,"covered":20,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/decorators/Inject.ts": {"lines":{"total":16,"covered":0,"skipped":0,"pct":0},"functions":{"total":4,"covered":0,"skipped":0,"pct":0},"statements":{"total":16,"covered":0,"skipped":0,"pct":0},"branches":{"total":5,"covered":0,"skipped":0,"pct":0}} +,"/home/runner/work/TSinjex/TSinjex/src/decorators/Register.ts": {"lines":{"total":5,"covered":0,"skipped":0,"pct":0},"functions":{"total":2,"covered":0,"skipped":0,"pct":0},"statements":{"total":5,"covered":0,"skipped":0,"pct":0},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/decorators/RegisterInstance.ts": {"lines":{"total":16,"covered":0,"skipped":0,"pct":0},"functions":{"total":4,"covered":0,"skipped":0,"pct":0},"statements":{"total":16,"covered":0,"skipped":0,"pct":0},"branches":{"total":4,"covered":0,"skipped":0,"pct":0}} +,"/home/runner/work/TSinjex/TSinjex/src/functions/register.ts": {"lines":{"total":3,"covered":0,"skipped":0,"pct":0},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":3,"covered":0,"skipped":0,"pct":0},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/functions/resolve.ts": {"lines":{"total":3,"covered":0,"skipped":0,"pct":0},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":3,"covered":0,"skipped":0,"pct":0},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/helper/ImplementsStatic.ts": {"lines":{"total":2,"covered":2,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"/home/runner/work/TSinjex/TSinjex/src/interfaces/Exceptions.ts": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":6,"covered":6,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +} diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index ffbe58a..90ffc92 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -5,9 +5,9 @@ Code coverage report for All files - - - + + + + + + +
+
+

All files / src/decorators Inject.ts

+
+ +
+ 0% + Statements + 0/16 +
+ + +
+ 0% + Branches + 0/5 +
+ + +
+ 0% + Functions + 0/4 +
+ + +
+ 0% + Lines + 0/16 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { TSinjex } from '../TSinjex';
+import { InitDelegate } from '../types/InitDelegate';
+ 
+/**
+ * A decorator to inject a dependency from a DI (Dependency Injection) container.
+ * The dependency is lazily evaluated when the property is accessed for the first time.
+ * This can help avoid issues like circular dependencies and not-found dependencies.
+ * @template ClassType The type of the property to be injected.
+ * @param identifier The identifier used to resolve the dependency from the DI container.
+ * @param init An optional initializer function to transform the dependency before injection.
+ * @param necessary Indicates if the dependency is necessary.
+ * - 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 TSinjex}
+ * @example
+ * ```ts
+ * class MyClass {
+ *   \@Inject<MyDependency>('MyDependencyIdentifier')
+ *   private myDependency!: MyDependency;
+ * }
+ * ```
+ * @example
+ * ```ts
+ * class MyClass {
+ *   \@Inject('ILogger_', (x: ILogger_) => x.getLogger('Tags'), false)
+ *   private _logger?: ILogger;
+ * }
+ * ```
+ */
+export function Inject<T, U>(
+    identifier: string,
+    init?: InitDelegate<T, U>,
+    necessary = true,
+) {
+    return function (target: unknown, propertyKey: string | symbol): void {
+        // Unique symbol to store the private property
+        const privatePropertyKey: unique symbol = Symbol();
+        // Get the DI container instance
+        const diContainer = TSinjex.getInstance();
+ 
+        // Function to evaluate the dependency lazily
+        // to avoid circular dependencies, not found dependencies, etc.
+        const evaluate = (): T | undefined => {
+            return diContainer.resolve<T>(identifier, necessary);
+        };
+ 
+        // Define the property
+        Object.defineProperty(target, propertyKey, {
+            get() {
+                // If the property is not defined, evaluate the dependency
+                Iif (!this.hasOwnProperty(privatePropertyKey)) {
+                    if (init) {
+                        try {
+                            this[privatePropertyKey] = init(evaluate() as T);
+                        } catch (error) {
+                            Iif (necessary) {
+                                throw error;
+                            }
+                        }
+                    } else {
+                        this[privatePropertyKey] = evaluate();
+                    }
+                }
+ 
+                return this[privatePropertyKey];
+            },
+            // Not necessary to set the property
+            // set(value: PropertieType) {
+            //     this[privatePropertyKey] = value;
+            // },
+            enumerable: true,
+            configurable: false,
+        });
+    };
+}
+ 
+ +
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/decorators/Register.ts.html b/coverage/lcov-report/src/decorators/Register.ts.html new file mode 100644 index 0000000..d2aafdc --- /dev/null +++ b/coverage/lcov-report/src/decorators/Register.ts.html @@ -0,0 +1,169 @@ + + + + + + Code coverage report for src/decorators/Register.ts + + + + + + + + + +
+
+

All files / src/decorators Register.ts

+
+ +
+ 0% + Statements + 0/5 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 0% + Lines + 0/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { TSinjex } from '../TSinjex';
+ 
+/**
+ * A decorator to register a class in the DI (Dependency Injection) container.
+ * @template TargetType The type of the class to be registered.
+ * @param identifier The identifier used to register the class in the DI container.
+ * @param deprecated If true, the dependency is deprecated => a warning
+ * is logged when the dependency is resolved.
+ * @returns A function that is applied as a decorator to the class.
+ * @example
+ * ```ts
+ * \@Register('MyClassIdentifier')
+ * class MyClass {
+ *   // ...
+ * }
+ * ```
+ */
+export function Register<
+    TargetType extends new (...args: unknown[]) => InstanceType<TargetType>,
+>(identifier: string, deprecated?: boolean) {
+    return function (constructor: TargetType, ...args: unknown[]): void {
+        // Get the instance of the DI container
+        const diContainer = TSinjex.getInstance();
+ 
+        // Register the class in the DI container
+        diContainer.register(identifier, constructor, deprecated);
+    };
+}
+ 
+ +
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/decorators/RegisterInstance.ts.html b/coverage/lcov-report/src/decorators/RegisterInstance.ts.html new file mode 100644 index 0000000..f4bbd6a --- /dev/null +++ b/coverage/lcov-report/src/decorators/RegisterInstance.ts.html @@ -0,0 +1,295 @@ + + + + + + Code coverage report for src/decorators/RegisterInstance.ts + + + + + + + + + +
+
+

All files / src/decorators RegisterInstance.ts

+
+ +
+ 0% + Statements + 0/16 +
+ + +
+ 0% + Branches + 0/4 +
+ + +
+ 0% + Functions + 0/4 +
+ + +
+ 0% + Lines + 0/16 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { TSinjex } from '../TSinjex';
+import { InitDelegate } from '../types/InitDelegate';
+ 
+/**
+ * A decorator to register an instance of a class in the DI (Dependency Injection) container.
+ * The instance is created only when it is first needed (Lazy Initialization).
+ * @template TargetType The type of the class whose instance is to be registered.
+ * @param identifier The identifier used to register the instance in the DI container.
+ * @param init An optional initializer function which get the constructor of the class
+ * as input and returns an instance of the class.
+ * @returns A function that is applied as a decorator to the class.
+ * @example
+ * ```ts
+ * \@RegisterInstance('MyClassInstanceIdentifier', arg1, arg2)
+ * class MyClass {
+ *   // ...
+ * }
+ * ```
+ */
+export function RegisterInstance<
+    TargetType extends new (..._args: unknown[]) => InstanceType<TargetType>,
+>(
+    identifier: string,
+    init?: InitDelegate<
+        TargetType & { new (..._args: unknown[]): InstanceType<TargetType> },
+        InstanceType<TargetType>
+    >,
+) {
+    return function (constructor: TargetType, ...args: unknown[]): void {
+        // Get the instance of the DI container
+        const diContainer = TSinjex.getInstance();
+ 
+        // Create a proxy to instantiate the class when needed (Lazy Initialization)
+        let lazyProxy: unknown = new Proxy(
+            {},
+            {
+                get(target, prop, receiver) {
+                    let instance: InstanceType<TargetType>;
+ 
+                    if (init) {
+                        instance = init(constructor);
+                    } else {
+                        instance = new constructor(...args);
+                    }
+                    lazyProxy = instance;
+ 
+                    // Return the requested property of the instance
+                    return instance[prop as keyof InstanceType<TargetType>];
+                },
+                set(target, prop, value, receiver) {
+                    let instance: InstanceType<TargetType>;
+ 
+                    if (init) {
+                        instance = init(constructor);
+                    } else {
+                        instance = new constructor(...args);
+                    }
+                    lazyProxy = instance;
+ 
+                    // Set the requested property of the instance
+                    return (instance[prop as keyof InstanceType<TargetType>] =
+                        value);
+                },
+            },
+        );
+ 
+        // Register the lazy proxy in the DI container
+        diContainer.register(identifier, lazyProxy);
+    };
+}
+ 
+ +
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/decorators/index.html b/coverage/lcov-report/src/decorators/index.html new file mode 100644 index 0000000..64cbe70 --- /dev/null +++ b/coverage/lcov-report/src/decorators/index.html @@ -0,0 +1,146 @@ + + + + + + Code coverage report for src/decorators + + + + + + + + + +
+
+

All files src/decorators

+
+ +
+ 0% + Statements + 0/37 +
+ + +
+ 0% + Branches + 0/9 +
+ + +
+ 0% + Functions + 0/10 +
+ + +
+ 0% + Lines + 0/37 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Inject.ts +
+
0%0/160%0/50%0/40%0/16
Register.ts +
+
0%0/5100%0/00%0/20%0/5
RegisterInstance.ts +
+
0%0/160%0/40%0/40%0/16
+
+
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/functions/index.html b/coverage/lcov-report/src/functions/index.html new file mode 100644 index 0000000..92ee63c --- /dev/null +++ b/coverage/lcov-report/src/functions/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for src/functions + + + + + + + + + +
+
+

All files src/functions

+
+ +
+ 0% + Statements + 0/6 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 0% + Lines + 0/6 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
register.ts +
+
0%0/3100%0/00%0/10%0/3
resolve.ts +
+
0%0/3100%0/00%0/10%0/3
+
+
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/functions/register.ts.html b/coverage/lcov-report/src/functions/register.ts.html new file mode 100644 index 0000000..a683a28 --- /dev/null +++ b/coverage/lcov-report/src/functions/register.ts.html @@ -0,0 +1,190 @@ + + + + + + Code coverage report for src/functions/register.ts + + + + + + + + + +
+
+

All files / src/functions register.ts

+
+ +
+ 0% + Statements + 0/3 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { TSinjex } from '../TSinjex';
+ 
+/**
+ * Register a dependency.
+ * @param identifier The identifier of the dependency.
+ * @param dependency The dependency to register.
+ */
+export function register<T>(identifier: string, dependency: T): void;
+ 
+/**
+ * Register a dependency.
+ * @param identifier The identifier of the dependency.
+ * @param dependency The dependency to register.
+ * @param deprecated A warning is logged when the dependency is resolved.
+ */
+export function register<T>(
+    identifier: string,
+    dependency: T,
+    deprecated?: true,
+): void;
+ 
+/**
+ * Register a dependency.
+ * @param identifier The identifier of the dependency.
+ * @param dependency The dependency to register.
+ * @param deprecated If true, the dependency is deprecated => a warning
+ * is logged when the dependency is resolved.
+ */
+export function register<T>(
+    identifier: string,
+    dependency: T,
+    deprecated?: boolean,
+): void {
+    TSinjex.getInstance().register(identifier, dependency, deprecated);
+}
+ 
+ +
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/functions/resolve.ts.html b/coverage/lcov-report/src/functions/resolve.ts.html new file mode 100644 index 0000000..54c3d06 --- /dev/null +++ b/coverage/lcov-report/src/functions/resolve.ts.html @@ -0,0 +1,184 @@ + + + + + + Code coverage report for src/functions/resolve.ts + + + + + + + + + +
+
+

All files / src/functions resolve.ts

+
+ +
+ 0% + Statements + 0/3 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { DependencyResolutionError } from '../interfaces/Exceptions';
+import { TSinjex } from '../TSinjex';
+ 
+/**
+ * Resolve a dependency.
+ * @param identifier The identifier of the dependency.
+ * @returns The resolved dependency.
+ * @throws A {@link DependencyResolutionError} if the dependency is not found.
+ */
+export function resolve<T>(identifier: string): T;
+ 
+/**
+ * Resolve a dependency
+ * @param identifier The identifier of the dependency.
+ * @param necessary The dependency is **not** necessary.
+ * @returns The resolved dependency or undefined if the dependency is not found.
+ */
+export function resolve<T>(identifier: string, necessary: false): T | undefined;
+ 
+/**
+ * Resolve a dependency.
+ * @param identifier The identifier of the dependency.
+ * @param necessary If true, throws an error if the dependency is not found.
+ * @returns 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.
+ * @throws A {@link DependencyResolutionError} if the dependency is not found and necessary.
+ */
+export function resolve<T>(
+    identifier: string,
+    necessary?: boolean,
+): T | undefined {
+    return TSinjex.getInstance().resolve<T>(identifier, necessary);
+}
+ 
+ +
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/helper/ImplementsStatic.ts.html b/coverage/lcov-report/src/helper/ImplementsStatic.ts.html index be0b508..ad67545 100644 --- a/coverage/lcov-report/src/helper/ImplementsStatic.ts.html +++ b/coverage/lcov-report/src/helper/ImplementsStatic.ts.html @@ -19,7 +19,7 @@
-

All files / src/helper ImplementsStatic.ts

+

All files / src/helper ImplementsStatic.ts

@@ -93,8 +93,8 @@ export function ImplementsStatic<I>() {
- +
Zur TypeDoc-Dokumentation
\ No newline at end of file diff --git a/coverage/lcov-report/src/helper/index.html b/coverage/lcov-report/src/helper/index.html index e8d88c9..6971097 100644 --- a/coverage/lcov-report/src/helper/index.html +++ b/coverage/lcov-report/src/helper/index.html @@ -79,7 +79,7 @@ - ImplementsStatic.ts + ImplementsStatic.ts
@@ -100,8 +100,8 @@
- +
Zur TypeDoc-Dokumentation
\ No newline at end of file diff --git a/coverage/lcov-report/src/index.html b/coverage/lcov-report/src/index.html index a5a2096..da981f0 100644 --- a/coverage/lcov-report/src/index.html +++ b/coverage/lcov-report/src/index.html @@ -23,9 +23,9 @@
- 85.71% + 66.66% Statements - 18/21 + 18/27
@@ -44,9 +44,9 @@
- 84.21% + 64% Lines - 16/19 + 16/25
@@ -61,7 +61,7 @@
-
+
@@ -79,7 +79,7 @@ - + @@ -93,6 +93,21 @@ + + + + + + + + + + + + +
TSinjex.tsTSinjex.ts
16/19
index.ts +
+
0%0/6100%0/0100%0/00%0/6
@@ -100,8 +115,8 @@
- +
Zur TypeDoc-Dokumentation
\ No newline at end of file diff --git a/coverage/lcov-report/src/index.ts.html b/coverage/lcov-report/src/index.ts.html new file mode 100644 index 0000000..5b475b9 --- /dev/null +++ b/coverage/lcov-report/src/index.ts.html @@ -0,0 +1,133 @@ + + + + + + Code coverage report for src/index.ts + + + + + + + + + +
+
+

All files / src index.ts

+
+ +
+ 0% + Statements + 0/6 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 0% + Lines + 0/6 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// Main
+export * from './TSinjex';
+ 
+// Decorators
+export * from './decorators/Inject';
+export * from './decorators/Register';
+export * from './decorators/RegisterInstance';
+ 
+// Functions
+export * from './functions/resolve';
+export * from './functions/register';
+ 
+// Interfaces & Types
+export type * from './interfaces/ITSinjex';
+export type * from './types/InitDelegate';
+export type * from './types/GenericContructor';
+ 
+ +
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/interfaces/Exceptions.ts.html b/coverage/lcov-report/src/interfaces/Exceptions.ts.html index 88ead63..98e041e 100644 --- a/coverage/lcov-report/src/interfaces/Exceptions.ts.html +++ b/coverage/lcov-report/src/interfaces/Exceptions.ts.html @@ -19,7 +19,7 @@
-

All files / src/interfaces Exceptions.ts

+

All files / src/interfaces Exceptions.ts

@@ -159,8 +159,8 @@ export class DependencyResolutionError extends TSinjexError {
- +
Zur TypeDoc-Dokumentation
\ No newline at end of file diff --git a/coverage/lcov-report/src/interfaces/index.html b/coverage/lcov-report/src/interfaces/index.html index 931e642..7ecdcee 100644 --- a/coverage/lcov-report/src/interfaces/index.html +++ b/coverage/lcov-report/src/interfaces/index.html @@ -79,7 +79,7 @@ - Exceptions.ts + Exceptions.ts
@@ -100,8 +100,8 @@
- +
Zur TypeDoc-Dokumentation
\ No newline at end of file diff --git a/coverage/lcov.info b/coverage/lcov.info index f1ec0bc..fa69700 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -1,5 +1,5 @@ TN: -SF:src/TSinjex.ts +SF:TSinjex/src/TSinjex.ts FN:17,(anonymous_0) FN:25,(anonymous_1) FN:37,(anonymous_2) @@ -50,7 +50,22 @@ BRF:11 BRH:9 end_of_record TN: -SF:src/__tests__/IDIContainer.spec.ts +SF:TSinjex/src/index.ts +FNF:0 +FNH:0 +DA:2,0 +DA:5,0 +DA:6,0 +DA:7,0 +DA:10,0 +DA:11,0 +LF:6 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:TSinjex/src/__tests__/IDIContainer.spec.ts FN:8,test_IDIContainer FN:9,(anonymous_1) FN:12,(anonymous_2) @@ -92,7 +107,128 @@ BRF:0 BRH:0 end_of_record TN: -SF:src/helper/ImplementsStatic.ts +SF:TSinjex/src/decorators/Inject.ts +FN:31,Inject +FN:36,(anonymous_1) +FN:44,(anonymous_2) +FN:50,(anonymous_3) +FNF:4 +FNH:0 +FNDA:0,Inject +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +DA:1,0 +DA:31,0 +DA:36,0 +DA:38,0 +DA:40,0 +DA:44,0 +DA:45,0 +DA:49,0 +DA:52,0 +DA:53,0 +DA:54,0 +DA:55,0 +DA:57,0 +DA:58,0 +DA:62,0 +DA:66,0 +LF:16 +LH:0 +BRDA:34,0,0,0 +BRDA:52,1,0,0 +BRDA:53,2,0,0 +BRDA:53,2,1,0 +BRDA:57,3,0,0 +BRF:5 +BRH:0 +end_of_record +TN: +SF:TSinjex/src/decorators/Register.ts +FN:18,Register +FN:21,(anonymous_1) +FNF:2 +FNH:0 +FNDA:0,Register +FNDA:0,(anonymous_1) +DA:1,0 +DA:18,0 +DA:21,0 +DA:23,0 +DA:26,0 +LF:5 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:TSinjex/src/decorators/RegisterInstance.ts +FN:20,RegisterInstance +FN:29,(anonymous_1) +FN:37,(anonymous_2) +FN:50,(anonymous_3) +FNF:4 +FNH:0 +FNDA:0,RegisterInstance +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +DA:1,0 +DA:20,0 +DA:29,0 +DA:31,0 +DA:34,0 +DA:40,0 +DA:41,0 +DA:43,0 +DA:45,0 +DA:48,0 +DA:53,0 +DA:54,0 +DA:56,0 +DA:58,0 +DA:61,0 +DA:68,0 +LF:16 +LH:0 +BRDA:40,0,0,0 +BRDA:40,0,1,0 +BRDA:53,1,0,0 +BRDA:53,1,1,0 +BRF:4 +BRH:0 +end_of_record +TN: +SF:TSinjex/src/functions/register.ts +FN:29,register +FNF:1 +FNH:0 +FNDA:0,register +DA:1,0 +DA:29,0 +DA:34,0 +LF:3 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:TSinjex/src/functions/resolve.ts +FN:28,resolve +FNF:1 +FNH:0 +FNDA:0,resolve +DA:2,0 +DA:28,0 +DA:32,0 +LF:3 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:TSinjex/src/helper/ImplementsStatic.ts FN:6,ImplementsStatic FN:7,(anonymous_1) FNF:2 @@ -107,7 +243,7 @@ BRF:0 BRH:0 end_of_record TN: -SF:src/interfaces/Exceptions.ts +SF:TSinjex/src/interfaces/Exceptions.ts FN:11,(anonymous_0) FN:26,(anonymous_1) FNF:2 diff --git a/functions/decorators_Inject.Inject.html b/functions/decorators_Inject.Inject.html index a940de1..9bb1e4b 100644 --- a/functions/decorators_Inject.Inject.html +++ b/functions/decorators_Inject.Inject.html @@ -16,4 +16,4 @@ This can help avoid issues like circular dependencies and not-found dependencies
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 815177f..c0cab60 100644 --- a/functions/decorators_Register.Register.html +++ b/functions/decorators_Register.Register.html @@ -7,4 +7,4 @@ is logged when the dependency is resolved.

\@Register('MyClassIdentifier')
class MyClass {
// ...
}
-
+
diff --git a/functions/decorators_RegisterInstance.RegisterInstance.html b/functions/decorators_RegisterInstance.RegisterInstance.html index 2b0dfff..ff51923 100644 --- a/functions/decorators_RegisterInstance.RegisterInstance.html +++ b/functions/decorators_RegisterInstance.RegisterInstance.html @@ -8,4 +8,4 @@ as input and returns an instance of the class.

\@RegisterInstance('MyClassInstanceIdentifier', arg1, arg2)
class MyClass {
// ...
}
-
+
diff --git a/functions/functions_register.register.html b/functions/functions_register.register.html index db5ad9c..da9e241 100644 --- a/functions/functions_register.register.html +++ b/functions/functions_register.register.html @@ -6,8 +6,8 @@ is logged when the dependency is resolved.

Returns void

  • Register a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: string

      The identifier of the dependency.

    • dependency: T

      The dependency to register.

    • Optionaldeprecated: true

      A warning is logged when the dependency is resolved.

      -

    Returns void

  • +

    Returns void

    diff --git a/functions/functions_resolve.resolve.html b/functions/functions_resolve.resolve.html index 74e76b0..bb4bf7f 100644 --- a/functions/functions_resolve.resolve.html +++ b/functions/functions_resolve.resolve.html @@ -8,8 +8,8 @@ and not found, or throws an error if the dependency is necessary and not found.<

    Type Parameters

    Parameters

    Returns T

    The resolved dependency.

    A DependencyResolutionError if the dependency is not found.

    -
  • Resolve a dependency

    +
  • Resolve a dependency

    Type Parameters

    Parameters

    Returns T | undefined

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

    -
  • +
    diff --git a/functions/helper_ImplementsStatic.ImplementsStatic.html b/functions/helper_ImplementsStatic.ImplementsStatic.html index e2c6264..8c467cc 100644 --- a/functions/helper_ImplementsStatic.ImplementsStatic.html +++ b/functions/helper_ImplementsStatic.ImplementsStatic.html @@ -1,4 +1,4 @@ ImplementsStatic | ts-injex - v0.0.9
    • 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

    +
    diff --git a/interfaces/interfaces_IDependency.IDependency.html b/interfaces/interfaces_IDependency.IDependency.html index a0a0da8..454d5cf 100644 --- a/interfaces/interfaces_IDependency.IDependency.html +++ b/interfaces/interfaces_IDependency.IDependency.html @@ -1,7 +1,7 @@ IDependency | ts-injex - v0.0.9

    Dependency Entry Interface

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

    Properties

    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 2e5bd87..7297d63 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjex.html +++ b/interfaces/interfaces_ITSinjex.ITSinjex.html @@ -1,30 +1,30 @@ ITSinjex | ts-injex - v0.0.9

    TSInjex Interface

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

    Hierarchy (view full)

    Implemented by

    Methods

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

    Hierarchy (view full)

    Implemented by

    Methods

    • Register a dependency.

      Type Parameters

      • T

      Parameters

      • identifier: string

        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: string

      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: string

      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.ITSinjexRegister.html b/interfaces/interfaces_ITSinjex.ITSinjexRegister.html index 16a099a..86828bd 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjexRegister.html +++ b/interfaces/interfaces_ITSinjex.ITSinjexRegister.html @@ -1,16 +1,16 @@ ITSinjexRegister | ts-injex - v0.0.9

    Register method for static and instance Dependency Injection Container.

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

    Hierarchy (view full)

    Methods

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

    Hierarchy (view full)

    Methods

    Methods

    • Register a dependency.

      Type Parameters

      • T

      Parameters

      • identifier: string

        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: string

      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: string

      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 810aa2a..7e1e54d 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjexResolve.html +++ b/interfaces/interfaces_ITSinjex.ITSinjexResolve.html @@ -1,16 +1,16 @@ ITSinjexResolve | ts-injex - v0.0.9

    Resolve method for static and instance Dependency Injection Container.

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

    Hierarchy (view full)

    Methods

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

    Hierarchy (view full)

    Methods

    Methods

    • Resolve a dependency

      Type Parameters

      • T

      Parameters

      • identifier: string

        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

      -
    • Resolve a necessary dependency.

      +
    • Resolve a necessary dependency.

      Type Parameters

      • T

      Parameters

      • identifier: string

        The identifier of the dependency.

      • Optionalnecessary: true

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

      Returns T

      The resolved dependency.

      Error if the dependency is not found.

      -
    • Resolve a non necessary dependency

      +
    • Resolve a non necessary dependency

      Type Parameters

      • T

      Parameters

      • identifier: string

        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 3cf8446..96c1ac6 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjex_.html +++ b/interfaces/interfaces_ITSinjex.ITSinjex_.html @@ -1,32 +1,32 @@ ITSinjex_ | ts-injex - v0.0.9

    Static TSInjex Interface

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

    Hierarchy (view full)

    Methods

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

    Hierarchy (view full)

    Methods

    • Register a dependency.

      Type Parameters

      • T

      Parameters

      • identifier: string

        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: string

      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: string

      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/modules/TSinjex.html b/modules/TSinjex.html index 6891970..115882a 100644 --- a/modules/TSinjex.html +++ b/modules/TSinjex.html @@ -1,2 +1,2 @@ -TSinjex | ts-injex - v0.0.9

    Module TSinjex

    Index

    Classes

    TSinjex +TSinjex | ts-injex - v0.0.9

    Module TSinjex

    Index

    Classes

    diff --git a/modules/decorators_Inject.html b/modules/decorators_Inject.html index 3a05eeb..fd21cde 100644 --- a/modules/decorators_Inject.html +++ b/modules/decorators_Inject.html @@ -1,2 +1,2 @@ -decorators/Inject | ts-injex - v0.0.9

    Module decorators/Inject

    Index

    Functions

    Inject +decorators/Inject | ts-injex - v0.0.9

    Module decorators/Inject

    Index

    Functions

    diff --git a/modules/decorators_Register.html b/modules/decorators_Register.html index d323157..9035d8a 100644 --- a/modules/decorators_Register.html +++ b/modules/decorators_Register.html @@ -1,2 +1,2 @@ -decorators/Register | ts-injex - v0.0.9

    Module decorators/Register

    Index

    Functions

    Register +decorators/Register | ts-injex - v0.0.9

    Module decorators/Register

    Index

    Functions

    diff --git a/modules/decorators_RegisterInstance.html b/modules/decorators_RegisterInstance.html index 5a0e356..023b8b2 100644 --- a/modules/decorators_RegisterInstance.html +++ b/modules/decorators_RegisterInstance.html @@ -1,2 +1,2 @@ -decorators/RegisterInstance | ts-injex - v0.0.9

    Module decorators/RegisterInstance

    Index

    Functions

    RegisterInstance +decorators/RegisterInstance | ts-injex - v0.0.9

    Module decorators/RegisterInstance

    Index

    Functions

    diff --git a/modules/functions_register.html b/modules/functions_register.html index 74281d9..29629e6 100644 --- a/modules/functions_register.html +++ b/modules/functions_register.html @@ -1,2 +1,2 @@ -functions/register | ts-injex - v0.0.9

    Module functions/register

    Index

    Functions

    register +functions/register | ts-injex - v0.0.9

    Module functions/register

    Index

    Functions

    diff --git a/modules/functions_resolve.html b/modules/functions_resolve.html index 68b9aef..e01315b 100644 --- a/modules/functions_resolve.html +++ b/modules/functions_resolve.html @@ -1,2 +1,2 @@ -functions/resolve | ts-injex - v0.0.9

    Module functions/resolve

    Index

    Functions

    resolve +functions/resolve | ts-injex - v0.0.9

    Module functions/resolve

    Index

    Functions

    diff --git a/modules/helper_ImplementsStatic.html b/modules/helper_ImplementsStatic.html index aa6f7b9..3ce8da9 100644 --- a/modules/helper_ImplementsStatic.html +++ b/modules/helper_ImplementsStatic.html @@ -1,2 +1,2 @@ -helper/ImplementsStatic | ts-injex - v0.0.9

    Module helper/ImplementsStatic

    Index

    Functions

    ImplementsStatic +helper/ImplementsStatic | ts-injex - v0.0.9

    Module helper/ImplementsStatic

    Index

    Functions

    diff --git a/modules/index.html b/modules/index.html index 2804cea..4ae6f99 100644 --- a/modules/index.html +++ b/modules/index.html @@ -1,4 +1,4 @@ -index | ts-injex - v0.0.9

    Module index

    References

    ForceConstructor +index | ts-injex - v0.0.9

    Module index

    References

    ForceConstructor GenericConstructor ITSinjex ITSinjexRegister diff --git a/modules/interfaces_Exceptions.html b/modules/interfaces_Exceptions.html index a2f6d4e..bbb0f3e 100644 --- a/modules/interfaces_Exceptions.html +++ b/modules/interfaces_Exceptions.html @@ -1,3 +1,3 @@ -interfaces/Exceptions | ts-injex - v0.0.9

    Module interfaces/Exceptions

    Index

    Classes

    DependencyResolutionError +interfaces/Exceptions | ts-injex - v0.0.9
    diff --git a/modules/interfaces_IDependency.html b/modules/interfaces_IDependency.html index b1b9134..658eb78 100644 --- a/modules/interfaces_IDependency.html +++ b/modules/interfaces_IDependency.html @@ -1,2 +1,2 @@ -interfaces/IDependency | ts-injex - v0.0.9

    Module interfaces/IDependency

    Index

    Interfaces

    IDependency +interfaces/IDependency | ts-injex - v0.0.9

    Module interfaces/IDependency

    Index

    Interfaces

    diff --git a/modules/interfaces_ITSinjex.html b/modules/interfaces_ITSinjex.html index 8710d37..3e32ad2 100644 --- a/modules/interfaces_ITSinjex.html +++ b/modules/interfaces_ITSinjex.html @@ -1,4 +1,4 @@ -interfaces/ITSinjex | ts-injex - v0.0.9

    Module interfaces/ITSinjex

    Index

    Interfaces

    ITSinjex +interfaces/ITSinjex | ts-injex - v0.0.9

    Module interfaces/ITSinjex

    Index

    Interfaces

    ITSinjex ITSinjexRegister ITSinjexResolve ITSinjex_ diff --git a/modules/types_GenericContructor.html b/modules/types_GenericContructor.html index d713c6c..4d54126 100644 --- a/modules/types_GenericContructor.html +++ b/modules/types_GenericContructor.html @@ -1,3 +1,3 @@ -types/GenericContructor | ts-injex - v0.0.9

    Module types/GenericContructor

    Index

    Type Aliases

    ForceConstructor +types/GenericContructor | ts-injex - v0.0.9
    diff --git a/modules/types_InitDelegate.html b/modules/types_InitDelegate.html index 5c0df98..30c3da8 100644 --- a/modules/types_InitDelegate.html +++ b/modules/types_InitDelegate.html @@ -1,2 +1,2 @@ -types/InitDelegate | ts-injex - v0.0.9

    Module types/InitDelegate

    Index

    Type Aliases

    InitDelegate +types/InitDelegate | ts-injex - v0.0.9

    Module types/InitDelegate

    Index

    Type Aliases

    diff --git a/types/types_GenericContructor.ForceConstructor.html b/types/types_GenericContructor.ForceConstructor.html index 707aa68..3d6b6f3 100644 --- a/types/types_GenericContructor.ForceConstructor.html +++ b/types/types_GenericContructor.ForceConstructor.html @@ -1,3 +1,3 @@ ForceConstructor | ts-injex - v0.0.9
    ForceConstructor<T>: (new (...args: unknown[]) => T)

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

    -

    Type Parameters

    • T
    +

    Type Parameters

    • T
    diff --git a/types/types_GenericContructor.GenericConstructor.html b/types/types_GenericContructor.GenericConstructor.html index e658e35..6d9241f 100644 --- a/types/types_GenericContructor.GenericConstructor.html +++ b/types/types_GenericContructor.GenericConstructor.html @@ -1,2 +1,2 @@ GenericConstructor | ts-injex - v0.0.9
    GenericConstructor<T>: (new (...args: ConstructorParameters<T>) => T)

    Generic constructor type.

    -

    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_InitDelegate.InitDelegate.html b/types/types_InitDelegate.InitDelegate.html index d820b90..29262b9 100644 --- a/types/types_InitDelegate.InitDelegate.html +++ b/types/types_InitDelegate.InitDelegate.html @@ -4,4 +4,4 @@ into an output of type U.

  • 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.

        -
    +