Methods
_doLog(message, type, data, forceToWindow){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error, group, groupCollaped, groupend) |
data |
array
|
An array of data strings that are to be applied to logging message |
forceToWindow |
Boolean
|
Flag to force logging to main window console |
Logs data to console
_getStack(){array}
Helper method for getting call stack array for debug or user message objects
addBoundMethods(){undefined}
Method that sets up this.boundMethods property by binding this objects
functions to itself to be used as event listener handlers
addEventListeners(){undefined}
Adds event listeners for this object
clearIntervals(){undefined}
Clears all intervals bound to this AppWrapper instance
clearTimeouts(){undefined}
Clears all timeouts bound to this AppWrapper instance
consoleLog(message){undefined}
Parameters
Name |
Type |
Description |
message |
mixed
|
Message to log |
Logs message to console
createDirFileRecursive(fileName, mode, options, data){Boolean}
Parameters
Name |
Type |
Description |
fileName |
string
|
Absolute path to file |
mode |
Number
|
Octal mode definition (i.e. 0o775) |
options |
Object
|
Options object for fs.writeFileSync |
data |
string
|
Data to write to file |
Creates directory (recursive) and writes file to it
createDirRecursive(directory, mode){Boolean}
Parameters
Name |
Type |
Description |
directory |
string
|
Absolute directory path |
mode |
Number
|
Octal mode definition (i.e. 0o775) |
Creates directory recursively
destroy(){undefined}
Destructor method - cleans up references for this instance
freeing memory upon object destruction
finalize(){Boolean}
Finalizes current class instance, setting up any additional properties
etc. Entire app structure, including frontend app is available here
formatTimeNormalize(date, options, includeDate, omitSeconds){string}
Parameters
Name |
Type |
Description |
date |
Date
|
Date value to format |
options |
Object
|
Date format options |
includeDate |
Boolean
|
Flag to indicate whether to include date |
omitSeconds |
Boolean
|
Flag to indicate whether to omit seconds |
Format time normalized (Y-m-d H:i:s format)
getAppState(){appWrapper.AppState}
Gets appState if available
getAppWrapper(){AppWrapper}
Gets appWrapper if available
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 |
Returns configuration var value
getDebugMessageFilePath(){string}
Returns path to debug message log file
getHelper(name){Object}
Parameters
Name |
Type |
Description |
name |
string
|
Name of the helper |
Returns instance of helper object based on passed parameter (or false if helper can't be found)
Returns main script object
getMainWindow(){Window|Boolean}
Gets reference to main window if available
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 |
Returns appState var value
initialize(options){BaseClass}
Initializes current class instance, setting up logging and
bound methods to be used in event listeners
initializeLogging(){BaseClass}
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)
isFile(file){Boolean}
Parameters
Name |
Type |
Description |
file |
string
|
Absolute file path |
Checks whether given path is a file
log(message, type, data, force, forceToWindow){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error, group, groupCollaped, groupend) |
data |
array
|
An array of data strings that are to be applied to logging message |
force |
Boolean
|
Flag to force logging output even if config does not allow it |
forceToWindow |
Boolean
|
Flag to force logging to main window console |
Logs message to console or stdout
print(message){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to print |
Prints message to stdout
printLn(message){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to print |
Prints message to stdout with newline appended
printLog(message, type){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to print |
type |
string
|
Type of message |
Prints message to stdout with newline appended
removeBoundMethods(){undefined}
Method that cleans up this.boundMethods property
set in this.addBoundMethods method
removeEventListeners(){undefined}
Removes event listeners for this object
windowLog(){undefined}
Logs to window console