param index param parent export const getChildByIndex = ( index , parent ) : HTMLElement => { if ( index !== null ) { const element = parent . children [ index ] ; if ( element !== null && element instanceof HTMLElement ) { return element ; } } return null ; } ; param tab param container param offset export const isElementOutsideRightEdge = ( tab , container , offset ) => { const tabElement = tab as HTMLElement ; const containerElement = container as HTMLElement ; const tabDistance = tabElement . offsetLeft + tabElement . offsetWidth ; return tabDistance > containerElement . offsetWidth + offset ; } ; param tab param offset export const isElementOutsideLeftEdge = ( tab , offset ) => { const tabElement = tab as HTMLElement ; const tabDistance = tabElement . offsetLeft ; return tabDistance < offset ; } ;