Typescript DOM helper
DOM helper for Typescript.
The elem
method is powerful for dom generation,
it also has alias called element
.
Install
npm i typescript-domhelper
Powerful element generation
Usage:
; ; ; ;
Powerful typed element generation
The Dom
class api have the same parameters as elem
, but it can specific the type of the return value, it contains all the elements of HTML.
Usage:
; // the type of `myDiv` is HTMLDivElement ; // HTMLImageElement
Relied on the type system of Typescript, you can write code more easily.