export * from "./components";
import * as components from "./components";
import * as directives from './directives'

import pkg from "../package.json";
import ViewUI from "view-ui-plus";

export const install = function (app) {
  if (install.installed) return;
  Object.keys(directives).forEach(key => {
    app.directive(key, directives[key]);
  });
  app.use(ViewUI);
  Object.keys(components).forEach((key) => {
    app.component(key, components[key]);
  });
};

export const version = pkg.version;

const API = {
  version,
  install,
  ...components
};

export default API;
