Hierarchy

Constructors

Properties

aliases: Map<TBindKey<any>, TBindKey<any>>
bindManger: BindManager<KyselyRootModule>
container: Container
exports: Set<TBindKey<any>>
factoriesAsync: Map<TBindKey<any>, IAsyncFactory<any, Module<any>>>
factoriesSync: Map<TBindKey<any>, ISyncFactory<any, Module<any>>>
importedDynamicModules: Set<Module<any>>
importer: Container | Module<any>
imports: Set<TClassConstructor<Module<any>, any[]>>
initialized: boolean
__svt_module_traits: string[]

Accessors

  • get bind(): BindManager<this>
  • Returns bind manager (aka bind util)

    Returns BindManager<this>

Methods

  • Defines an alias (aka link) to another binding. Alias can be used in export and global export to achieve global "scoped" bindings for dynamic modules. (see @silvertree/logging for usage example)

    Parameters

    • key: TBindKey<any>
    • aliasKey: TBindKey<any>

    Returns void

  • Binds async factory to key

    Type Parameters

    • F extends IAsyncFactory<any, Module<any>>

    Parameters

    • key: TBindKey<any>
    • factory: F

    Returns FactoryBindContext<Module<any>, any, F>

  • Binds sync factory to key

    Type Parameters

    • F extends ISyncFactory<any, Module<any>>

    Parameters

    • key: TBindKey<any>
    • factory: F

    Returns FactoryBindContext<Module<any>, any, F>

  • Defines binding or reference to binding export from this module

    Parameters

    • keys: TBindKey<any> | TBindKey<any>[]

    Returns void

  • Defines binding or reference to binding global export from this module. This binding will be available in all modules and by calling provide* methods in container.

    Parameters

    • keys: TBindKey<any> | TBindKey<any>[]

    Returns void

  • Returns all aliases pointing to the binding key

    Parameters

    • key: TBindKey<any>

    Returns TBindKey<any>[]

  • Returns async entity factory by given key. It will try to find factory from the current module, then from imported modules and finally from global exports. It will also try to resolve sync binding if async binding is not found.

    Type Parameters

    • T = any
    • F extends IAsyncFactory<T, Module<any>> = IAsyncFactory<T, Module<any>>

    Parameters

    • key: TBindKey<any>

    Returns [F, Module<any>]

  • Returns container

    Returns Container

  • Returns module which imports this dynamic module

    Returns Container | Module<any>

  • Parameters

    • key: TBindKey<any>

    Returns undefined | TBindKey<any>

  • Returns module instances which can be used for resolving bindings in this module

    Returns Generator<Container | Module<any>, void, undefined>

  • Returns sync entity factory by given key. It will try to find factory from the current module, then from imported modules and finally from global exports.

    Type Parameters

    • T = any
    • F extends ISyncFactory<T, Module<any>> = ISyncFactory<T, Module<any>>

    Parameters

    • key: TBindKey<any>

    Returns [F, Module<any>]

  • Returns true if binding is exported from this module. Also includes sync imports check.

    Parameters

    • key: TBindKey<any>

    Returns boolean

  • Returns true if binding is exported from this module.

    Parameters

    • key: TBindKey<any>

    Returns boolean

  • Returns true if async (or sync) binding is imported from other modules.

    Parameters

    • key: TBindKey<any>

    Returns boolean

    See

    Module.import

  • Returns true if sync binding is imported from other modules.

    Parameters

    • key: TBindKey<any>

    Returns boolean

  • Parameters

    • key: TBindKey<any>

    Returns boolean

  • Parameters

    • key: TBindKey<any>

    Returns boolean

  • Parameters

    • key: TBindKey<any>

    Returns boolean

  • Parameters

    • key: TBindKey<any>

    Returns boolean

  • Parameters

    • key: TBindKey<any>

    Returns boolean

  • Imports modules into current the current module. All exported bindings (and/or its aliases) will be available in the current module.

    Parameters

    • modules: TClassConstructor<Module<any>, any[]> | TConfiguredModuleTerm<Module<any>, Container, KyselyRootModule, any> | (TClassConstructor<Module<any>, any[]> | TConfiguredModuleTerm<Module<any>, Container, KyselyRootModule, any>)[]

    Returns Promise<void>

  • Initializes module

    Returns Promise<unknown>

  • Returns resolved entity by given async binding or binding ref. It will try to find binding from the current module, then from imported modules and finally from global exports. It will also try to resolve sync binding if async binding is not found.

    Type Parameters

    • T

    Parameters

    • key: TClassConstructor<T, any[]>
    • Optional options: null | Partial<IInjectOptions>
    • Optional ctx: TProvideContext

    Returns Promise<T>

  • Type Parameters

    • T = any

    Parameters

    • key: string | symbol
    • Optional options: null | Partial<IInjectOptions>
    • Optional ctx: TProvideContext

    Returns Promise<T>

  • Type Parameters

    • T = any

    Parameters

    • key: TBindKey<any>
    • Optional options: null | Partial<IInjectOptions>
    • Optional ctx: TProvideContext

    Returns Promise<T>

  • Returns resolved entity by given sync binding or binding ref. It will try to find binding from the current module, then from imported modules and finally from global exports.

    Type Parameters

    • T

    Parameters

    • key: TClassConstructor<T, any[]>
    • Optional options: null | Partial<IInjectOptions>
    • Optional ctx: TProvideContext

    Returns T

  • Type Parameters

    • T = any

    Parameters

    • key: string | symbol
    • Optional options: null | Partial<IInjectOptions>
    • Optional ctx: TProvideContext

    Returns T

  • Type Parameters

    • T = any

    Parameters

    • key: TBindKey<any>
    • Optional options: null | Partial<IInjectOptions>
    • Optional ctx: TProvideContext

    Returns T

  • Internal method which is called by container or module which imports this dynamic module. Sets module which imports this dynamic module.

    Parameters

    • importer: Container | Module<any>

    Returns void

  • Defines basic bindings such as module config, container, etc.

    Returns Promise<void>