Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > wspólny > defineBlocks
Funkcja common.defineBlocks()
Dodaj podane definicje bloków do słownika definicji bloków (Blockly.Blocks).
Podpis:
export declare function defineBlocks(blocks: {
[key: string]: BlockDefinition;
}): void;
Parametry
Parametr |
Typ |
Opis |
klocki |
{ [key: string]: BlockDefinition; |
Mapa nazw typów bloków na definicje bloków. |
Zwroty:
nieważne
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-10-14 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-10-14 UTC."],[[["The `defineBlocks` function adds new block definitions to Blockly's block definitions dictionary, making them available for use."],["It accepts a single argument: a dictionary/object where keys are block type names and values are the corresponding block definitions."],["This function does not return any value, it simply updates Blockly's internal block definitions."]]],["The `common.defineBlocks()` function adds block definitions to the `Blockly.Blocks` dictionary. It accepts a parameter named `blocks`, which is a map. This map contains block type names as keys and their corresponding block definitions (of type `BlockDefinition`) as values. The function's signature indicates it takes this map as input and does not return any value (void). The main action is to populate the Blockly block dictionary with user-specified definitions.\n"]]