[passport-oauth2-refresh] Updated types (#40288)

This commit is contained in:
Brian Torres-Gil
2019-11-11 11:33:14 -08:00
committed by Pranav Senthilnathan
parent 19c417168f
commit 484ad440d4
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -1,13 +1,16 @@
// Type definitions for passport-oauth2-refresh 1.1
// Project: https://github.com/fiznool/passport-oauth2-refresh#readme
// Definitions by: Daphne Smit <https://github.com/daphnesmit>
// Brian Torres-Gil <https://github.com/btorresgil>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Strategy } from 'passport-oauth2';
import { oauth2tokenCallback } from 'oauth';
export function use(name: string | Strategy, strategy?: Strategy): void;
export function has(name: string): boolean;
export function requestNewAccessToken(name: string, refreshToken: string, params: any, done: () => any): any;
export function requestNewAccessToken(name: string, refreshToken: string, done: oauth2tokenCallback): any;
export function requestNewAccessToken(name: string, refreshToken: string, params: any, done: oauth2tokenCallback): any;
@@ -17,4 +17,5 @@ const strategy1: OAuth2Strategy = new OAuth2Strategy(strategyOptions1, verifyFun
use('strategy1', strategy1);
requestNewAccessToken('strategy1', 'exampleRefreshToken', {}, () => {});
requestNewAccessToken('strategy1', 'exampleRefreshToken', (err, accessToken, refreshToken, results) => {});
requestNewAccessToken('strategy1', 'exampleRefreshToken', {}, (err, accessToken, refreshToken, results) => {});