Function JSService

  • Experimental

    Marks class as a service that can be injected using Container. Uses the default options, wherein the class can be passed to .get and an instance of it will be returned. By default, the service shall be registered upon the defaultContainer container.

    Type Parameters

    • T extends AnyConstructable

    Parameters

    • dependencies: AnyServiceDependency[]

      The dependencies to provide upon initialisation of this service. These will be provided to the service as arguments to its constructor. They must be valid identifiers in the container the service shall be executed under.

    • constructor: T

      The constructor of the service to inject.

    Returns T

    The constructor.

  • Experimental

    Marks class as a service that can be injected using Container. The options allow customization of how the service is injected. By default, the service shall be registered upon the defaultContainer container.

    Type Parameters

    • T extends AnyConstructable

    Parameters

    • options: Omit<ServiceOptions<T>, "dependencies">

      The options to use for initialisation of the service. Documentation for the options can be found in ServiceOptions.

    • dependencies: AnyServiceDependency[]

      The dependencies to provide upon initialisation of this service. These will be provided to the service as arguments to its constructor. They must be valid identifiers in the container the service shall be executed under.

    • constructor: T

      The constructor of the service to inject.

    Returns T

    The constructor.

  • Experimental

    Marks class as a service that can be injected using Container. The options allow customization of how the service is injected. By default, the service shall be registered upon the defaultContainer container.

    Type Parameters

    • T extends AnyConstructable

    Parameters

    • options: Object

      The options to use for initialisation of the service. Documentation for the options can be found in ServiceOptions. The options must also contain the dependencies that the service requires.

      If found, the specified dependencies to provide upon initialisation of this service. These will be provided to the service as arguments to its constructor. They must be valid identifiers in the container the service shall be executed under.

    • constructor: T

      The constructor of the service to inject.

    Returns T

    The constructor.

Generated using TypeDoc