mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
62 lines
1.7 KiB
TypeScript
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;
|
|
}
|