From e5c64f1abff4f278f358d1638f396c76afe9a183 Mon Sep 17 00:00:00 2001 From: Mark Oosting Date: Thu, 4 Jan 2024 12:59:21 +0100 Subject: [PATCH] Updated docs --- README.md | 23 ++- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/Container.html | 33 ++-- docs/classes/ContainerNotResolvedError.html | 4 +- docs/classes/ContainerOverrideUserError.html | 4 +- docs/classes/CyclicalDependencyError.html | 4 +- docs/classes/ExtendableContainer.html | 39 ++-- docs/classes/ParameterNotFoundError.html | 187 +++++++++++++++++++ docs/classes/ServiceNotFoundError.html | 4 +- docs/enums/Lifetime.html | 6 +- docs/functions/assert.html | 2 +- docs/hierarchy.html | 2 +- docs/index.html | 6 +- docs/interfaces/BundleInterface.html | 6 +- docs/modules.html | 5 +- docs/types/BundleConfigType.html | 2 +- docs/types/ClassType.html | 2 +- docs/types/Dependencies.html | 2 +- docs/types/DependsOn.html | 2 +- docs/variables/container-1.html | 2 +- src/ExtendableContainer.ts | 9 + src/types.ts | 20 +- typedoc.json | 2 +- 24 files changed, 291 insertions(+), 79 deletions(-) create mode 100644 docs/classes/ParameterNotFoundError.html diff --git a/README.md b/README.md index 39395b4..7891723 100644 --- a/README.md +++ b/README.md @@ -198,15 +198,15 @@ import type { BundleInterface } from '@wildsea/dependency-injection' /* Define the bundle configuration class */ export class MyBundleConfig { debug: boolean; - graphics: Partial; + myService: Partial; } /* Create the bundle definition */ export class MyBundle implements BundleInterface { constructor( - public timer: Timer, - public graphics: GraphicsManager, + public api: ApiManager, + public service: MyService, ) {} /* The configure() method wires the services in this bundle */ @@ -215,12 +215,15 @@ export class MyBundle implements BundleInterface { /* Apply configuration overrides */ const config = {...new MyBundleConfig(), ...overrides}; - /* Register the services in this bundle */ - container.transient(Timer, []); - container.singleton(GraphicsManager, [Timer, config.graphics]); + /* Get some global parameters (could also be passed via config, based on the scope) */ + const apiKey = container.getParameter('apiKey'); + + /* Wire the services in this bundle */ + container.transient(ApiManager, [apiKey]); + container.singleton(MyService, [ApiManager, config.myService]); /* Then register the bundle itself */ - container.register(MyBundle, [Timer, GraphicsManager]); + container.register(MyBundle, [Timer, MyService]); } } ``` @@ -254,14 +257,14 @@ container.addExtension(MyBundle, { ```ts import { MyBundle } from "." -/* You must call `build` first. This will wire the services. */ +/* You must call `build` first. */ container.build(); const ext = container.getExtension(MyBundle); if (ext) { - const bundleTimer = ext.timer; /* instanceof 'Timer' */ - const bundleGraphics = ext.graphics; /* instanceof 'GraphicsManager' */ + const instance1 = ext.api; /* instanceof 'ApiManager' */ + const instance2 = ext.service; /* instanceof 'MyService' */ } ``` diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 55d2b04..b20e251 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA42Ty27CMBBF/8Vr2pS0UJplKZUqVUXqY4VYuM6kGdVxkD1EoIp/rwHhvJzA0r53zh3N2Is/RrAhFrFproijAs0GTKQoYw2KRQuvvuKU2ishuTFgAiddp5RJq/+iilk0DCe7gaufbQhUzL8l9JA8pj6maJMKrnFfbwInXg3rjNuwgnjFBAgzKAmg1pkJTvf10sluWal9XKvYJnUM7Ki+KAKdcFEJwNOVCRqeelg4GrfC7FgS/Pncrio8sqcTqtQbrJuH++EorLU/p7Rz2/t1aCozkrUShLkywVGp08d3Fex0v0tfh07wt1YSnmBlX4GZqybBCZcRQAk8rMcDOWrnhzTTOtddK55uhUTBpUNuD3bPD/Eb+962+wBvOb2DyWUBcRe9y3oRf16A1hjDl93ruYCWty/hA3SBAmxTz7l9nB1sn6tNXe6W/wHYYnSrBAAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA42TXU/CMBSG/4rpNTqZgsiliImJEePHFeGidmfuxK4j7WGBGP67hYXug25w2fO+fd6253T+xwjWxMZskiniqECzHhMJykiDYuO5V19ySmxJSG4MmMBJVwml0uq/qCI27oejbc/tn64JVMS/JXSQPKYupjgm5Vzjbr8JnHjZrzNuwgriBWMgTKEkgFqlJjjU61tH20XzSgYzdfGwUpHNbHm6Qn1WBDrmohKFh5IJGp56bDgYVmILq32gGH8+N8sKj+zqgCr1Buv6/q4/CGsXmVHS2vddYzSVGfFKCbJ3NkGh1OnD2wp2suuq74RO8B+tJDzC0s6DmakmwQnnEUAJ3LfHAym004801TrTbS2ebIREwaVDbvZ2z1/xG7um3H2F14zewWQyh6iN3mY9iz/LQWuM4Mv29VTAkbcr4Y1rngLtj/WU2fFsoft9XeQP0DkKOMH1uY6pi+3iH+J/+CoPBQAA" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 238ec20..a56c584 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7Va227bRhD9lYJ+VWztLqmL39LERQO0SZGkfTEMgxHXDlGKEkjKTWD437vL285QMySlMG+hdeayc2aGM9w8e9nuv9y7vn32/o3TyLtWcual4VZ7195mlxZhnOrMm3mHLDF/eQqzOPyS6Pyq/e2VuPxabBMD2SRhnmujy/NeZo06IVetvjdH+mqRq/aXXl2BQL7lRXbYFLshbRcYCjTPvH2Y6bRArgHX59Jv7Rmk+Uehs3zIHEI6a0UevYrzV/tsV+hNoaOTrEd6r9NIp5tYD9rvYCfyINfZU7wZtg5wE1nePeksjoYtA9xElpvD/BE/6CLeDrtwTwgQvsRPYaFP82Sz2+7jpPS/3wMAPNeynPsrwHvxV5PQw9wj7PhKQxYfT7D4OInFTD/G+QhrAHempTxOHxNd7NLBUALgmbaKLEzz2IIHbEHgmba+HOJkMDcb0Jk2bH3bAh/TB2rc+Rk4IvF+JN/yXfI0eBAHO9POJtOm3N+Zt1+YbgbNHaHP7lzglX/zrTAvIzsy8C9/AjPJGMDpZQeC+phx+tW8STovC+ogTLPWFprHxsh4l5DMuNfXOR4Z5EP8eIZbreDkvlkbn7/v9Z/hfrxf90hoTKL2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j7myF+yrzxMkW95kGST8TFFvuVBkU3GxxQFlgdFNpkAUxRYHhTZZAJMUWB5UGSTCTBFgeVBkbQHmKKgnAtI2oPOZGB5UCSZQUVROU6ZOcosvu+qscoMRs0y9ezd17OWobme5p49Q+7188uLm63sk1UdRpF2FwNAWDph04MZ4Xpcd2IKiJmo0mL1bYCTMm26lRKlsZlnmjQnbXeLapnpHtkkgjM/71UQu60MnHoNQrZi5MvJ9ijYCyDJxct9UnWCgKRVdXLTqDnxdoEDR54Dw2te0t1sgrgDjuuoc0ED/+fLyQPT80qeo7wVT3dF/UEn0tVOAY7iA/bUkKbmQ9nB5OCxqgCoYukob7bj9mYbBAawItg8qJfH9urm+7EbILEDjlZ89QOEAbE1O3WGmL7apyrvlPIKKOKqSrdfzUimBdAhuCxrG8mmvhUGPoBUkVwg4GU3MA1qUnL5ZURtRW7tvS+wChOcS6jyOycwBzJHLOqK5E5sZOnuCbiTXOs1wnt3U+CEwXlFXVaKS+Gk/YgJjIMy8rmAudsyJwhO3hycawfuKzWIHLArgloBVzzwUha47jSoOuW5VHe3GsADkGVC1B5w4W+/KwN50MTFsq41LgT1NV7irvGcIqCnVqM4Imo1pi8+2G8oxy0E6Aq4s7irWScIm2kdSy6NcyYTQdGv62NwVZR/DTP8YpMgnXyu5MFlEKABlK2oX0yKa1zg+gZoAIkk6kxSDaHkEcxMtY/3hs3UCN3evbz8D/gltbgBLQAA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7Va227bRhD9lYJ+VWztLlcXv6WJiwZokyJJ+2IYBiPSDlGKEkjKTWD437vL285QMySlMG+hdeayc2aGM9w8e9nuv9y7vn32/o3T0LtWcualwTbyrr3NLi2COI0yb+YdssT85SnI4uBLEuVX7W+vxOXXYpsYyCYJ8jwyujzvZdaoE3LV6ntzpK8WuWp/6dWlBfItL7LDptgNabvAUKB55u2DLEoL5BpwfS791p5Bmn8UUZYPmUNIZ63Iw1dx/mqf7YpoU0ThSdbDaB+l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tc5wHUWoAFUv6jfb4o7OriAAhpAIok6k1RDKHkEM5rt471hMzVCt3cvL/8DFV0J6cMtAAA="; \ No newline at end of file diff --git a/docs/classes/Container.html b/docs/classes/Container.html index 40e2fd8..e860395 100644 --- a/docs/classes/Container.html +++ b/docs/classes/Container.html @@ -162,7 +162,7 @@

Other DI solutions use decorators (which are experimental) or reflect-metadata (extra package). This package heavily relies on Typescript and native Javascript features instead.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

parameters: Record<string, any> = {}
dependencies: Map<ClassType<any>, ClassType<any>[]> = ...
services: Map<ClassType<any>, any> = ...
overides: Map<ClassType<any>, ClassType<any>> = ...
#serviceLifetimes: Map<ClassType<any>, Lifetime> = ...
#compiled: boolean = false

Methods

  • Set a 'superglobal'. Can be useful for general application config.

    -

    Parameters

    • key: string
    • value: any

    Returns this

  • Get a 'superglobal'. Can be useful for general application config.

    -

    Type Parameters

    • T = any

    Parameters

    • key: string

    Returns T

Properties

parameters: Record<string, any> = {}
dependencies: Map<ClassType<any>, ClassType<any>[]> = ...
services: Map<ClassType<any>, any> = ...
overides: Map<ClassType<any>, ClassType<any>> = ...
#serviceLifetimes: Map<ClassType<any>, Lifetime> = ...
#compiled: boolean = false

Methods

  • Set a 'superglobal'. Can be useful for general application config.

    +

    Parameters

    • key: string
    • value: any

    Returns this

  • Get a 'superglobal'. Can be useful for general application config.

    +

    Type Parameters

    • T = any

    Parameters

    Returns T

  • Registers a class as a service.

    Type Parameters

    Parameters

    • ctor: T

      The service to register - can be any class.

    • dependencies: MapDependencies<ConstructorParameters<T>>

      Dependencies (constructor parameters) of the service

    • Optional lifetime: Lifetime = Lifetime.SHARED

    Returns this

    Example

    container.register(LoggerService, [config.logLevel]);
    container.register(Database, [LoggerService]);
    -
  • Shortcut for register with Lifetime.SHARED.

    Registers a class as a singleton service.

    Type Parameters

    Parameters

    • ctor: T

      The service to register - can be any class.

    • dependencies: MapDependencies<ConstructorParameters<T>>

      Dependencies (constructor parameters) of the service

      -

    Returns this

Returns this

  • Shortcut for register with Lifetime.TRANSIENT.

    Registers a class as a transient service.

    Type Parameters

    Parameters

    • ctor: T

      The service to register - can be any class.

    • dependencies: MapDependencies<ConstructorParameters<T>>

      Dependencies (constructor parameters) of the service

      -

    Returns this

  • Resolves the container.

    +

Returns this

  • Resolves the container.

    Also applies implementation overrides that were set via override.

    -

    Returns this

  • Overrides a service with another concrete implementation.

    -

    You may omit the 'dependencies' argument to match the -constructor signature of the overridden class.

    -

    Type Parameters

    Parameters

    • ctor: T
    • overrideCtor: T
    • Optional dependencies: MapDependencies<ConstructorParameters<T>>

    Returns this

    Example

    container.transient(Foo, []); // Foo is some service
    container.singleton(MyService, [Foo]); // MyService depends on Foo

    container.transient(OverrideFoo, []); // Add an override service
    container.override(Foo, OverrideFoo); // MyService will now use OverrideFoo +

    Returns this

  • Overrides a service with another concrete implementation.

    +

    You may omit the 'dependencies' argument to match the constructor +signature of the overridden class.

    +

    Type Parameters

    Parameters

    • ctor: T
    • overrideCtor: T
    • Optional dependencies: MapDependencies<ConstructorParameters<T>>

    Returns this

    Example

    class IFoo {
    someMethod(): void {}
    }

    // First register the default implementation / 'base class' for IFoo.
    container.transient(IFoo, []);

    container.singleton(MyService, [IFoo]); // MyService depends on IFoo

    container.transient(ConcreteFoo, []); // Register an override service
    container.override(IFoo, ConcreteFoo); // ConcreteFoo will be passed to MyService
    -
  • Retrieves a service from the container with resolved dependencies.

    +
  • Resolves an instance of the given class.

    +
  • Resolves an instance of the given class.

    Type Parameters

    • T

    Parameters

    Returns undefined | T

  • Creates a new instance of a service and resolves/injects it's dependencies.

    -

    Type Parameters

    • T

    Parameters

    Returns T

Generated using TypeDoc

Thrown when a user tries to get() an instance from the container, before calling build().

-

Hierarchy

  • Error
    • ContainerNotResolvedError

Properties

Hierarchy

  • Error
    • ContainerNotResolvedError

Properties

Parameters

  • err: Error
  • stackTraces: CallSite[]

Returns any

stackTraceLimit: number
cause?: unknown
name: string
message: string
stack?: string

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc

Thrown a user tries to override() a class when build() was already called.

-

Hierarchy

  • Error
    • ContainerOverrideUserError

Properties

Hierarchy

  • Error
    • ContainerOverrideUserError

Properties

Parameters

  • err: Error
  • stackTraces: CallSite[]

Returns any

stackTraceLimit: number
cause?: unknown
name: string
message: string
stack?: string

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc

Thrown when a class references itself as a dependency - prevents infinite loops.

-

Hierarchy

  • Error
    • CyclicalDependencyError

Properties

Hierarchy

  • Error
    • CyclicalDependencyError

Properties

Parameters

  • err: Error
  • stackTraces: CallSite[]

Returns any

stackTraceLimit: number
cause?: unknown
name: string
message: string
stack?: string

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc

Thrown when a parameter is not found.

+

Hierarchy

  • Error
    • ParameterNotFoundError

Properties

prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

+

Type declaration

stackTraceLimit: number
cause?: unknown
name: string
message: string
stack?: string

Methods

  • Create .stack property on a target object

    +

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/ServiceNotFoundError.html b/docs/classes/ServiceNotFoundError.html index 5ef1567..cd2742b 100644 --- a/docs/classes/ServiceNotFoundError.html +++ b/docs/classes/ServiceNotFoundError.html @@ -157,7 +157,7 @@ --md-sys-color-surface-container-highest: #e1e3e3 }

Thrown when a service is not found by the container.

-

Hierarchy

  • Error
    • ServiceNotFoundError

Properties

Hierarchy

  • Error
    • ServiceNotFoundError

Properties

Parameters

  • err: Error
  • stackTraces: CallSite[]

Returns any

stackTraceLimit: number
cause?: unknown
name: string
message: string
stack?: string

Methods

  • Create .stack property on a target object

    -

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc

Generated using TypeDoc

Generated using TypeDoc

Type alias BundleConfigType<T>

BundleConfigType<T>: T extends BundleInterface<infer X>
    ? X
    : never

Provides type hints for a given BundleInterface.

Type Parameters

Generated using TypeDoc

ClassType<T>: (new (...args) => T)

The static 'name' of a class, rather than an instance. E.g. MyClass instead of new MyClass().

Type Parameters

  • T

    Any constructable class.

    -

Type declaration

    • new (...args): T
    • Parameters

      • Rest ...args: any[]

      Returns T

Generated using TypeDoc

Dependencies<T>: MapDependencies<ConstructorParameters<T>>

Get the dependency types of a class, based on it's ConstructorParameters.

Type Parameters

Generated using TypeDoc

DependsOn<T>: T | ClassType<T>

A 'nice to read' alias for the depenency mapping. Can be T or the ClassType of T.

Type Parameters

  • T

    Any constructable class.

    -

Generated using TypeDoc