Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DependencyManager

Index

Constructors

Methods

Constructors

constructor

Methods

alias

  • alias(name: string, alias: string): void
  • Add an alias name to a dependency name

    throws

    {Error} if there is a invalid dependency

    Parameters

    • name: string

      The name of the dependency

    • alias: string

      The alias name

    Returns void

get

  • get<T>(name: string): T
  • Get the instance of dependency

    throws

    {Error} if the dependencies have not been loaded or the dependency does not exist

    Type parameters

    • T

    Parameters

    • name: string

      The name of the dependency

    Returns T

    The dependency instance

load

  • load(): Promise<void>
  • Load all registered dependencies

    throws

    {Error} if a dependencies does not exist or cannot be loaded

    Returns Promise<void>

register

  • register<T, D>(name: string, factory: function, dependencyNames?: string[]): void
  • Register a dependency

    throws

    {Error} if there is a invalid dependency

    Type parameters

    • T

    • D

    Parameters

    • name: string

      The name of the dependency

    • factory: function

      The factory function that will create the instance

        • (deps: D): T
        • Parameters

          • deps: D

          Returns T

    • Optional dependencyNames: string[]

      An array of dependency names

    Returns void

set

  • set<T>(name: string, instance: T): void
  • Set a static instance as a dependency

    throws

    {Error} if there is a invalid dependency

    Type parameters

    • T

    Parameters

    • name: string

      The name of the dependency

    • instance: T

      The instance of the dependency

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc