diff --git a/assets/navigation.js b/assets/navigation.js index e2b1d2c..2676a06 100644 --- a/assets/navigation.js +++ b/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA5WWTU/DMAyG/0vOEzDE+NiVL+06uE2oqjKPFbqkSjy0CfHfCR1t08SuUu2W2s/7Jk7srb4FwgHFXLy+FOoDDmIiqhy3bmGn1/sS7Pn/h7Mt7kr39bNQazG/nAi5Lcq1ASXmKx4iy9xaD0LCppe3P28/k5ayBqlNjtpYQcssHENibLVLzE4hSaZD2mavJBZaUTwKe33Vc7+E98IimEF7TVCSwZhIWmyZNJyxuVAWcyUhyW4TPMp2rDBov9UYFq2342+ohTKXxrB1aTMzM6YsMbDbF4Gk2UFVDFhdfhHF8IF1SKLFAEc7PAFJcHTMWygrMOeLXVXCDhTaF8yxkLHjU2AWBqY9SZbebYDjDwsG5+3WqJ5XLwdOe1mujptcAnfXHg8SquYyRuwmOevCkk7lASpwxpQ8Lv9Ktf/LfDRGezew6be0CAuI+/Ek7OmjhPyc4V6/6DwNHpUXl3aDKG7H49C8zOy675udlz55zOyMiYzdBsrQndHYZjxCEuHMoGJEgm6TrEF1NFIiGw3PqDr6lcRjxb7jZ1BgCnmvFZq9RE0Mjzo9iwKTSv6kjQSXYyN6TWXZYV4gdnF3M535/aojjFWKM2mt3tNQBT5ACe85EoPspOTHJP5Jo6C++R5ygN86dr9fqSxli/8KAAA=" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA5WWy07DMBBF/8Xripd4dstL3QI7hKLInVJDakf2FBUh/h2TNoljz0SOukvunHudscd9/REIOxRzIavSOXDHL89Kf8BOzERd4tq/2JjltvIvDoLiIDha46byqk+ll2J+NhNyraqlBS3mrx00gbUuMYyEnp5d/779zjraEqSxJRrrBG238AyJafS+sNhLssLHtNVWS1RGUzwKe3k+SP8E78oh2NF4rSgrYEokI3ZMGs7EXGiHpZaQFbcVT4qdOozG7zzGTZvlhAvqoMymsWxfusrCTmlLCuzXRSBpdtQVC85UX0QzQmAjyYwY4eiEeyAJTj7zGqoa7PFiU1ewAY3uGUtUMk28FxaxMO9IsvR+ARx/3DD63v4ZNQObx1HSQZXv46qUwO21+52Eut2MCbstLnpZ1le5gxp8MC2/n/5btf2vvLfWBDuwnbu0CQtI5/Esnu2TjMKa8Vm/6DONfqpAl7eDKG7P49C8zcXlMDd7f4bkKXdoSmTitlCG7oOmMdMrJBPOXFSMSTRtsj2oiUZaFJPhBdXHsJP4XbPn+BE0WCVvjUa7lWiIy6MpLxJhVssfjJXga1xCb6gsO66LzE5urk4vwnnVE6Y6pZW01+Bo+OODaqWoq3bv0yvyTgYBDGMHOJZM5dQK76CC9xKJC/eADjSZfyYp6CBtiBzhd4n97w9lCdBXvwsAAA==" \ No newline at end of file diff --git a/assets/search.js b/assets/search.js index bb42c9a..190b448 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA8WbS2/jNhDHv4t99Trm01au3W2Ra7boJQiMwGayah3ZkJV0F0G+eymJkjiaoUzZKXJy5HD+8+CPzyhvk3z/73Fyffc2+SfNtpNrPptkD89mcj3583ua/W1+TmaTl3xnn5/325edOV657+c/iued/eVm93A8GisxmbzPGhXGV0EdZ9DqhPVmk8NDbrLCE/FcLLhsfazT7Fg8ZBsT5WXqN+/8Fcftl/T45ZCnrw+FIbzPcRR8IbtMn0xxMyoOaDCY+SnfuXlKj4XJ4xw3rb/wy/0e97vXyHxd47O8KtahudnbquUvm2IfmS80uKzLIXhbczDZ1mSb1ArGwdcz+UAAz4PgMxA4x2fr0D4S81L17eCs1ClszWafP1gajlc31s2mQGpdi3XdYlBZd0T09B5fsk2RWvwIxaCwVw8cqedVKaE7FNfFr4MZ63jqfm6tI8OYg49TRb7tg0mUuWkTW2ikSWbcqg7I03m2+pcUnHY/bZ/iy46ViAAHi4/WpoFOaNqO7QzkY7AqrZcIt8NVaf1+RGcN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3kb30vYmHx3GZBgj3wxRxSkOBLb3A4nh0/4XUaXgSLA6VNEuLbXtv73WqR52SrlN1pGR//ku8sJrlIw4Q7w0J47337FXNm1v5aM1Qz3pEi7gh4osWR/c3F0/RG3QisoyUjFdJqVyvRLLi5NZAzxsMYun0IhN2etSUxT0OZTMXRo6QVhZNXNzraunmBR03gqkgvfXJ8b2qP5grLHeRCzenSYeubHZErr2OW9IHV10vGOZkVRIpiwrlD93aqtnLuapJt5eTLnHZdH3cnEGA6S3KTtsVT8XB7iTRas884HncGlC/B9EtWdSK5YUrx6gGZ0uv/1QE6HZ/fkgPZpdm1uTu/v39PygGObgFPwAA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA82bTXPiRhCG/wu+spj5BHxNNilfd1O5uFyUC7S7SjBQQt4k5fJ/z4w0krrVPWIETm1OGJh+u6fnmZ4P5NdJcfjrNLl7eJ38me+3kzs5neyfnrPJ3cS9zf6eTCcvxc69ez5sX3bZ6bb6dPatfN65rza7p9Mpc+aTyduUKoSvb3/7nO//YLTC9+vw/aCqkMtWt6/X+OnrxXWnk+NTke1LJkjgci5163Od70/l036TjfJ6A806/+Vp+yE/fTgW+fenMhuIZkajknPdZeJrVt5fFBc2TMrMuViK7Gt+KrNiXCCN1Qf5fnGcDrvvI/MRjK6KwgiA/sFlt3jZlIeR+cCG74MMBnmbHTM3ifeb3AmPg7ln+h8AfR1E/weEromhDWCbbQ7Fk2PgdHvvGm1KUju7Fuu6xWD1tN349/S+vOw3Ze6gYxSjwqBXNFLg1RhlO/DW5T/HbKzjm/B3a50Yxgy9nEvypz52TJqbNqmJJppsj1vVAXm+n63+NQnn3d+079LTTpWYAAeTT1aygUFo2o4dDOJjMCutlwS3w1lp/b7HYA2HdUM+HT+IcQ8DHeoGt4ue1PNmTNsm62LkvCKSnTdGdEAdpIAJ+Fy/8ArBdatqkd4rLMh3qpaMS0e6VEtzPfqW7Y5ZcXv/fNxlz87w9Ll8KvMN6Vfdbt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5j3kmkIZfv83Lb/rYBsgTSbcKyZNMGk9ZRAcISzZqWRhp4NiYDT7wDbVCkZVrhgw/zREYWTA2VNtegKLPgSTB7lU1TZGQUyKQ2YVgSex3k1igsMMwqrKA2cVIEPa72SYCyDkXVJiLdypIKKMFQ67CFsmm55IKEdaA2C0VQhLcyRK7C5zqgq5v5ELZpNm3uDy7foHSKZZBN23IwiQKsNTvMEKoMadPhvQ51WjdjnwY7BziYhmGGp5WLoEU3DAB1mShVPSbSrXrcoge2IXqMamQxAeNm0jAIcrG6C8bOJMwYd/o45sdsl++dycPj29u/CCyuA+hBAAA="; \ No newline at end of file diff --git a/classes/TSinjex.TSinjex.html b/classes/TSinjex.TSinjex.html deleted file mode 100644 index 7e86fa9..0000000 --- a/classes/TSinjex.TSinjex.html +++ /dev/null @@ -1,24 +0,0 @@ -TSinjex | ts-injex - v0.0.9

