blockly > common > defineBlocksWithJsonArray
common.defineBlocksWithJsonArray() function
Define blocks from an array of JSON block definitions, as might be generated by the Blockly Developer Tools.
Signature:
export declare function defineBlocksWithJsonArray(jsonArray: any[]): void;
Parameters
Parameter |
Type |
Description |
jsonArray |
any[] |
An array of JSON block definitions. |
Returns:
void
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.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `defineBlocksWithJsonArray` function dynamically creates Blockly blocks based on JSON definitions provided in an array."],["This function is particularly useful when utilizing block definitions exported from the Blockly Developer Tools, streamlining the block creation process."],["The function accepts a single argument: an array containing JSON objects, each representing the structure and properties of a Blockly block."],["Upon execution, the function generates and registers the specified blocks within the Blockly environment, making them available for use in your workspace without returning any specific value."]]],["The `defineBlocksWithJsonArray` function accepts an array of JSON block definitions (`jsonArray`) as input. It then uses these definitions to create blocks within the Blockly environment. The function is designed to handle definitions that might be generated by the Blockly Developer Tools. The function does not return any value and only take the array of JSON.\n"]]