Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typed-dom

Package Overview
Dependencies
Maintainers
1
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-dom - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

src/dom/builder.ts

558

dist/typed-dom.js

@@ -1,2 +0,2 @@

/*! typed-dom v0.0.3 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License (https://opensource.org/licenses/MIT) */
/*! typed-dom v0.0.4 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License (https://opensource.org/licenses/MIT) */
define = typeof define === 'function' && define.amd

@@ -31,3 +31,3 @@ ? define

})();
define('src/builder', [
define('src/dom/builder', [
'require',

@@ -37,4 +37,58 @@ 'exports'

'use strict';
function build(factory, contents) {
if (contents === void 0) {
contents = [];
}
var raw = factory();
void Object.keys(contents).forEach(function (k) {
return void raw.appendChild(contents[k].raw);
});
contents = contents instanceof Array ? Object.freeze(contents) : observe(contents);
return Object.freeze({
raw: raw,
get contents() {
return contents;
},
set contents(cs) {
if (contents instanceof Array) {
cs = Object.freeze(cs);
raw.innerHTML = '';
void cs.forEach(function (c) {
return void raw.appendChild(c.raw);
});
} else {
void Object.keys(cs).forEach(function (k) {
return void raw.replaceChild(cs[k].raw, contents[k].raw);
});
cs = observe(cs);
}
contents = cs;
}
});
function observe(contents) {
return Object.keys(contents).reduce(function (obj, k) {
Object.defineProperty(obj, k, {
get: function () {
return contents[k];
},
set: function (newElt) {
var oldElt = contents[k];
contents[k] = newElt;
raw.replaceChild(newElt.raw, oldElt.raw);
}
});
return obj;
}, {});
}
}
exports.build = build;
});
define('src/dom/html', [
'require',
'exports',
'src/dom/builder'
], function (require, exports, builder_1) {
'use strict';
exports.TypedHTML = {
a: function (children, factory) {
a: function (contents, factory) {
if (factory === void 0) {

@@ -45,5 +99,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
abbr: function (children, factory) {
abbr: function (contents, factory) {
if (factory === void 0) {

@@ -54,5 +108,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
acronym: function (children, factory) {
acronym: function (contents, factory) {
if (factory === void 0) {

@@ -63,5 +117,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
address: function (children, factory) {
address: function (contents, factory) {
if (factory === void 0) {

@@ -72,5 +126,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
applet: function (children, factory) {
applet: function (contents, factory) {
if (factory === void 0) {

@@ -81,5 +135,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
area: function (children, factory) {
area: function (contents, factory) {
if (factory === void 0) {

@@ -90,5 +144,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
audio: function (children, factory) {
audio: function (contents, factory) {
if (factory === void 0) {

@@ -99,5 +153,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
b: function (children, factory) {
b: function (contents, factory) {
if (factory === void 0) {

@@ -108,5 +162,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
base: function (children, factory) {
base: function (contents, factory) {
if (factory === void 0) {

@@ -117,5 +171,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
basefont: function (children, factory) {
basefont: function (contents, factory) {
if (factory === void 0) {

@@ -126,5 +180,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
bdo: function (children, factory) {
bdo: function (contents, factory) {
if (factory === void 0) {

@@ -135,5 +189,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
big: function (children, factory) {
big: function (contents, factory) {
if (factory === void 0) {

@@ -144,5 +198,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
blockquote: function (children, factory) {
blockquote: function (contents, factory) {
if (factory === void 0) {

@@ -153,5 +207,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
body: function (children, factory) {
body: function (contents, factory) {
if (factory === void 0) {

@@ -162,5 +216,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
br: function (children, factory) {
br: function (contents, factory) {
if (factory === void 0) {

@@ -171,5 +225,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
button: function (children, factory) {
button: function (contents, factory) {
if (factory === void 0) {

@@ -180,5 +234,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
canvas: function (children, factory) {
canvas: function (contents, factory) {
if (factory === void 0) {

@@ -189,5 +243,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
caption: function (children, factory) {
caption: function (contents, factory) {
if (factory === void 0) {

@@ -198,5 +252,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
center: function (children, factory) {
center: function (contents, factory) {
if (factory === void 0) {

@@ -207,5 +261,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
cite: function (children, factory) {
cite: function (contents, factory) {
if (factory === void 0) {

@@ -216,5 +270,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
code: function (children, factory) {
code: function (contents, factory) {
if (factory === void 0) {

@@ -225,5 +279,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
col: function (children, factory) {
col: function (contents, factory) {
if (factory === void 0) {

@@ -234,5 +288,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
colgroup: function (children, factory) {
colgroup: function (contents, factory) {
if (factory === void 0) {

@@ -243,5 +297,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
datalist: function (children, factory) {
datalist: function (contents, factory) {
if (factory === void 0) {

@@ -252,5 +306,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
dd: function (children, factory) {
dd: function (contents, factory) {
if (factory === void 0) {

@@ -261,5 +315,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
del: function (children, factory) {
del: function (contents, factory) {
if (factory === void 0) {

@@ -270,5 +324,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
dfn: function (children, factory) {
dfn: function (contents, factory) {
if (factory === void 0) {

@@ -279,5 +333,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
dir: function (children, factory) {
dir: function (contents, factory) {
if (factory === void 0) {

@@ -288,5 +342,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
div: function (children, factory) {
div: function (contents, factory) {
if (factory === void 0) {

@@ -297,5 +351,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
dl: function (children, factory) {
dl: function (contents, factory) {
if (factory === void 0) {

@@ -306,5 +360,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
dt: function (children, factory) {
dt: function (contents, factory) {
if (factory === void 0) {

@@ -315,5 +369,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
em: function (children, factory) {
em: function (contents, factory) {
if (factory === void 0) {

@@ -324,5 +378,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
embed: function (children, factory) {
embed: function (contents, factory) {
if (factory === void 0) {

@@ -333,5 +387,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
fieldset: function (children, factory) {
fieldset: function (contents, factory) {
if (factory === void 0) {

@@ -342,5 +396,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
font: function (children, factory) {
font: function (contents, factory) {
if (factory === void 0) {

@@ -351,5 +405,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
form: function (children, factory) {
form: function (contents, factory) {
if (factory === void 0) {

@@ -360,5 +414,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
frame: function (children, factory) {
frame: function (contents, factory) {
if (factory === void 0) {

@@ -369,5 +423,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
frameset: function (children, factory) {
frameset: function (contents, factory) {
if (factory === void 0) {

@@ -378,5 +432,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
h1: function (children, factory) {
h1: function (contents, factory) {
if (factory === void 0) {

@@ -387,5 +441,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
h2: function (children, factory) {
h2: function (contents, factory) {
if (factory === void 0) {

@@ -396,5 +450,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
h3: function (children, factory) {
h3: function (contents, factory) {
if (factory === void 0) {

@@ -405,5 +459,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
h4: function (children, factory) {
h4: function (contents, factory) {
if (factory === void 0) {

@@ -414,5 +468,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
h5: function (children, factory) {
h5: function (contents, factory) {
if (factory === void 0) {

@@ -423,5 +477,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
h6: function (children, factory) {
h6: function (contents, factory) {
if (factory === void 0) {

@@ -432,5 +486,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
head: function (children, factory) {
head: function (contents, factory) {
if (factory === void 0) {

@@ -441,5 +495,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
hr: function (children, factory) {
hr: function (contents, factory) {
if (factory === void 0) {

@@ -450,5 +504,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
html: function (children, factory) {
html: function (contents, factory) {
if (factory === void 0) {

@@ -459,5 +513,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
i: function (children, factory) {
i: function (contents, factory) {
if (factory === void 0) {

@@ -468,5 +522,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
iframe: function (children, factory) {
iframe: function (contents, factory) {
if (factory === void 0) {

@@ -477,5 +531,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
img: function (children, factory) {
img: function (contents, factory) {
if (factory === void 0) {

@@ -486,5 +540,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
input: function (children, factory) {
input: function (contents, factory) {
if (factory === void 0) {

@@ -495,5 +549,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
ins: function (children, factory) {
ins: function (contents, factory) {
if (factory === void 0) {

@@ -504,5 +558,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
isindex: function (children, factory) {
isindex: function (contents, factory) {
if (factory === void 0) {

@@ -513,5 +567,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
kbd: function (children, factory) {
kbd: function (contents, factory) {
if (factory === void 0) {

@@ -522,5 +576,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
keygen: function (children, factory) {
keygen: function (contents, factory) {
if (factory === void 0) {

@@ -531,5 +585,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
label: function (children, factory) {
label: function (contents, factory) {
if (factory === void 0) {

@@ -540,5 +594,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
legend: function (children, factory) {
legend: function (contents, factory) {
if (factory === void 0) {

@@ -549,5 +603,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
li: function (children, factory) {
li: function (contents, factory) {
if (factory === void 0) {

@@ -558,5 +612,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
link: function (children, factory) {
link: function (contents, factory) {
if (factory === void 0) {

@@ -567,5 +621,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
listing: function (children, factory) {
listing: function (contents, factory) {
if (factory === void 0) {

@@ -576,5 +630,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
map: function (children, factory) {
map: function (contents, factory) {
if (factory === void 0) {

@@ -585,5 +639,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
marquee: function (children, factory) {
marquee: function (contents, factory) {
if (factory === void 0) {

@@ -594,5 +648,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
menu: function (children, factory) {
menu: function (contents, factory) {
if (factory === void 0) {

@@ -603,5 +657,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
meta: function (children, factory) {
meta: function (contents, factory) {
if (factory === void 0) {

@@ -612,5 +666,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
nextid: function (children, factory) {
nextid: function (contents, factory) {
if (factory === void 0) {

@@ -621,5 +675,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
nobr: function (children, factory) {
nobr: function (contents, factory) {
if (factory === void 0) {

@@ -630,5 +684,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
object: function (children, factory) {
object: function (contents, factory) {
if (factory === void 0) {

@@ -639,5 +693,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
ol: function (children, factory) {
ol: function (contents, factory) {
if (factory === void 0) {

@@ -648,5 +702,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
optgroup: function (children, factory) {
optgroup: function (contents, factory) {
if (factory === void 0) {

@@ -657,5 +711,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
option: function (children, factory) {
option: function (contents, factory) {
if (factory === void 0) {

@@ -666,5 +720,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
p: function (children, factory) {
p: function (contents, factory) {
if (factory === void 0) {

@@ -675,5 +729,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
param: function (children, factory) {
param: function (contents, factory) {
if (factory === void 0) {

@@ -684,5 +738,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
picture: function (children, factory) {
picture: function (contents, factory) {
if (factory === void 0) {

@@ -693,5 +747,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
plaintext: function (children, factory) {
plaintext: function (contents, factory) {
if (factory === void 0) {

@@ -702,5 +756,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
pre: function (children, factory) {
pre: function (contents, factory) {
if (factory === void 0) {

@@ -711,5 +765,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
progress: function (children, factory) {
progress: function (contents, factory) {
if (factory === void 0) {

@@ -720,5 +774,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
q: function (children, factory) {
q: function (contents, factory) {
if (factory === void 0) {

@@ -729,5 +783,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
rt: function (children, factory) {
rt: function (contents, factory) {
if (factory === void 0) {

@@ -738,5 +792,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
ruby: function (children, factory) {
ruby: function (contents, factory) {
if (factory === void 0) {

@@ -747,5 +801,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
s: function (children, factory) {
s: function (contents, factory) {
if (factory === void 0) {

@@ -756,5 +810,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
samp: function (children, factory) {
samp: function (contents, factory) {
if (factory === void 0) {

@@ -765,5 +819,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
script: function (children, factory) {
script: function (contents, factory) {
if (factory === void 0) {

@@ -774,5 +828,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
select: function (children, factory) {
select: function (contents, factory) {
if (factory === void 0) {

@@ -783,5 +837,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
small: function (children, factory) {
small: function (contents, factory) {
if (factory === void 0) {

@@ -792,5 +846,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
source: function (children, factory) {
source: function (contents, factory) {
if (factory === void 0) {

@@ -801,5 +855,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
span: function (children, factory) {
span: function (contents, factory) {
if (factory === void 0) {

@@ -810,5 +864,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
strike: function (children, factory) {
strike: function (contents, factory) {
if (factory === void 0) {

@@ -819,5 +873,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
strong: function (children, factory) {
strong: function (contents, factory) {
if (factory === void 0) {

@@ -828,5 +882,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
style: function (children, factory) {
style: function (contents, factory) {
if (factory === void 0) {

@@ -837,5 +891,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
sub: function (children, factory) {
sub: function (contents, factory) {
if (factory === void 0) {

@@ -846,5 +900,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
sup: function (children, factory) {
sup: function (contents, factory) {
if (factory === void 0) {

@@ -855,5 +909,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
table: function (children, factory) {
table: function (contents, factory) {
if (factory === void 0) {

@@ -864,5 +918,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
tbody: function (children, factory) {
tbody: function (contents, factory) {
if (factory === void 0) {

@@ -873,5 +927,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
td: function (children, factory) {
td: function (contents, factory) {
if (factory === void 0) {

@@ -882,5 +936,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
textarea: function (children, factory) {
textarea: function (contents, factory) {
if (factory === void 0) {

@@ -891,5 +945,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
tfoot: function (children, factory) {
tfoot: function (contents, factory) {
if (factory === void 0) {

@@ -900,5 +954,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
th: function (children, factory) {
th: function (contents, factory) {
if (factory === void 0) {

@@ -909,5 +963,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
thead: function (children, factory) {
thead: function (contents, factory) {
if (factory === void 0) {

@@ -918,5 +972,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
title: function (children, factory) {
title: function (contents, factory) {
if (factory === void 0) {

@@ -927,5 +981,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
tr: function (children, factory) {
tr: function (contents, factory) {
if (factory === void 0) {

@@ -936,5 +990,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
track: function (children, factory) {
track: function (contents, factory) {
if (factory === void 0) {

@@ -945,5 +999,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
tt: function (children, factory) {
tt: function (contents, factory) {
if (factory === void 0) {

@@ -954,5 +1008,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
u: function (children, factory) {
u: function (contents, factory) {
if (factory === void 0) {

@@ -963,5 +1017,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
ul: function (children, factory) {
ul: function (contents, factory) {
if (factory === void 0) {

@@ -972,5 +1026,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
var: function (children, factory) {
var: function (contents, factory) {
if (factory === void 0) {

@@ -981,5 +1035,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
video: function (children, factory) {
video: function (contents, factory) {
if (factory === void 0) {

@@ -990,5 +1044,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
xmp: function (children, factory) {
xmp: function (contents, factory) {
if (factory === void 0) {

@@ -999,5 +1053,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
article: function (children, factory) {
article: function (contents, factory) {
if (factory === void 0) {

@@ -1008,5 +1062,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
aside: function (children, factory) {
aside: function (contents, factory) {
if (factory === void 0) {

@@ -1017,5 +1071,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
nav: function (children, factory) {
nav: function (contents, factory) {
if (factory === void 0) {

@@ -1026,5 +1080,5 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
section: function (children, factory) {
section: function (contents, factory) {
if (factory === void 0) {

@@ -1035,54 +1089,8 @@ factory = function () {

}
return build(factory, children);
return builder_1.build(factory, contents);
},
untyped: function (children, factory) {
return build(factory, children);
untyped: function (contents, factory) {
return builder_1.build(factory, contents);
}
};
function build(factory, children) {
if (children === void 0) {
children = [];
}
var raw = factory();
void Object.keys(children).forEach(function (k) {
return void raw.appendChild(children[k].raw);
});
children = children instanceof Array ? Object.freeze(children) : observe(children);
return Object.freeze({
raw: raw,
get contents() {
return children;
},
set contents(cs) {
if (children instanceof Array) {
void Object.freeze(cs);
raw.innerHTML = '';
void cs.forEach(function (c) {
return void raw.appendChild(c.raw);
});
} else {
void Object.keys(cs).forEach(function (k) {
return void raw.replaceChild(cs[k].raw, children[k].raw);
});
cs = observe(cs);
}
children = cs;
}
});
function observe(children) {
return Object.keys(children).reduce(function (obj, k) {
Object.defineProperty(obj, k, {
get: function () {
return children[k];
},
set: function (newElt) {
var oldElt = children[k];
children[k] = newElt;
raw.replaceChild(newElt.raw, oldElt.raw);
}
});
return obj;
}, {});
}
}
});

@@ -1092,6 +1100,6 @@ define('src/export', [

'exports',
'src/builder'
], function (require, exports, builder_1) {
'src/dom/html'
], function (require, exports, html_1) {
'use strict';
exports.default = builder_1.TypedHTML;
exports.default = html_1.TypedHTML;
});

@@ -1098,0 +1106,0 @@ define('typed-dom', [

@@ -1,2 +0,2 @@

/*! typed-dom v0.0.3 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License (https://opensource.org/licenses/MIT) */
define="function"==typeof define&&define.amd?define:function(){"use strict";var n="typed-dom",e={};return function t(r,u,o){return o?void o.apply(this,u.map(function(n){switch(n){case"require":return"function"==typeof require?require:void 0;case"exports":return-1===r.indexOf("/")?e[r]="undefined"==typeof exports?self[r]=self[r]||{}:exports:e[r]=e.hasOwnProperty(r)?e[r]:{};default:return".d"===n.slice(-2)&&{}||e.hasOwnProperty(n)&&e[n]||"function"==typeof require&&require(n)||self[n]}})):void t(n,r,u)}}(),define("src/builder",["require","exports"],function(n,e){"use strict";function t(n,e){function t(n){return Object.keys(n).reduce(function(e,t){return Object.defineProperty(e,t,{get:function(){return n[t]},set:function(e){var u=n[t];n[t]=e,r.replaceChild(e.raw,u.raw)}}),e},{})}void 0===e&&(e=[]);var r=n();return void Object.keys(e).forEach(function(n){return void r.appendChild(e[n].raw)}),e=e instanceof Array?Object.freeze(e):t(e),Object.freeze({raw:r,get contents(){return e},set contents(n){e instanceof Array?(void Object.freeze(n),r.innerHTML="",void n.forEach(function(n){return void r.appendChild(n.raw)})):(void Object.keys(n).forEach(function(t){return void r.replaceChild(n[t].raw,e[t].raw)}),n=t(n)),e=n}})}e.TypedHTML={a:function(n,e){return void 0===e&&(e=function(){return document.createElement("a")}),t(e,n)},abbr:function(n,e){return void 0===e&&(e=function(){return document.createElement("abbr")}),t(e,n)},acronym:function(n,e){return void 0===e&&(e=function(){return document.createElement("acronym")}),t(e,n)},address:function(n,e){return void 0===e&&(e=function(){return document.createElement("address")}),t(e,n)},applet:function(n,e){return void 0===e&&(e=function(){return document.createElement("applet")}),t(e,n)},area:function(n,e){return void 0===e&&(e=function(){return document.createElement("area")}),t(e,n)},audio:function(n,e){return void 0===e&&(e=function(){return document.createElement("audio")}),t(e,n)},b:function(n,e){return void 0===e&&(e=function(){return document.createElement("b")}),t(e,n)},base:function(n,e){return void 0===e&&(e=function(){return document.createElement("base")}),t(e,n)},basefont:function(n,e){return void 0===e&&(e=function(){return document.createElement("basefont")}),t(e,n)},bdo:function(n,e){return void 0===e&&(e=function(){return document.createElement("bdo")}),t(e,n)},big:function(n,e){return void 0===e&&(e=function(){return document.createElement("big")}),t(e,n)},blockquote:function(n,e){return void 0===e&&(e=function(){return document.createElement("blockquote")}),t(e,n)},body:function(n,e){return void 0===e&&(e=function(){return document.createElement("body")}),t(e,n)},br:function(n,e){return void 0===e&&(e=function(){return document.createElement("br")}),t(e,n)},button:function(n,e){return void 0===e&&(e=function(){return document.createElement("button")}),t(e,n)},canvas:function(n,e){return void 0===e&&(e=function(){return document.createElement("canvas")}),t(e,n)},caption:function(n,e){return void 0===e&&(e=function(){return document.createElement("caption")}),t(e,n)},center:function(n,e){return void 0===e&&(e=function(){return document.createElement("center")}),t(e,n)},cite:function(n,e){return void 0===e&&(e=function(){return document.createElement("cite")}),t(e,n)},code:function(n,e){return void 0===e&&(e=function(){return document.createElement("code")}),t(e,n)},col:function(n,e){return void 0===e&&(e=function(){return document.createElement("col")}),t(e,n)},colgroup:function(n,e){return void 0===e&&(e=function(){return document.createElement("colgroup")}),t(e,n)},datalist:function(n,e){return void 0===e&&(e=function(){return document.createElement("datalist")}),t(e,n)},dd:function(n,e){return void 0===e&&(e=function(){return document.createElement("dd")}),t(e,n)},del:function(n,e){return void 0===e&&(e=function(){return document.createElement("del")}),t(e,n)},dfn:function(n,e){return void 0===e&&(e=function(){return document.createElement("dfn")}),t(e,n)},dir:function(n,e){return void 0===e&&(e=function(){return document.createElement("dir")}),t(e,n)},div:function(n,e){return void 0===e&&(e=function(){return document.createElement("div")}),t(e,n)},dl:function(n,e){return void 0===e&&(e=function(){return document.createElement("dl")}),t(e,n)},dt:function(n,e){return void 0===e&&(e=function(){return document.createElement("dt")}),t(e,n)},em:function(n,e){return void 0===e&&(e=function(){return document.createElement("em")}),t(e,n)},embed:function(n,e){return void 0===e&&(e=function(){return document.createElement("embed")}),t(e,n)},fieldset:function(n,e){return void 0===e&&(e=function(){return document.createElement("fieldset")}),t(e,n)},font:function(n,e){return void 0===e&&(e=function(){return document.createElement("font")}),t(e,n)},form:function(n,e){return void 0===e&&(e=function(){return document.createElement("form")}),t(e,n)},frame:function(n,e){return void 0===e&&(e=function(){return document.createElement("frame")}),t(e,n)},frameset:function(n,e){return void 0===e&&(e=function(){return document.createElement("frameset")}),t(e,n)},h1:function(n,e){return void 0===e&&(e=function(){return document.createElement("h1")}),t(e,n)},h2:function(n,e){return void 0===e&&(e=function(){return document.createElement("h2")}),t(e,n)},h3:function(n,e){return void 0===e&&(e=function(){return document.createElement("h3")}),t(e,n)},h4:function(n,e){return void 0===e&&(e=function(){return document.createElement("h4")}),t(e,n)},h5:function(n,e){return void 0===e&&(e=function(){return document.createElement("h5")}),t(e,n)},h6:function(n,e){return void 0===e&&(e=function(){return document.createElement("h6")}),t(e,n)},head:function(n,e){return void 0===e&&(e=function(){return document.createElement("head")}),t(e,n)},hr:function(n,e){return void 0===e&&(e=function(){return document.createElement("hr")}),t(e,n)},html:function(n,e){return void 0===e&&(e=function(){return document.createElement("html")}),t(e,n)},i:function(n,e){return void 0===e&&(e=function(){return document.createElement("i")}),t(e,n)},iframe:function(n,e){return void 0===e&&(e=function(){return document.createElement("iframe")}),t(e,n)},img:function(n,e){return void 0===e&&(e=function(){return document.createElement("img")}),t(e,n)},input:function(n,e){return void 0===e&&(e=function(){return document.createElement("input")}),t(e,n)},ins:function(n,e){return void 0===e&&(e=function(){return document.createElement("ins")}),t(e,n)},isindex:function(n,e){return void 0===e&&(e=function(){return document.createElement("isindex")}),t(e,n)},kbd:function(n,e){return void 0===e&&(e=function(){return document.createElement("kbd")}),t(e,n)},keygen:function(n,e){return void 0===e&&(e=function(){return document.createElement("keygen")}),t(e,n)},label:function(n,e){return void 0===e&&(e=function(){return document.createElement("label")}),t(e,n)},legend:function(n,e){return void 0===e&&(e=function(){return document.createElement("legend")}),t(e,n)},li:function(n,e){return void 0===e&&(e=function(){return document.createElement("li")}),t(e,n)},link:function(n,e){return void 0===e&&(e=function(){return document.createElement("link")}),t(e,n)},listing:function(n,e){return void 0===e&&(e=function(){return document.createElement("listing")}),t(e,n)},map:function(n,e){return void 0===e&&(e=function(){return document.createElement("map")}),t(e,n)},marquee:function(n,e){return void 0===e&&(e=function(){return document.createElement("marquee")}),t(e,n)},menu:function(n,e){return void 0===e&&(e=function(){return document.createElement("menu")}),t(e,n)},meta:function(n,e){return void 0===e&&(e=function(){return document.createElement("meta")}),t(e,n)},nextid:function(n,e){return void 0===e&&(e=function(){return document.createElement("nextid")}),t(e,n)},nobr:function(n,e){return void 0===e&&(e=function(){return document.createElement("nobr")}),t(e,n)},object:function(n,e){return void 0===e&&(e=function(){return document.createElement("object")}),t(e,n)},ol:function(n,e){return void 0===e&&(e=function(){return document.createElement("ol")}),t(e,n)},optgroup:function(n,e){return void 0===e&&(e=function(){return document.createElement("optgroup")}),t(e,n)},option:function(n,e){return void 0===e&&(e=function(){return document.createElement("option")}),t(e,n)},p:function(n,e){return void 0===e&&(e=function(){return document.createElement("p")}),t(e,n)},param:function(n,e){return void 0===e&&(e=function(){return document.createElement("param")}),t(e,n)},picture:function(n,e){return void 0===e&&(e=function(){return document.createElement("picture")}),t(e,n)},plaintext:function(n,e){return void 0===e&&(e=function(){return document.createElement("plaintext")}),t(e,n)},pre:function(n,e){return void 0===e&&(e=function(){return document.createElement("pre")}),t(e,n)},progress:function(n,e){return void 0===e&&(e=function(){return document.createElement("progress")}),t(e,n)},q:function(n,e){return void 0===e&&(e=function(){return document.createElement("q")}),t(e,n)},rt:function(n,e){return void 0===e&&(e=function(){return document.createElement("rt")}),t(e,n)},ruby:function(n,e){return void 0===e&&(e=function(){return document.createElement("ruby")}),t(e,n)},s:function(n,e){return void 0===e&&(e=function(){return document.createElement("s")}),t(e,n)},samp:function(n,e){return void 0===e&&(e=function(){return document.createElement("samp")}),t(e,n)},script:function(n,e){return void 0===e&&(e=function(){return document.createElement("script")}),t(e,n)},select:function(n,e){return void 0===e&&(e=function(){return document.createElement("select")}),t(e,n)},small:function(n,e){return void 0===e&&(e=function(){return document.createElement("small")}),t(e,n)},source:function(n,e){return void 0===e&&(e=function(){return document.createElement("source")}),t(e,n)},span:function(n,e){return void 0===e&&(e=function(){return document.createElement("span")}),t(e,n)},strike:function(n,e){return void 0===e&&(e=function(){return document.createElement("strike")}),t(e,n)},strong:function(n,e){return void 0===e&&(e=function(){return document.createElement("strong")}),t(e,n)},style:function(n,e){return void 0===e&&(e=function(){return document.createElement("style")}),t(e,n)},sub:function(n,e){return void 0===e&&(e=function(){return document.createElement("sub")}),t(e,n)},sup:function(n,e){return void 0===e&&(e=function(){return document.createElement("sup")}),t(e,n)},table:function(n,e){return void 0===e&&(e=function(){return document.createElement("table")}),t(e,n)},tbody:function(n,e){return void 0===e&&(e=function(){return document.createElement("tbody")}),t(e,n)},td:function(n,e){return void 0===e&&(e=function(){return document.createElement("td")}),t(e,n)},textarea:function(n,e){return void 0===e&&(e=function(){return document.createElement("textarea")}),t(e,n)},tfoot:function(n,e){return void 0===e&&(e=function(){return document.createElement("tfoot")}),t(e,n)},th:function(n,e){return void 0===e&&(e=function(){return document.createElement("th")}),t(e,n)},thead:function(n,e){return void 0===e&&(e=function(){return document.createElement("thead")}),t(e,n)},title:function(n,e){return void 0===e&&(e=function(){return document.createElement("title")}),t(e,n)},tr:function(n,e){return void 0===e&&(e=function(){return document.createElement("tr")}),t(e,n)},track:function(n,e){return void 0===e&&(e=function(){return document.createElement("track")}),t(e,n)},tt:function(n,e){return void 0===e&&(e=function(){return document.createElement("tt")}),t(e,n)},u:function(n,e){return void 0===e&&(e=function(){return document.createElement("u")}),t(e,n)},ul:function(n,e){return void 0===e&&(e=function(){return document.createElement("ul")}),t(e,n)},"var":function(n,e){return void 0===e&&(e=function(){return document.createElement("var")}),t(e,n)},video:function(n,e){return void 0===e&&(e=function(){return document.createElement("video")}),t(e,n)},xmp:function(n,e){return void 0===e&&(e=function(){return document.createElement("xmp")}),t(e,n)},article:function(n,e){return void 0===e&&(e=function(){return document.createElement("article")}),t(e,n)},aside:function(n,e){return void 0===e&&(e=function(){return document.createElement("aside")}),t(e,n)},nav:function(n,e){return void 0===e&&(e=function(){return document.createElement("nav")}),t(e,n)},section:function(n,e){return void 0===e&&(e=function(){return document.createElement("section")}),t(e,n)},untyped:function(n,e){return t(e,n)}}}),define("src/export",["require","exports","src/builder"],function(n,e,t){"use strict";e["default"]=t.TypedHTML}),define("typed-dom",["require","exports","src/export","src/export"],function(n,e,t,r){"use strict";function u(n){for(var t in n)e.hasOwnProperty(t)||(e[t]=n[t])}u(t),e["default"]=r["default"]});
/*! typed-dom v0.0.4 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | MIT License (https://opensource.org/licenses/MIT) */
define="function"==typeof define&&define.amd?define:function(){"use strict";var n="typed-dom",e={};return function t(u,r,i){return i?void i.apply(this,r.map(function(n){switch(n){case"require":return"function"==typeof require?require:void 0;case"exports":return-1===u.indexOf("/")?e[u]="undefined"==typeof exports?self[u]=self[u]||{}:exports:e[u]=e.hasOwnProperty(u)?e[u]:{};default:return".d"===n.slice(-2)&&{}||e.hasOwnProperty(n)&&e[n]||"function"==typeof require&&require(n)||self[n]}})):void t(n,u,r)}}(),define("src/dom/builder",["require","exports"],function(n,e){"use strict";function t(n,e){function t(n){return Object.keys(n).reduce(function(e,t){return Object.defineProperty(e,t,{get:function(){return n[t]},set:function(e){var r=n[t];n[t]=e,u.replaceChild(e.raw,r.raw)}}),e},{})}void 0===e&&(e=[]);var u=n();return void Object.keys(e).forEach(function(n){return void u.appendChild(e[n].raw)}),e=e instanceof Array?Object.freeze(e):t(e),Object.freeze({raw:u,get contents(){return e},set contents(n){e instanceof Array?(n=Object.freeze(n),u.innerHTML="",void n.forEach(function(n){return void u.appendChild(n.raw)})):(void Object.keys(n).forEach(function(t){return void u.replaceChild(n[t].raw,e[t].raw)}),n=t(n)),e=n}})}e.build=t}),define("src/dom/html",["require","exports","src/dom/builder"],function(n,e,t){"use strict";e.TypedHTML={a:function(n,e){return void 0===e&&(e=function(){return document.createElement("a")}),t.build(e,n)},abbr:function(n,e){return void 0===e&&(e=function(){return document.createElement("abbr")}),t.build(e,n)},acronym:function(n,e){return void 0===e&&(e=function(){return document.createElement("acronym")}),t.build(e,n)},address:function(n,e){return void 0===e&&(e=function(){return document.createElement("address")}),t.build(e,n)},applet:function(n,e){return void 0===e&&(e=function(){return document.createElement("applet")}),t.build(e,n)},area:function(n,e){return void 0===e&&(e=function(){return document.createElement("area")}),t.build(e,n)},audio:function(n,e){return void 0===e&&(e=function(){return document.createElement("audio")}),t.build(e,n)},b:function(n,e){return void 0===e&&(e=function(){return document.createElement("b")}),t.build(e,n)},base:function(n,e){return void 0===e&&(e=function(){return document.createElement("base")}),t.build(e,n)},basefont:function(n,e){return void 0===e&&(e=function(){return document.createElement("basefont")}),t.build(e,n)},bdo:function(n,e){return void 0===e&&(e=function(){return document.createElement("bdo")}),t.build(e,n)},big:function(n,e){return void 0===e&&(e=function(){return document.createElement("big")}),t.build(e,n)},blockquote:function(n,e){return void 0===e&&(e=function(){return document.createElement("blockquote")}),t.build(e,n)},body:function(n,e){return void 0===e&&(e=function(){return document.createElement("body")}),t.build(e,n)},br:function(n,e){return void 0===e&&(e=function(){return document.createElement("br")}),t.build(e,n)},button:function(n,e){return void 0===e&&(e=function(){return document.createElement("button")}),t.build(e,n)},canvas:function(n,e){return void 0===e&&(e=function(){return document.createElement("canvas")}),t.build(e,n)},caption:function(n,e){return void 0===e&&(e=function(){return document.createElement("caption")}),t.build(e,n)},center:function(n,e){return void 0===e&&(e=function(){return document.createElement("center")}),t.build(e,n)},cite:function(n,e){return void 0===e&&(e=function(){return document.createElement("cite")}),t.build(e,n)},code:function(n,e){return void 0===e&&(e=function(){return document.createElement("code")}),t.build(e,n)},col:function(n,e){return void 0===e&&(e=function(){return document.createElement("col")}),t.build(e,n)},colgroup:function(n,e){return void 0===e&&(e=function(){return document.createElement("colgroup")}),t.build(e,n)},datalist:function(n,e){return void 0===e&&(e=function(){return document.createElement("datalist")}),t.build(e,n)},dd:function(n,e){return void 0===e&&(e=function(){return document.createElement("dd")}),t.build(e,n)},del:function(n,e){return void 0===e&&(e=function(){return document.createElement("del")}),t.build(e,n)},dfn:function(n,e){return void 0===e&&(e=function(){return document.createElement("dfn")}),t.build(e,n)},dir:function(n,e){return void 0===e&&(e=function(){return document.createElement("dir")}),t.build(e,n)},div:function(n,e){return void 0===e&&(e=function(){return document.createElement("div")}),t.build(e,n)},dl:function(n,e){return void 0===e&&(e=function(){return document.createElement("dl")}),t.build(e,n)},dt:function(n,e){return void 0===e&&(e=function(){return document.createElement("dt")}),t.build(e,n)},em:function(n,e){return void 0===e&&(e=function(){return document.createElement("em")}),t.build(e,n)},embed:function(n,e){return void 0===e&&(e=function(){return document.createElement("embed")}),t.build(e,n)},fieldset:function(n,e){return void 0===e&&(e=function(){return document.createElement("fieldset")}),t.build(e,n)},font:function(n,e){return void 0===e&&(e=function(){return document.createElement("font")}),t.build(e,n)},form:function(n,e){return void 0===e&&(e=function(){return document.createElement("form")}),t.build(e,n)},frame:function(n,e){return void 0===e&&(e=function(){return document.createElement("frame")}),t.build(e,n)},frameset:function(n,e){return void 0===e&&(e=function(){return document.createElement("frameset")}),t.build(e,n)},h1:function(n,e){return void 0===e&&(e=function(){return document.createElement("h1")}),t.build(e,n)},h2:function(n,e){return void 0===e&&(e=function(){return document.createElement("h2")}),t.build(e,n)},h3:function(n,e){return void 0===e&&(e=function(){return document.createElement("h3")}),t.build(e,n)},h4:function(n,e){return void 0===e&&(e=function(){return document.createElement("h4")}),t.build(e,n)},h5:function(n,e){return void 0===e&&(e=function(){return document.createElement("h5")}),t.build(e,n)},h6:function(n,e){return void 0===e&&(e=function(){return document.createElement("h6")}),t.build(e,n)},head:function(n,e){return void 0===e&&(e=function(){return document.createElement("head")}),t.build(e,n)},hr:function(n,e){return void 0===e&&(e=function(){return document.createElement("hr")}),t.build(e,n)},html:function(n,e){return void 0===e&&(e=function(){return document.createElement("html")}),t.build(e,n)},i:function(n,e){return void 0===e&&(e=function(){return document.createElement("i")}),t.build(e,n)},iframe:function(n,e){return void 0===e&&(e=function(){return document.createElement("iframe")}),t.build(e,n)},img:function(n,e){return void 0===e&&(e=function(){return document.createElement("img")}),t.build(e,n)},input:function(n,e){return void 0===e&&(e=function(){return document.createElement("input")}),t.build(e,n)},ins:function(n,e){return void 0===e&&(e=function(){return document.createElement("ins")}),t.build(e,n)},isindex:function(n,e){return void 0===e&&(e=function(){return document.createElement("isindex")}),t.build(e,n)},kbd:function(n,e){return void 0===e&&(e=function(){return document.createElement("kbd")}),t.build(e,n)},keygen:function(n,e){return void 0===e&&(e=function(){return document.createElement("keygen")}),t.build(e,n)},label:function(n,e){return void 0===e&&(e=function(){return document.createElement("label")}),t.build(e,n)},legend:function(n,e){return void 0===e&&(e=function(){return document.createElement("legend")}),t.build(e,n)},li:function(n,e){return void 0===e&&(e=function(){return document.createElement("li")}),t.build(e,n)},link:function(n,e){return void 0===e&&(e=function(){return document.createElement("link")}),t.build(e,n)},listing:function(n,e){return void 0===e&&(e=function(){return document.createElement("listing")}),t.build(e,n)},map:function(n,e){return void 0===e&&(e=function(){return document.createElement("map")}),t.build(e,n)},marquee:function(n,e){return void 0===e&&(e=function(){return document.createElement("marquee")}),t.build(e,n)},menu:function(n,e){return void 0===e&&(e=function(){return document.createElement("menu")}),t.build(e,n)},meta:function(n,e){return void 0===e&&(e=function(){return document.createElement("meta")}),t.build(e,n)},nextid:function(n,e){return void 0===e&&(e=function(){return document.createElement("nextid")}),t.build(e,n)},nobr:function(n,e){return void 0===e&&(e=function(){return document.createElement("nobr")}),t.build(e,n)},object:function(n,e){return void 0===e&&(e=function(){return document.createElement("object")}),t.build(e,n)},ol:function(n,e){return void 0===e&&(e=function(){return document.createElement("ol")}),t.build(e,n)},optgroup:function(n,e){return void 0===e&&(e=function(){return document.createElement("optgroup")}),t.build(e,n)},option:function(n,e){return void 0===e&&(e=function(){return document.createElement("option")}),t.build(e,n)},p:function(n,e){return void 0===e&&(e=function(){return document.createElement("p")}),t.build(e,n)},param:function(n,e){return void 0===e&&(e=function(){return document.createElement("param")}),t.build(e,n)},picture:function(n,e){return void 0===e&&(e=function(){return document.createElement("picture")}),t.build(e,n)},plaintext:function(n,e){return void 0===e&&(e=function(){return document.createElement("plaintext")}),t.build(e,n)},pre:function(n,e){return void 0===e&&(e=function(){return document.createElement("pre")}),t.build(e,n)},progress:function(n,e){return void 0===e&&(e=function(){return document.createElement("progress")}),t.build(e,n)},q:function(n,e){return void 0===e&&(e=function(){return document.createElement("q")}),t.build(e,n)},rt:function(n,e){return void 0===e&&(e=function(){return document.createElement("rt")}),t.build(e,n)},ruby:function(n,e){return void 0===e&&(e=function(){return document.createElement("ruby")}),t.build(e,n)},s:function(n,e){return void 0===e&&(e=function(){return document.createElement("s")}),t.build(e,n)},samp:function(n,e){return void 0===e&&(e=function(){return document.createElement("samp")}),t.build(e,n)},script:function(n,e){return void 0===e&&(e=function(){return document.createElement("script")}),t.build(e,n)},select:function(n,e){return void 0===e&&(e=function(){return document.createElement("select")}),t.build(e,n)},small:function(n,e){return void 0===e&&(e=function(){return document.createElement("small")}),t.build(e,n)},source:function(n,e){return void 0===e&&(e=function(){return document.createElement("source")}),t.build(e,n)},span:function(n,e){return void 0===e&&(e=function(){return document.createElement("span")}),t.build(e,n)},strike:function(n,e){return void 0===e&&(e=function(){return document.createElement("strike")}),t.build(e,n)},strong:function(n,e){return void 0===e&&(e=function(){return document.createElement("strong")}),t.build(e,n)},style:function(n,e){return void 0===e&&(e=function(){return document.createElement("style")}),t.build(e,n)},sub:function(n,e){return void 0===e&&(e=function(){return document.createElement("sub")}),t.build(e,n)},sup:function(n,e){return void 0===e&&(e=function(){return document.createElement("sup")}),t.build(e,n)},table:function(n,e){return void 0===e&&(e=function(){return document.createElement("table")}),t.build(e,n)},tbody:function(n,e){return void 0===e&&(e=function(){return document.createElement("tbody")}),t.build(e,n)},td:function(n,e){return void 0===e&&(e=function(){return document.createElement("td")}),t.build(e,n)},textarea:function(n,e){return void 0===e&&(e=function(){return document.createElement("textarea")}),t.build(e,n)},tfoot:function(n,e){return void 0===e&&(e=function(){return document.createElement("tfoot")}),t.build(e,n)},th:function(n,e){return void 0===e&&(e=function(){return document.createElement("th")}),t.build(e,n)},thead:function(n,e){return void 0===e&&(e=function(){return document.createElement("thead")}),t.build(e,n)},title:function(n,e){return void 0===e&&(e=function(){return document.createElement("title")}),t.build(e,n)},tr:function(n,e){return void 0===e&&(e=function(){return document.createElement("tr")}),t.build(e,n)},track:function(n,e){return void 0===e&&(e=function(){return document.createElement("track")}),t.build(e,n)},tt:function(n,e){return void 0===e&&(e=function(){return document.createElement("tt")}),t.build(e,n)},u:function(n,e){return void 0===e&&(e=function(){return document.createElement("u")}),t.build(e,n)},ul:function(n,e){return void 0===e&&(e=function(){return document.createElement("ul")}),t.build(e,n)},"var":function(n,e){return void 0===e&&(e=function(){return document.createElement("var")}),t.build(e,n)},video:function(n,e){return void 0===e&&(e=function(){return document.createElement("video")}),t.build(e,n)},xmp:function(n,e){return void 0===e&&(e=function(){return document.createElement("xmp")}),t.build(e,n)},article:function(n,e){return void 0===e&&(e=function(){return document.createElement("article")}),t.build(e,n)},aside:function(n,e){return void 0===e&&(e=function(){return document.createElement("aside")}),t.build(e,n)},nav:function(n,e){return void 0===e&&(e=function(){return document.createElement("nav")}),t.build(e,n)},section:function(n,e){return void 0===e&&(e=function(){return document.createElement("section")}),t.build(e,n)},untyped:function(n,e){return t.build(e,n)}}}),define("src/export",["require","exports","src/dom/html"],function(n,e,t){"use strict";e["default"]=t.TypedHTML}),define("typed-dom",["require","exports","src/export","src/export"],function(n,e,t,u){"use strict";function r(n){for(var t in n)e.hasOwnProperty(t)||(e[t]=n[t])}r(t),e["default"]=u["default"]});
{
"name": "typed-dom",
"version": "0.0.3",
"version": "0.0.4",
"description": "Typed html dom structs.",

@@ -5,0 +5,0 @@ "private": false,

@@ -1,1 +0,1 @@

export {TypedHTML as default} from './builder';
export {TypedHTML as default} from './dom/html';

@@ -8,8 +8,9 @@ import TypedHTML from 'typed-dom';

title: TypedHTML.h1(),
content: TypedHTML.p()
content: TypedHTML.p([TypedHTML.a()])
});
assert(struct.raw.nodeName === 'ARTICLE');
assert(struct.contents.title.raw.nodeName === 'H1');
assert(struct.contents.title.raw === struct.raw.firstChild);
assert(struct.contents.title.raw.nodeName === 'H1');
assert(struct.contents.content.raw.nodeName === 'P');
assert(struct.contents.content.raw === struct.raw.lastChild);
});

@@ -24,4 +25,4 @@

};
assert(struct.raw.children[0].nodeName === 'H2');
assert(struct.contents.title.raw === struct.raw.children[0]);
assert(struct.contents.title.raw.nodeName === 'H2');
assert(struct.contents.title.raw === struct.raw.firstChild);
});

@@ -34,4 +35,4 @@

struct.contents.title = TypedHTML.h2();
assert(struct.raw.children[0].nodeName === 'H2');
assert(struct.contents.title.raw === struct.raw.children[0]);
assert(struct.contents.title.raw.nodeName === 'H2');
assert(struct.contents.title.raw === struct.raw.firstChild);
});

@@ -45,7 +46,8 @@

assert(list.raw.nodeName === 'UL');
assert(list.raw.children[0].nodeName === 'LI');
assert(list.contents[0].raw.nodeName === 'LI');
assert(list.contents[0].raw === list.raw.children[0]);
assert(list.raw.children[1].nodeName === 'LI');
assert(list.contents[1].raw.nodeName === 'LI');
assert(list.contents[1].raw === list.raw.children[1]);
assert(list.contents[2] === void 0 && list.raw.children[2] === void 0);
assert(list.contents[2] === void 0);
assert(list.raw.children[2] === void 0);
});

@@ -61,5 +63,6 @@

];
assert(list.raw.children[0].nodeName === 'LI');
assert(list.contents[0].raw.nodeName === 'LI');
assert(list.contents[0].raw === list.raw.children[0]);
assert(list.contents[1] === void 0 && list.raw.children[1] === void 0);
assert(list.contents[1] === void 0);
assert(list.raw.children[1] === void 0);
});

@@ -66,0 +69,0 @@

import TypedHTML, {
TypedHTMLElement,
TypedHTMLElementChildren
TypedHTMLContents
} from 'typed-dom';

@@ -5,0 +4,0 @@

@@ -9,10 +9,10 @@ /**

declare module 'typed-dom' {
export interface TypedHTMLElement<T extends HTMLElement, U extends TypedHTMLElementChildren<HTMLElement>> {
export interface TypedHTML<T extends HTMLElement, U extends TypedHTMLContents<HTMLElement>> {
raw: T;
contents: U;
}
export type TypedHTMLElementChildren<T extends HTMLElement> = void[] | TypedHTMLElement<T, any>[] | { [name: string]: TypedHTMLElement<T, any>; };
interface TypedHTMLElementBuilder<T extends HTMLElement> {
(): TypedHTMLElement<T, void[]>;
<U extends TypedHTMLElementChildren<HTMLElement>>(children: U, factory?: () => T): TypedHTMLElement<T, U>;
export type TypedHTMLContents<T extends HTMLElement> = void[] | TypedHTML<T, any>[] | { [name: string]: TypedHTML<T, any>; };
interface TypedHTMLBuilder<T extends HTMLElement> {
(): TypedHTML<T, void[]>;
<U extends TypedHTMLContents<HTMLElement>>(contents: U, factory?: () => T): TypedHTML<T, U>;
}

@@ -22,118 +22,118 @@

// lib.d.ts
a: TypedHTMLElementBuilder<HTMLAnchorElement>;
abbr: TypedHTMLElementBuilder<HTMLPhraseElement>;
acronym: TypedHTMLElementBuilder<HTMLPhraseElement>;
address: TypedHTMLElementBuilder<HTMLBlockElement>;
applet: TypedHTMLElementBuilder<HTMLAppletElement>;
area: TypedHTMLElementBuilder<HTMLAreaElement>;
audio: TypedHTMLElementBuilder<HTMLAudioElement>;
b: TypedHTMLElementBuilder<HTMLPhraseElement>;
base: TypedHTMLElementBuilder<HTMLBaseElement>;
basefont: TypedHTMLElementBuilder<HTMLBaseFontElement>;
bdo: TypedHTMLElementBuilder<HTMLPhraseElement>;
big: TypedHTMLElementBuilder<HTMLPhraseElement>;
blockquote: TypedHTMLElementBuilder<HTMLBlockElement>;
body: TypedHTMLElementBuilder<HTMLBodyElement>;
br: TypedHTMLElementBuilder<HTMLBRElement>;
button: TypedHTMLElementBuilder<HTMLButtonElement>;
canvas: TypedHTMLElementBuilder<HTMLCanvasElement>;
caption: TypedHTMLElementBuilder<HTMLTableCaptionElement>;
center: TypedHTMLElementBuilder<HTMLBlockElement>;
cite: TypedHTMLElementBuilder<HTMLPhraseElement>;
code: TypedHTMLElementBuilder<HTMLPhraseElement>;
col: TypedHTMLElementBuilder<HTMLTableColElement>;
colgroup: TypedHTMLElementBuilder<HTMLTableColElement>;
datalist: TypedHTMLElementBuilder<HTMLDataListElement>;
dd: TypedHTMLElementBuilder<HTMLDDElement>;
del: TypedHTMLElementBuilder<HTMLModElement>;
dfn: TypedHTMLElementBuilder<HTMLPhraseElement>;
dir: TypedHTMLElementBuilder<HTMLDirectoryElement>;
div: TypedHTMLElementBuilder<HTMLDivElement>;
dl: TypedHTMLElementBuilder<HTMLDListElement>;
dt: TypedHTMLElementBuilder<HTMLDTElement>;
em: TypedHTMLElementBuilder<HTMLPhraseElement>;
embed: TypedHTMLElementBuilder<HTMLEmbedElement>;
fieldset: TypedHTMLElementBuilder<HTMLFieldSetElement>;
font: TypedHTMLElementBuilder<HTMLFontElement>;
form: TypedHTMLElementBuilder<HTMLFormElement>;
frame: TypedHTMLElementBuilder<HTMLFrameElement>;
frameset: TypedHTMLElementBuilder<HTMLFrameSetElement>;
h1: TypedHTMLElementBuilder<HTMLHeadingElement>;
h2: TypedHTMLElementBuilder<HTMLHeadingElement>;
h3: TypedHTMLElementBuilder<HTMLHeadingElement>;
h4: TypedHTMLElementBuilder<HTMLHeadingElement>;
h5: TypedHTMLElementBuilder<HTMLHeadingElement>;
h6: TypedHTMLElementBuilder<HTMLHeadingElement>;
head: TypedHTMLElementBuilder<HTMLHeadElement>;
hr: TypedHTMLElementBuilder<HTMLHRElement>;
html: TypedHTMLElementBuilder<HTMLHtmlElement>;
i: TypedHTMLElementBuilder<HTMLPhraseElement>;
iframe: TypedHTMLElementBuilder<HTMLIFrameElement>;
img: TypedHTMLElementBuilder<HTMLImageElement>;
input: TypedHTMLElementBuilder<HTMLInputElement>;
ins: TypedHTMLElementBuilder<HTMLModElement>;
isindex: TypedHTMLElementBuilder<HTMLIsIndexElement>;
kbd: TypedHTMLElementBuilder<HTMLPhraseElement>;
keygen: TypedHTMLElementBuilder<HTMLBlockElement>;
label: TypedHTMLElementBuilder<HTMLLabelElement>;
legend: TypedHTMLElementBuilder<HTMLLegendElement>;
li: TypedHTMLElementBuilder<HTMLLIElement>;
link: TypedHTMLElementBuilder<HTMLLinkElement>;
listing: TypedHTMLElementBuilder<HTMLBlockElement>;
map: TypedHTMLElementBuilder<HTMLMapElement>;
marquee: TypedHTMLElementBuilder<HTMLMarqueeElement>;
menu: TypedHTMLElementBuilder<HTMLMenuElement>;
meta: TypedHTMLElementBuilder<HTMLMetaElement>;
nextid: TypedHTMLElementBuilder<HTMLNextIdElement>;
nobr: TypedHTMLElementBuilder<HTMLPhraseElement>;
object: TypedHTMLElementBuilder<HTMLObjectElement>;
ol: TypedHTMLElementBuilder<HTMLOListElement>;
optgroup: TypedHTMLElementBuilder<HTMLOptGroupElement>;
option: TypedHTMLElementBuilder<HTMLOptionElement>;
p: TypedHTMLElementBuilder<HTMLParagraphElement>;
param: TypedHTMLElementBuilder<HTMLParamElement>;
picture: TypedHTMLElementBuilder<HTMLPictureElement>;
plaintext: TypedHTMLElementBuilder<HTMLBlockElement>;
pre: TypedHTMLElementBuilder<HTMLPreElement>;
progress: TypedHTMLElementBuilder<HTMLProgressElement>;
q: TypedHTMLElementBuilder<HTMLQuoteElement>;
rt: TypedHTMLElementBuilder<HTMLPhraseElement>;
ruby: TypedHTMLElementBuilder<HTMLPhraseElement>;
s: TypedHTMLElementBuilder<HTMLPhraseElement>;
samp: TypedHTMLElementBuilder<HTMLPhraseElement>;
script: TypedHTMLElementBuilder<HTMLScriptElement>;
select: TypedHTMLElementBuilder<HTMLSelectElement>;
small: TypedHTMLElementBuilder<HTMLPhraseElement>;
source: TypedHTMLElementBuilder<HTMLSourceElement>;
span: TypedHTMLElementBuilder<HTMLSpanElement>;
strike: TypedHTMLElementBuilder<HTMLPhraseElement>;
strong: TypedHTMLElementBuilder<HTMLPhraseElement>;
style: TypedHTMLElementBuilder<HTMLStyleElement>;
sub: TypedHTMLElementBuilder<HTMLPhraseElement>;
sup: TypedHTMLElementBuilder<HTMLPhraseElement>;
table: TypedHTMLElementBuilder<HTMLTableElement>;
tbody: TypedHTMLElementBuilder<HTMLTableSectionElement>;
td: TypedHTMLElementBuilder<HTMLTableDataCellElement>;
textarea: TypedHTMLElementBuilder<HTMLTextAreaElement>;
tfoot: TypedHTMLElementBuilder<HTMLTableSectionElement>;
th: TypedHTMLElementBuilder<HTMLTableHeaderCellElement>;
thead: TypedHTMLElementBuilder<HTMLTableSectionElement>;
title: TypedHTMLElementBuilder<HTMLTitleElement>;
tr: TypedHTMLElementBuilder<HTMLTableRowElement>;
track: TypedHTMLElementBuilder<HTMLTrackElement>;
tt: TypedHTMLElementBuilder<HTMLPhraseElement>;
u: TypedHTMLElementBuilder<HTMLPhraseElement>;
ul: TypedHTMLElementBuilder<HTMLUListElement>;
var: TypedHTMLElementBuilder<HTMLPhraseElement>;
video: TypedHTMLElementBuilder<HTMLVideoElement>;
xmp: TypedHTMLElementBuilder<HTMLBlockElement>;
a: TypedHTMLBuilder<HTMLAnchorElement>;
abbr: TypedHTMLBuilder<HTMLPhraseElement>;
acronym: TypedHTMLBuilder<HTMLPhraseElement>;
address: TypedHTMLBuilder<HTMLBlockElement>;
applet: TypedHTMLBuilder<HTMLAppletElement>;
area: TypedHTMLBuilder<HTMLAreaElement>;
audio: TypedHTMLBuilder<HTMLAudioElement>;
b: TypedHTMLBuilder<HTMLPhraseElement>;
base: TypedHTMLBuilder<HTMLBaseElement>;
basefont: TypedHTMLBuilder<HTMLBaseFontElement>;
bdo: TypedHTMLBuilder<HTMLPhraseElement>;
big: TypedHTMLBuilder<HTMLPhraseElement>;
blockquote: TypedHTMLBuilder<HTMLBlockElement>;
body: TypedHTMLBuilder<HTMLBodyElement>;
br: TypedHTMLBuilder<HTMLBRElement>;
button: TypedHTMLBuilder<HTMLButtonElement>;
canvas: TypedHTMLBuilder<HTMLCanvasElement>;
caption: TypedHTMLBuilder<HTMLTableCaptionElement>;
center: TypedHTMLBuilder<HTMLBlockElement>;
cite: TypedHTMLBuilder<HTMLPhraseElement>;
code: TypedHTMLBuilder<HTMLPhraseElement>;
col: TypedHTMLBuilder<HTMLTableColElement>;
colgroup: TypedHTMLBuilder<HTMLTableColElement>;
datalist: TypedHTMLBuilder<HTMLDataListElement>;
dd: TypedHTMLBuilder<HTMLDDElement>;
del: TypedHTMLBuilder<HTMLModElement>;
dfn: TypedHTMLBuilder<HTMLPhraseElement>;
dir: TypedHTMLBuilder<HTMLDirectoryElement>;
div: TypedHTMLBuilder<HTMLDivElement>;
dl: TypedHTMLBuilder<HTMLDListElement>;
dt: TypedHTMLBuilder<HTMLDTElement>;
em: TypedHTMLBuilder<HTMLPhraseElement>;
embed: TypedHTMLBuilder<HTMLEmbedElement>;
fieldset: TypedHTMLBuilder<HTMLFieldSetElement>;
font: TypedHTMLBuilder<HTMLFontElement>;
form: TypedHTMLBuilder<HTMLFormElement>;
frame: TypedHTMLBuilder<HTMLFrameElement>;
frameset: TypedHTMLBuilder<HTMLFrameSetElement>;
h1: TypedHTMLBuilder<HTMLHeadingElement>;
h2: TypedHTMLBuilder<HTMLHeadingElement>;
h3: TypedHTMLBuilder<HTMLHeadingElement>;
h4: TypedHTMLBuilder<HTMLHeadingElement>;
h5: TypedHTMLBuilder<HTMLHeadingElement>;
h6: TypedHTMLBuilder<HTMLHeadingElement>;
head: TypedHTMLBuilder<HTMLHeadElement>;
hr: TypedHTMLBuilder<HTMLHRElement>;
html: TypedHTMLBuilder<HTMLHtmlElement>;
i: TypedHTMLBuilder<HTMLPhraseElement>;
iframe: TypedHTMLBuilder<HTMLIFrameElement>;
img: TypedHTMLBuilder<HTMLImageElement>;
input: TypedHTMLBuilder<HTMLInputElement>;
ins: TypedHTMLBuilder<HTMLModElement>;
isindex: TypedHTMLBuilder<HTMLIsIndexElement>;
kbd: TypedHTMLBuilder<HTMLPhraseElement>;
keygen: TypedHTMLBuilder<HTMLBlockElement>;
label: TypedHTMLBuilder<HTMLLabelElement>;
legend: TypedHTMLBuilder<HTMLLegendElement>;
li: TypedHTMLBuilder<HTMLLIElement>;
link: TypedHTMLBuilder<HTMLLinkElement>;
listing: TypedHTMLBuilder<HTMLBlockElement>;
map: TypedHTMLBuilder<HTMLMapElement>;
marquee: TypedHTMLBuilder<HTMLMarqueeElement>;
menu: TypedHTMLBuilder<HTMLMenuElement>;
meta: TypedHTMLBuilder<HTMLMetaElement>;
nextid: TypedHTMLBuilder<HTMLNextIdElement>;
nobr: TypedHTMLBuilder<HTMLPhraseElement>;
object: TypedHTMLBuilder<HTMLObjectElement>;
ol: TypedHTMLBuilder<HTMLOListElement>;
optgroup: TypedHTMLBuilder<HTMLOptGroupElement>;
option: TypedHTMLBuilder<HTMLOptionElement>;
p: TypedHTMLBuilder<HTMLParagraphElement>;
param: TypedHTMLBuilder<HTMLParamElement>;
picture: TypedHTMLBuilder<HTMLPictureElement>;
plaintext: TypedHTMLBuilder<HTMLBlockElement>;
pre: TypedHTMLBuilder<HTMLPreElement>;
progress: TypedHTMLBuilder<HTMLProgressElement>;
q: TypedHTMLBuilder<HTMLQuoteElement>;
rt: TypedHTMLBuilder<HTMLPhraseElement>;
ruby: TypedHTMLBuilder<HTMLPhraseElement>;
s: TypedHTMLBuilder<HTMLPhraseElement>;
samp: TypedHTMLBuilder<HTMLPhraseElement>;
script: TypedHTMLBuilder<HTMLScriptElement>;
select: TypedHTMLBuilder<HTMLSelectElement>;
small: TypedHTMLBuilder<HTMLPhraseElement>;
source: TypedHTMLBuilder<HTMLSourceElement>;
span: TypedHTMLBuilder<HTMLSpanElement>;
strike: TypedHTMLBuilder<HTMLPhraseElement>;
strong: TypedHTMLBuilder<HTMLPhraseElement>;
style: TypedHTMLBuilder<HTMLStyleElement>;
sub: TypedHTMLBuilder<HTMLPhraseElement>;
sup: TypedHTMLBuilder<HTMLPhraseElement>;
table: TypedHTMLBuilder<HTMLTableElement>;
tbody: TypedHTMLBuilder<HTMLTableSectionElement>;
td: TypedHTMLBuilder<HTMLTableDataCellElement>;
textarea: TypedHTMLBuilder<HTMLTextAreaElement>;
tfoot: TypedHTMLBuilder<HTMLTableSectionElement>;
th: TypedHTMLBuilder<HTMLTableHeaderCellElement>;
thead: TypedHTMLBuilder<HTMLTableSectionElement>;
title: TypedHTMLBuilder<HTMLTitleElement>;
tr: TypedHTMLBuilder<HTMLTableRowElement>;
track: TypedHTMLBuilder<HTMLTrackElement>;
tt: TypedHTMLBuilder<HTMLPhraseElement>;
u: TypedHTMLBuilder<HTMLPhraseElement>;
ul: TypedHTMLBuilder<HTMLUListElement>;
var: TypedHTMLBuilder<HTMLPhraseElement>;
video: TypedHTMLBuilder<HTMLVideoElement>;
xmp: TypedHTMLBuilder<HTMLBlockElement>;
// sectioning contents
article: TypedHTMLElementBuilder<HTMLElement>;
aside: TypedHTMLElementBuilder<HTMLElement>;
nav: TypedHTMLElementBuilder<HTMLElement>;
section: TypedHTMLElementBuilder<HTMLElement>;
article: TypedHTMLBuilder<HTMLElement>;
aside: TypedHTMLBuilder<HTMLElement>;
nav: TypedHTMLBuilder<HTMLElement>;
section: TypedHTMLBuilder<HTMLElement>;
// untyped
untyped<T extends TypedHTMLElementChildren<HTMLElement>, U extends HTMLElement>(children: T, factory: () => U): TypedHTMLElement<U, T>;
untyped<T extends TypedHTMLContents<HTMLElement>, U extends HTMLElement>(contents: T, factory: () => U): TypedHTML<U, T>;
};
export default TypedHTML;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc