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

1.0.40 • Public • Published

Installation

npm install --save @types/passport-twitter

Summary

This package contains type definitions for passport-twitter (https://github.com/jaredhanson/passport-twitter).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-twitter.

index.d.ts

/// <reference types="passport"/>

import passport = require("passport");
import express = require("express");

interface Profile extends passport.Profile {
    gender: string;
    username: string;

    _raw: string;
    _json: any;
    _accessLevel: string;
}

interface IStrategyOptionBase {
    consumerKey: string;
    consumerSecret: string;
    callbackURL: string;

    includeEmail?: boolean | undefined;
    includeStatus?: boolean | undefined;
    includeEntities?: boolean | undefined;

    requestTokenURL?: string | undefined;
    accessTokenURL?: string | undefined;
    userAuthorizationURL?: string | undefined;
    sessionKey?: string | undefined;

    forceLogin?: boolean | undefined;
    screenName?: string | undefined;

    userProfileURL?: string | undefined;
    skipExtendedUserProfile?: boolean | undefined;
}

interface IStrategyOption extends IStrategyOptionBase {
    passReqToCallback?: false | undefined;
}

interface IStrategyOptionWithRequest extends IStrategyOptionBase {
    passReqToCallback: true;
}

declare class Strategy extends passport.Strategy {
    constructor(
        options: IStrategyOption,
        verify: (
            accessToken: string,
            refreshToken: string,
            profile: Profile,
            done: (error: any, user?: any) => void,
        ) => void,
    );
    constructor(
        options: IStrategyOptionWithRequest,
        verify: (
            req: express.Request,
            accessToken: string,
            refreshToken: string,
            profile: Profile,
            done: (error: any, user?: any) => void,
        ) => void,
    );

    name: string;
    authenticate(req: express.Request, options?: Object): void;
}

Additional Details

Credits

These definitions were written by James Roland Cabresos.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-twitter

Weekly Downloads

34,578

Version

1.0.40

License

MIT

Unpacked Size

6.24 kB

Total Files

5

Last publish

Collaborators

  • types