From f618ed02a28060cb3d979b00f12751d644332ab9 Mon Sep 17 00:00:00 2001 From: pathanin Date: Tue, 14 Feb 2017 08:52:34 +0700 Subject: [PATCH] Seperate method between passReqToCallback and normal way --- passport-facebook/index.d.ts | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index d0843f6d3d..b9505f6e1f 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -31,12 +31,31 @@ interface IStrategyOption { scopeSeparator?: string; enableProof?: boolean; profileFields?: string[]; - passReqToCallback?: boolean; +} + +interface IStrategyOptionWithRequest { + clientID: string; + clientSecret: string; + callbackURL: string; + + scopeSeparator?: string; + enableProof?: boolean; + profileFields?: string[]; + passReqToCallback: boolean; +} + +interface VerifyFunction { + (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; +} + +interface VerifyFunctionWithRequest { + (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; } declare class Strategy implements passport.Strategy { - constructor(options: IStrategyOption, - verify: (req?: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void); - name: string; + constructor(options: IStrategyOptionWithRequest, verify: VerifyFunctionWithRequest); + constructor(options: IStrategyOption, verify: VerifyFunction); + + name: string; authenticate: (req: express.Request, options?: Object) => void; }