forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
passport-local.d.ts
45 lines (35 loc) · 1.43 KB
/
passport-local.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
// Type definitions for passport-local 1.0.0
// Project: https://github.com/jaredhanson/passport-local
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../passport/passport.d.ts"/>
declare module 'passport-local' {
import passport = require('passport');
import express = require('express');
interface IStrategyOptions {
usernameField?: string;
passwordField?: string;
passReqToCallback?: boolean;
}
interface IStrategyOptionsWithRequest {
usernameField?: string;
passwordField?: string;
passReqToCallback: boolean;
}
interface IVerifyOptions {
message: string;
}
interface VerifyFunctionWithRequest {
(req: express.Request, username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void;
}
interface VerifyFunction {
(username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void;
}
class Strategy implements passport.Strategy {
constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
constructor(options: IStrategyOptions, verify: VerifyFunction);
constructor(verify: VerifyFunction);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}
}