export function html ( tagName , attr = { } , ... children ) { const tag = document . createElement ( tagName ) ; for ( const key in attr ) { if ( key === 'style' ) { const style = attr [ key ] as { [ key ] : { } ; } ; for ( const key in style ) { ( tag . style as any ) [ key ] = style [ key ] ; } } else { ( tag as any ) [ key ] = attr [ key ] ; } } for ( const child of children ) { tag . appendChild ( child ) ; } return tag ; } export function htext ( text ) { return document . createTextNode ( text ) ; }