Home Reference Source
public class | source

BrandingEngine

Constructor Summary

Public Constructor
public

constructor(dataSource: undefined)

Member Summary

Public Members
public get

options: *

public set

options: *

Method Summary

Public Methods
public

get(optionName: String): *

Get a branding option value by its name.

public

getAll(): *

Gets all branding options for the current brand.

public

setOption(optionName: String, value: *): void

Set one branding option manually.

public

setOptions(options: Object): void

Set the branding options manually.

public

Sets the branding options using the local cache and an external dataSource.

Public Constructors

public constructor(dataSource: undefined) source

Params:

NameTypeAttributeDescription
dataSource undefined
  • optional
  • default: undefined

Public Members

public get options: * source

public set options: * source

Public Methods

public get(optionName: String): * source

Get a branding option value by its name.

Params:

NameTypeAttributeDescription
optionName String

Name of the option to fetch.

Return:

*

Option

public getAll(): * source

Gets all branding options for the current brand.

Return:

*

All options

public setOption(optionName: String, value: *): void source

Set one branding option manually.

Params:

NameTypeAttributeDescription
optionName String

Name of the option to fetch.

value *

Value to set the option to.

Return:

void

public setOptions(options: Object): void source

Set the branding options manually.

Params:

NameTypeAttributeDescription
options Object

Dictionary object with wanted branding options. Example: {textColor: 'black', backgroundColor: 'white'}

Return:

void

public setOptionsFromDataSource(): Promise source

Sets the branding options using the local cache and an external dataSource. If a cached version is present, it is used to populate the options, and the function is resolved immediately. Otherwise, the options are populated from the external dataSource. In both cases, the latest options are fetched from the dataSource and saved to cache for use on the next app launch.

Return:

Promise

A promise that is resolved when the branding options have been fetched from cache or remote storage.