Class: Library

BIM. Library


new Library()

Provides an application-wide library of component configurations.

Classes

configurations

Methods


_getClassName(componentClass) <static>

Retrieves the class name for the class, instance or name.

Parameters:
Name Type Description
componentClass PD.Base | string

A registered class, class instance or class name.

Returns:

Returns the name pf the class.

Type
string

addConfiguration(componentClass, config) <static>

Adds a new configuration for the given component class.

Configurations are simple objects that can be sent to a component's fromJSON() method in order to change its parameters. Configuration objects can be instances of the given component class, but they are more typically simple objects parsed from JSON data.

Parameters:
Name Type Description
componentClass string

The name of a registered component class.

config object | Array.<object>

A simple object containing component properties, or an array of.

Returns:

Returns true if the configuration object was added to the list.

Type
boolean

getConfigurations(componentClass) <static>

Retrieves a list of configurations for the given component class.

Configurations are simple objects that can be sent to a component's fromJSON() method in order to change its parameters. Configuration objects can be instances of the given component class, but they are more typically simple objects parsed from JSON data.

Parameters:
Name Type Description
componentClass string

The name of a registered component class.

Returns:

Returns an array of matching configurations.

Type
Array.<object>