Skip to main content

Module

Callable


  • A @Module is a class decorator to be placed on top of a class that represents a module.

    • A Module class must implement the IModule interface.
    • The IModule.onInit method is called to initialize the module, and is where you will define your infrastructure.
    @example
    @Module<MyInputInterface, OutputModel>('my-package', {})
    export class MyModule implements IModule<Region> {
    constructor(inputs: IMyInputs) { ... }

    async onInit(): Promise<Region> { ... }
    }
    @group

    Decorators

    @see

    Definition of Modules.


    Type parameters

    • T

    Parameters

    Returns (constructor: any) => void

    The decorated class.

      • (constructor: any): void
      • Parameters

        • constructor: any

        Returns void