Files
DefinitelyTyped/passport-facebook/index.d.ts
2017-02-14 09:21:18 +07:00

62 lines
1.7 KiB
TypeScript

// Type definitions for passport-facebook 2.1.1
// Project: https://github.com/jaredhanson/passport-facebook
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>, Lucas Acosta <https://github.com/lucasmacosta>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="passport"/>
import passport = require('passport');
import express = require('express');
interface Profile extends passport.Profile {
gender: string;
profileUrl: string;
username: string;
_raw: string;
_json: any;
}
export interface AuthenticateOptions extends passport.AuthenticateOptions {
authType?: string;
}
interface IStrategyOption {
clientID: string;
clientSecret: string;
callbackURL: string;
scopeSeparator?: string;
enableProof?: boolean;
profileFields?: string[];
}
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;
}
interface VerifyFunctionWithRequest {
(req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void): void;
}
declare class Strategy implements passport.Strategy {
constructor(options: IStrategyOptionWithRequest, verify: VerifyFunctionWithRequest);
constructor(options: IStrategyOption, verify: VerifyFunction);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}