nw-skeleton

Class: BaseClass

appWrapper. BaseClass

Base class for extending when creating other classes

BaseClass()

Creates class instance, setting basic properties, and returning the instance itself

Properties

Name Type Description
manifest Object Object containing manifest (package.json) file data
config Object Object containing configuration data
forceUserMessages Boolean Flag to force user message output
forceDebug Boolean Flag to force debug message output
boundMethods Object Object to hold bound method references for event listeners
timeouts Object Object that holds references to this class instance timeouts
intervals Object Object that holds references to this class instance intervals
needsConfig Boolean Flag to indicate whether class instance needs config, triggering warnings if config is not available for the class

Methods

addBoundMethods(){undefined}

Return

Method that sets up this.boundMethods property by binding this objects functions to itself to be used as event listener handlers

finalize(){Boolean}

Return

Finalizes current class instance, setting up any additional properties etc. Entire app structure, including frontend app is available here

getConfig(name, defaultValue){mixed}

Parameters

Name Type Description
name string String representing path to requested var (i.e. 'appConfig.appInfo.name')
defaultValue mixed Default value to be returned if configuration var is not found

Return

Returns configuration var value

getHelper(name){Object}

Parameters

Name Type Description
name string Name of the helper

Return

Returns instance of helper object based on passed parameter (or false if helper can't be found)

getStateVar(varPath, defaultValue){mixed}

Parameters

Name Type Description
varPath string String representing path to requested var (i.e. 'appData.appMainData.cancelable')
defaultValue mixed Default value to be returned if appState var is not found

Return

Returns appState var value

initializeLogging(){BaseClass}

Return

Determines whether logging for this class is regulated through configuration, setting the logging by it (or warning if there are no configuration settings for this class)