2.0.5 • Published 6 months ago

@types/passport-bnet v2.0.5

Weekly downloads
46
License
MIT
Repository
github
Last release
6 months ago

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.

2.0.3

8 months ago

2.0.5

6 months ago

2.0.4

7 months ago

2.0.2

3 years ago

2.0.1

5 years ago

2.0.0

5 years ago