(blocks: {[key: string]: BlockDefinition})
| 330 | * type names to block definitions. |
| 331 | */ |
| 332 | export 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 |
no outgoing calls
no test coverage detected