A Blockly plugin that allows you to create more advanced connection checks.
This project is targeted at helping Blockly model languages with complex nominal typing systems, like C++, Java, or Rust. It can also be used for modeling subsets of structurally typed languages like TypeScript, Golang, or Haskell. Or it can be used to create a type-safe blocks languages that generates a dynamically typed language like JavaScript.
It includes support for modeling subtyping, generic functions/blocks, and parameterized types.
yarn add blockly-plugin-nominal
npm install blockly-plugin-nominal --save
import * as Blockly from 'blockly';
import {pluginInfo as NominalConnectionCheckerPluginInfo} from '@blockly/plugin-nominal-connection-checker';
// Inject Blockly.
const workspace = Blockly.inject('blocklyDiv', {
toolbox: toolboxCategories,
plugins: {
...NominalConnectionCheckerPluginInfo,
},
});
// Initialize plugin.
workspace.connectionChecker.init(hierarchyDef);
Apache 2.0