refactor: Remove uses of AnyDuringMigration from scrollbar.ts, workspace_svg.ts, contextmenu_registry.ts, and component_manager.ts (#6318)

* refactor: Remove uses of AnyDuringMigration from scrollbar.ts.

* refactor: Remove almost all uses of AnyDuringMigration from workspace_svg.ts.

* refactor: Remove uses of AnyDuringMigration from contextmenu_registry.ts.

* refactor: Remove uses of AnyDuringMigration from component_manager.ts.

* refactor: Use String() rather than toString().

* fix: Fix lint and build errors.
This commit is contained in:
Aaron Dodson
2022-08-22 11:04:11 -07:00
committed by GitHub
parent eca2b1bc4a
commit 9454b7070c
11 changed files with 162 additions and 341 deletions

View File

@@ -72,7 +72,8 @@ let canvasContext: CanvasRenderingContext2D = null as AnyDuringMigration;
* @alias Blockly.utils.dom.createSvgElement
*/
export function createSvgElement<T extends SVGElement>(
name: string|Svg<T>, attrs: AnyDuringMigration, opt_parent?: Element): T {
name: string|Svg<T>, attrs: AnyDuringMigration,
opt_parent?: Element|null): T {
const e = document.createElementNS(SVG_NS, String(name)) as T;
for (const key in attrs) {
e.setAttribute(key, attrs[key]);