TSInjex: Dependency Injection Container

-

Implements

Constructors

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

    -

    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/classes_TSinjex.TSinjex.html b/classes/classes_TSinjex.TSinjex.html new file mode 100644 index 0000000..efb5234 --- /dev/null +++ b/classes/classes_TSinjex.TSinjex.html @@ -0,0 +1,39 @@ +TSinjex | ts-injex - v0.0.10

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.
  • +
  • Inject for injecting a dependency into a property.
  • +
+
+
    +
  • register for registering a dependency (class or instance) as a function.
  • +
  • resolve for resolving a dependency as a function.
  • +
+

Implements

Constructors

Properties

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

The dependencies map.

+
_instance: TSinjex

The singleton instance of the TSinjex class.

+

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

    +

    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

    +

    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 20a8ea7..a122c23 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.

+DependencyResolutionError | ts-injex - v0.0.10

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.TSinjexError.html b/classes/interfaces_Exceptions.TSinjexError.html index 344393d..4acccf0 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

constructor +TSinjexError | ts-injex - v0.0.10

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/coverage-summary.json b/coverage/coverage-summary.json index da092e1..38611a6 100644 --- a/coverage/coverage-summary.json +++ b/coverage/coverage-summary.json @@ -1,7 +1,7 @@ {"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/classes/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/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}} diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index ccfd31a..871f366 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -79,18 +79,18 @@ - src - -
+ src + +
- 66.66% - 18/27 - 81.81% - 9/11 + 0% + 0/6 100% - 6/6 - 64% - 16/25 + 0/0 + 100% + 0/0 + 0% + 0/6 @@ -108,6 +108,21 @@ 19/19 + + src/classes + +
+ + 85.71% + 18/21 + 81.81% + 9/11 + 100% + 6/6 + 84.21% + 16/19 + + src/decorators @@ -176,7 +191,7 @@ + - - + +
Zur TypeDoc-Dokumentation
\ No newline at end of file diff --git a/coverage/lcov-report/src/classes/index.html b/coverage/lcov-report/src/classes/index.html new file mode 100644 index 0000000..dd2ce94 --- /dev/null +++ b/coverage/lcov-report/src/classes/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for src/classes + + + + + + + + + +
+
+

All files src/classes

+
+ +
+ 85.71% + Statements + 18/21 +
+ + +
+ 81.81% + Branches + 9/11 +
+ + +
+ 100% + Functions + 6/6 +
+ + +
+ 84.21% + Lines + 16/19 +
+ + +
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TSinjex.ts +
+
85.71%18/2181.81%9/11100%6/684.21%16/19
+
+
+
+ + + + + +
Zur TypeDoc-Dokumentation
+ + \ No newline at end of file diff --git a/coverage/lcov-report/src/decorators/Inject.ts.html b/coverage/lcov-report/src/decorators/Inject.ts.html index 9280c9d..f4698fa 100644 --- a/coverage/lcov-report/src/decorators/Inject.ts.html +++ b/coverage/lcov-report/src/decorators/Inject.ts.html @@ -139,7 +139,9 @@ 74 75 76 -77  +77 +78  +        @@ -215,21 +217,22 @@       - 
import { TSinjex } from '../TSinjex';
+ 
import { Identifier } from 'src/types/Identifier';
+import { TSinjex } from '../classes/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.
+ * A decorator to inject a dependency from a DI (Dependency Injection) container into a class property.
+ * @template T The type of the dependency to be injected.
+ * @template U The type of the property to be injected.
+ * @param identifier The identifier used to resolve the class in the DI container.
+ * @see {@link Identifier} for more information on identifiers.
  * @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}
