Hierarchy

  • FiberModule
    • CliFiberModule

Constructors

  • Parameters

    • container: Container
    • parentModule: Module<any>

    Returns CliFiberModule

Properties

aliases: Map<TBindKey<any>, TBindKey<any>>
bindManger: BindManager<CliFiberModule>
config?: void
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>>
imports: Set<TClassConstructor<Module<any>, any[]>>
initialized: boolean
parentModule: Module<any>
__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>

  • Parameters

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

    Returns void

  • Parameters

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

    Returns void

  • Parameters

    • key: TBindKey<any>

    Returns TBindKey<any>[]

  • 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

  • Type Parameters

    • Cfg = any

    Returns undefined | Cfg

  • Parameters

    • key: TBindKey<any>

    Returns undefined | TBindKey<any>

  • Returns Module<any>

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

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

  • Type Parameters

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

    Parameters

    • key: TBindKey<any>

    Returns [F, Module<any>]

  • Parameters

    • _: TBindKey<any>

    Returns boolean

  • Parameters

    • _: 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

  • Parameters

    • modules: TClassConstructor<Module<any>, any[]> | TConfiguredModuleTerm<Module<any>, Container, CliFiberModule, any> | (TClassConstructor<Module<any>, any[]> | TConfiguredModuleTerm<Module<any>, Container, CliFiberModule, 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

  • This method invokes user defined bindings, imports, export and internal module related init logic. Any entity initialization logic should be placed in corresponded factory to minimize module initialization time.

    Returns Promise<void>