param accept param callback param context export const uploadFile = ( accept , callback , context ) : void => { const el = context . createElement ( "input" ) ; el . type = "file" ; el . accept = accept ; el . addEventListener ( "input" , ( e ) => { callback ( ( e . target as HTMLInputElement ) . files ) ; } ) ; context . body . appendChild ( el ) ; el . click ( ) ; el . remove ( ) ; } ;