From d0227b9c72434c32139a8b8ad19cf79391fb8bd3 Mon Sep 17 00:00:00 2001 From: SomaticIT Date: Mon, 15 Sep 2014 00:03:57 +0200 Subject: [PATCH] Add definitions for passport-local module --- passport-local/passport-local.d.ts | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 passport-local/passport-local.d.ts diff --git a/passport-local/passport-local.d.ts b/passport-local/passport-local.d.ts new file mode 100644 index 000000000..6b3cbef38 --- /dev/null +++ b/passport-local/passport-local.d.ts @@ -0,0 +1,33 @@ +// Type definitions for passport-local 1.0.0 +// Project: https://github.com/jaredhanson/passport-local +// Definitions by: Maxime LUCE +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'passport-local' { + + import passport = require('passport'); + import express = require('express'); + + interface IStrategyOptions { + usernameField?: string; + passwordField?: string; + } + + interface IVerifyOptions { + message: string; + } + + interface VerifyFunction { + (username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void; + } + + class Strategy implements passport.Strategy { + constructor(options: IStrategyOptions, verify: VerifyFunction); + constructor(verify: VerifyFunction); + + name: string; + authenticate: (req: express.Request, options?: Object) => void; + } +}