+ * @see {@link InitDelegate} for more information on initializer functions.
+ * @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.
  * @example
  * ```ts
  * class MyClass {
@@ -246,7 +249,7 @@ import { InitDelegate } from '../types/InitDelegate';
  * ```
  */
 export function Inject<T, U>(
-    identifier: string,
+    identifier: Identifier,
     init?: InitDelegate<T, U>,
     necessary = true,
 ) {
@@ -298,7 +301,7 @@ 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.

    -

    Type Parameters

    • T
    • U

    Parameters

    • identifier: string

      The identifier used to resolve the dependency from the DI container.

      +Inject | ts-injex - v0.0.10
      • 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: string

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

        • Optionalinit: InitDelegate<T, U>

          An optional initializer function to transform the dependency before injection.

          -
        • necessary: boolean = true

          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.
          • +
        • necessary: boolean = true

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

          +

        Returns ((target: unknown, propertyKey: string | symbol) => void)

        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.

        +
          • (target, propertyKey): void
          • Parameters

            • target: unknown
            • propertyKey: string | symbol

            Returns void

          +
        • Identifier for more information on identifiers.
        • +
        • InitDelegate for more information on initializer functions.
        -

      Returns ((target: unknown, propertyKey: string | symbol) => void)

      A decorator function to be applied on the class property.

      -
        • (target, propertyKey): void
        • Parameters

          • target: unknown
          • propertyKey: string | symbol

          Returns void

      TSinjex

      +

      A DependencyResolutionError if the dependency is not found and necessary.

      class MyClass {
      @Inject<MyDependency>('MyDependencyIdentifier')
      private myDependency!: MyDependency;
      }
      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 ef53dda..932687d 100644 --- a/functions/decorators_Register.Register.html +++ b/functions/decorators_Register.Register.html @@ -1,10 +1,11 @@ -Register | ts-injex - v0.0.9
  • A decorator to register a class in the DI (Dependency Injection) container.

    +Register | ts-injex - v0.0.10
    • 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: string

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

        -
      • Optionaldeprecated: boolean

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

        -

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

      A function that is applied as a decorator to the class.

      -
        • (constructor, ...args): void
        • Parameters

          Returns void

      @Register('MyClassIdentifier')
      class MyClass {
      // ...
      } +
    • Optionaldeprecated: boolean

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

      +

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

    The decorator function to be applied on the class.

    +
      • (constructor, ...args): void
      • Parameters

        Returns void

    Identifier for more information on identifiers.

    +
    @Register('MyClassIdentifier')
    class MyClass {
    // ...
    }
    -
+
diff --git a/functions/decorators_RegisterInstance.RegisterInstance.html b/functions/decorators_RegisterInstance.RegisterInstance.html index cc854c3..e8ed2ad 100644 --- a/functions/decorators_RegisterInstance.RegisterInstance.html +++ b/functions/decorators_RegisterInstance.RegisterInstance.html @@ -1,11 +1,14 @@ -RegisterInstance | ts-injex - v0.0.9
  • 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).

    +RegisterInstance | ts-injex - v0.0.10
    • 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: string

        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 as input and returns an instance of the class.

        -

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

      A function that is applied as a decorator to the class.

      -
        • (constructor, ...args): void
        • Parameters

          Returns void

      @RegisterInstance('MyClassInstanceIdentifier', arg1, arg2)
      class MyClass {
      // ...
      } +

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

    The decorator function to be applied on the class.

    +
      • (constructor, ...args): void
      • Parameters

        Returns void

      +
    • Identifier for more information on identifiers.
    • +
    • InitDelegate for more information on initializer functions.
    • +
    +
    @RegisterInstance('MyClassInstanceIdentifier', (constructor) => new constructor())
    class MyClass {
    // ...
    }
    -
