interface CustomEventConstructor { new ( name , args ? ) : CustomEvent ; } type x = typeof CustomEvent ; let CustomEvent = function < T extends { } > ( name , args ? ) { const event = new Event ( name ) ; if ( args !== undefined ) { Object . assign ( event , args ) ; } return event ; } ; export { CustomEvent } ;