const createElement = ( type , classes , children ) : HTMLElement => { const element = document . createElement ( type ) ; classes . forEach ( ( className ) => element . classList . add ( className ) ) ; children . forEach ( ( child ) => element . appendChild ( child ) ) ; return element ; } ; export const createDiv = ( classes , children ) : HTMLDivElement => createElement ( "div" , classes , children ) as HTMLDivElement ; export const createUl = ( classes , children ) : HTMLUListElement => createElement ( "ul" , classes , children ) as HTMLUListElement ; export const createLi = ( classes , textContent ) : HTMLLIElement => { const element = createElement ( "li" , classes , [ ] ) as HTMLLIElement ; element . textContent = textContent ; return element ; } ; export const createSpan = ( classes , textContent ) : HTMLSpanElement => { const element = createElement ( "span" , classes , [ ] ) as HTMLSpanElement ; element . textContent = textContent ; return element ; } ; export const createParagraph = ( classes , textContent ) : HTMLSpanElement => { const element = createElement ( "p" , classes , [ ] ) as HTMLParagraphElement ; element . textContent = textContent ; return element ; } ; export const createImg = ( classes , src , aria ) : HTMLImageElement => { const element = createElement ( "img" , classes , [ ] ) as HTMLImageElement ; element . src = src ; element . alt = aria . alt ; if ( aria . hidden ) { element . setAttribute ( "aria-hidden" , "true" ) ; } return element ; } ;