npm.io
2.0.5 • Published 2 years ago

@types/passport-bnet

Licence
MIT
Version
2.0.5
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

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.