@types/passport-facebook-token
Version:
TypeScript definitions for passport-facebook-token
87 lines (72 loc) • 2.74 kB
Markdown
# Installation
> `npm install --save @types/passport-facebook-token`
# Summary
This package contains type definitions for passport-facebook-token (https://github.com/drudge/passport-facebook-token).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-facebook-token.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-facebook-token/index.d.ts)
````ts
import * as express from "express";
import * as passport from "passport";
declare namespace PassportFacebookToken {
interface StrategyStatic {
new(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest): StrategyInstance;
new(options: StrategyOptions, verify: VerifyFunction): StrategyInstance;
}
interface StrategyInstance {
name: string;
authenticate: (req: express.Request, options?: any) => void;
}
interface ValueObject {
value: string;
}
interface Profile extends passport.Profile {
provider: string;
id: string;
displayName: string;
name: {
familyName: string;
givenName: string;
middleName: string;
};
gender: string;
emails: ValueObject[];
photos: ValueObject[];
_raw: string;
_json: any;
}
interface StrategyOptions {
clientID: string;
clientSecret: string;
authorizationURL?: string | undefined;
tokenURL?: string | undefined;
scopeSeparator?: string | undefined;
enableProof?: boolean | undefined;
profileFields?: string[] | undefined;
fbGraphVersion?: string | undefined;
}
interface StrategyOptionsWithRequest extends StrategyOptions {
passReqToCallback: true;
}
type VerifyFunction = (
accessToken: string,
refreshToken: string,
profile: Profile,
done: (error: any, user?: any, info?: any) => void,
) => void;
type VerifyFunctionWithRequest = (
req: express.Request,
accessToken: string,
refreshToken: string,
profile: Profile,
done: (error: any, user?: any, info?: any) => void,
) => void;
}
declare const PassportFacebookToken: PassportFacebookToken.StrategyStatic;
export = PassportFacebookToken;
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 09:09:39 GMT
* Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/passport](https://npmjs.com/package/@types/passport)
# Credits
These definitions were written by [Ray Martone](https://github.com/rmartone), and [Michael Randolph](https://github.com/mrand01).