Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > wspólny > createBlockDefinitionsFromJsonArray
Funkcja common.createBlockDefinitionsFromJsonArray()
Definiowanie bloków na podstawie tablicy definicji bloków JSON na podstawie narzędzi dla programistów Blockly dla programistów.
Podpis:
export declare function createBlockDefinitionsFromJsonArray(jsonArray: any[]): {
[key: string]: BlockDefinition;
};
Parametry
Parametr |
Typ |
Opis |
jsonArray |
dowolne[] |
Tablica definicji bloków JSON. |
Zwroty:
{ [key: string]: BlockDefinition;
Mapa utworzonych definicji bloków.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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"]]