+
diff --git a/functions/functions_register.register.html b/functions/functions_register.register.html index 7c0035f..3c82fbe 100644 --- a/functions/functions_register.register.html +++ b/functions/functions_register.register.html @@ -1,13 +1,16 @@ -register | ts-injex - v0.0.9

Register a dependency.

-

The identifier of the dependency.

+register | ts-injex - v0.0.10

Register a dependency.

+

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

+

Identifier for more information on identifiers.

The dependency to register.

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

  • Register a dependency.

    -

    Type Parameters

    • T

    Parameters

    • identifier: string

      The identifier of the dependency.

      +

      Type Parameters

      • T

      Parameters

      • identifier: string

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

      • dependency: T

        The dependency to register.

        -

      Returns void

    • Register a dependency.

      -

      Type Parameters

      • T

      Parameters

      • identifier: string

        The identifier of the dependency.

        +

      Returns void

      Identifier for more information on identifiers..

      +
    • Register a dependency.

      +

      Type Parameters

      • T

      Parameters

      • identifier: string

        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

+

Returns void

Identifier for more information on identifiers.

+
diff --git a/functions/functions_resolve.resolve.html b/functions/functions_resolve.resolve.html index 477db63..c3775c4 100644 --- a/functions/functions_resolve.resolve.html +++ b/functions/functions_resolve.resolve.html @@ -1,15 +1,18 @@ -resolve | ts-injex - v0.0.9

