연구 설문조사: Blockly 사용 경험을 알려주세요
설문조사 시작
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
차단 > 일반 > createBlockDefinitionsFromJsonArray
common.createBlockDefinitionFromJsonArray() 함수
Blockly 개발자 도구에서 생성될 수 있는 JSON 블록 정의 배열에서 블록을 정의합니다.
서명:
export declare function createBlockDefinitionsFromJsonArray(jsonArray: any[]): {
[key: string]: BlockDefinition;
};
매개변수
매개변수 |
유형 |
설명 |
jsonArray |
모두[] |
JSON 블록 정의의 배열입니다. |
반환:
{ [key: string]: BlockDefinition; }
생성된 블록 정의의 맵입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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."]]