1
+ import { AxiosResponse , AxiosInstance , AxiosRequestConfig } from 'axios' ;
2
+
3
+ export interface CookieStorageOptions {
4
+ domain ?: string ;
5
+ path ?: string ;
6
+ secure ?: boolean ;
7
+ }
8
+
9
+ export interface ProviderOptions {
10
+ name ?: string ;
11
+ url ?: string ;
12
+ clientId ?: string ;
13
+ authorizationEndpoint ?: string ;
14
+ redirectUri ?: string ;
15
+ requiredUrlParams ?: string [ ] ;
16
+ defaultUrlParams ?: string [ ] ;
17
+ optionalUrlParams ?: string [ ] ;
18
+ scope ?: string [ ] ;
19
+ scopePrefix ?: string ;
20
+ scopeDelimiter ?: string ;
21
+ state ?: string ;
22
+ display ?: string ;
23
+ oauthType ?: string ;
24
+ responseType ?: string ;
25
+ responseParams ?: {
26
+ code ?: string ;
27
+ clientId ?: string ;
28
+ redirectUri ?: string ;
29
+ } ;
30
+ popupOptions ?: {
31
+ width : number ;
32
+ height : number ;
33
+ } ;
34
+ }
35
+
36
+ export declare class VueAuthenticate {
37
+ login ( user : Object ) : Promise < AxiosResponse > ;
38
+ login (
39
+ user : Object ,
40
+ requestOptions : AxiosRequestConfig
41
+ ) : Promise < AxiosResponse > ;
42
+ isAuthenticated ( ) : boolean ;
43
+ getToken ( ) : string ;
44
+ setToken ( token : string | object ) : void ;
45
+ register (
46
+ user : any ,
47
+ requestOptions ?: AxiosRequestConfig
48
+ ) : Promise < AxiosResponse > ;
49
+ logout ( requestOptions ?: AxiosRequestConfig ) : Promise < AxiosResponse > ;
50
+ authenticate (
51
+ provider : string ,
52
+ userData : any ,
53
+ requestOptions ?: AxiosRequestConfig
54
+ ) : Promise < { } > ;
55
+ }
56
+
57
+ export interface AuthenticateOptions {
58
+ baseUrl ?: string ;
59
+ axios ?: AxiosInstance ;
60
+ tokenName ?: string ;
61
+ tokenPrefix ?: string ;
62
+ tokenHeader ?: string ;
63
+ tokenType ?: string ;
64
+ loginUrl ?: string ;
65
+ registerUrl ?: string ;
66
+ logoutUrl ?: string ;
67
+ storageType ?: string ;
68
+ storageNamespace ?: string ;
69
+ cookieStorage ?: CookieStorageOptions ;
70
+ requestDataKey ?: string ;
71
+ responseDataKey ?: string ;
72
+ withCredentials ?: boolean ;
73
+ providers : { [ key : string ] : ProviderOptions } ;
74
+ }
75
+
76
+ declare module "vue/types/vue" {
77
+ interface Vue {
78
+ $auth : VueAuthenticate ;
79
+ }
80
+ }
0 commit comments