Home Reference Source Test
import {Registry} from '@mixer/cdk'
public class | source

Registry

The Registry is a simple class that maintains a list of available controls and scenes, and can return them given control kinds or scene IDs.

Method Summary

Public Methods
public

Returns the Control descriptor for a control of the given kind, or thows if it's not found.

public

Returns inputs defined on the given control instance.

public

Returns the Scene descriptor for the given scene ID, returning the default scene if a specific handler wasn't found. Throws if no default scene is present and the specific ID is not registered.

public

register(things: ...*): Registry

Adds a collection of controls and scenes to the registry.

Public Methods

public getControl(kind: string): IControlDescriptor source

Returns the Control descriptor for a control of the given kind, or thows if it's not found.

Params:

NameTypeAttributeDescription
kind string

Throw:

Error

if the control kind is not found

public getInputs(control: object): IInputDescriptor[] source

Returns inputs defined on the given control instance.

Params:

NameTypeAttributeDescription
control object

Return:

IInputDescriptor[]

Throw:

Error

if the passed object is not decorated with @Scene or @Control.

public getScene(id: string): ISceneDescriptor source

Returns the Scene descriptor for the given scene ID, returning the default scene if a specific handler wasn't found. Throws if no default scene is present and the specific ID is not registered.

Params:

NameTypeAttributeDescription
id string

Throw:

Error

if an appropriate scene implementation is not found

public register(things: ...*): Registry source

Adds a collection of controls and scenes to the registry. This will throw if anything given is not a scene or control.

Params:

NameTypeAttributeDescription
things ...*

Return:

Registry