1010
1111import * as Blockly from 'blockly/core' ;
1212
13+ /**
14+ * The ConstantProvider holds rendering-related constants such as colour
15+ * and size information.
16+ */
1317class CustomConstantProvider extends Blockly . blockRendering . ConstantProvider {
18+ /** @override */
1419 constructor ( ) {
1520 // Set up all of the constants from the base provider.
1621 super ( ) ;
@@ -81,7 +86,7 @@ class CustomConstantProvider extends Blockly.blockRendering.ConstantProvider {
8186 }
8287
8388 /**
84- * @returns Rectangular notch for use with previous and next connections.
89+ * @returns { Object } Rectangular notch for use with previous and next connections.
8590 */
8691 makeRectangularPreviousConn ( ) {
8792 const width = this . NOTCH_WIDTH ;
@@ -90,8 +95,8 @@ class CustomConstantProvider extends Blockly.blockRendering.ConstantProvider {
9095 /**
9196 * Since previous and next connections share the same shape you can define
9297 * a function to generate the path for both.
93- * @param dir Multiplier for the horizontal direction of the path (-1 or 1)
94- * @returns SVGPath line for use with previous and next connections.
98+ * @param { number } dir Multiplier for the horizontal direction of the path (-1 or 1)
99+ * @returns { Object } SVGPath line for use with previous and next connections.
95100 */
96101 function makeMainPath ( dir ) {
97102 return Blockly . utils . svgPaths . line ( [
@@ -112,7 +117,7 @@ class CustomConstantProvider extends Blockly.blockRendering.ConstantProvider {
112117 }
113118
114119 /**
115- * @returns Rectangular puzzle tab for use with input and output connections.
120+ * @returns { Object } Rectangular puzzle tab for use with input and output connections.
116121 */
117122 makeRectangularInputConn ( ) {
118123 const width = this . TAB_WIDTH ;
@@ -121,8 +126,8 @@ class CustomConstantProvider extends Blockly.blockRendering.ConstantProvider {
121126 /**
122127 * Since input and output connections share the same shape you can define
123128 * a function to generate the path for both.
124- * @param dir Multiplier for the vertical direction of the path (-1 or 1)
125- * @returns SVGPath line for use with input and output connections.
129+ * @param { number } dir Multiplier for the vertical direction of the path (-1 or 1)
130+ * @returns { Object } SVGPath line for use with input and output connections.
126131 */
127132 function makeMainPath ( dir ) {
128133 return Blockly . utils . svgPaths . line ( [
@@ -143,7 +148,9 @@ class CustomConstantProvider extends Blockly.blockRendering.ConstantProvider {
143148 }
144149}
145150
151+ /** The CustomRenderer class incorporates our custom ConstantProvider. */
146152export class CustomRenderer extends Blockly . blockRendering . Renderer {
153+ /** @override */
147154 constructor ( ) {
148155 super ( ) ;
149156 }
0 commit comments