/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * @fileoverview Defines the Svg class. Its constants enumerate * all SVG tag names used by Blockly. */ 'use strict'; /** * Defines the Svg class. Its constants enumerate * all SVG tag names used by Blockly. * @class */ goog.module('Blockly.utils.Svg'); /** * A name with the type of the SVG element stored in the generic. * @template T * @alias Blockly.utils.Svg */ class Svg { /** * @param {string} tagName The SVG element tag name. * @package */ constructor(tagName) { /** * @type {string} * @private */ this.tagName_ = tagName; } /** * Returns the SVG element tag name. * @return {string} The name. */ toString() { return this.tagName_; } } /** * @type {!Svg} * @package */ Svg.ANIMATE = new Svg('animate'); /** * @type {!Svg} * @package */ Svg.CIRCLE = new Svg('circle'); /** * @type {!Svg} * @package */ Svg.CLIPPATH = new Svg('clipPath'); /** * @type {!Svg} * @package */ Svg.DEFS = new Svg('defs'); /** * @type {!Svg} * @package */ Svg.FECOMPOSITE = new Svg('feComposite'); /** * @type {!Svg} * @package */ Svg.FECOMPONENTTRANSFER = new Svg('feComponentTransfer'); /** * @type {!Svg} * @package */ Svg.FEFLOOD = new Svg('feFlood'); /** * @type {!Svg} * @package */ Svg.FEFUNCA = new Svg('feFuncA'); /** * @type {!Svg} * @package */ Svg.FEGAUSSIANBLUR = new Svg('feGaussianBlur'); /** * @type {!Svg} * @package */ Svg.FEPOINTLIGHT = new Svg('fePointLight'); /** * @type {!Svg} * @package */ Svg.FESPECULARLIGHTING = new Svg('feSpecularLighting'); /** * @type {!Svg} * @package */ Svg.FILTER = new Svg('filter'); /** * @type {!Svg} * @package */ Svg.FOREIGNOBJECT = new Svg('foreignObject'); /** * @type {!Svg} * @package */ Svg.G = new Svg('g'); /** * @type {!Svg} * @package */ Svg.IMAGE = new Svg('image'); /** * @type {!Svg} * @package */ Svg.LINE = new Svg('line'); /** * @type {!Svg} * @package */ Svg.PATH = new Svg('path'); /** * @type {!Svg} * @package */ Svg.PATTERN = new Svg('pattern'); /** * @type {!Svg} * @package */ Svg.POLYGON = new Svg('polygon'); /** * @type {!Svg} * @package */ Svg.RECT = new Svg('rect'); /** * @type {!Svg} * @package */ Svg.SVG = new Svg('svg'); /** * @type {!Svg} * @package */ Svg.TEXT = new Svg('text'); /** * @type {!Svg} * @package */ Svg.TSPAN = new Svg('tspan'); exports.Svg = Svg;