import type { App } from 'vue'
import { hasRole } from './permission/hasRole'
import { hasPermi } from './permission/hasPermi'
import { setupImageDirective } from './image'

/**
 * 导出指令：v-xxx
 * @methods hasRole 用户权限，用法: v-hasRole
 * @methods hasPermi 按钮权限，用法: v-hasPermi
 * @methods v-image 图片URL处理指令，用法: v-image="imageUrl" 或 v-image:src="imageUrl"
 */
export function setupAuth(app: App<Element>) {
  hasRole(app)
  hasPermi(app)
  setupImageDirective(app)
}
