CardKit

CardKit

Core CardKit class used for managing a single card instance

Constructor

new CardKit()

Source:

Methods

_configureOptions(options)

Configures the supplied options on this instance of CardKit
Parameters:
Name Type Description
options object The options to configure
Source:

_isValidConfiguration(configuration) → {boolean}

Validates the provided configuration object
Parameters:
Name Type Description
configuration object The configuration object to validate
Source:
Returns:
Is the configuration object valid
Type
boolean

_isValidLayoutsConfiguration(configuration) → {boolean}

Validates the provided layouts configuration object
Parameters:
Name Type Description
configuration object The layouts configuration object to validate
Source:
Returns:
Is the layouts configuration object valid
Type
boolean

_isValidRenderer(renderer) → {boolean}

Validates the supplied renderer
Parameters:
Name Type Description
renderer object The renderer to validate
Source:
Returns:
If the renderer is valid
Type
boolean

_isValidTemplatesConfiguration(configuration) → {boolean}

Validates the provided templates configuration object
Parameters:
Name Type Description
configuration object The templates configuration object to validate
Source:
Returns:
Is the templates configuration object valid
Type
boolean

_isValidThemesConfiguration(configuration) → {boolean}

Validates the provided themes configuration object
Parameters:
Name Type Description
configuration object The themes configuration object to validate
Source:
Returns:
Is the themes configuration object valid
Type
boolean

addRenderer(renderer)

Add a renderer
Parameters:
Name Type Description
renderer object A renderer to add
Source:

computeConfiguration(options) → {object}

Compute the configuration
Parameters:
Name Type Default Description
options object null Any options (e.g. a specific theme and / or layout) to use when computing the configuration
Source:
Returns:
The computed configuration
Type
object

getRenderers() → {array}

Get the renderers
Source:
Returns:
The configured renderers
Type
array

updateConfiguration(configuration, options, rerender)

Updates the configuration, and optionally rerenders the image (if previously rendered)
Parameters:
Name Type Default Description
configuration object The configuration object to update to
options object Any options to supply (templates, themes, layouts)
rerender boolean true Whether or not to attempt to rerender the image
Source:

CardKit

new CardKit(configuration, options)

Constructor takes in the configuration and stores it for later user
Parameters:
Name Type Default Description
configuration object The configuration object to initialise the CardKit image with.
options object false The additional options for use
Source:

Methods

_configureOptions(options)

Configures the supplied options on this instance of CardKit
Parameters:
Name Type Description
options object The options to configure
Source:

_isValidConfiguration(configuration) → {boolean}

Validates the provided configuration object
Parameters:
Name Type Description
configuration object The configuration object to validate
Source:
Returns:
Is the configuration object valid
Type
boolean

_isValidLayoutsConfiguration(configuration) → {boolean}

Validates the provided layouts configuration object
Parameters:
Name Type Description
configuration object The layouts configuration object to validate
Source:
Returns:
Is the layouts configuration object valid
Type
boolean

_isValidRenderer(renderer) → {boolean}

Validates the supplied renderer
Parameters:
Name Type Description
renderer object The renderer to validate
Source:
Returns:
If the renderer is valid
Type
boolean

_isValidTemplatesConfiguration(configuration) → {boolean}

Validates the provided templates configuration object
Parameters:
Name Type Description
configuration object The templates configuration object to validate
Source:
Returns:
Is the templates configuration object valid
Type
boolean

_isValidThemesConfiguration(configuration) → {boolean}

Validates the provided themes configuration object
Parameters:
Name Type Description
configuration object The themes configuration object to validate
Source:
Returns:
Is the themes configuration object valid
Type
boolean

addRenderer(renderer)

Add a renderer
Parameters:
Name Type Description
renderer object A renderer to add
Source:

computeConfiguration(options) → {object}

Compute the configuration
Parameters:
Name Type Default Description
options object null Any options (e.g. a specific theme and / or layout) to use when computing the configuration
Source:
Returns:
The computed configuration
Type
object

getRenderers() → {array}

Get the renderers
Source:
Returns:
The configured renderers
Type
array

updateConfiguration(configuration, options, rerender)

Updates the configuration, and optionally rerenders the image (if previously rendered)
Parameters:
Name Type Default Description
configuration object The configuration object to update to
options object Any options to supply (templates, themes, layouts)
rerender boolean true Whether or not to attempt to rerender the image
Source: