-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
49 lines (40 loc) · 1.25 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
44
45
46
47
48
49
/// <reference types="passport"/>
import { Strategy as PassportStrategy } from "passport-strategy";
import express = require("express");
interface IStrategyOptions {
usernameField?: string | undefined;
passwordField?: string | undefined;
session?: boolean | undefined;
passReqToCallback?: false | undefined;
}
interface IStrategyOptionsWithRequest {
usernameField?: string | undefined;
passwordField?: string | undefined;
session?: boolean | undefined;
passReqToCallback: true;
}
interface IVerifyOptions {
message: string;
}
interface VerifyFunctionWithRequest {
(
req: express.Request,
username: string,
password: string,
done: (error: any, user?: Express.User | false, options?: IVerifyOptions) => void,
): void;
}
interface VerifyFunction {
(
username: string,
password: string,
done: (error: any, user?: Express.User | false, options?: IVerifyOptions) => void,
): void;
}
declare class Strategy extends PassportStrategy {
constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
constructor(options: IStrategyOptions, verify: VerifyFunction);
constructor(verify: VerifyFunction);
name: string;
}
export = Strategy;