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

2.0.5 • Public • Published

Installation

npm install --save @types/passport-bnet

Summary

This package contains type definitions for passport-bnet (https://github.com/Blizzard/passport-bnet#readme).

Details

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

index.d.ts

import {
    _StrategyOptionsBase,
    Strategy as OAuth2Strategy,
    VerifyFunction,
    VerifyFunctionWithRequest,
} from "passport-oauth2";

declare class BnetStrategy extends OAuth2Strategy {
    constructor(options: BnetStrategy.StrategyOptions, verify: VerifyFunction);
    constructor(options: BnetStrategy.StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
}

declare namespace BnetStrategy {
    // passport--bnet accepts any options that passport-oauth2 accepts, but add the option region and makes authorizationURL and tokenURL optional
    interface _BaseBnetOptions extends Partial<_StrategyOptionsBase> {
        clientID: string;
        clientSecret: string;

        region?: string | undefined;
    }

    interface StrategyOptions extends _BaseBnetOptions {
        passReqToCallback?: false | undefined;
    }

    interface StrategyOptionsWithRequest extends _BaseBnetOptions {
        passReqToCallback: true;
    }

    function getHost(region: string): string;

    type Strategy = BnetStrategy;
    const Strategy: typeof BnetStrategy;
}

export = BnetStrategy;

Additional Details

Credits

These definitions were written by Ivan Fernandes.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-bnet

Weekly Downloads

66

Version

2.0.5

License

MIT

Unpacked Size

4.89 kB

Total Files

5

Last publish

Collaborators

  • types