mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
add Profile common interface
This commit is contained in:
+19
-12
@@ -10,18 +10,25 @@ declare module 'passport-facebook' {
|
||||
import passport = require('passport');
|
||||
import express = require('express');
|
||||
|
||||
interface Profile {
|
||||
id:string;
|
||||
provider:string;
|
||||
displayName:string;
|
||||
name:{familyName:string; givenName:string; middleName:string};
|
||||
profileUrl:string;
|
||||
interface Profile extends passport.Profile {
|
||||
gender: string;
|
||||
profileUrl: string;
|
||||
}
|
||||
|
||||
class Strategy implements passport.Strategy{
|
||||
constructor(options:{clientID:string; clientSecret:string; callbackURL:string},
|
||||
verify:(accessToken:string, refreshToken:string, profile:Profile, done:(error:any, user?:any) => void) => void);
|
||||
name: string;
|
||||
authenticate:(req: express.Request, options?: Object) => void;
|
||||
interface IStrategyOption {
|
||||
clientID: string;
|
||||
clientSecret: string;
|
||||
callbackURL: string;
|
||||
|
||||
scopeSeparator?: string;
|
||||
enableProof?: boolean;
|
||||
profileFields?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
class Strategy implements passport.Strategy {
|
||||
constructor(options: IStrategyOption,
|
||||
verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
|
||||
name: string;
|
||||
authenticate: (req: express.Request, options?: Object) => void;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+19
@@ -42,6 +42,24 @@ declare module 'passport' {
|
||||
name?: string;
|
||||
authenticate(req: express.Request, options?: Object): void;
|
||||
}
|
||||
|
||||
interface Profile {
|
||||
provider: string;
|
||||
id: string;
|
||||
displayName: string;
|
||||
name? : {
|
||||
familyName: string;
|
||||
givenName: string;
|
||||
middleName?: string;
|
||||
};
|
||||
emails?: {
|
||||
value: string;
|
||||
type?: string;
|
||||
}[];
|
||||
photos?: {
|
||||
value: string;
|
||||
}[];
|
||||
}
|
||||
}
|
||||
|
||||
declare module Express {
|
||||
@@ -60,3 +78,4 @@ declare module Express {
|
||||
isUnauthenticated(): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user