Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ModuleLoader

A class which handles the loading of the different module and their dependencies. This will also check that both Coriolis instances have the same modules loaded and log into the console if it's not the case.

Hierarchy

  • EventEmitter
    • ModuleLoader

Implements

Index

Constructors

Methods

  • has(name: string): boolean
  • list(): Set<string>
  • eventNames(): (string | symbol)[]
  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

  • listeners<T>(event: T): ((...args: any[]) => void)[]
  • Return the listeners registered for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

  • emit<T>(event: T, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Rest ...args: any[]

    Returns boolean

  • on<T>(event: T, fn: (...args: any[]) => void, context?: any): ModuleLoader
  • Add a listener for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns ModuleLoader

  • addListener<T>(event: T, fn: (...args: any[]) => void, context?: any): ModuleLoader
  • Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns ModuleLoader

  • once<T>(event: T, fn: (...args: any[]) => void, context?: any): ModuleLoader
  • Add a one-time listener for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns ModuleLoader

  • removeListener<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): ModuleLoader
  • Remove the listeners of a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns ModuleLoader

  • off<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): ModuleLoader
  • Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns ModuleLoader

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns ModuleLoader

Properties

_postMessage: PostMessageChannel

Internal save of postMessage main instance

_loadedModules: Map<string, ModuleBase> = ...

Internal array to save all modules that are registered

Generated using TypeDoc