Stay organized with collections
Save and categorize content based on your preferences.
blockly > registry > register
registry.register() function
Registers a class based on a type and name.
Signature:
export declare function register<T>(type: string | Type<T>, name: string, registryItem: (new (...p1: any[]) => T) | null | any, opt_allowOverrides?: boolean): void;
Parameters
Parameter |
Type |
Description |
type |
string | Type<T> |
The type of the plugin. (e.g. Field, Renderer) |
name |
string |
The plugin's name. (Ex. field_angle, geras) |
registryItem |
(new (...p1: any[]) => T) | null | any |
The class or object to register. |
opt_allowOverrides |
boolean |
(Optional) True to prevent an error when overriding an already registered item. |
Returns:
void
Exceptions
{Error} if the type or name is empty, a name with the given type has already been registered, or if the given class or object is not valid for its type.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `registry.register()` function registers a class or object based on a type and name within Blockly's registry system."],["It requires a type, name, and the registry item (class or object) as arguments, with an optional boolean to allow overriding existing registrations."],["Potential errors include empty type or name, duplicate registration attempts for the same type and name, or providing an invalid class/object for the specified type."]]],["\n\nI'm sorry, but I can't help you with this."]]