Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Module

Decorator that marks a class as a module. Decorator that marks a class as a module.

Modules are used by Nest to organize the application structure into scopes. Controllers and Providers are scoped by the module they are declared in. Modules and their classes (Controllers and Providers) form a graph that determines how Nest performs Dependency Injection (DI).

Modules are used by Nest to organize the application structure into scopes. Controllers and Providers are scoped by the module they are declared in. Modules and their classes (Controllers and Providers) form a graph that determines how Nest performs Dependency Injection (DI).

see

Modules

publicapi
see

Modules

publicapi

Hierarchy

  • Module

Callable

  • Module(metadata: any): (Anonymous function)
  • Decorator that marks a class as a module.

    Modules are used by Nest to organize the application structure into scopes. Controllers and Providers are scoped by the module they are declared in. Modules and their classes (Controllers and Providers) form a graph that determines how Nest performs Dependency Injection (DI).

    see

    Modules

    publicapi

    Parameters

    • metadata: any

      module configuration metadata

    Returns (Anonymous function)

Index

Constructors

constructor

  • new Module(_metatype: any, container: any): Module
  • Parameters

    • _metatype: any
    • container: any

    Returns Module

Properties

Private Readonly _controllers

_controllers: Map<string, InstanceWrapper<object>> = new Map<string,InstanceWrapper<Controller>>()

Private _distance

_distance: number = 0

Private Readonly _exports

_exports: Set<string | symbol> = new Set<string | symbol>()

Private Readonly _id

_id: string

Private Readonly _imports

_imports: Set<Module> = new Set<Module>()

Private Readonly _injectables

_injectables: Map<any, InstanceWrapper<unknown>> = new Map<any, InstanceWrapper<Injectable>>()

Private Readonly _metatype

_metatype: Type<any>

Private Readonly _middlewares

_middlewares: Map<any, InstanceWrapper<unknown>> = new Map<any, InstanceWrapper<Injectable>>()

Private Readonly _providers

_providers: Map<any, InstanceWrapper<unknown>> = new Map<any, InstanceWrapper<Injectable>>()

Private Readonly container

container: NestContainer

Accessors

components

controllers

distance

  • get distance(): number
  • set distance(value: number): void

exports

  • get exports(): Set<string | symbol>

id

  • get id(): string

imports

  • get imports(): Set<Module>

injectables

instance

  • get instance(): NestModule

metatype

  • get metatype(): Type<any>

middlewares

providers

relatedModules

  • get relatedModules(): Set<Module>

routes

Methods

addApplicationConfig

  • addApplicationConfig(): void
  • Returns void

addController

  • addController(controller: any): void
  • Parameters

    • controller: any

    Returns void

addCoreProviders

  • addCoreProviders(): void
  • Returns void

addCustomClass

  • addCustomClass(provider: any, collection: any): void
  • Parameters

    • provider: any
    • collection: any

    Returns void

addCustomExportedProvider

  • addCustomExportedProvider(provider: any): Set<any>
  • Parameters

    • provider: any

    Returns Set<any>

addCustomFactory

  • addCustomFactory(provider: any, collection: any): void
  • Parameters

    • provider: any
    • collection: any

    Returns void

addCustomProvider

  • addCustomProvider(provider: any, collection: any): any
  • Parameters

    • provider: any
    • collection: any

    Returns any

addCustomUseExisting

  • addCustomUseExisting(provider: any, collection: any): void
  • Parameters

    • provider: any
    • collection: any

    Returns void

addCustomValue

  • addCustomValue(provider: any, collection: any): void
  • Parameters

    • provider: any
    • collection: any

    Returns void

addExportedProvider

  • addExportedProvider(provider: any): Set<any>
  • Parameters

    • provider: any

    Returns Set<any>

addInjectable

  • addInjectable(injectable: any, host: any): any
  • Parameters

    • injectable: any
    • host: any

    Returns any

addModuleAsProvider

  • addModuleAsProvider(): void
  • Returns void

addModuleRef

  • addModuleRef(): void
  • Returns void

addProvider

  • addProvider(provider: any): any
  • Parameters

    • provider: any

    Returns any

addRelatedModule

  • addRelatedModule(module: any): void
  • Parameters

    • module: any

    Returns void

assignControllerUniqueId

  • assignControllerUniqueId(controller: any): void
  • Parameters

    • controller: any

    Returns void

createModuleReferenceType

  • createModuleReferenceType(): (Anonymous class)
  • Returns (Anonymous class)

getNonAliasProviders

  • getNonAliasProviders(): [any, any][]
  • Returns [any, any][]

getProviderByKey

  • getProviderByKey(name: any): any
  • Parameters

    • name: any

    Returns any

getProviderStaticToken

  • getProviderStaticToken(provider: any): any
  • Parameters

    • provider: any

    Returns any

hasInjectable

  • hasInjectable(token: any): boolean
  • Parameters

    • token: any

    Returns boolean

hasProvider

  • hasProvider(token: any): boolean
  • Parameters

    • token: any

    Returns boolean

isCustomClass

  • isCustomClass(provider: any): boolean
  • Parameters

    • provider: any

    Returns boolean

isCustomFactory

  • isCustomFactory(provider: any): boolean
  • Parameters

    • provider: any

    Returns boolean

isCustomProvider

  • isCustomProvider(provider: any): boolean
  • Parameters

    • provider: any

    Returns boolean

isCustomUseExisting

  • isCustomUseExisting(provider: any): boolean
  • Parameters

    • provider: any

    Returns boolean

isCustomValue

  • isCustomValue(provider: any): boolean
  • Parameters

    • provider: any

    Returns boolean

isDynamicModule

  • isDynamicModule(exported: any): any
  • Parameters

    • exported: any

    Returns any

replace

  • replace(toReplace: any, options: any): any
  • Parameters

    • toReplace: any
    • options: any

    Returns any

validateExportedProvider

  • validateExportedProvider(token: any): any
  • Parameters

    • token: any

    Returns any

Generated using TypeDoc