AbstractModule

core. AbstractModule

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

Constructor

new AbstractModule(app, pkg)

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

Members

app :App

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

initTime :Number

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

name :String

Source:
Name of the module
Type:
  • String

pkg :Object

Source:
Module config options
Type:
  • Object

readyHook :Hook

Source:
Hook invoked on module ready
Type:
  • Hook

rootDir :String

Source:
Root directory of this module
Type:
  • String

Methods

getConfig(key) → {*}

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

(async) init() → {Promise}

Source:
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.
Returns:
Type
Promise

log(level, …rest)

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

(async) onReady() → {Promise}

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

(async) setReady(error) → {Promise}

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