blockly > registry > getClassFromOptions

registry.getClassFromOptions() function

Gets the class from Blockly options for the given type. This is used for plugins that override a built in feature. (e.g. Toolbox)

Signature:

export declare function getClassFromOptions<T>(type: Type<T>, options: Options, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;

Parameters

Parameter Type Description
type Type<T> The type of the plugin.
options Options The option object to check for the given plugin.
opt_throwIfMissing boolean (Optional) Whether or not to throw an error if we are unable to find the plugin.

Returns:

(new (...p1: any[]) => T) | null

The class for the plugin.