Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
блочный > общий > createBlockDefinitionsFromJsonArray
Функция common.createBlockDefinitionsFromJsonArray()
Определите блоки из массива определений блоков JSON, который может быть создан с помощью инструментов разработчика Blockly.
Подпись:
export declare function createBlockDefinitionsFromJsonArray(jsonArray: any[]): {
[key: string]: BlockDefinition;
};
Параметры
Параметр | Тип | Описание |
---|
jsonArray | любой[] | Массив определений блоков JSON. |
Возврат:
{[ключ: строка]: BlockDefinition; }
Создана карта определений блоков.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[null,null,["Последнее обновление: 2025-07-29 UTC."],[[["\u003cp\u003eDefines new block types in Blockly based on an array of JSON definitions, commonly generated by the Blockly Developer Tools.\u003c/p\u003e\n"],["\u003cp\u003eTakes an array of JSON objects representing block configurations as input.\u003c/p\u003e\n"],["\u003cp\u003eReturns a dictionary/map where block type names are keys and corresponding block definitions are values, allowing access and usage of the newly defined blocks.\u003c/p\u003e\n"]]],["The `createBlockDefinitionsFromJsonArray` function defines blocks from an array of JSON block definitions. It accepts a `jsonArray` parameter, which is an array of these definitions. The function then returns a map where each key corresponds to a block definition and its value is the associated `BlockDefinition`. This effectively translates a JSON array into a set of usable block definitions.\n"],null,["[blockly](./blockly.md) \\\u003e [common](./blockly.common_namespace.md) \\\u003e [createBlockDefinitionsFromJsonArray](./blockly.common_namespace.createblockdefinitionsfromjsonarray_1_function.md)\n\ncommon.createBlockDefinitionsFromJsonArray() function\n-----------------------------------------------------\n\nDefine blocks from an array of JSON block definitions, as might be generated by the Blockly Developer Tools.\n\n**Signature:** \n\n export declare function createBlockDefinitionsFromJsonArray(jsonArray: any[]): {\n [key: string]: BlockDefinition;\n };\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|---------|-------------------------------------|\n| jsonArray | any\\[\\] | An array of JSON block definitions. |\n\n**Returns:**\n\n{ \\[key: string\\]: BlockDefinition; }\n\nA map of the block definitions created."]]