@types/passport-facebook-token
TypeScript icon, indicating that this package has built-in type declarations

0.4.38 • Public • Published

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

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

Credits

These definitions were written by Ray Martone, and Michael Randolph.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-facebook-token

Weekly Downloads

2,962

Version

0.4.38

License

MIT

Unpacked Size

6.85 kB

Total Files

5

Last publish

Collaborators

  • types