typed-dom
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.18 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License */ | ||
/*! typed-dom v0.0.19 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License */ | ||
require = function e(t, n, r) { | ||
@@ -56,3 +56,3 @@ function s(o, u) { | ||
void Object.keys(attrs).forEach(function (name) { | ||
return element.setAttribute(name, attrs[name] || ''); | ||
return void element.setAttribute(name, attrs[name] || ''); | ||
}); | ||
@@ -95,15 +95,13 @@ void Object.keys(children).forEach(function (k) { | ||
return os; | ||
}, children.slice()).map(function (a) { | ||
return a.element; | ||
}).forEach(function (a) { | ||
return void a.remove(); | ||
}, children.slice()).forEach(function (_a) { | ||
var child = _a.element; | ||
return void child.remove(); | ||
}); | ||
void cs.map(function (a) { | ||
return a.element; | ||
}).forEach(function (c) { | ||
return void element.appendChild(c); | ||
void cs.forEach(function (_a) { | ||
var child = _a.element; | ||
return void element.appendChild(child); | ||
}); | ||
break; | ||
case 'object': | ||
void Object.keys(cs).forEach(function (k) { | ||
void Object.keys(children).forEach(function (k) { | ||
return void element.replaceChild(cs[k].element, children[k].element); | ||
@@ -110,0 +108,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.18 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License */ | ||
require=function e(t,r,n){function o(c,a){if(!r[c]){if(!t[c]){var u="function"==typeof require&&require;if(!a&&u)return u(c,!0);if(i)return i(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var f=r[c]={exports:{}};t[c][0].call(f.exports,function(e){var r=t[c][1][e];return o(r?r:e)},f,f.exports,e,t,r,n)}return r[c].exports}for(var i="function"==typeof require&&require,c=0;c<n.length;c++)o(n[c]);return o}({1:[function(e,t,r){},{}],2:[function(e,t,r){arguments[4][1][0].apply(r,arguments)},{dup:1}],3:[function(e,t,r){"use strict";function n(e,t,r){function n(e){var t={};return Object.keys(e).reduce(function(e,r){return t[r]=e[r],Object.defineProperty(e,r,{get:function(){return t[r]},set:function(e){var n=t[r];t[r]=e,o.replaceChild(e.element,n.element)}}),e},e)}var o=e();if(void 0===r)return Object.freeze({element:o,children:r});var i="string"==typeof r?"text":Array.isArray(r)?"array":"object";switch(i){case"text":r=document.createTextNode(r),void o.appendChild(r);break;default:switch(void Object.keys(t).forEach(function(e){return o.setAttribute(e,t[e]||"")}),void Object.keys(r).forEach(function(e){return void o.appendChild(r[e].element)}),i){case"array":void Object.freeze(r);break;case"object":void n(r)}}return Object.freeze({element:o,get children(){switch(i){case"text":return r.data;default:return r}},set children(e){switch(i){case"text":r.data=e,e=r;break;case"array":e=Object.freeze(e),void e.reduce(function(e,t){var r=e.indexOf(t);return r===-1?e:(void e.splice(r,1),e)},r.slice()).map(function(e){return e.element}).forEach(function(e){return void e.remove()}),void e.map(function(e){return e.element}).forEach(function(e){return void o.appendChild(e)});break;case"object":void Object.keys(e).forEach(function(t){return void o.replaceChild(e[t].element,r[t].element)}),e=n(e)}r=e}})}r.build=n},{}],4:[function(e,t,r){"use strict";var n=e("./builder");r.TypedHTML=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","datalist","dd","del","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","map","mark","marquee","menu","meta","meter","nav","nextid","nobr","noframes","noscript","object","ol","optgroup","option","p","param","picture","plaintext","pre","progress","q","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","sup","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","tt","u","ul","var","video","wbr","xmp","custom"].reduce(function(e,t){return e[t]=function(e,r,o){return e&&r&&"function"!=typeof r?n.build(o||function(){return document.createElement(t)},e,r):n.build(r||function(){return document.createElement(t)},{},e)},e},{})},{"./builder":3}],5:[function(e,t,r){"use strict";var n=e("./dom/html");r.default=n.TypedHTML},{"./dom/html":4}],6:[function(e,t,r){arguments[4][1][0].apply(r,arguments)},{dup:1}],"typed-dom":[function(e,t,r){"use strict";function n(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}n(e("./src/export"));var o=e("./src/export");r.default=o.default,r.__esModule=!0},{"./src/export":5}]},{},[1,2,6,"typed-dom"]); | ||
/*! typed-dom v0.0.19 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License */ | ||
require=function e(t,r,n){function o(c,a){if(!r[c]){if(!t[c]){var u="function"==typeof require&&require;if(!a&&u)return u(c,!0);if(i)return i(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var f=r[c]={exports:{}};t[c][0].call(f.exports,function(e){var r=t[c][1][e];return o(r?r:e)},f,f.exports,e,t,r,n)}return r[c].exports}for(var i="function"==typeof require&&require,c=0;c<n.length;c++)o(n[c]);return o}({1:[function(e,t,r){},{}],2:[function(e,t,r){arguments[4][1][0].apply(r,arguments)},{dup:1}],3:[function(e,t,r){"use strict";function n(e,t,r){function n(e){var t={};return Object.keys(e).reduce(function(e,r){return t[r]=e[r],Object.defineProperty(e,r,{get:function(){return t[r]},set:function(e){var n=t[r];t[r]=e,o.replaceChild(e.element,n.element)}}),e},e)}var o=e();if(void 0===r)return Object.freeze({element:o,children:r});var i="string"==typeof r?"text":Array.isArray(r)?"array":"object";switch(i){case"text":r=document.createTextNode(r),void o.appendChild(r);break;default:switch(void Object.keys(t).forEach(function(e){return void o.setAttribute(e,t[e]||"")}),void Object.keys(r).forEach(function(e){return void o.appendChild(r[e].element)}),i){case"array":void Object.freeze(r);break;case"object":void n(r)}}return Object.freeze({element:o,get children(){switch(i){case"text":return r.data;default:return r}},set children(e){switch(i){case"text":r.data=e,e=r;break;case"array":e=Object.freeze(e),void e.reduce(function(e,t){var r=e.indexOf(t);return r===-1?e:(void e.splice(r,1),e)},r.slice()).forEach(function(e){var t=e.element;return void t.remove()}),void e.forEach(function(e){var t=e.element;return void o.appendChild(t)});break;case"object":void Object.keys(r).forEach(function(t){return void o.replaceChild(e[t].element,r[t].element)}),e=n(e)}r=e}})}r.build=n},{}],4:[function(e,t,r){"use strict";var n=e("./builder");r.TypedHTML=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","datalist","dd","del","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","map","mark","marquee","menu","meta","meter","nav","nextid","nobr","noframes","noscript","object","ol","optgroup","option","p","param","picture","plaintext","pre","progress","q","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","sup","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","tt","u","ul","var","video","wbr","xmp","custom"].reduce(function(e,t){return e[t]=function(e,r,o){return e&&r&&"function"!=typeof r?n.build(o||function(){return document.createElement(t)},e,r):n.build(r||function(){return document.createElement(t)},{},e)},e},{})},{"./builder":3}],5:[function(e,t,r){"use strict";var n=e("./dom/html");r.default=n.TypedHTML},{"./dom/html":4}],6:[function(e,t,r){arguments[4][1][0].apply(r,arguments)},{dup:1}],"typed-dom":[function(e,t,r){"use strict";function n(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}n(e("./src/export"));var o=e("./src/export");r.default=o.default,r.__esModule=!0},{"./src/export":5}]},{},[1,2,6,"typed-dom"]); |
{ | ||
"name": "typed-dom", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Static typed dom component builder.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -6,4 +6,5 @@ # typed-dom | ||
Static typed dom component builder. | ||
Enhance dom manipulability via static typings of TypeScript. | ||
**Visualize** dom structures and **Assist** dom access by static types of TypeScript. | ||
[typed-dom.d.ts](typed-dom.d.ts) | ||
@@ -14,14 +15,36 @@ | ||
const component = TypedHTML.article({ | ||
title: TypedHTML.h1('title'), | ||
const id = 'id'; | ||
const component = TypedHTML.article({ id }, { | ||
style: TypedHTML.style(`#${id} ul { width: 100px; }`), | ||
title: TypedHTML.h1(`title`), | ||
content: TypedHTML.ul([ | ||
TypedHTML.li('item'), | ||
TypedHTML.li('item'), | ||
TypedHTML.li(`item`), | ||
TypedHTML.li(`item`), | ||
]) | ||
}); | ||
assert(component.element.outerHTML === '<article><h1>title</h1><ul><li>item</li><li>item</li></ul></article>'); | ||
assert(component.children.title.element.outerHTML === '<h1>title</h1>'); | ||
assert(component.children.title.children === 'title'); | ||
assert(component.children.content.element.outerHTML === '<ul><li>item</li><li>item</li></ul>'); | ||
assert(component.children.content.children[0].children === 'item'); | ||
// inspect | ||
component.element.outerHTML; // '<article id="id"><style>#id ul { width: 100px; }</style><h1>title</h1><ul><li>item</li><li>item</li></ul></article>' | ||
component.children.title.element.outerHTML; // '<h1>title</h1>' | ||
component.children.title.children; // 'title' | ||
component.children.content.element.outerHTML; // '<ul><li>item</li><li>item</li></ul>' | ||
component.children.content.children[0].children; // 'item' | ||
// update | ||
// - text | ||
component.children.title.children = 'Title'; | ||
component.children.title.element.outerHTML; // '<h1>Title</h1>' | ||
// - struct | ||
component.children.content.children = [ | ||
TypedHTML.li('Item') | ||
]; | ||
component.children.content.element.outerHTML; // '<ul><li>Item</li></ul>' | ||
// - TypedHTML | ||
component.children.title = TypedHTML.h1('Title!'); | ||
component.children.content = TypedHTML.ul([ | ||
TypedHTML.li('Item!') | ||
]); | ||
component.element.outerHTML; // '<article id="id"><style>#id ul { width: 100px; }</style><h1>Title!</h1><ul><li>Item!</li></ul></article>' | ||
``` |
@@ -1,9 +0,9 @@ | ||
import { TypedHTML, TypedHTMLContents } from 'typed-dom'; | ||
import { TypedHTMLElement, TypedHTMLElementChildren } from 'typed-dom'; | ||
export function build | ||
<S extends string, T extends HTMLElement, U extends TypedHTMLContents<HTMLElement>> | ||
<S extends string, T extends HTMLElement, U extends TypedHTMLElementChildren<HTMLElement>> | ||
(factory: () => T, attrs: {}, children: U) | ||
: TypedHTML<S, T, U> { | ||
: TypedHTMLElement<S, T, U> { | ||
const element = factory(); | ||
if (children === void 0) return <TypedHTML<S, T, U>>Object.freeze({ | ||
if (children === void 0) return <TypedHTMLElement<S, T, U>>Object.freeze({ | ||
element, | ||
@@ -24,5 +24,7 @@ children: <U>children | ||
void Object.keys(attrs) | ||
.forEach(name => element.setAttribute(name, attrs[name] || '')); | ||
.forEach(name => | ||
void element.setAttribute(name, attrs[name] || '')); | ||
void Object.keys(children) | ||
.forEach(k => void element.appendChild(children[k].element)); | ||
.forEach(k => | ||
void element.appendChild(children[k].element)); | ||
switch (mode) { | ||
@@ -33,7 +35,7 @@ case 'array': | ||
case 'object': | ||
void observe(children); | ||
void observe(<{ [name: string]: TypedHTMLElement<string, HTMLElement, any>; }>children); | ||
break; | ||
} | ||
} | ||
return <TypedHTML<S, T, U>>Object.freeze({ | ||
return <TypedHTMLElement<S, T, U>>Object.freeze({ | ||
element, | ||
@@ -57,4 +59,4 @@ get children(): U { | ||
cs = <U>Object.freeze(cs); | ||
void (<TypedHTML<string, T, any>[]><any>cs) | ||
.reduce<TypedHTML<string, T, any>[]>((os, n) => { | ||
void (<TypedHTMLElement<string, HTMLElement, any>[]>cs) | ||
.reduce<TypedHTMLElement<string, HTMLElement, any>[]>((os, n) => { | ||
const i = os.indexOf(n); | ||
@@ -64,15 +66,15 @@ if (i === -1) return os; | ||
return os; | ||
}, (<TypedHTML<string, T, any>[]><any>children).slice()) | ||
.map(a => (<TypedHTML<string, T, any>>a).element) | ||
.forEach(a => | ||
void a.remove()); | ||
void (<TypedHTML<string, T, any>[]><any>cs) | ||
.map(a => (<TypedHTML<string, T, any>>a).element) | ||
.forEach(c => void element.appendChild(c)); | ||
}, (<TypedHTMLElement<string, HTMLElement, any>[]>children).slice()) | ||
.forEach(({element: child}) => | ||
void child.remove()); | ||
void (<TypedHTMLElement<string, HTMLElement, any>[]>cs) | ||
.forEach(({element: child}) => | ||
void element.appendChild(child)); | ||
break; | ||
case 'object': | ||
void Object.keys(cs) | ||
.forEach(k => void element.replaceChild(cs[k].element, children[k].element)); | ||
cs = observe(cs); | ||
void Object.keys(children) | ||
.forEach(k => | ||
void element.replaceChild(cs[k].element, children[k].element)); | ||
cs = <U>observe(<{ [name: string]: TypedHTMLElement<string, HTMLElement, any>; }>cs); | ||
break; | ||
@@ -85,4 +87,4 @@ | ||
function observe(children: U): U { | ||
const cache = {}; | ||
function observe<T extends { [name: string]: TypedHTMLElement<string, HTMLElement, any>; }>(children: T): T { | ||
const cache: T = <T>{}; | ||
return Object.keys(children) | ||
@@ -89,0 +91,0 @@ .reduce((children, k) => { |
@@ -1,6 +0,6 @@ | ||
import { TypedHTML as ITypedHTML, TypedHTMLContents } from 'typed-dom'; | ||
import { TypedHTMLElement as ITypedHTML, TypedHTMLElementChildren } from 'typed-dom'; | ||
import { build } from './builder'; | ||
export type TypedHTML<S extends string, T extends HTMLElement, U extends TypedHTMLContents<HTMLElement>> = ITypedHTML<S, T, U>; | ||
export const TypedHTML: TypedHTML<string, HTMLElement, TypedHTMLContents<HTMLElement>> = [ | ||
export type TypedHTML<S extends string, T extends HTMLElement, U extends TypedHTMLElementChildren<HTMLElement>> = ITypedHTML<S, T, U>; | ||
export const TypedHTML: TypedHTML<string, HTMLElement, TypedHTMLElementChildren<HTMLElement>> = [ | ||
// lib.dom.d.ts | ||
@@ -134,3 +134,3 @@ 'a', | ||
obj[tag] = | ||
<T extends TypedHTMLContents<HTMLElement>> | ||
<T extends TypedHTMLElementChildren<HTMLElement>> | ||
(attrs?: { [name: string]: string; }, children?: T, factory?: () => HTMLElement) | ||
@@ -142,2 +142,2 @@ : TypedHTML<string, HTMLElement, T> => | ||
obj | ||
), <TypedHTML<string, HTMLElement, TypedHTMLContents<HTMLElement>>>{}); | ||
), <TypedHTML<string, HTMLElement, TypedHTMLElementChildren<HTMLElement>>>{}); |
@@ -61,3 +61,3 @@ import { Sequence } from 'spica'; | ||
const struct = TypedHTML.article({ | ||
title: TypedHTML.h1('title'), | ||
title: TypedHTML.h1(`title`), | ||
content: TypedHTML.p([TypedHTML.a()]) | ||
@@ -72,6 +72,6 @@ }); | ||
const struct = TypedHTML.article({ | ||
title: TypedHTML.h1<string>('a') | ||
title: TypedHTML.h1(`a`) | ||
}); | ||
struct.children = { | ||
title: TypedHTML.h1('b') | ||
title: TypedHTML.h1(`b`) | ||
}; | ||
@@ -85,5 +85,5 @@ assert(struct.children.title.element.textContent === 'b'); | ||
const struct = TypedHTML.article({ | ||
title: TypedHTML.h1<string>('a') | ||
title: TypedHTML.h1(`a`) | ||
}); | ||
struct.children.title = TypedHTML.h1('b'); | ||
struct.children.title = TypedHTML.h1(`b`); | ||
assert(struct.children.title.element.textContent === 'b'); | ||
@@ -100,4 +100,4 @@ assert(struct.children.title.element === struct.element.firstChild); | ||
const collection = TypedHTML.ul([ | ||
TypedHTML.li('1'), | ||
TypedHTML.li('2') | ||
TypedHTML.li(`1`), | ||
TypedHTML.li(`2`) | ||
]); | ||
@@ -111,3 +111,3 @@ assert(collection.element.outerHTML === '<ul><li>1</li><li>2</li></ul>'); | ||
const collection = TypedHTML.ul([ | ||
TypedHTML.li<string>('1') | ||
TypedHTML.li(`1`) | ||
]); | ||
@@ -114,0 +114,0 @@ collection.children = [ |
@@ -9,145 +9,162 @@ /** | ||
declare module 'typed-dom' { | ||
class HTML<T extends string> { | ||
private TAG: T; | ||
} | ||
export interface TypedHTML<S extends string, T extends HTMLElement, U extends TypedHTMLContents<HTMLElement>> extends HTML<S> { | ||
element: T; | ||
export default TypedHTML; | ||
export interface TypedHTMLElement< | ||
S extends string, | ||
T extends HTMLElement, | ||
U extends TypedHTMLElementChildren<HTMLElement>, | ||
> extends AbstractTypedHTMLElement<S> { | ||
readonly element: T; | ||
children: U; | ||
} | ||
export type TypedHTMLContents<T extends HTMLElement> = never | string | TypedHTML<string, T, any>[] | { [name: string]: TypedHTML<string, T, any>; }; | ||
interface TypedHTMLBuilder<T extends HTMLElement, S extends string> { | ||
(): TypedHTML<S, T, never>; | ||
<U extends TypedHTMLContents<HTMLElement>>(children: U, factory?: () => T): TypedHTML<S, T, U>; | ||
<U extends TypedHTMLContents<HTMLElement>>(attrs: { [name: string]: string; }, children: U, factory?: () => T): TypedHTML<S, T, U>; | ||
export type TypedHTMLElementChildren<T extends HTMLElement> | ||
= string | ||
| TypedHTMLElement<string, T, any>[] | ||
| { [name: string]: TypedHTMLElement<string, T, any>; }; | ||
abstract class AbstractTypedHTMLElement<T extends string> { | ||
private identifier: T; | ||
} | ||
interface TypedHTMLElementBuilder<T extends HTMLElement, S extends string> { | ||
(): TypedHTMLElement<S, T, never>; | ||
<U extends string> | ||
(children: U): TypedHTMLElement<S, T, U>; | ||
<U extends string> | ||
(children: U, factory?: () => T): never; | ||
<U extends TypedHTMLElementChildren<HTMLElement>> | ||
(children: U, factory?: () => T): TypedHTMLElement<S, T, U>; | ||
<U extends string> | ||
(attrs: { [name: string]: string; }, children: U, factory?: () => T): never; | ||
<U extends TypedHTMLElementChildren<HTMLElement>> | ||
(attrs: { [name: string]: string; }, children: U, factory?: () => T): TypedHTMLElement<S, T, U>; | ||
} | ||
const TypedHTML: { | ||
// lib.dom.d.ts | ||
//[K in keyof HTMLElementTagNameMap]: TypedHTMLBuilder<HTMLElementTagNameMap[K], K>; | ||
a: TypedHTMLBuilder<HTMLAnchorElement, 'a'>; | ||
abbr: TypedHTMLBuilder<HTMLElement, 'abbr'>; | ||
acronym: TypedHTMLBuilder<HTMLElement, 'acronym'>; | ||
address: TypedHTMLBuilder<HTMLElement, 'address'>; | ||
applet: TypedHTMLBuilder<HTMLAppletElement, 'applet'>; | ||
area: TypedHTMLBuilder<HTMLAreaElement, 'area'>; | ||
article: TypedHTMLBuilder<HTMLElement, 'article'>; | ||
aside: TypedHTMLBuilder<HTMLElement, 'aside'>; | ||
audio: TypedHTMLBuilder<HTMLAudioElement, 'audio'>; | ||
b: TypedHTMLBuilder<HTMLElement, 'b'>; | ||
base: TypedHTMLBuilder<HTMLBaseElement, 'base'>; | ||
basefont: TypedHTMLBuilder<HTMLBaseFontElement, 'basefont'>; | ||
bdo: TypedHTMLBuilder<HTMLElement, 'bdo'>; | ||
big: TypedHTMLBuilder<HTMLElement, 'big'>; | ||
blockquote: TypedHTMLBuilder<HTMLQuoteElement, 'blockquote'>; | ||
body: TypedHTMLBuilder<HTMLBodyElement, 'body'>; | ||
br: TypedHTMLBuilder<HTMLBRElement, 'br'>; | ||
button: TypedHTMLBuilder<HTMLButtonElement, 'button'>; | ||
canvas: TypedHTMLBuilder<HTMLCanvasElement, 'canvas'>; | ||
caption: TypedHTMLBuilder<HTMLTableCaptionElement, 'caption'>; | ||
center: TypedHTMLBuilder<HTMLElement, 'center'>; | ||
cite: TypedHTMLBuilder<HTMLElement, 'cite'>; | ||
code: TypedHTMLBuilder<HTMLElement, 'code'>; | ||
col: TypedHTMLBuilder<HTMLTableColElement, 'col'>; | ||
colgroup: TypedHTMLBuilder<HTMLTableColElement, 'colgroup'>; | ||
datalist: TypedHTMLBuilder<HTMLDataListElement, 'datalist'>; | ||
dd: TypedHTMLBuilder<HTMLElement, 'dd'>; | ||
del: TypedHTMLBuilder<HTMLModElement, 'del'>; | ||
dfn: TypedHTMLBuilder<HTMLElement, 'dfn'>; | ||
dir: TypedHTMLBuilder<HTMLDirectoryElement, 'dir'>; | ||
div: TypedHTMLBuilder<HTMLDivElement, 'div'>; | ||
dl: TypedHTMLBuilder<HTMLDListElement, 'dl'>; | ||
dt: TypedHTMLBuilder<HTMLElement, 'dt'>; | ||
em: TypedHTMLBuilder<HTMLElement, 'em'>; | ||
embed: TypedHTMLBuilder<HTMLEmbedElement, 'embed'>; | ||
fieldset: TypedHTMLBuilder<HTMLFieldSetElement, 'fieldset'>; | ||
figcaption: TypedHTMLBuilder<HTMLElement, 'figcaption'>; | ||
figure: TypedHTMLBuilder<HTMLElement, 'figure'>; | ||
font: TypedHTMLBuilder<HTMLFontElement, 'font'>; | ||
footer: TypedHTMLBuilder<HTMLElement, 'footer'>; | ||
form: TypedHTMLBuilder<HTMLFormElement, 'form'>; | ||
frame: TypedHTMLBuilder<HTMLFrameElement, 'frame'>; | ||
frameset: TypedHTMLBuilder<HTMLFrameSetElement, 'frameset'>; | ||
h1: TypedHTMLBuilder<HTMLHeadingElement, 'h1'>; | ||
h2: TypedHTMLBuilder<HTMLHeadingElement, 'h2'>; | ||
h3: TypedHTMLBuilder<HTMLHeadingElement, 'h3'>; | ||
h4: TypedHTMLBuilder<HTMLHeadingElement, 'h4'>; | ||
h5: TypedHTMLBuilder<HTMLHeadingElement, 'h5'>; | ||
h6: TypedHTMLBuilder<HTMLHeadingElement, 'h6'>; | ||
head: TypedHTMLBuilder<HTMLHeadElement, 'head'>; | ||
header: TypedHTMLBuilder<HTMLElement, 'header'>; | ||
hgroup: TypedHTMLBuilder<HTMLElement, 'hgroup'>; | ||
hr: TypedHTMLBuilder<HTMLHRElement, 'hr'>; | ||
html: TypedHTMLBuilder<HTMLHtmlElement, 'html'>; | ||
i: TypedHTMLBuilder<HTMLElement, 'i'>; | ||
iframe: TypedHTMLBuilder<HTMLIFrameElement, 'iframe'>; | ||
img: TypedHTMLBuilder<HTMLImageElement, 'img'>; | ||
input: TypedHTMLBuilder<HTMLInputElement, 'input'>; | ||
ins: TypedHTMLBuilder<HTMLModElement, 'ins'>; | ||
isindex: TypedHTMLBuilder<HTMLUnknownElement, 'isindex'>; | ||
kbd: TypedHTMLBuilder<HTMLElement, 'kbd'>; | ||
keygen: TypedHTMLBuilder<HTMLElement, 'keygen'>; | ||
label: TypedHTMLBuilder<HTMLLabelElement, 'label'>; | ||
legend: TypedHTMLBuilder<HTMLLegendElement, 'legend'>; | ||
li: TypedHTMLBuilder<HTMLLIElement, 'li'>; | ||
link: TypedHTMLBuilder<HTMLLinkElement, 'link'>; | ||
listing: TypedHTMLBuilder<HTMLPreElement, 'listing'>; | ||
map: TypedHTMLBuilder<HTMLMapElement, 'map'>; | ||
mark: TypedHTMLBuilder<HTMLElement, 'mark'>; | ||
marquee: TypedHTMLBuilder<HTMLMarqueeElement, 'marquee'>; | ||
menu: TypedHTMLBuilder<HTMLMenuElement, 'menu'>; | ||
meta: TypedHTMLBuilder<HTMLMetaElement, 'meta'>; | ||
meter: TypedHTMLBuilder<HTMLMeterElement, 'meter'>; | ||
nav: TypedHTMLBuilder<HTMLElement, 'nav'>; | ||
nextid: TypedHTMLBuilder<HTMLUnknownElement, 'nextid'>; | ||
nobr: TypedHTMLBuilder<HTMLElement, 'nobr'>; | ||
noframes: TypedHTMLBuilder<HTMLElement, 'noframes'>; | ||
noscript: TypedHTMLBuilder<HTMLElement, 'noscript'>; | ||
object: TypedHTMLBuilder<HTMLObjectElement, 'object'>; | ||
ol: TypedHTMLBuilder<HTMLOListElement, 'ol'>; | ||
optgroup: TypedHTMLBuilder<HTMLOptGroupElement, 'optgroup'>; | ||
option: TypedHTMLBuilder<HTMLOptionElement, 'option'>; | ||
p: TypedHTMLBuilder<HTMLParagraphElement, 'p'>; | ||
param: TypedHTMLBuilder<HTMLParamElement, 'param'>; | ||
picture: TypedHTMLBuilder<HTMLPictureElement, 'picture'>; | ||
plaintext: TypedHTMLBuilder<HTMLElement, 'plaintext'>; | ||
pre: TypedHTMLBuilder<HTMLPreElement, 'pre'>; | ||
progress: TypedHTMLBuilder<HTMLProgressElement, 'progress'>; | ||
q: TypedHTMLBuilder<HTMLQuoteElement, 'q'>; | ||
rt: TypedHTMLBuilder<HTMLElement, 'rt'>; | ||
ruby: TypedHTMLBuilder<HTMLElement, 'ruby'>; | ||
s: TypedHTMLBuilder<HTMLElement, 's'>; | ||
samp: TypedHTMLBuilder<HTMLElement, 'samp'>; | ||
script: TypedHTMLBuilder<HTMLScriptElement, 'script'>; | ||
section: TypedHTMLBuilder<HTMLElement, 'section'>; | ||
select: TypedHTMLBuilder<HTMLSelectElement, 'select'>; | ||
small: TypedHTMLBuilder<HTMLElement, 'small'>; | ||
source: TypedHTMLBuilder<HTMLSourceElement, 'source'>; | ||
span: TypedHTMLBuilder<HTMLSpanElement, 'span'>; | ||
strike: TypedHTMLBuilder<HTMLElement, 'strike'>; | ||
strong: TypedHTMLBuilder<HTMLElement, 'strong'>; | ||
style: TypedHTMLBuilder<HTMLStyleElement, 'style'>; | ||
sub: TypedHTMLBuilder<HTMLElement, 'sub'>; | ||
sup: TypedHTMLBuilder<HTMLElement, 'sup'>; | ||
table: TypedHTMLBuilder<HTMLTableElement, 'table'>; | ||
tbody: TypedHTMLBuilder<HTMLTableSectionElement, 'tbody'>; | ||
td: TypedHTMLBuilder<HTMLTableDataCellElement, 'td'>; | ||
template: TypedHTMLBuilder<HTMLTemplateElement, 'template'>; | ||
textarea: TypedHTMLBuilder<HTMLTextAreaElement, 'textarea'>; | ||
tfoot: TypedHTMLBuilder<HTMLTableSectionElement, 'tfoot'>; | ||
th: TypedHTMLBuilder<HTMLTableHeaderCellElement, 'th'>; | ||
thead: TypedHTMLBuilder<HTMLTableSectionElement, 'thead'>; | ||
title: TypedHTMLBuilder<HTMLTitleElement, 'title'>; | ||
tr: TypedHTMLBuilder<HTMLTableRowElement, 'tr'>; | ||
track: TypedHTMLBuilder<HTMLTrackElement, 'track'>; | ||
tt: TypedHTMLBuilder<HTMLElement, 'tt'>; | ||
u: TypedHTMLBuilder<HTMLElement, 'u'>; | ||
ul: TypedHTMLBuilder<HTMLUListElement, 'ul'>; | ||
var: TypedHTMLBuilder<HTMLElement, 'var'>; | ||
video: TypedHTMLBuilder<HTMLVideoElement, 'video'>; | ||
wbr: TypedHTMLBuilder<HTMLElement, 'wbr'>; | ||
xmp: TypedHTMLBuilder<HTMLPreElement, 'xmp'>; | ||
a: TypedHTMLElementBuilder<HTMLAnchorElement, 'a'>; | ||
abbr: TypedHTMLElementBuilder<HTMLElement, 'abbr'>; | ||
acronym: TypedHTMLElementBuilder<HTMLElement, 'acronym'>; | ||
address: TypedHTMLElementBuilder<HTMLElement, 'address'>; | ||
applet: TypedHTMLElementBuilder<HTMLAppletElement, 'applet'>; | ||
area: TypedHTMLElementBuilder<HTMLAreaElement, 'area'>; | ||
article: TypedHTMLElementBuilder<HTMLElement, 'article'>; | ||
aside: TypedHTMLElementBuilder<HTMLElement, 'aside'>; | ||
audio: TypedHTMLElementBuilder<HTMLAudioElement, 'audio'>; | ||
b: TypedHTMLElementBuilder<HTMLElement, 'b'>; | ||
base: TypedHTMLElementBuilder<HTMLBaseElement, 'base'>; | ||
basefont: TypedHTMLElementBuilder<HTMLBaseFontElement, 'basefont'>; | ||
bdo: TypedHTMLElementBuilder<HTMLElement, 'bdo'>; | ||
big: TypedHTMLElementBuilder<HTMLElement, 'big'>; | ||
blockquote: TypedHTMLElementBuilder<HTMLQuoteElement, 'blockquote'>; | ||
body: TypedHTMLElementBuilder<HTMLBodyElement, 'body'>; | ||
br: TypedHTMLElementBuilder<HTMLBRElement, 'br'>; | ||
button: TypedHTMLElementBuilder<HTMLButtonElement, 'button'>; | ||
canvas: TypedHTMLElementBuilder<HTMLCanvasElement, 'canvas'>; | ||
caption: TypedHTMLElementBuilder<HTMLTableCaptionElement, 'caption'>; | ||
center: TypedHTMLElementBuilder<HTMLElement, 'center'>; | ||
cite: TypedHTMLElementBuilder<HTMLElement, 'cite'>; | ||
code: TypedHTMLElementBuilder<HTMLElement, 'code'>; | ||
col: TypedHTMLElementBuilder<HTMLTableColElement, 'col'>; | ||
colgroup: TypedHTMLElementBuilder<HTMLTableColElement, 'colgroup'>; | ||
datalist: TypedHTMLElementBuilder<HTMLDataListElement, 'datalist'>; | ||
dd: TypedHTMLElementBuilder<HTMLElement, 'dd'>; | ||
del: TypedHTMLElementBuilder<HTMLModElement, 'del'>; | ||
dfn: TypedHTMLElementBuilder<HTMLElement, 'dfn'>; | ||
dir: TypedHTMLElementBuilder<HTMLDirectoryElement, 'dir'>; | ||
div: TypedHTMLElementBuilder<HTMLDivElement, 'div'>; | ||
dl: TypedHTMLElementBuilder<HTMLDListElement, 'dl'>; | ||
dt: TypedHTMLElementBuilder<HTMLElement, 'dt'>; | ||
em: TypedHTMLElementBuilder<HTMLElement, 'em'>; | ||
embed: TypedHTMLElementBuilder<HTMLEmbedElement, 'embed'>; | ||
fieldset: TypedHTMLElementBuilder<HTMLFieldSetElement, 'fieldset'>; | ||
figcaption: TypedHTMLElementBuilder<HTMLElement, 'figcaption'>; | ||
figure: TypedHTMLElementBuilder<HTMLElement, 'figure'>; | ||
font: TypedHTMLElementBuilder<HTMLFontElement, 'font'>; | ||
footer: TypedHTMLElementBuilder<HTMLElement, 'footer'>; | ||
form: TypedHTMLElementBuilder<HTMLFormElement, 'form'>; | ||
frame: TypedHTMLElementBuilder<HTMLFrameElement, 'frame'>; | ||
frameset: TypedHTMLElementBuilder<HTMLFrameSetElement, 'frameset'>; | ||
h1: TypedHTMLElementBuilder<HTMLHeadingElement, 'h1'>; | ||
h2: TypedHTMLElementBuilder<HTMLHeadingElement, 'h2'>; | ||
h3: TypedHTMLElementBuilder<HTMLHeadingElement, 'h3'>; | ||
h4: TypedHTMLElementBuilder<HTMLHeadingElement, 'h4'>; | ||
h5: TypedHTMLElementBuilder<HTMLHeadingElement, 'h5'>; | ||
h6: TypedHTMLElementBuilder<HTMLHeadingElement, 'h6'>; | ||
head: TypedHTMLElementBuilder<HTMLHeadElement, 'head'>; | ||
header: TypedHTMLElementBuilder<HTMLElement, 'header'>; | ||
hgroup: TypedHTMLElementBuilder<HTMLElement, 'hgroup'>; | ||
hr: TypedHTMLElementBuilder<HTMLHRElement, 'hr'>; | ||
html: TypedHTMLElementBuilder<HTMLHtmlElement, 'html'>; | ||
i: TypedHTMLElementBuilder<HTMLElement, 'i'>; | ||
iframe: TypedHTMLElementBuilder<HTMLIFrameElement, 'iframe'>; | ||
img: TypedHTMLElementBuilder<HTMLImageElement, 'img'>; | ||
input: TypedHTMLElementBuilder<HTMLInputElement, 'input'>; | ||
ins: TypedHTMLElementBuilder<HTMLModElement, 'ins'>; | ||
isindex: TypedHTMLElementBuilder<HTMLUnknownElement, 'isindex'>; | ||
kbd: TypedHTMLElementBuilder<HTMLElement, 'kbd'>; | ||
keygen: TypedHTMLElementBuilder<HTMLElement, 'keygen'>; | ||
label: TypedHTMLElementBuilder<HTMLLabelElement, 'label'>; | ||
legend: TypedHTMLElementBuilder<HTMLLegendElement, 'legend'>; | ||
li: TypedHTMLElementBuilder<HTMLLIElement, 'li'>; | ||
link: TypedHTMLElementBuilder<HTMLLinkElement, 'link'>; | ||
listing: TypedHTMLElementBuilder<HTMLPreElement, 'listing'>; | ||
map: TypedHTMLElementBuilder<HTMLMapElement, 'map'>; | ||
mark: TypedHTMLElementBuilder<HTMLElement, 'mark'>; | ||
marquee: TypedHTMLElementBuilder<HTMLMarqueeElement, 'marquee'>; | ||
menu: TypedHTMLElementBuilder<HTMLMenuElement, 'menu'>; | ||
meta: TypedHTMLElementBuilder<HTMLMetaElement, 'meta'>; | ||
meter: TypedHTMLElementBuilder<HTMLMeterElement, 'meter'>; | ||
nav: TypedHTMLElementBuilder<HTMLElement, 'nav'>; | ||
nextid: TypedHTMLElementBuilder<HTMLUnknownElement, 'nextid'>; | ||
nobr: TypedHTMLElementBuilder<HTMLElement, 'nobr'>; | ||
noframes: TypedHTMLElementBuilder<HTMLElement, 'noframes'>; | ||
noscript: TypedHTMLElementBuilder<HTMLElement, 'noscript'>; | ||
object: TypedHTMLElementBuilder<HTMLObjectElement, 'object'>; | ||
ol: TypedHTMLElementBuilder<HTMLOListElement, 'ol'>; | ||
optgroup: TypedHTMLElementBuilder<HTMLOptGroupElement, 'optgroup'>; | ||
option: TypedHTMLElementBuilder<HTMLOptionElement, 'option'>; | ||
p: TypedHTMLElementBuilder<HTMLParagraphElement, 'p'>; | ||
param: TypedHTMLElementBuilder<HTMLParamElement, 'param'>; | ||
picture: TypedHTMLElementBuilder<HTMLPictureElement, 'picture'>; | ||
plaintext: TypedHTMLElementBuilder<HTMLElement, 'plaintext'>; | ||
pre: TypedHTMLElementBuilder<HTMLPreElement, 'pre'>; | ||
progress: TypedHTMLElementBuilder<HTMLProgressElement, 'progress'>; | ||
q: TypedHTMLElementBuilder<HTMLQuoteElement, 'q'>; | ||
rt: TypedHTMLElementBuilder<HTMLElement, 'rt'>; | ||
ruby: TypedHTMLElementBuilder<HTMLElement, 'ruby'>; | ||
s: TypedHTMLElementBuilder<HTMLElement, 's'>; | ||
samp: TypedHTMLElementBuilder<HTMLElement, 'samp'>; | ||
script: TypedHTMLElementBuilder<HTMLScriptElement, 'script'>; | ||
section: TypedHTMLElementBuilder<HTMLElement, 'section'>; | ||
select: TypedHTMLElementBuilder<HTMLSelectElement, 'select'>; | ||
small: TypedHTMLElementBuilder<HTMLElement, 'small'>; | ||
source: TypedHTMLElementBuilder<HTMLSourceElement, 'source'>; | ||
span: TypedHTMLElementBuilder<HTMLSpanElement, 'span'>; | ||
strike: TypedHTMLElementBuilder<HTMLElement, 'strike'>; | ||
strong: TypedHTMLElementBuilder<HTMLElement, 'strong'>; | ||
style: TypedHTMLElementBuilder<HTMLStyleElement, 'style'>; | ||
sub: TypedHTMLElementBuilder<HTMLElement, 'sub'>; | ||
sup: TypedHTMLElementBuilder<HTMLElement, 'sup'>; | ||
table: TypedHTMLElementBuilder<HTMLTableElement, 'table'>; | ||
tbody: TypedHTMLElementBuilder<HTMLTableSectionElement, 'tbody'>; | ||
td: TypedHTMLElementBuilder<HTMLTableDataCellElement, 'td'>; | ||
template: TypedHTMLElementBuilder<HTMLTemplateElement, 'template'>; | ||
textarea: TypedHTMLElementBuilder<HTMLTextAreaElement, 'textarea'>; | ||
tfoot: TypedHTMLElementBuilder<HTMLTableSectionElement, 'tfoot'>; | ||
th: TypedHTMLElementBuilder<HTMLTableHeaderCellElement, 'th'>; | ||
thead: TypedHTMLElementBuilder<HTMLTableSectionElement, 'thead'>; | ||
title: TypedHTMLElementBuilder<HTMLTitleElement, 'title'>; | ||
tr: TypedHTMLElementBuilder<HTMLTableRowElement, 'tr'>; | ||
track: TypedHTMLElementBuilder<HTMLTrackElement, 'track'>; | ||
tt: TypedHTMLElementBuilder<HTMLElement, 'tt'>; | ||
u: TypedHTMLElementBuilder<HTMLElement, 'u'>; | ||
ul: TypedHTMLElementBuilder<HTMLUListElement, 'ul'>; | ||
var: TypedHTMLElementBuilder<HTMLElement, 'var'>; | ||
video: TypedHTMLElementBuilder<HTMLVideoElement, 'video'>; | ||
wbr: TypedHTMLElementBuilder<HTMLElement, 'wbr'>; | ||
xmp: TypedHTMLElementBuilder<HTMLPreElement, 'xmp'>; | ||
// custom | ||
custom<T extends TypedHTMLContents<HTMLElement>, U extends HTMLElement, V extends string>(children: T, factory: () => U, identity: V): TypedHTML<V, U, T>; | ||
custom<T extends TypedHTMLElementChildren<HTMLElement>, U extends HTMLElement, V extends string>(children: T, factory: () => U, identity: V): TypedHTMLElement<V, U, T>; | ||
}; | ||
export default TypedHTML; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44963
1120
49