調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >共通 >createBlockDefinitionsFromJsonArray
common.createBlockDefinitionsFromJsonArray() 関数
JSON ブロック定義の配列からブロックを定義します。Blockly デベロッパー ツールで生成できます。
署名:
export declare function createBlockDefinitionsFromJsonArray(jsonArray: any[]): {
[key: string]: BlockDefinition;
};
パラメータ
パラメータ |
型 |
説明 |
jsonArray |
任意 |
JSON ブロック定義の配列。 |
戻り値:
{ [key: string]: BlockDefinition;}
作成されたブロック定義のマップ。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-28 UTC。
[null,null,["最終更新日 2025-07-28 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."]]