Resolve a dependency.

-

The identifier of the dependency.

+resolve | ts-injex - v0.0.10

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.

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.

A DependencyResolutionError if the dependency is not found and necessary.

  • Resolve a dependency.

    -

    Type Parameters

    • T

    Parameters

    • identifier: string

      The identifier of the dependency.

      +

      Type Parameters

      • T

      Parameters

      • identifier: string

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

      Returns T

      The resolved dependency.

      -

      A DependencyResolutionError if the dependency is not found.

      -
    • Resolve a dependency

      -

      Type Parameters

      • T

      Parameters

      • identifier: string

        The identifier of the dependency.

        +

        Identifier for more information on identifiers.

        +

        A DependencyResolutionError if the dependency is not found.

        +
      • Resolve a dependency

        +

        Type Parameters

        • T

        Parameters

        • identifier: string

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

        • necessary: 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 5d2e72a..42ff8da 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. +ImplementsStatic | ts-injex - v0.0.10

    • 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 84ac481..3124074 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -1 +1 @@ -ts-injex - v0.0.9
+ts-injex - v0.0.10
diff --git a/index.html b/index.html index e532fa5..7d63122 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ -ts-injex - v0.0.9

ts-injex - v0.0.9

Time

+ts-injex - v0.0.10

ts-injex - v0.0.10

Time

Statements Branches Functions Lines

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 bc9d0a3..33f075e 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

dependency +IDependency | ts-injex - v0.0.10

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 7c8fe0a..48cd23b 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjex.html +++ b/interfaces/interfaces_ITSinjex.ITSinjex.html @@ -1,30 +1,31 @@ -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

register +ITSinjex | ts-injex - v0.0.10

