import * as vue from 'vue'; import { Plugin } from 'vue'; import { Router } from 'vue-router'; import { Method, AxiosInstance } from 'axios'; declare module 'vue' { interface ComponentCustomProperties { $hasPermission: (permission: string) => boolean; $isRole: (role: string) => boolean; } } declare module '@vue/runtime-core' { interface ComponentCustomProperties { $hasPermission: (permission: string) => boolean; $isRole: (role: string) => boolean; } } declare const authPlugin: Plugin; interface Redirect { login: string; logout: string; home: string; } interface Endpoint { url: string; method: Method; } interface Token { property: string; type: string; name: string; } interface User { propertyInLogin: string; propertyInFetch: string; propertyRole: string; propertyPermission: string; autoFetch: boolean; } declare type EndpointKey = 'login' | 'logout' | 'user'; interface AuthOptions { router: Router; fetch: AxiosInstance; fullPathRedirect?: boolean; watchLoggedIn?: boolean; redirect: Redirect; local: { endpoints: Record; token: Token; user: User; }; } declare type MetaAuth = boolean | { role: string; permission: string; }; declare const useAuth: (_options?: AuthOptions | undefined) => { login: (args: any) => Promise; logout: (args?: any) => Promise; setToken: (tokenValue: string) => string | undefined; getToken: () => string | undefined; removeToken: () => void; user: vue.ComputedRef; loggedIn: vue.ComputedRef; setUser: (data: any) => void; getRole: () => any; isRole: (role: string) => boolean; getPermissions: () => string[]; hasPermission: (permission: string) => boolean; resetState: () => void; fetchUser: () => Promise; }; declare const useToken: () => { key: string; getToken: () => string | undefined; setToken: (tokenValue: string) => string | undefined; removeToken: () => void; }; declare const DEFAULT_OPTION: { fullPathRedirect: boolean; watchLoggedIn: boolean; redirect: { login: string; logout: string; home: string; }; local: { endpoints: { login: { url: string; method: string; }; logout: { url: string; method: string; }; user: { url: string; method: string; }; }; token: { property: string; type: string; name: string; }; user: { propertyInLogin: string; propertyInFetch: string; propertyRole: string; propertyPermission: string; autoFetch: boolean; }; }; }; export { AuthOptions, DEFAULT_OPTION, Endpoint, EndpointKey, MetaAuth, Redirect, Token, User, authPlugin, useAuth, useToken };