import * as Vue from 'vue' ; type VueAsync = ( ) => Promise < typeof import ( '*.vue' ) > ; type ConfigureVueApp = ( app : Vue . App < Element > ) => void ; /**
 * Convert a hyphenated string to camelCase.
 */ function hyphenToCamelCase ( name ) { return name . replace ( /-(.)/g , ( _match , char ) => { return char . toUpperCase ( ) ; } ) ; } param el returns function convertElementAttributesToPropsMap ( el ) { if ( el . hasAttributes ( ) === false ) { return { } ; } const result = { } ; for ( const attribute of el . attributes ) { const name = hyphenToCamelCase ( attribute . name ) ; result [ name ] = attribute . value ; } return result ; } param tag param factory param configure export function renderAsyncComponent ( tag , factory , configure ? ) { const ac = Vue . defineAsyncComponent ( factory ) ; const elements = document . getElementsByTagName ( tag ) ; for ( const el of elements ) { const props = convertElementAttributesToPropsMap ( el ) ; const app = Vue . createApp ( ac , props ) ; if ( configure ) { configure ( app ) ; } app . mount ( el ) ; } }