@soil/dom
Version:
Declaratively create type-safe HTML and SVG elements.
77 lines (76 loc) • 2.98 kB
TypeScript
import { Props } from '../../../shared/types/Props';
declare type S = {
[T in keyof SVGElementTagNameMap]: (props?: Props<SVGElementTagNameMap[T]>, children?: (string | Element)[]) => SVGElementTagNameMap[T];
};
/**
* Helpers to facilitate the concise creation of any SVG element.
*
* NOTE The following functions silently depend on the `document` variable
* being globally available. Therefore, unit tests of components that use them
* must be run inside a browser, or must expose `document` globally, e.g.
* through PhantomJS or jsdom.
*/
export declare const s: S;
/**
* Nice-to-remember aliases for all SVG element interfaces.
*/
export declare namespace s {
type A = SVGAElement;
type Circle = SVGCircleElement;
type ClipPath = SVGClipPathElement;
type Defs = SVGDefsElement;
type Desc = SVGDescElement;
type Ellipse = SVGEllipseElement;
type FeBlend = SVGFEBlendElement;
type FeColorMatrix = SVGFEColorMatrixElement;
type FeComponentTransfer = SVGFEComponentTransferElement;
type FeComposite = SVGFECompositeElement;
type FeConvolveMatrix = SVGFEConvolveMatrixElement;
type FeDiffuseLighting = SVGFEDiffuseLightingElement;
type FeDisplacementMap = SVGFEDisplacementMapElement;
type FeDistantLight = SVGFEDistantLightElement;
type FeFlood = SVGFEFloodElement;
type FeFuncA = SVGFEFuncAElement;
type FeFuncB = SVGFEFuncBElement;
type FeFuncG = SVGFEFuncGElement;
type FeFuncR = SVGFEFuncRElement;
type FeGaussianBlur = SVGFEGaussianBlurElement;
type FeImage = SVGFEImageElement;
type FeMerge = SVGFEMergeElement;
type FeMergeNode = SVGFEMergeNodeElement;
type FeMorphology = SVGFEMorphologyElement;
type FeOffset = SVGFEOffsetElement;
type FePointLight = SVGFEPointLightElement;
type FeSpecularLighting = SVGFESpecularLightingElement;
type FeSpotLight = SVGFESpotLightElement;
type FeTile = SVGFETileElement;
type FeTurbulence = SVGFETurbulenceElement;
type Filter = SVGFilterElement;
type ForeignObject = SVGForeignObjectElement;
type G = SVGGElement;
type Image = SVGImageElement;
type Line = SVGLineElement;
type LinearGradient = SVGLinearGradientElement;
type Marker = SVGMarkerElement;
type Mask = SVGMaskElement;
type Metadata = SVGMetadataElement;
type Path = SVGPathElement;
type Pattern = SVGPatternElement;
type Polygon = SVGPolygonElement;
type Polyline = SVGPolylineElement;
type RadialGradient = SVGRadialGradientElement;
type Rect = SVGRectElement;
type Script = SVGScriptElement;
type Stop = SVGStopElement;
type Style = SVGStyleElement;
type Svg = SVGSVGElement;
type Switch = SVGSwitchElement;
type Symbol = SVGSymbolElement;
type Text = SVGTextElement;
type TextPath = SVGTextPathElement;
type Title = SVGTitleElement;
type Tspan = SVGTSpanElement;
type Use = SVGUseElement;
type View = SVGViewElement;
}
export {};