import { App, Directive } from 'vue'
import permissions from './modules/permissions'
import copy from './modules/copy'

const directivesList: { [key: string]: Directive } = {
  permissions,
  copy
}

const directives = {
  install: function (app: App<Element>) {
    Object.keys(directivesList).forEach((key) => {
      app.directive(key, directivesList[key])
    })
  }
}

export function setupDirectives(app: App<Element>) {
  app.use(directives)
}
