Home Manual Reference Source Test Repository
public class | source

Plugins

Provides a wrapper around PluginManager for ESComplexModule. Several convenience methods for the plugin callbacks properly manage and or create initial data that are processed by the plugins.

The default plugins loaded include:

See:

Constructor Summary

Public Constructor
public

constructor(options: object)

Initializes Plugins.

Member Summary

Private Members
private

_pluginManager: PluginManager

Provides a generic plugin manager for dispatching events to module plugins.

Method Summary

Public Methods
public

Initializes the default settings object hash and then invokes the onConfigure plugin callback for all loaded plugins.

public

onEnterNode(report: ModuleReport, node: object, parent: object): Array<string> | null

Invokes the onEnterNode plugin callback during AST traversal when a node is entered.

public

onExitNode(report: ModuleReport, node: object, parent: object)

Invokes the onExitNode plugin callback during AST traversal when a node is exited.

public

onLoadSyntax(settings: object): object

Initializes the trait syntaxes object hash and then invokes the onLoadSyntax plugin callback for all loaded plugins.

public

onModuleEnd(report: ModuleReport): ModuleReport

Invokes the onModuleEnd plugin callback for all loaded plugins such they might finish calculating results.

public

onModuleStart(ast: object, syntaxes: object, settings: object): ModuleReport

Initializes the default report object hash and then invokes the onModuleStart plugin callback for all loaded plugins.

Public Constructors

public constructor(options: object) source

Initializes Plugins.

Params:

NameTypeAttributeDescription
options object

module options including user plugins to load including:

(boolean)         loadDefaultPlugins - When false ESComplexModule will not load any default plugins.
(Array<Object>)   plugins - A list of ESComplexModule plugins that have already been instantiated.

Private Members

private _pluginManager: PluginManager source

Provides a generic plugin manager for dispatching events to module plugins.

Public Methods

public onConfigure(options: object): object source

Initializes the default settings object hash and then invokes the onConfigure plugin callback for all loaded plugins.

Params:

NameTypeAttributeDescription
options object

(Optional) module processing options.

Return:

object

public onEnterNode(report: ModuleReport, node: object, parent: object): Array<string> | null source

Invokes the onEnterNode plugin callback during AST traversal when a node is entered.

Params:

NameTypeAttributeDescription
report ModuleReport

The ModuleReport being processed.

node object

The node being entered.

parent object

The parent node of the node being entered.

Return:

Array<string> | null

A directive indicating children keys to be skipped or if null all keys entirely.

public onExitNode(report: ModuleReport, node: object, parent: object) source

Invokes the onExitNode plugin callback during AST traversal when a node is exited.

Params:

NameTypeAttributeDescription
report ModuleReport

The ModuleReport being processed.

node object

The node being entered.

parent object

The parent node of the node being entered.

public onLoadSyntax(settings: object): object source

Initializes the trait syntaxes object hash and then invokes the onLoadSyntax plugin callback for all loaded plugins.

Params:

NameTypeAttributeDescription
settings object

Settings for module processing.

Return:

object

Loaded trait syntaxes for AST nodes.

public onModuleEnd(report: ModuleReport): ModuleReport source

Invokes the onModuleEnd plugin callback for all loaded plugins such they might finish calculating results.

Params:

NameTypeAttributeDescription
report ModuleReport

The ModuleReport being processed.

Return:

ModuleReport

The ModuleReport being processed.

public onModuleStart(ast: object, syntaxes: object, settings: object): ModuleReport source

Initializes the default report object hash and then invokes the onModuleStart plugin callback for all loaded plugins.

Params:

NameTypeAttributeDescription
ast object

Settings for module processing.

syntaxes object

All loaded trait syntaxes for AST nodes.

settings object

Settings for module processing.

Return:

ModuleReport

The ModuleReport being processed.