Function: register()
function register(type, fieldClass): void;
Defined in: packages/blockly/core/field_registry.ts:62
Registers a field type. fieldRegistry.fromJson uses this registry to find the appropriate field type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | The field type name as used in the JSON definition. |
fieldClass | RegistrableField | The field class containing a fromJson function that can construct an instance of the field. |
Returns
void
Throws
if the type name is empty or the fieldClass is not an object containing a fromJson function.