Bản khảo sát nghiên cứu: Cho chúng tôi biết trải nghiệm của bạn khi sử dụng Blockly
Bắt đầu khảo sát
chặn > phổ biến > createBlockDefinitionsFromJsonArray
Hàm Common.createBlockdefinedFromJsonArray()
Xác định các khối trong một mảng định nghĩa khối JSON do Công cụ dành cho nhà phát triển Blockly tạo ra.
Chữ ký:
export declare function createBlockDefinitionsFromJsonArray(jsonArray: any[]): {
[key: string]: BlockDefinition;
};
Tham số
Thông số |
Loại |
Mô tả |
jsonArray |
bất kỳ[] |
Một mảng định nghĩa khối JSON. |
Trường hợp trả lại hàng:
{ [key: string]: BlockDefinition; }
Đã tạo bản đồ các định nghĩa khối.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-27 UTC."],[[["Defines new block types in Blockly based on an array of JSON definitions, commonly generated by the Blockly Developer Tools."],["Takes an array of JSON objects representing block configurations as input."],["Returns a dictionary/map where block type names are keys and corresponding block definitions are values, allowing access and usage of the newly defined blocks."]]],["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"]]