UNPKG

@selfage/element

Version:

Create vanilla HTML elements/tags with visual structures.

51 lines (50 loc) 4.07 kB
import { Ref } from "@selfage/ref"; export interface ElementAttributeMap { [index: string]: string; } export declare class ElementFactory { private static setAttributes; div(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLDivElement; divRef(ref: Ref<HTMLDivElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLDivElement; text(content?: string): Text; textRef(ref: Ref<Text>, content?: string): Text; ol(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLOListElement; olRef(ref: Ref<HTMLOListElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLOListElement; ul(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLUListElement; ulRef(ref: Ref<HTMLUListElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLUListElement; li(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLLIElement; liRef(ref: Ref<HTMLLIElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLLIElement; label(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLLabelElement; labelRef(ref: Ref<HTMLLabelElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLLabelElement; image(attributes: ElementAttributeMap): HTMLImageElement; imageRef(ref: Ref<HTMLImageElement>, attributes: ElementAttributeMap): HTMLImageElement; form(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLFormElement; formRef(ref: Ref<HTMLFormElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLFormElement; input(attributes: ElementAttributeMap): HTMLInputElement; inputRef(ref: Ref<HTMLInputElement>, attributes: ElementAttributeMap): HTMLInputElement; textarea(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLTextAreaElement; textareaRef(ref: Ref<HTMLTextAreaElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLTextAreaElement; button(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLButtonElement; buttonRef(ref: Ref<HTMLButtonElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLButtonElement; a(attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLAnchorElement; aRef(ref: Ref<HTMLAnchorElement>, attributes: ElementAttributeMap, ...childNodes: Array<Node>): HTMLAnchorElement; iframe(attributes: ElementAttributeMap): HTMLIFrameElement; iframeRef(ref: Ref<HTMLIFrameElement>, attributes: ElementAttributeMap): HTMLIFrameElement; video(attributes: ElementAttributeMap): HTMLVideoElement; videoRef(ref: Ref<HTMLVideoElement>, attributes: ElementAttributeMap): HTMLVideoElement; canvas(attributes: ElementAttributeMap): HTMLCanvasElement; canvasRef(ref: Ref<HTMLCanvasElement>, attributes: ElementAttributeMap): HTMLCanvasElement; svg(attributes: ElementAttributeMap, ...childNodes: Array<SVGElement>): SVGSVGElement; svgRef(ref: Ref<SVGSVGElement>, attributes: ElementAttributeMap, ...childNodes: Array<SVGElement>): SVGSVGElement; path(attributes: ElementAttributeMap): SVGPathElement; pathRef(ref: Ref<SVGPathElement>, attributes: ElementAttributeMap): SVGPathElement; clipPath(attributes: ElementAttributeMap, ...childNodes: Array<SVGElement>): SVGClipPathElement; linearGradient(attributes: ElementAttributeMap, ...childNodes: Array<SVGElement>): SVGLinearGradientElement; linearGradientRef(ref: Ref<SVGLinearGradientElement>, attributes: ElementAttributeMap, ...childNodes: Array<SVGElement>): SVGLinearGradientElement; stop(attributes: ElementAttributeMap): SVGStopElement; stopRef(ref: Ref<SVGStopElement>, attributes: ElementAttributeMap): SVGStopElement; defs(attributes: ElementAttributeMap, ...childNodes: Array<SVGElement>): SVGDefsElement; use(attributes: ElementAttributeMap): SVGUseElement; useRef(ref: Ref<SVGUseElement>, attributes: ElementAttributeMap): SVGUseElement; } export declare let E: ElementFactory;