New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.58 to 0.0.59

package-lock.json

55

dist/typed-dom.js

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

/*! typed-dom v0.0.58 https://github.com/falsandtru/typed-dom | (c) 2017, falsandtru | (Apache-2.0 AND MPL-2.0) License */
/*! typed-dom v0.0.59 https://github.com/falsandtru/typed-dom | (c) 2017, falsandtru | (Apache-2.0 AND MPL-2.0) License */
require = function e(t, n, r) {

@@ -314,17 +314,55 @@ function s(o, u) {

'center',
'circle',
'cite',
'clippath',
'code',
'dd',
'defs',
'desc',
'dfn',
'dt',
'ellipse',
'em',
'feblend',
'fecolormatrix',
'fecomponenttransfer',
'fecomposite',
'feconvolvematrix',
'fediffuselighting',
'fedisplacementmap',
'fedistantlight',
'feflood',
'fefunca',
'fefuncb',
'fefuncg',
'fefuncr',
'fegaussianblur',
'feimage',
'femerge',
'femergenode',
'femorphology',
'feoffset',
'fepointlight',
'fespecularlighting',
'fespotlight',
'fetile',
'feturbulence',
'figcaption',
'figure',
'filter',
'footer',
'foreignobject',
'g',
'header',
'hgroup',
'i',
'image',
'kbd',
'keygen',
'line',
'lineargradient',
'mark',
'marker',
'mask',
'metadata',
'nav',

@@ -334,3 +372,9 @@ 'nobr',

'noscript',
'path',
'pattern',
'plaintext',
'polygon',
'polyline',
'radialgradient',
'rect',
'rt',

@@ -342,2 +386,3 @@ 'ruby',

'small',
'stop',
'strike',

@@ -347,5 +392,13 @@ 'strong',

'sup',
'svg',
'switch',
'symbol',
'text',
'textpath',
'tspan',
'tt',
'u',
'use',
'var',
'view',
'wbr',

@@ -352,0 +405,0 @@ 'create',

4

dist/typed-dom.min.js

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

/*! typed-dom v0.0.58 https://github.com/falsandtru/typed-dom | (c) 2017, falsandtru | (Apache-2.0 AND MPL-2.0) License */
require=function e(t,r,n){function i(c,u){if(!r[c]){if(!t[c]){var a="function"==typeof require&&require;if(!u&&a)return a(c,!0);if(o)return o(c,!0);var l=new Error("Cannot find module '"+c+"'");throw l.code="MODULE_NOT_FOUND",l}var d=r[c]={exports:{}};t[c][0].call(d.exports,function(e){var r=t[c][1][e];return i(r||e)},d,d.exports,e,t,r,n)}return r[c].exports}for(var o="function"==typeof require&&require,c=0;c<n.length;c++)i(n[c]);return i}({1:[function(e,t,r){},{}],2:[function(e,t,r){"use strict";function n(e){var t=e.element;if(null!==t.parentElement&&a.has(t.parentElement))throw new Error("TypedDOM: Cannot add an element used in another typed dom.")}var i=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)c.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return c},c=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(r,"__esModule",{value:!0});var u;!function(e){e.Void="void",e.Text="text",e.Collection="collection",e.Struct="struct"}(u||(u={}));var a=new WeakSet,l=function(){function e(e,t){function r(){for(;e.childNodes.length>0;)e.removeChild(e.firstChild)}function l(e,t){function r(e,t){e.innerHTML=e.innerHTML.replace(/^\s*\$scope(?!\w)/gm,"#"+t),c(e.querySelectorAll("*")).forEach(function(e){return void e.remove()})}if(e.match(/^[\w\-]+$/))return void Object.values(t).map(function(e){return e.element}).forEach(function(t){return t instanceof HTMLStyleElement&&void r(t,e)})}switch(this.element_=e,this.children_=t,this.type=void 0===this.children_?u.Void:"string"==typeof this.children_?u.Text:Array.isArray(this.children_)?u.Collection:u.Struct,this.tag,n(this),a.add(e),this.type){case u.Void:return;case u.Text:return r(),this.children_=document.createTextNode(""),this.element_.appendChild(this.children_),void(this.children=t);case u.Collection:return r(),this.children_=[],this.children=t,void l(this.element_.id,this.children_);case u.Struct:return r(),this.children_=function(e,t){return Object.defineProperties(t,Object.entries(t).reduce(function(t,r){var i=o(r,2),c=i[0],u=i[1];return n(u),e.appendChild(u.element),t[c]={configurable:!0,enumerable:!0,get:function(){return u},set:function(t){var r=u;t!==r&&(t.element_.parentElement===e||n(t),u=t,e.replaceChild(t.element,r.element))}},t},{}))}(this.element_,i({},t)),void l(this.element_.id,this.children_)}}return Object.defineProperty(e.prototype,"element",{get:function(){return this.element_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){switch(this.type){case u.Text:return this.children_.data;default:return this.children_}},set:function(e){var t=this;switch(this.type){case u.Void:return;case u.Text:return void(this.children_.data=e);case u.Collection:return this.children_.reduce(function(e,t){var r=e.indexOf(t);return r>-1?e:(e.splice(r,1),t.element.remove(),e)},c(e)),this.children_=[],e.forEach(function(e,r){e.element_.parentElement===t.element_||n(e),t.children_[r]=e,t.element_.appendChild(e.element)}),void Object.freeze(this.children_);case u.Struct:return void Object.keys(this.children_).forEach(function(r){return t.children_[r]=e[r]})}},enumerable:!0,configurable:!0}),e}();r.El=l},{}],3:[function(e,t,r){"use strict";function n(e,t,r){var n=t();if(e!==n.tagName.toLowerCase())throw new Error('TypedDOM: Tag name must be "'+e+'" but "'+n.tagName.toLowerCase()+'".');return r?(Object.keys(r).forEach(function(e){return void n.setAttribute(e,r[e])}),n):n}Object.defineProperty(r,"__esModule",{value:!0});var i=e("./builder");r.TypedHTML=["a","applet","area","audio","base","basefont","blockquote","body","br","button","canvas","caption","col","colgroup","data","datalist","del","dir","div","dl","embed","fieldset","font","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","hr","html","iframe","img","input","ins","isindex","label","legend","li","link","listing","map","marquee","menu","meta","meter","nextid","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","script","select","source","span","style","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","ul","video","x-ms-webview","xmp","abbr","acronym","address","article","aside","b","bdo","big","center","cite","code","dd","dfn","dt","em","figcaption","figure","footer","header","hgroup","i","kbd","keygen","mark","nav","nobr","noframes","noscript","plaintext","rt","ruby","s","samp","section","small","strike","strong","sub","sup","tt","u","var","wbr","create","any"].reduce(function(e,t){return e[t]="create"===t?function(e,t,n,i){return void 0===t&&(t=function(){return document.createElement(e)}),void 0===n&&(n=function(){return document.createElement(e)}),void 0===i&&(i=function(){return document.createElement(e)}),r.TypedHTML.any(t,n,i,e)}:function(e,r,o,c){switch(void 0===c&&(c=t),c="any"===t?c:t,typeof e){case"undefined":return new i.El(n(c,function(){return document.createElement(c)}),void 0);case"function":return new i.El(n(c,e),void 0);case"string":return new i.El(n(c,r||function(){return document.createElement(c)}),e);case"object":return o="function"==typeof r?r:o||function(){return document.createElement(c)},Object.keys(e).slice(-1).every(function(t){return void 0===t||"object"==typeof e[t]})?new i.El(n(c,o),e):new i.El(n(c,o,e),r===o?void 0:r);default:throw new TypeError("TypedDOM: Invalid arguments: ["+e+", "+r+", "+o+"]")}},e},{})},{"./builder":2}],4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./dom/html");r.default=n.TypedHTML,r.TypedHTML=n.TypedHTML,function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./util/dom"))},{"./dom/html":3,"./util/dom":5}],5:[function(e,t,r){"use strict";function n(e,t,n,i){function c(e){"object"==typeof i&&i.passive&&(e.preventDefault=l.noop),r.currentTargets.set(e,e.currentTarget),n(e)}void 0===i&&(i=!1),e.addEventListener(t,c,o(i));var u=function(){return u=l.noop,void e.removeEventListener(t,c,o(i))};return function(){return void u()}}function i(e,t,r,i){void 0===i&&(i=!1);var o=n(e,t,function(e){o(),r(e)},i);return function(){return void o()}}function o(e){return d?e:"boolean"==typeof e?e:e.capture}var c=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},u=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)c.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return c},a=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(u(arguments[t]));return e};Object.defineProperty(r,"__esModule",{value:!0});var l=e("./noop");r.currentTargets=new WeakMap,r.bind=n,r.once=i,r.delegate=function(e,t,r,o,u){return void 0===u&&(u={}),n(e instanceof Document?e.documentElement:e,r,function(n){var c=n.target.closest(t);c&&a(e.querySelectorAll(t)).filter(function(e){return e===c}).forEach(function(e){return void i(e,r,function(e){o(e)},u)})},c({},u,{capture:!0}))};var d=!1;try{document.createElement("div").addEventListener("test",function(){},{get capture(){return d=!0}})}catch(e){}},{"./noop":6}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.noop=function(){}},{}],"typed-dom":[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./src/export"));var n=e("./src/export");r.default=n.default},{"./src/export":4}]},{},[1,"typed-dom"]);
/*! typed-dom v0.0.59 https://github.com/falsandtru/typed-dom | (c) 2017, falsandtru | (Apache-2.0 AND MPL-2.0) License */
require=function e(t,n,r){function i(c,a){if(!n[c]){if(!t[c]){var u="function"==typeof require&&require;if(!a&&u)return u(c,!0);if(o)return o(c,!0);var l=new Error("Cannot find module '"+c+"'");throw l.code="MODULE_NOT_FOUND",l}var d=n[c]={exports:{}};t[c][0].call(d.exports,function(e){var n=t[c][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[c].exports}for(var o="function"==typeof require&&require,c=0;c<r.length;c++)i(r[c]);return i}({1:[function(e,t,n){},{}],2:[function(e,t,n){"use strict";function r(e){var t=e.element;if(null!==t.parentElement&&u.has(t.parentElement))throw new Error("TypedDOM: Cannot add an element used in another typed dom.")}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return c},c=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(n,"__esModule",{value:!0});var a;!function(e){e.Void="void",e.Text="text",e.Collection="collection",e.Struct="struct"}(a||(a={}));var u=new WeakSet,l=function(){function e(e,t){function n(){for(;e.childNodes.length>0;)e.removeChild(e.firstChild)}function l(e,t){function n(e,t){e.innerHTML=e.innerHTML.replace(/^\s*\$scope(?!\w)/gm,"#"+t),c(e.querySelectorAll("*")).forEach(function(e){return void e.remove()})}if(e.match(/^[\w\-]+$/))return void Object.values(t).map(function(e){return e.element}).forEach(function(t){return t instanceof HTMLStyleElement&&void n(t,e)})}switch(this.element_=e,this.children_=t,this.type=void 0===this.children_?a.Void:"string"==typeof this.children_?a.Text:Array.isArray(this.children_)?a.Collection:a.Struct,this.tag,r(this),u.add(e),this.type){case a.Void:return;case a.Text:return n(),this.children_=document.createTextNode(""),this.element_.appendChild(this.children_),void(this.children=t);case a.Collection:return n(),this.children_=[],this.children=t,void l(this.element_.id,this.children_);case a.Struct:return n(),this.children_=function(e,t){return Object.defineProperties(t,Object.entries(t).reduce(function(t,n){var i=o(n,2),c=i[0],a=i[1];return r(a),e.appendChild(a.element),t[c]={configurable:!0,enumerable:!0,get:function(){return a},set:function(t){var n=a;t!==n&&(t.element_.parentElement===e||r(t),a=t,e.replaceChild(t.element,n.element))}},t},{}))}(this.element_,i({},t)),void l(this.element_.id,this.children_)}}return Object.defineProperty(e.prototype,"element",{get:function(){return this.element_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){switch(this.type){case a.Text:return this.children_.data;default:return this.children_}},set:function(e){var t=this;switch(this.type){case a.Void:return;case a.Text:return void(this.children_.data=e);case a.Collection:return this.children_.reduce(function(e,t){var n=e.indexOf(t);return n>-1?e:(e.splice(n,1),t.element.remove(),e)},c(e)),this.children_=[],e.forEach(function(e,n){e.element_.parentElement===t.element_||r(e),t.children_[n]=e,t.element_.appendChild(e.element)}),void Object.freeze(this.children_);case a.Struct:return void Object.keys(this.children_).forEach(function(n){return t.children_[n]=e[n]})}},enumerable:!0,configurable:!0}),e}();n.El=l},{}],3:[function(e,t,n){"use strict";function r(e,t,n){var r=t();if(e!==r.tagName.toLowerCase())throw new Error('TypedDOM: Tag name must be "'+e+'" but "'+r.tagName.toLowerCase()+'".');return n?(Object.keys(n).forEach(function(e){return void r.setAttribute(e,n[e])}),r):r}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./builder");n.TypedHTML=["a","applet","area","audio","base","basefont","blockquote","body","br","button","canvas","caption","col","colgroup","data","datalist","del","dir","div","dl","embed","fieldset","font","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","hr","html","iframe","img","input","ins","isindex","label","legend","li","link","listing","map","marquee","menu","meta","meter","nextid","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","script","select","source","span","style","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","ul","video","x-ms-webview","xmp","abbr","acronym","address","article","aside","b","bdo","big","center","circle","cite","clippath","code","dd","defs","desc","dfn","dt","ellipse","em","feblend","fecolormatrix","fecomponenttransfer","fecomposite","feconvolvematrix","fediffuselighting","fedisplacementmap","fedistantlight","feflood","fefunca","fefuncb","fefuncg","fefuncr","fegaussianblur","feimage","femerge","femergenode","femorphology","feoffset","fepointlight","fespecularlighting","fespotlight","fetile","feturbulence","figcaption","figure","filter","footer","foreignobject","g","header","hgroup","i","image","kbd","keygen","line","lineargradient","mark","marker","mask","metadata","nav","nobr","noframes","noscript","path","pattern","plaintext","polygon","polyline","radialgradient","rect","rt","ruby","s","samp","section","small","stop","strike","strong","sub","sup","svg","switch","symbol","text","textpath","tspan","tt","u","use","var","view","wbr","create","any"].reduce(function(e,t){return e[t]="create"===t?function(e,t,r,i){return void 0===t&&(t=function(){return document.createElement(e)}),void 0===r&&(r=function(){return document.createElement(e)}),void 0===i&&(i=function(){return document.createElement(e)}),n.TypedHTML.any(t,r,i,e)}:function(e,n,o,c){switch(void 0===c&&(c=t),c="any"===t?c:t,typeof e){case"undefined":return new i.El(r(c,function(){return document.createElement(c)}),void 0);case"function":return new i.El(r(c,e),void 0);case"string":return new i.El(r(c,n||function(){return document.createElement(c)}),e);case"object":return o="function"==typeof n?n:o||function(){return document.createElement(c)},Object.keys(e).slice(-1).every(function(t){return void 0===t||"object"==typeof e[t]})?new i.El(r(c,o),e):new i.El(r(c,o,e),n===o?void 0:n);default:throw new TypeError("TypedDOM: Invalid arguments: ["+e+", "+n+", "+o+"]")}},e},{})},{"./builder":2}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./dom/html");n.default=r.TypedHTML,n.TypedHTML=r.TypedHTML,function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./util/dom"))},{"./dom/html":3,"./util/dom":5}],5:[function(e,t,n){"use strict";function r(e,t,r,i){function c(e){"object"==typeof i&&i.passive&&(e.preventDefault=l.noop),n.currentTargets.set(e,e.currentTarget),r(e)}void 0===i&&(i=!1),e.addEventListener(t,c,o(i));var a=function(){return a=l.noop,void e.removeEventListener(t,c,o(i))};return function(){return void a()}}function i(e,t,n,i){void 0===i&&(i=!1);var o=r(e,t,function(e){o(),n(e)},i);return function(){return void o()}}function o(e){return d?e:"boolean"==typeof e?e:e.capture}var c=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return c},u=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e};Object.defineProperty(n,"__esModule",{value:!0});var l=e("./noop");n.currentTargets=new WeakMap,n.bind=r,n.once=i,n.delegate=function(e,t,n,o,a){return void 0===a&&(a={}),r(e instanceof Document?e.documentElement:e,n,function(r){var c=r.target.closest(t);c&&u(e.querySelectorAll(t)).filter(function(e){return e===c}).forEach(function(e){return void i(e,n,function(e){o(e)},a)})},c({},a,{capture:!0}))};var d=!1;try{document.createElement("div").addEventListener("test",function(){},{get capture(){return d=!0}})}catch(e){}},{"./noop":6}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.noop=function(){}},{}],"typed-dom":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./src/export"));var r=e("./src/export");n.default=r.default},{"./src/export":4}]},{},[1,"typed-dom"]);
{
"name": "typed-dom",
"version": "0.0.58",
"version": "0.0.59",
"description": "Static typed dom component builder.",

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

"run-sequence": "^2.2.0",
"spica": "0.0.112",
"spica": "0.0.113",
"tsify": "^3.0.3",
"typescript": "2.6.0-dev.20171007",
"typescript": "2.6.0-dev.20171018",
"vinyl-buffer": "^1.0.0",

@@ -65,0 +65,0 @@ "vinyl-source-stream": "^1.1.0",

@@ -5,9 +5,9 @@ # typed-dom

Static typed dom component builder.
Static typed DOM component builder.
**Visualize** dom structures and **Assist** dom access by static types of TypeScript.
**Visualize** DOM structures and **Assist** DOM access by static types of TypeScript.
## Usage
Build a typed dom object.
Build a typed DOM object.

@@ -37,3 +37,3 @@ ```ts

// Note: TypedHTMLElement type is defined as follows in index.d.ts.
// Note: TypedHTMLElement type is defined as follows.
export interface TypedHTMLElement<

@@ -54,3 +54,3 @@ T extends string,

namespace TypedHTMLElementChildren {
export type Void = void;
export type Void = undefined;
export type Text = string;

@@ -99,3 +99,3 @@ export type Collection = TypedHTMLElement<string, HTMLElement, any>[];

Use micro dom components to hide and manage the typed dom object.
Use micro DOM components to hide and manage the typed DOM object.

@@ -121,3 +121,3 @@ ```ts

Use dom components to manage the micro dom components.
Use DOM components to manage the micro DOM components.

@@ -142,1 +142,5 @@ ```ts

```
## Dependency
- unassert (in compiling source code)

@@ -25,7 +25,7 @@ type ElChildrenType =

const memory = new WeakSet<HTMLElement>();
const memory = new WeakSet<Element>();
export class El<
T extends string,
E extends HTMLElement,
E extends Element,
C extends ElChildren

@@ -85,3 +85,3 @@ > {

function observe<C extends ElChildren.Struct>(element: HTMLElement, children: C): C {
function observe<C extends ElChildren.Struct>(element: Element, children: C): C {
return Object.defineProperties(

@@ -152,3 +152,3 @@ children,

.forEach((child, i) => {
child.element_.parentElement === this.element_ || void throwErrorIfNotUsable(child);
child.element_.parentElement as Element === this.element_ || void throwErrorIfNotUsable(child);
this.children_![i] = child;

@@ -173,5 +173,5 @@ void this.element_.appendChild(child.element);

function throwErrorIfNotUsable({ element }: El<string, HTMLElement, any>): void {
function throwErrorIfNotUsable({ element }: El<string, Element, any>): void {
if (element.parentElement === null || !memory.has(element.parentElement)) return;
throw new Error(`TypedDOM: Cannot add an element used in another typed dom.`);
}
import { El, ElChildren } from './builder';
interface ElBuilder<T extends string, E extends HTMLElement = HTMLElement> {
interface ElBuilder<T extends string, E extends Element> {
(factory?: () => E): El<T, E, undefined>; <C extends ElChildren>

@@ -11,51 +11,6 @@ (children: C, factory?: () => E): El<T, E, C>;

export const TypedHTML: {
// lib.dom.d.ts
[K in keyof HTMLElementTagNameMap]: ElBuilder<K, HTMLElementTagNameMap[K]>;
} & {
// other
abbr: ElBuilder<'abbr'>;
acronym: ElBuilder<'acronym'>;
address: ElBuilder<'address'>;
article: ElBuilder<'article'>;
aside: ElBuilder<'aside'>;
b: ElBuilder<'b'>;
bdo: ElBuilder<'bdo'>;
big: ElBuilder<'big'>;
center: ElBuilder<'center'>;
cite: ElBuilder<'cite'>;
code: ElBuilder<'code'>;
dd: ElBuilder<'dd'>;
dfn: ElBuilder<'dfn'>;
dt: ElBuilder<'dt'>;
em: ElBuilder<'em'>;
figcaption: ElBuilder<'figcaption'>;
figure: ElBuilder<'figure'>;
footer: ElBuilder<'footer'>;
header: ElBuilder<'header'>;
hgroup: ElBuilder<'hgroup'>;
i: ElBuilder<'i'>;
kbd: ElBuilder<'kbd'>;
keygen: ElBuilder<'keygen'>;
mark: ElBuilder<'mark'>;
nav: ElBuilder<'nav'>;
nobr: ElBuilder<'nobr'>;
noframes: ElBuilder<'noframes'>;
noscript: ElBuilder<'noscript'>;
plaintext: ElBuilder<'plaintext'>;
rt: ElBuilder<'rt'>;
ruby: ElBuilder<'ruby'>;
s: ElBuilder<'s'>;
samp: ElBuilder<'samp'>;
section: ElBuilder<'section'>;
small: ElBuilder<'small'>;
strike: ElBuilder<'strike'>;
strong: ElBuilder<'strong'>;
sub: ElBuilder<'sub'>;
sup: ElBuilder<'sup'>;
tt: ElBuilder<'tt'>;
u: ElBuilder<'u'>;
var: ElBuilder<'var'>;
wbr: ElBuilder<'wbr'>;
// create
[K in keyof ElementTagNameMap]: ElBuilder<K, ElementTagNameMap[K]>;
} & {
create: { <T extends keyof HTMLElementTagNameMap>

@@ -73,3 +28,3 @@ (tag: T, factory?: () => HTMLElementTagNameMap[T]): El<T, HTMLElementTagNameMap[T], undefined>; <T extends keyof HTMLElementTagNameMap, C extends ElChildren = ElChildren>

} = [
// lib.dom.d.ts
// HTMLElement
"a",

@@ -158,46 +113,99 @@ "applet",

"xmp",
// other
'abbr',
'acronym',
'address',
'article',
'aside',
'b',
'bdo',
'big',
'center',
'cite',
'code',
'dd',
'dfn',
'dt',
'em',
'figcaption',
'figure',
'footer',
'header',
'hgroup',
'i',
'kbd',
'keygen',
'mark',
'nav',
'nobr',
'noframes',
'noscript',
'plaintext',
'rt',
'ruby',
's',
'samp',
'section',
'small',
'strike',
'strong',
'sub',
'sup',
'tt',
'u',
'var',
'wbr',
// Element
"abbr",
"acronym",
"address",
"article",
"aside",
"b",
"bdo",
"big",
"center",
"circle",
"cite",
"clippath",
"code",
"dd",
"defs",
"desc",
"dfn",
"dt",
"ellipse",
"em",
"feblend",
"fecolormatrix",
"fecomponenttransfer",
"fecomposite",
"feconvolvematrix",
"fediffuselighting",
"fedisplacementmap",
"fedistantlight",
"feflood",
"fefunca",
"fefuncb",
"fefuncg",
"fefuncr",
"fegaussianblur",
"feimage",
"femerge",
"femergenode",
"femorphology",
"feoffset",
"fepointlight",
"fespecularlighting",
"fespotlight",
"fetile",
"feturbulence",
"figcaption",
"figure",
"filter",
"footer",
"foreignobject",
"g",
"header",
"hgroup",
"i",
"image",
"kbd",
"keygen",
"line",
"lineargradient",
"mark",
"marker",
"mask",
"metadata",
"nav",
"nobr",
"noframes",
"noscript",
"path",
"pattern",
"plaintext",
"polygon",
"polyline",
"radialgradient",
"rect",
"rt",
"ruby",
"s",
"samp",
"section",
"small",
"stop",
"strike",
"strong",
"sub",
"sup",
"svg",
"switch",
"symbol",
"text",
"textpath",
"tspan",
"tt",
"u",
"use",
"var",
"view",
"wbr",
// create

@@ -204,0 +212,0 @@ 'create',

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