Options
All
  • Public
  • Public/Protected
  • All
Menu

A ModuleCollection consists of multiple modules and handles manipilation like routing updates to them.

Hierarchy

  • ModuleCollection

Index

Constructors

constructor

  • Parameters

    • Optional eventEmitter: EventEmitter

      The global EventEmitter.

    Returns ModuleCollection

Properties

eventEmitter

eventEmitter: undefined | EventEmitter

The EventEmitter, used for inter-object server side communication.

Readonly id

id: string

Unique Id of this collection.

modules

modules: ModuleModel[]

List of modules.

Accessors

length

  • get length(): number
  • Returns the number of modules in this collection.

    Returns number

Methods

addModule

  • addModule(moduleModel: ModuleModel, index?: number): void
  • Adds a module to the collection.

    Parameters

    • moduleModel: ModuleModel

      The module to be added.

    • Optional index: number

      Adds module at a specific index in the list or at the end when empty.

    Returns void

decreaseModulePosition

  • decreaseModulePosition(id: string): void
  • Decreases the index of a module inside the list structure of this collection. (Index -= 1)

    Parameters

    • id: string

      Unique id of the ModuleModel

    Returns void

getModuleById

  • Retrieves a module.

    Parameters

    • id: string

      Unique id of the module.

    Returns undefined | ModuleModel

    The module if it exists, undefined otherwise.

getModuleByIndex

  • Retrieves a module.

    Parameters

    • idx: number

      The index of the module.

    Returns undefined | ModuleModel

    The module if idx is valid, undefined otherwise.

increaseModulePosition

  • increaseModulePosition(id: string): void
  • Increases the index of a module inside the list structure of this collection. (Index += 1)

    Parameters

    • id: string

      Unique id of the ModuleModel

    Returns void

move

  • move(from: number, to: number): void
  • Moves a module inside the list structure of this collection.

    Parameters

    • from: number

      Current index of the module.

    • to: number

      New module index.

    Returns void

removeModuleById

  • removeModuleById(moduleModelId: string): void
  • Deletes a module from the collection.

    Parameters

    • moduleModelId: string

      Unique Id of the module.

    Returns void

removeModuleByIdx

  • removeModuleByIdx(idx: number): void
  • Deletes a module from the collection.

    Parameters

    • idx: number

      The index of the module.

    Returns void

setEventEmitter

  • setEventEmitter(eventEmitter: EventEmitter): void
  • Sets the EventEmitter after creating the object.

    Parameters

    • eventEmitter: EventEmitter

      The global EventEmitter.

    Returns void

updateModule

  • Updates the internal settings of a module.

    Parameters

    • newModule: ModuleModel

      New module holding the updated settings but with the same unique id of the module about to be updated.

    Returns void

Generated using TypeDoc