Skip to main content

Module

Callable


  • A @Module is a class decorator and must be placed on top of a class representing a module.

    • A module must also extend the AModule class.
    • For type safety, the type of module being decorated is passed to the decorator.

    Decorating a class registers it with Octo, which is what makes the module loadable by name with Octo.loadModule.

    @example
    @Module<MyModule>('@example', MyModuleSchema)
    export class MyModule extends AModule<MyModuleSchema, MyRegion> { ... }
    @group

    Decorators

    @see

    Definition of Modules.


    Type parameters

    • T

    Parameters

    • packageName: string

      The name of the package under which the module is registered. Selecting a unique package name helps avoid collisions between same module class names across different libraries. You will reuse the same package name throughout your library for different Octo components you create.

    • schema: Constructable<ModuleSchema<T>>

      The schema of the module, describing the inputs it accepts.

    Returns (constructor: any) => void

    The decorated class.

      • (constructor: any): void
      • Parameters

        • constructor: any

        Returns void