Stay organized with collections
Save and categorize content based on your preferences.
blockly > fieldRegistry > RegistrableField
fieldRegistry.RegistrableField interface
Represents the static methods that must be defined on any field that is registered, i.e. the constructor and fromJson methods.
Because we don't know which Field subclass will be registered, we are unable to typecheck the parameters of the constructor.
Signature:
export interface RegistrableField
Methods
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 `RegistrableField` interface outlines the necessary static methods for registering a field in Blockly, specifically the constructor and `fromJson` methods."],["Due to the dynamic nature of field registration, type checking the constructor's parameters is not feasible, as the specific Field subclass being registered is unknown."],["This interface ensures that all registered fields adhere to a standardized structure, enabling consistent field creation and JSON deserialization within Blockly."]]],["The `RegistrableField` interface defines the required static methods for any registered field in the Blockly `fieldRegistry`. It mandates the presence of a constructor (`new`) and a `fromJson` method. Due to the dynamic nature of field registration, the constructor's parameter types cannot be checked. These methods are essential for creating new field instances and loading fields from JSON configurations, respectively. This interface ensures all fields can be registered and utilized.\n"]]