forked from feathersjs-ecosystem/authentication-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
43 lines (37 loc) · 1.1 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
declare function feathersAuthClient(config?: feathersAuthClient.Config) : () => void;
declare namespace feathersAuthClient {
export const defaults: Config;
interface Config {
storage?: Storage;
header?: string;
cookie?: string;
storageKey?: string;
jwtStrategy?: string;
path?: string;
entity?: string;
service?: string;
}
interface Credentials {
strategy?: string;
accessToken?: string;
type: string;
[index: string]: any;
}
class Passport {
constructor(app: any, options: Config);
setupSocketListeners(): void;
connected(): Promise<any>;
authenticate(credentials?: Credentials): any;
authenticateSocket(credentials: Credentials, socket: any, emit: any): any;
logoutSocket(socket: any, emit: any): any;
logout(): Promise<any>;
setJWT(data: any): Promise<any>;
getJWT(): Promise<any>;
verifyJWT(token: string): Promise<string>;
payloadIsValid(payload: string): boolean;
getCookie(name: string): string;
clearCookie(name: string): null;
getStorage(storage: any): any;
}
}
export = feathersAuthClient;