Nutmeg Pumpkin Macchiato

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

    2.0.2 • 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

    // Type definitions for passport-bnet 2.0
    // Project: https://github.com/Blizzard/passport-bnet#readme
    // Definitions by: Ivan Fernandes <https://github.com/ivan94>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.3
    
    import { Strategy as OAuth2Strategy, VerifyFunction, VerifyFunctionWithRequest, _StrategyOptionsBase } 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.

    Keywords

    none

    Install

    npm i @types/passport-bnet

    DownloadsWeekly Downloads

    15

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    5.4 kB

    Total Files

    4

    Last publish

    Collaborators

    • types