MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / defineBlocks

Function defineBlocks

packages/blockly/core/common.ts:332–343  ·  view source on GitHub ↗
(blocks: {[key: string]: BlockDefinition})

Source from the content-addressed store, hash-verified

330 * type names to block definitions.
331 */
332export function defineBlocks(blocks: {[key: string]: BlockDefinition}) {
333 // Iterate over own enumerable properties.
334 for (const type of Object.keys(blocks)) {
335 const definition = blocks[type];
336 if (type in Blocks) {
337 console.warn(
338 `Block definition "${type}" overwrites previous definition.`,
339 );
340 }
341 Blocks[type] = definition;
342 }
343}
344
345/**
346 * Handle a key-down on SVG drawing surface. Does nothing if the main workspace

Callers 9

text.tsFile · 0.85
variables.tsFile · 0.85
lists.tsFile · 0.85
math.tsFile · 0.85
loops.tsFile · 0.85
procedures.tsFile · 0.85
logic.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected