-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassport.d.ts
42 lines (38 loc) · 1.16 KB
/
passport.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
declare module 'floof-passport' {
/**
* A JSON-safe value.
*/
type Serialized = string | number;
/**
* A serialization scheme for representing users as JSON-serializable identifiers.
*/
interface UserSerialization {
/**
* Serializes a user object to some identifier.
* May be async.
*/
serialize(user: any): Serialized;
/**
* Retrieves a user object for a previously-serialized identifier.
* May be async.
*/
deserialize(ser: Serialized): any;
}
/**
* The floof-passport plugin. Register an instance with FloofBall#plugin.
*/
export class PassportPlugin {
/**
* Initializes the plugin.
* @param session Whether to use persistent login sessions or not. Defaults to false.
* @param userSerialization A user serialization scheme. Required if login sessions are enabled.
*/
constructor(session?: boolean, userSerialization?: UserSerialization);
/**
* Registers a passport strategy.
* @param strategy The strategy to be registered.
* @returns This PassportPlugin instance, for the sake of chaining.
*/
use(strategy: any): PassportPlugin;
}
}