Use generics to derive SVG element type (#4036)

* Encapsulate type in a generic to automatically derive type of SVG element when using createSvgElement
This commit is contained in:
Sam El-Husseini
2020-07-13 10:40:31 -07:00
committed by GitHub
parent e4bbd451a3
commit 0f3db47fa5
39 changed files with 564 additions and 278 deletions

View File

@@ -58,8 +58,8 @@ Blockly.BlockSvg = function(workspace, prototypeName, opt_id) {
* @type {!SVGGElement}
* @private
*/
this.svgGroup_ = /** @type {!SVGGElement} */ (
Blockly.utils.dom.createSvgElement('g', {}, null));
this.svgGroup_ = Blockly.utils.dom.createSvgElement(
Blockly.utils.dom.SvgElementType.G, {}, null);
this.svgGroup_.translate_ = '';
/**