Instance 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

  • 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

    • Resolve a dependency

      +

    Returns void

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

      +

      A DependencyResolutionError if the dependency is not found and necessary.

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

      +

      A DependencyResolutionError if the dependency is not found.

      +
    • 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.ITSinjexRegister.html b/interfaces/interfaces_ITSinjex.ITSinjexRegister.html index 73a54d4..1f8edb2 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

    register +ITSinjexRegister | ts-injex - v0.0.10

    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

    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 cc0198e..f76ddf1 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjexResolve.html +++ b/interfaces/interfaces_ITSinjex.ITSinjexResolve.html @@ -1,16 +1,17 @@ -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

    resolve +ITSinjexResolve | ts-injex - v0.0.10

    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

    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.

      +

      A DependencyResolutionError if the dependency is not found and necessary.

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

      +

      A DependencyResolutionError if the dependency is not found.

      +
    • 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 e9d1ca9..df075f4 100644 --- a/interfaces/interfaces_ITSinjex.ITSinjex_.html +++ b/interfaces/interfaces_ITSinjex.ITSinjex_.html @@ -1,32 +1,34 @@ -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

    getInstance +ITSinjex_ | ts-injex - v0.0.10

    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

    • 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

    • Resolve a dependency

      +

    Returns void

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

      +

      A DependencyResolutionError if the dependency is not found and necessary.

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

      +

      A DependencyResolutionError if the dependency is not found.

      +
    • 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/modules/TSinjex.html b/modules/classes_TSinjex.html similarity index 50% rename from modules/TSinjex.html rename to modules/classes_TSinjex.html index 8fedc42..8885215 100644 --- a/modules/TSinjex.html +++ b/modules/classes_TSinjex.html @@ -1,2 +1,2 @@ -TSinjex | ts-injex - v0.0.9

    Module TSinjex

    Index

    Classes

    +classes/TSinjex | ts-injex - v0.0.10

    Module classes/TSinjex

    Index

    Classes

    diff --git a/modules/decorators_Inject.html b/modules/decorators_Inject.html index 523fd90..add8f0c 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

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

    Module decorators/Inject

    Index

    Functions

    diff --git a/modules/decorators_Register.html b/modules/decorators_Register.html index 4d5bf40..c46893c 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

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

    Module decorators/Register

    Index

    Functions

    diff --git a/modules/decorators_RegisterInstance.html b/modules/decorators_RegisterInstance.html index 129f31c..5f593d0 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

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

    Module decorators/RegisterInstance

    Index

    Functions

    diff --git a/modules/functions_register.html b/modules/functions_register.html index eb81a78..97d6b7d 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

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

    Module functions/register

    Index

    Functions

    diff --git a/modules/functions_resolve.html b/modules/functions_resolve.html index e422581..b8b8bbe 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

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

    Module functions/resolve

    Index

    Functions

    diff --git a/modules/helper_ImplementsStatic.html b/modules/helper_ImplementsStatic.html index 1214e90..a4f324a 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

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

    Module helper/ImplementsStatic

    Index

    Functions

    diff --git a/modules/index.html b/modules/index.html index d2c4606..c2130d2 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.10

    Module index

    References

    Re-exports ForceConstructor
    Re-exports GenericConstructor
    Re-exports ITSinjex
    Re-exports ITSinjexRegister
    Re-exports ITSinjexResolve
    Re-exports ITSinjex_
    Re-exports InitDelegate
    Re-exports Inject
    Re-exports Register
    Re-exports RegisterInstance
    Re-exports TSinjex
    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 InitDelegate
    Re-exports Inject
    Re-exports Register
    Re-exports RegisterInstance
    Re-exports TSinjex
    Re-exports register
    Re-exports resolve
    diff --git a/modules/interfaces_Exceptions.html b/modules/interfaces_Exceptions.html index d4c8e58..2b5bdd9 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.10
    +
    diff --git a/modules/interfaces_IDependency.html b/modules/interfaces_IDependency.html index 28a8582..4298f0d 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

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

    Module interfaces/IDependency

    Index

    Interfaces

    diff --git a/modules/interfaces_ITSinjex.html b/modules/interfaces_ITSinjex.html index f13c3b9..dd18828 100644 --- a/modules/interfaces_ITSinjex.html +++ b/modules/interfaces_ITSinjex.html @@ -1,5 +1,5 @@ -interfaces/ITSinjex | ts-injex - v0.0.9

    Module interfaces/ITSinjex

    Index

    Interfaces

    ITSinjex +interfaces/ITSinjex | ts-injex - v0.0.10
    +
    diff --git a/modules/types_GenericContructor.html b/modules/types_GenericContructor.html index 4e4cbca..4d3ca1d 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.10
    +
    diff --git a/modules/types_Identifier.html b/modules/types_Identifier.html new file mode 100644 index 0000000..82dc01b --- /dev/null +++ b/modules/types_Identifier.html @@ -0,0 +1,2 @@ +types/Identifier | ts-injex - v0.0.10

    Module types/Identifier

    Index

    Type Aliases

    diff --git a/modules/types_InitDelegate.html b/modules/types_InitDelegate.html index 93a0d61..d6e28e0 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

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

    Module types/InitDelegate

    Index

    Type Aliases

    diff --git a/types/types_GenericContructor.ForceConstructor.html b/types/types_GenericContructor.ForceConstructor.html index 8c153ec..b447d15 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
    +ForceConstructor | ts-injex - v0.0.10
    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
    diff --git a/types/types_GenericContructor.GenericConstructor.html b/types/types_GenericContructor.GenericConstructor.html index e086d2c..32136fa 100644 --- a/types/types_GenericContructor.GenericConstructor.html +++ b/types/types_GenericContructor.GenericConstructor.html @@ -1,2 +1,3 @@ -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>)
    +GenericConstructor | ts-injex - v0.0.10
    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>)
    diff --git a/types/types_Identifier.Identifier.html b/types/types_Identifier.Identifier.html new file mode 100644 index 0000000..a713475 --- /dev/null +++ b/types/types_Identifier.Identifier.html @@ -0,0 +1,9 @@ +Identifier | ts-injex - v0.0.10
    Identifier: string

    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. +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 61c369b..e96cbc6 100644 --- a/types/types_InitDelegate.InitDelegate.html +++ b/types/types_InitDelegate.InitDelegate.html @@ -1,7 +1,7 @@ -InitDelegate | ts-injex - v0.0.9

    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 - v0.0.10

    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.

        -
    +