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: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[],["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"]]