html-spec-tags
Advanced tools
Comparing version 1.0.4 to 2.0.0
import { HtmlSpecTagName } from './html'; | ||
import { MathmlSpecTagName } from './mathml'; | ||
import { SvgSpecTagName } from './svg'; | ||
/** All possible spec tag names in a single array. */ | ||
export declare const allSpecTagNames: ReadonlyArray<SpecTagName>; | ||
/** A string literal type that matches all valid spec tag names. */ | ||
export type SpecTagName = HtmlSpecTagName | SvgSpecTagName; | ||
/** Type guards the input as any valid spec tag name. */ | ||
/** Any valid spec tag name. */ | ||
export type SpecTagName = HtmlSpecTagName | SvgSpecTagName | MathmlSpecTagName; | ||
/** Type guards the input as a valid spec tag name. */ | ||
export declare function isSpecTagName(input: unknown): input is SpecTagName; | ||
/** Asserts that the input as a valid spec tag name. */ | ||
export declare function assertSpecTagName(input: unknown, failureMessage?: string | undefined): asserts input is SpecTagName; | ||
/** Passes the input through if it's a valid spec tag name, throws an error if not. */ | ||
export declare function ensureSpecTagName(input: unknown): SpecTagName; |
@@ -1,13 +0,34 @@ | ||
import { isRunTimeType } from 'run-time-assertions'; | ||
import { allHtmlSpecTagNames, isHtmlSpecTagName } from './html'; | ||
import { allSvgSpecTagNames, isSvgSpecTagName } from './svg'; | ||
import { isTruthy, typedArrayIncludes, wrapInTry } from '@augment-vir/common'; | ||
import { AssertionError, assertRunTimeType, isRunTimeType } from 'run-time-assertions'; | ||
import { allHtmlSpecTagNames } from './html'; | ||
import { allMathmlSpecTagNames } from './mathml'; | ||
import { allSvgSpecTagNames } from './svg'; | ||
/** All possible spec tag names in a single array. */ | ||
export const allSpecTagNames = [ | ||
export const allSpecTagNames = Array.from(new Set([ | ||
...allHtmlSpecTagNames, | ||
...allSvgSpecTagNames, | ||
]; | ||
/** Type guards the input as any valid spec tag name. */ | ||
...allMathmlSpecTagNames, | ||
].sort())); | ||
/** Type guards the input as a valid spec tag name. */ | ||
export function isSpecTagName(input) { | ||
return isHtmlSpecTagName(input) || isSvgSpecTagName(input); | ||
return wrapInTry({ | ||
callback() { | ||
assertSpecTagName(input); | ||
return true; | ||
}, | ||
fallbackValue: false, | ||
}); | ||
} | ||
/** Asserts that the input as a valid spec tag name. */ | ||
export function assertSpecTagName(input, failureMessage) { | ||
assertRunTimeType(input, 'string', failureMessage); | ||
if (!typedArrayIncludes(allSpecTagNames, input)) { | ||
throw new AssertionError([ | ||
`'${input}' is not tag name`, | ||
failureMessage, | ||
] | ||
.filter(isTruthy) | ||
.join(': ')); | ||
} | ||
} | ||
/** Passes the input through if it's a valid spec tag name, throws an error if not. */ | ||
@@ -19,7 +40,7 @@ export function ensureSpecTagName(input) { | ||
else if (!isRunTimeType(input, 'string')) { | ||
throw new Error(`'${JSON.stringify(input)}' is not a string, it cannot be a valid SpecTagName.`); | ||
throw new Error(`'${JSON.stringify(input)}' is not a string, it cannot be a valid tag name.`); | ||
} | ||
else { | ||
throw new Error(`'${input}' is not a valid SpecTagName.`); | ||
throw new Error(`'${input}' is not a valid tag name.`); | ||
} | ||
} |
/** A string literal type that only matches the HTML spec tag names. */ | ||
export type HtmlSpecTagName = keyof typeof htmlSpecConstructorsByTagName; | ||
/** A mapping of all HTML spec tag names to their respective element classes. */ | ||
/** | ||
* All current HTML spec tag names mapped to their respective element constructors. | ||
* | ||
* Generated from `HTMLElementTagNameMap` in `typescript/lib/lib.dom.d.ts`: | ||
* https://raw.githubusercontent.com/microsoft/TypeScript/main/src/lib/dom.generated.d.ts | ||
*/ | ||
export declare const htmlSpecConstructorsByTagName: { | ||
@@ -461,5 +466,1 @@ readonly a: { | ||
export declare const allHtmlSpecTagNames: ReadonlyArray<HtmlSpecTagName>; | ||
/** Type guards the input as a valid HTML spec tag name. */ | ||
export declare function isHtmlSpecTagName(input: unknown): input is HtmlSpecTagName; | ||
/** Passes the input through if it's a valid HTML spec tag name, throws an error if not. */ | ||
export declare function ensureHtmlSpecTagName(input: unknown): HtmlSpecTagName; |
@@ -1,3 +0,7 @@ | ||
import { isRunTimeType } from 'run-time-assertions'; | ||
/** A mapping of all HTML spec tag names to their respective element classes. */ | ||
/** | ||
* All current HTML spec tag names mapped to their respective element constructors. | ||
* | ||
* Generated from `HTMLElementTagNameMap` in `typescript/lib/lib.dom.d.ts`: | ||
* https://raw.githubusercontent.com/microsoft/TypeScript/main/src/lib/dom.generated.d.ts | ||
*/ | ||
export const htmlSpecConstructorsByTagName = { | ||
@@ -119,17 +123,1 @@ a: window.HTMLAnchorElement, | ||
export const allHtmlSpecTagNames = Object.keys(htmlSpecConstructorsByTagName); | ||
/** Type guards the input as a valid HTML spec tag name. */ | ||
export function isHtmlSpecTagName(input) { | ||
return isRunTimeType(input, 'string') && input in htmlSpecConstructorsByTagName; | ||
} | ||
/** Passes the input through if it's a valid HTML spec tag name, throws an error if not. */ | ||
export function ensureHtmlSpecTagName(input) { | ||
if (isHtmlSpecTagName(input)) { | ||
return input; | ||
} | ||
else if (!isRunTimeType(input, 'string')) { | ||
throw new Error(`'${JSON.stringify(input)}' is not a string, it cannot be a valid HtmlSpecTagName.`); | ||
} | ||
else { | ||
throw new Error(`'${input}' is not a valid HtmlSpecTagName.`); | ||
} | ||
} |
export * from './all-tags'; | ||
export * from './assertions'; | ||
export * from './html'; | ||
export * from './mathml'; | ||
export * from './svg'; |
export * from './all-tags'; | ||
export * from './assertions'; | ||
export * from './html'; | ||
export * from './mathml'; | ||
export * from './svg'; |
/** A string literal type that only matches the SVG spec tag names. */ | ||
export type SvgSpecTagName = (typeof allSvgSpecTagNames)[number]; | ||
/** All possible SVG spec 2 tag names within a single array. */ | ||
export declare const allSvgSpecTagNames: readonly ["a", "animate", "animateMotion", "animateTransform", "audio", "canvas", "circle", "clipPath", "defs", "desc", "discard", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "iframe", "image", "line", "linearGradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "script", "set", "stop", "style", "svg", "switch", "symbol", "text", "textPath", "title", "tspan", "unknown", "use", "video", "view"]; | ||
/** Type guards the input as a valid SVG spec tag name. */ | ||
export declare function isSvgSpecTagName(input: unknown): input is SvgSpecTagName; | ||
/** Passes the input through if it's a valid SVG spec tag name, throws an error if not. */ | ||
export declare function ensureSvgSpecTagName(input: unknown): SvgSpecTagName; | ||
export type SvgSpecTagName = keyof typeof svgSpecConstructorsByTagName; | ||
/** | ||
* All current SVG spec tag names mapped to their respective element constructors. | ||
* | ||
* Generated from `SVGElementTagNameMap` in `typescript/lib/lib.dom.d.ts`: | ||
* https://raw.githubusercontent.com/microsoft/TypeScript/main/src/lib/dom.generated.d.ts | ||
*/ | ||
export declare const svgSpecConstructorsByTagName: { | ||
readonly a: { | ||
new (): SVGAElement; | ||
prototype: SVGAElement; | ||
}; | ||
readonly animate: { | ||
new (): SVGAnimateElement; | ||
prototype: SVGAnimateElement; | ||
}; | ||
readonly animateMotion: { | ||
new (): SVGAnimateMotionElement; | ||
prototype: SVGAnimateMotionElement; | ||
}; | ||
readonly animateTransform: { | ||
new (): SVGAnimateTransformElement; | ||
prototype: SVGAnimateTransformElement; | ||
}; | ||
readonly circle: { | ||
new (): SVGCircleElement; | ||
prototype: SVGCircleElement; | ||
}; | ||
readonly clipPath: { | ||
new (): SVGClipPathElement; | ||
prototype: SVGClipPathElement; | ||
}; | ||
readonly defs: { | ||
new (): SVGDefsElement; | ||
prototype: SVGDefsElement; | ||
}; | ||
readonly desc: { | ||
new (): SVGDescElement; | ||
prototype: SVGDescElement; | ||
}; | ||
readonly ellipse: { | ||
new (): SVGEllipseElement; | ||
prototype: SVGEllipseElement; | ||
}; | ||
readonly feBlend: { | ||
new (): SVGFEBlendElement; | ||
prototype: SVGFEBlendElement; | ||
readonly SVG_FEBLEND_MODE_UNKNOWN: 0; | ||
readonly SVG_FEBLEND_MODE_NORMAL: 1; | ||
readonly SVG_FEBLEND_MODE_MULTIPLY: 2; | ||
readonly SVG_FEBLEND_MODE_SCREEN: 3; | ||
readonly SVG_FEBLEND_MODE_DARKEN: 4; | ||
readonly SVG_FEBLEND_MODE_LIGHTEN: 5; | ||
readonly SVG_FEBLEND_MODE_OVERLAY: 6; | ||
readonly SVG_FEBLEND_MODE_COLOR_DODGE: 7; | ||
readonly SVG_FEBLEND_MODE_COLOR_BURN: 8; | ||
readonly SVG_FEBLEND_MODE_HARD_LIGHT: 9; | ||
readonly SVG_FEBLEND_MODE_SOFT_LIGHT: 10; | ||
readonly SVG_FEBLEND_MODE_DIFFERENCE: 11; | ||
readonly SVG_FEBLEND_MODE_EXCLUSION: 12; | ||
readonly SVG_FEBLEND_MODE_HUE: 13; | ||
readonly SVG_FEBLEND_MODE_SATURATION: 14; | ||
readonly SVG_FEBLEND_MODE_COLOR: 15; | ||
readonly SVG_FEBLEND_MODE_LUMINOSITY: 16; | ||
}; | ||
readonly feColorMatrix: { | ||
new (): SVGFEColorMatrixElement; | ||
prototype: SVGFEColorMatrixElement; | ||
readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: 0; | ||
readonly SVG_FECOLORMATRIX_TYPE_MATRIX: 1; | ||
readonly SVG_FECOLORMATRIX_TYPE_SATURATE: 2; | ||
readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: 3; | ||
readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: 4; | ||
}; | ||
readonly feComponentTransfer: { | ||
new (): SVGFEComponentTransferElement; | ||
prototype: SVGFEComponentTransferElement; | ||
}; | ||
readonly feComposite: { | ||
new (): SVGFECompositeElement; | ||
prototype: SVGFECompositeElement; | ||
readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: 0; | ||
readonly SVG_FECOMPOSITE_OPERATOR_OVER: 1; | ||
readonly SVG_FECOMPOSITE_OPERATOR_IN: 2; | ||
readonly SVG_FECOMPOSITE_OPERATOR_OUT: 3; | ||
readonly SVG_FECOMPOSITE_OPERATOR_ATOP: 4; | ||
readonly SVG_FECOMPOSITE_OPERATOR_XOR: 5; | ||
readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: 6; | ||
}; | ||
readonly feConvolveMatrix: { | ||
new (): SVGFEConvolveMatrixElement; | ||
prototype: SVGFEConvolveMatrixElement; | ||
readonly SVG_EDGEMODE_UNKNOWN: 0; | ||
readonly SVG_EDGEMODE_DUPLICATE: 1; | ||
readonly SVG_EDGEMODE_WRAP: 2; | ||
readonly SVG_EDGEMODE_NONE: 3; | ||
}; | ||
readonly feDiffuseLighting: { | ||
new (): SVGFEDiffuseLightingElement; | ||
prototype: SVGFEDiffuseLightingElement; | ||
}; | ||
readonly feDisplacementMap: { | ||
new (): SVGFEDisplacementMapElement; | ||
prototype: SVGFEDisplacementMapElement; | ||
readonly SVG_CHANNEL_UNKNOWN: 0; | ||
readonly SVG_CHANNEL_R: 1; | ||
readonly SVG_CHANNEL_G: 2; | ||
readonly SVG_CHANNEL_B: 3; | ||
readonly SVG_CHANNEL_A: 4; | ||
}; | ||
readonly feDistantLight: { | ||
new (): SVGFEDistantLightElement; | ||
prototype: SVGFEDistantLightElement; | ||
}; | ||
readonly feDropShadow: { | ||
new (): SVGFEDropShadowElement; | ||
prototype: SVGFEDropShadowElement; | ||
}; | ||
readonly feFlood: { | ||
new (): SVGFEFloodElement; | ||
prototype: SVGFEFloodElement; | ||
}; | ||
readonly feFuncA: { | ||
new (): SVGFEFuncAElement; | ||
prototype: SVGFEFuncAElement; | ||
}; | ||
readonly feFuncB: { | ||
new (): SVGFEFuncBElement; | ||
prototype: SVGFEFuncBElement; | ||
}; | ||
readonly feFuncG: { | ||
new (): SVGFEFuncGElement; | ||
prototype: SVGFEFuncGElement; | ||
}; | ||
readonly feFuncR: { | ||
new (): SVGFEFuncRElement; | ||
prototype: SVGFEFuncRElement; | ||
}; | ||
readonly feGaussianBlur: { | ||
new (): SVGFEGaussianBlurElement; | ||
prototype: SVGFEGaussianBlurElement; | ||
}; | ||
readonly feImage: { | ||
new (): SVGFEImageElement; | ||
prototype: SVGFEImageElement; | ||
}; | ||
readonly feMerge: { | ||
new (): SVGFEMergeElement; | ||
prototype: SVGFEMergeElement; | ||
}; | ||
readonly feMergeNode: { | ||
new (): SVGFEMergeNodeElement; | ||
prototype: SVGFEMergeNodeElement; | ||
}; | ||
readonly feMorphology: { | ||
new (): SVGFEMorphologyElement; | ||
prototype: SVGFEMorphologyElement; | ||
readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: 0; | ||
readonly SVG_MORPHOLOGY_OPERATOR_ERODE: 1; | ||
readonly SVG_MORPHOLOGY_OPERATOR_DILATE: 2; | ||
}; | ||
readonly feOffset: { | ||
new (): SVGFEOffsetElement; | ||
prototype: SVGFEOffsetElement; | ||
}; | ||
readonly fePointLight: { | ||
new (): SVGFEPointLightElement; | ||
prototype: SVGFEPointLightElement; | ||
}; | ||
readonly feSpecularLighting: { | ||
new (): SVGFESpecularLightingElement; | ||
prototype: SVGFESpecularLightingElement; | ||
}; | ||
readonly feSpotLight: { | ||
new (): SVGFESpotLightElement; | ||
prototype: SVGFESpotLightElement; | ||
}; | ||
readonly feTile: { | ||
new (): SVGFETileElement; | ||
prototype: SVGFETileElement; | ||
}; | ||
readonly feTurbulence: { | ||
new (): SVGFETurbulenceElement; | ||
prototype: SVGFETurbulenceElement; | ||
readonly SVG_TURBULENCE_TYPE_UNKNOWN: 0; | ||
readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: 1; | ||
readonly SVG_TURBULENCE_TYPE_TURBULENCE: 2; | ||
readonly SVG_STITCHTYPE_UNKNOWN: 0; | ||
readonly SVG_STITCHTYPE_STITCH: 1; | ||
readonly SVG_STITCHTYPE_NOSTITCH: 2; | ||
}; | ||
readonly filter: { | ||
new (): SVGFilterElement; | ||
prototype: SVGFilterElement; | ||
}; | ||
readonly foreignObject: { | ||
new (): SVGForeignObjectElement; | ||
prototype: SVGForeignObjectElement; | ||
}; | ||
readonly g: { | ||
new (): SVGGElement; | ||
prototype: SVGGElement; | ||
}; | ||
readonly image: { | ||
new (): SVGImageElement; | ||
prototype: SVGImageElement; | ||
}; | ||
readonly line: { | ||
new (): SVGLineElement; | ||
prototype: SVGLineElement; | ||
}; | ||
readonly linearGradient: { | ||
new (): SVGLinearGradientElement; | ||
prototype: SVGLinearGradientElement; | ||
}; | ||
readonly marker: { | ||
new (): SVGMarkerElement; | ||
prototype: SVGMarkerElement; | ||
readonly SVG_MARKERUNITS_UNKNOWN: 0; | ||
readonly SVG_MARKERUNITS_USERSPACEONUSE: 1; | ||
readonly SVG_MARKERUNITS_STROKEWIDTH: 2; | ||
readonly SVG_MARKER_ORIENT_UNKNOWN: 0; | ||
readonly SVG_MARKER_ORIENT_AUTO: 1; | ||
readonly SVG_MARKER_ORIENT_ANGLE: 2; | ||
}; | ||
readonly mask: { | ||
new (): SVGMaskElement; | ||
prototype: SVGMaskElement; | ||
}; | ||
readonly metadata: { | ||
new (): SVGMetadataElement; | ||
prototype: SVGMetadataElement; | ||
}; | ||
readonly mpath: { | ||
new (): SVGMPathElement; | ||
prototype: SVGMPathElement; | ||
}; | ||
readonly path: { | ||
new (): SVGPathElement; | ||
prototype: SVGPathElement; | ||
}; | ||
readonly pattern: { | ||
new (): SVGPatternElement; | ||
prototype: SVGPatternElement; | ||
}; | ||
readonly polygon: { | ||
new (): SVGPolygonElement; | ||
prototype: SVGPolygonElement; | ||
}; | ||
readonly polyline: { | ||
new (): SVGPolylineElement; | ||
prototype: SVGPolylineElement; | ||
}; | ||
readonly radialGradient: { | ||
new (): SVGRadialGradientElement; | ||
prototype: SVGRadialGradientElement; | ||
}; | ||
readonly rect: { | ||
new (): SVGRectElement; | ||
prototype: SVGRectElement; | ||
}; | ||
readonly script: { | ||
new (): SVGScriptElement; | ||
prototype: SVGScriptElement; | ||
}; | ||
readonly set: { | ||
new (): SVGSetElement; | ||
prototype: SVGSetElement; | ||
}; | ||
readonly stop: { | ||
new (): SVGStopElement; | ||
prototype: SVGStopElement; | ||
}; | ||
readonly style: { | ||
new (): SVGStyleElement; | ||
prototype: SVGStyleElement; | ||
}; | ||
readonly svg: { | ||
new (): SVGSVGElement; | ||
prototype: SVGSVGElement; | ||
}; | ||
readonly switch: { | ||
new (): SVGSwitchElement; | ||
prototype: SVGSwitchElement; | ||
}; | ||
readonly symbol: { | ||
new (): SVGSymbolElement; | ||
prototype: SVGSymbolElement; | ||
}; | ||
readonly text: { | ||
new (): SVGTextElement; | ||
prototype: SVGTextElement; | ||
}; | ||
readonly textPath: { | ||
new (): SVGTextPathElement; | ||
prototype: SVGTextPathElement; | ||
readonly TEXTPATH_METHODTYPE_UNKNOWN: 0; | ||
readonly TEXTPATH_METHODTYPE_ALIGN: 1; | ||
readonly TEXTPATH_METHODTYPE_STRETCH: 2; | ||
readonly TEXTPATH_SPACINGTYPE_UNKNOWN: 0; | ||
readonly TEXTPATH_SPACINGTYPE_AUTO: 1; | ||
readonly TEXTPATH_SPACINGTYPE_EXACT: 2; | ||
}; | ||
readonly title: { | ||
new (): SVGTitleElement; | ||
prototype: SVGTitleElement; | ||
}; | ||
readonly tspan: { | ||
new (): SVGTSpanElement; | ||
prototype: SVGTSpanElement; | ||
}; | ||
readonly use: { | ||
new (): SVGUseElement; | ||
prototype: SVGUseElement; | ||
}; | ||
readonly view: { | ||
new (): SVGViewElement; | ||
prototype: SVGViewElement; | ||
}; | ||
}; | ||
/** All possible SVG spec tag names within a single array. */ | ||
export declare const allSvgSpecTagNames: ReadonlyArray<SvgSpecTagName>; |
163
dist/svg.js
@@ -1,90 +0,73 @@ | ||
import { typedArrayIncludes } from '@augment-vir/common'; | ||
import { isRunTimeType } from 'run-time-assertions'; | ||
/** All possible SVG spec 2 tag names within a single array. */ | ||
export const allSvgSpecTagNames = [ | ||
'a', | ||
'animate', | ||
'animateMotion', | ||
'animateTransform', | ||
'audio', | ||
'canvas', | ||
'circle', | ||
'clipPath', | ||
'defs', | ||
'desc', | ||
'discard', | ||
'ellipse', | ||
'feBlend', | ||
'feColorMatrix', | ||
'feComponentTransfer', | ||
'feComposite', | ||
'feConvolveMatrix', | ||
'feDiffuseLighting', | ||
'feDisplacementMap', | ||
'feDistantLight', | ||
'feDropShadow', | ||
'feFlood', | ||
'feFuncA', | ||
'feFuncB', | ||
'feFuncG', | ||
'feFuncR', | ||
'feGaussianBlur', | ||
'feImage', | ||
'feMerge', | ||
'feMergeNode', | ||
'feMorphology', | ||
'feOffset', | ||
'fePointLight', | ||
'feSpecularLighting', | ||
'feSpotLight', | ||
'feTile', | ||
'feTurbulence', | ||
'filter', | ||
'foreignObject', | ||
'g', | ||
'iframe', | ||
'image', | ||
'line', | ||
'linearGradient', | ||
'marker', | ||
'mask', | ||
'metadata', | ||
'mpath', | ||
'path', | ||
'pattern', | ||
'polygon', | ||
'polyline', | ||
'radialGradient', | ||
'rect', | ||
'script', | ||
'set', | ||
'stop', | ||
'style', | ||
'svg', | ||
'switch', | ||
'symbol', | ||
'text', | ||
'textPath', | ||
'title', | ||
'tspan', | ||
'unknown', | ||
'use', | ||
'video', | ||
'view', | ||
]; | ||
/** Type guards the input as a valid SVG spec tag name. */ | ||
export function isSvgSpecTagName(input) { | ||
return typedArrayIncludes(allSvgSpecTagNames, input); | ||
} | ||
/** Passes the input through if it's a valid SVG spec tag name, throws an error if not. */ | ||
export function ensureSvgSpecTagName(input) { | ||
if (isSvgSpecTagName(input)) { | ||
return input; | ||
} | ||
else if (!isRunTimeType(input, 'string')) { | ||
throw new Error(`'${JSON.stringify(input)}' is not a string, it cannot be a valid SvgSpecTagName.`); | ||
} | ||
else { | ||
throw new Error(`'${input}' is not a valid SvgSpecTagName.`); | ||
} | ||
} | ||
/** | ||
* All current SVG spec tag names mapped to their respective element constructors. | ||
* | ||
* Generated from `SVGElementTagNameMap` in `typescript/lib/lib.dom.d.ts`: | ||
* https://raw.githubusercontent.com/microsoft/TypeScript/main/src/lib/dom.generated.d.ts | ||
*/ | ||
export const svgSpecConstructorsByTagName = { | ||
a: window.SVGAElement, | ||
animate: window.SVGAnimateElement, | ||
animateMotion: window.SVGAnimateMotionElement, | ||
animateTransform: window.SVGAnimateTransformElement, | ||
circle: window.SVGCircleElement, | ||
clipPath: window.SVGClipPathElement, | ||
defs: window.SVGDefsElement, | ||
desc: window.SVGDescElement, | ||
ellipse: window.SVGEllipseElement, | ||
feBlend: window.SVGFEBlendElement, | ||
feColorMatrix: window.SVGFEColorMatrixElement, | ||
feComponentTransfer: window.SVGFEComponentTransferElement, | ||
feComposite: window.SVGFECompositeElement, | ||
feConvolveMatrix: window.SVGFEConvolveMatrixElement, | ||
feDiffuseLighting: window.SVGFEDiffuseLightingElement, | ||
feDisplacementMap: window.SVGFEDisplacementMapElement, | ||
feDistantLight: window.SVGFEDistantLightElement, | ||
feDropShadow: window.SVGFEDropShadowElement, | ||
feFlood: window.SVGFEFloodElement, | ||
feFuncA: window.SVGFEFuncAElement, | ||
feFuncB: window.SVGFEFuncBElement, | ||
feFuncG: window.SVGFEFuncGElement, | ||
feFuncR: window.SVGFEFuncRElement, | ||
feGaussianBlur: window.SVGFEGaussianBlurElement, | ||
feImage: window.SVGFEImageElement, | ||
feMerge: window.SVGFEMergeElement, | ||
feMergeNode: window.SVGFEMergeNodeElement, | ||
feMorphology: window.SVGFEMorphologyElement, | ||
feOffset: window.SVGFEOffsetElement, | ||
fePointLight: window.SVGFEPointLightElement, | ||
feSpecularLighting: window.SVGFESpecularLightingElement, | ||
feSpotLight: window.SVGFESpotLightElement, | ||
feTile: window.SVGFETileElement, | ||
feTurbulence: window.SVGFETurbulenceElement, | ||
filter: window.SVGFilterElement, | ||
foreignObject: window.SVGForeignObjectElement, | ||
g: window.SVGGElement, | ||
image: window.SVGImageElement, | ||
line: window.SVGLineElement, | ||
linearGradient: window.SVGLinearGradientElement, | ||
marker: window.SVGMarkerElement, | ||
mask: window.SVGMaskElement, | ||
metadata: window.SVGMetadataElement, | ||
mpath: window.SVGMPathElement, | ||
path: window.SVGPathElement, | ||
pattern: window.SVGPatternElement, | ||
polygon: window.SVGPolygonElement, | ||
polyline: window.SVGPolylineElement, | ||
radialGradient: window.SVGRadialGradientElement, | ||
rect: window.SVGRectElement, | ||
script: window.SVGScriptElement, | ||
set: window.SVGSetElement, | ||
stop: window.SVGStopElement, | ||
style: window.SVGStyleElement, | ||
svg: window.SVGSVGElement, | ||
switch: window.SVGSwitchElement, | ||
symbol: window.SVGSymbolElement, | ||
text: window.SVGTextElement, | ||
textPath: window.SVGTextPathElement, | ||
title: window.SVGTitleElement, | ||
tspan: window.SVGTSpanElement, | ||
use: window.SVGUseElement, | ||
view: window.SVGViewElement, | ||
}; | ||
/** All possible SVG spec tag names within a single array. */ | ||
export const allSvgSpecTagNames = Object.keys(svgSpecConstructorsByTagName); |
{ | ||
"name": "html-spec-tags", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"description": "All HTML tags supported by the current spec. With types!", | ||
"keywords": [ | ||
"html", | ||
"svg", | ||
"mathml", | ||
"spec", | ||
@@ -40,7 +42,7 @@ "tag", | ||
"dependencies": { | ||
"@augment-vir/common": "^23.3.4", | ||
"@augment-vir/common": "^23.4.0", | ||
"run-time-assertions": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@augment-vir/browser-testing": "^23.3.4", | ||
"@augment-vir/browser-testing": "^23.4.0", | ||
"@open-wc/testing": "^4.0.0", | ||
@@ -53,25 +55,21 @@ "@types/mocha": "^10.0.6", | ||
"@web/test-runner-visual-regression": "^0.9.0", | ||
"cspell": "^8.4.0", | ||
"cspell": "^8.4.1", | ||
"dependency-cruiser": "^16.2.1", | ||
"esbuild": "^0.20.1", | ||
"istanbul-smart-text-reporter": "^1.1.3", | ||
"markdown-code-example-inserter": "^0.3.3", | ||
"istanbul-smart-text-reporter": "^1.1.4", | ||
"markdown-code-example-inserter": "^1.0.0", | ||
"npm-check-updates": "~16.12.3", | ||
"prettier": "^3.2.5", | ||
"prettier-plugin-interpolated-html-tags": "^1.0.3", | ||
"prettier-plugin-interpolated-html-tags": "^1.0.5", | ||
"prettier-plugin-jsdoc": "^1.3.0", | ||
"prettier-plugin-multiline-arrays": "^3.0.3", | ||
"prettier-plugin-multiline-arrays": "^3.0.4", | ||
"prettier-plugin-organize-imports": "^3.2.4", | ||
"prettier-plugin-packagejson": "^2.4.11", | ||
"prettier-plugin-packagejson": "^2.4.12", | ||
"prettier-plugin-sort-json": "^3.1.0", | ||
"prettier-plugin-toml": "^2.0.1", | ||
"type-fest": "^4.10.2", | ||
"type-fest": "^4.10.3", | ||
"typedoc": "^0.25.8", | ||
"typescript": "5.3.3", | ||
"virmator": "^11.3.3" | ||
}, | ||
"overrides": { | ||
"@open-wc/testing-helpers": "2.3.0", | ||
"@open-wc/scoped-elements": "2.2.3" | ||
"typescript": "^5.3.3", | ||
"virmator": "^11.4.0" | ||
} | ||
} |
# html-spec-tags | ||
All HTML and SVG tags supported by the current specs. With types! | ||
All HTML, SVG, and MathML tags and their constructor as supported by current specs. With types! | ||
The lists are generated via scripts inside the included `extraction-scripts.js` file. | ||
Each list is generated from Typescript's [`lib.dom.d.ts` types](https://raw.githubusercontent.com/microsoft/TypeScript/main/src/lib/dom.generated.d.ts) (from `HTMLElementTagNameMap`, `SVGElementTagNameMap`, `MathMLElementTagNameMap`, respectively). | ||
Updated on Sep 28, 2023 | ||
List contents last updated on Feb 24, 2024. | ||
@@ -9,0 +9,0 @@ ## Installation |
57159
16
1322
Updated@augment-vir/common@^23.4.0