import Vue , { PluginFunction } from 'vue' ; import ComponentSettings from './types/ComponentSettings' ; import LibrarySettings from './types/LibrarySettings' ; import configure from './configure' ; export { default as BaseComponent } from './base/Component' ; export interface InstallFunction extends PluginFunction < LibrarySettings > { installed ? : boolean ; } const install = function installVueTailwind ( vueInstance , settings ) { if ( install . installed ) return ; install . installed = true ; vueInstance . prototype . $vueTailwind = true ; if ( ! settings ) { return ; } Object . keys ( settings ) . forEach ( ( componentName ) => { const componentSettings = settings [ componentName ] ; if ( typeof componentSettings === 'function' && typeof componentSettings . extend !== undefined ) { const component = componentSettings ; vueInstance . component ( componentName , configure ( component ) ) ; return ; } const { component , props } = componentSettings as ComponentSettings ; vueInstance . component ( componentName , configure ( component , props ) ) ; } ) ; } ; const plugin = { install , } ; export default plugin ;