AbstractModule

core. AbstractModule

Abstract class for authoring tool modules. All custom modules must extend this class.

Constructor

new AbstractModule(app, pkg)

Description:
  • Create the Module instance
Source:
Parameters:
Name Type Description
app Object Reference to the main application
pkg Object Config object from package.json for this module

Members

app :App

Description:
  • Reference to the main app instance
Source:
Reference to the main app instance
Type:
  • App

initTime :Number

Description:
  • Time taken in milliseconds for module to initialise
Source:
Time taken in milliseconds for module to initialise
Type:
  • Number

name :String

Description:
  • Name of the module
Source:
Name of the module
Type:
  • String

pkg :Object

Description:
  • Module config options
Source:
Module config options
Type:
  • Object

readyHook :Hook

Description:
  • Hook invoked on module ready
Source:
Hook invoked on module ready
Type:
  • Hook

rootDir :String

Description:
  • Root directory of this module
Source:
Root directory of this module
Type:
  • String

Methods

getConfig(key) → {*}

Description:
  • Shortcut for retrieving config values
Source:
Parameters:
Name Type Description
key String
Returns:
Type
*

(async) init() → {Promise}

Description:
  • Initialises the module. Any custom initialisation tasks should go here. Any uncaught errors thrown here will be caught later and halt the module's load, so make sure any non-fatal errors are handled.
Source:
Returns:
Type
Promise

log(level, …rest)

Description:
  • Log a message using the Logger module
Source:
Parameters:
Name Type Attributes Description
level String Log level of message
rest * <repeatable>
Arguments to log

(async) onReady() → {Promise}

Description:
  • Used to listen to the module's ready signal. The returned promise will be resolved when the module has completed initialisation successfully.
Source:
Returns:
Type
Promise

(async) setReady(error) → {Promise}

Description:
  • Signals that the module is loaded
Source:
Parameters:
Name Type Description
error Error
Returns:
Type
Promise