# Module: chiefTheme

Contains all of the functions for high level management of the theme system, such as theme data loading, setup, parsing, processing and data integration from the framework, application and plugins.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - controllers/chiefTheme.js, line 1

### Requires

- module:dataBroker
- module:themeBroker
- module:configurator
- module:loggers
- @haystacks/constants
- path

### Methods

#### (inner) addThemeData(themeData, contextName) → {boolean}

Adds theme data, theme names and theme paths for resource paths external to the framework. Ex: Application, Plugins

##### Parameters:

Name | Type | Description
--- | --- | ---
`themeData` | object | A JSON object that contains the externally defined theme data names and data paths.
`contextName` | string | A context name that indicates where the data is coming from. Ex: Application, Plugins

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefTheme.js, line 45

##### Returns:

True or False to indicate if the merge was successful or not.

Type
  boolean

#### (inner) determineThemeDebugConfigFilesToLoad(themeConfigPathName) → {array.<string>}

If the debugSettings flag is already set, then look up the specified path name and scan the path to determine all of the theme debug config files that should be loaded.

##### Parameters:

Name | Type | Description
--- | --- | ---
`themeConfigPathName` | string | The configuration name of the path that should be looked up for scanningg purposes.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefTheme.js, line 91

##### Returns:

An array of file names and paths that should be used when loading the theme debug configuration files.

Type
  array.<string>

#### (inner) generateThemeDataFromThemeRootPath(themesRootPath) → {object}

Scans the specified root path for folders and determines a list of theme names and theme paths, returns this data as a JSON data object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`themesRootPath` | string | The root path where the themes folders are located. This is the path that should be scanned.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefTheme.js, line 70

##### Returns:

A JSON object that contains the theme names and theme paths from the specified root path.

Type
  object

#### (inner) initThemes() → {void}

Initializes the themes data on the D-data structure.

Author:
  - Seth Hollingsead
Source:
  - controllers/chiefTheme.js, line 31

##### Returns:

Type
  void