0.1.8 • Published 6 months ago

@types/passport-google-oauth2 v0.1.8

Weekly downloads
2,540
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/passport-google-oauth2

Summary

This package contains type definitions for passport-google-oauth2 (https://github.com/mstade/passport-google-oauth2).

Details

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

index.d.ts

// Type definitions for passport-google-oauth2 0.1
// Project: https://github.com/mstade/passport-google-oauth2
// Definitions by: Elliot Blackburn <https://github.com/bluehatbrit>
//                 Mike Francis <https://github.com/mikefrancis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import { Request } from 'express';

export interface StrategyOptions {
  clientID: string;
  clientSecret: string;
  callbackURL: string;
  passReqToCallback?: true | undefined;
  scope?: string[] | string | undefined;
  proxy?: boolean | undefined;
}

export interface StrategyOptionsWithRequest {
  clientID: string;
  clientSecret: string;
  callbackURL: string;
  passReqToCallback: true;
  scope?: string[] | string | undefined;
}

export interface VerifyOptions {
  message: string;
}

export type VerifyCallback = (error: any, user?: any, options?: VerifyOptions) => void;

export type VerifyFunctionWithRequestAndParams = (
  req: Request,
  accessToken: string,
  refreshToken: string,
  params: {
    access_token: string;
    expires_in: number;
    scope: string;
    token_type: 'Bearer';
    id_token: string;
  },
  profile: any,
  done: VerifyCallback,
) => void;

export type VerifyFunctionWithRequest = (
    req: Request,
    accessToken: string,
    refreshToken: string,
    profile: any,
    done: VerifyCallback
) => void;

export type VerifyFunction = (accessToken: string, refreshToken: string, profile: any, done: VerifyCallback) => void;

export class Strategy implements Strategy {
  name: string;
  authenticate: (req: Request, options?: object) => void;

  constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest | VerifyFunctionWithRequestAndParams);
  constructor(options: StrategyOptions, verify: VerifyFunction);
  constructor(verify: VerifyFunction);
}

Additional Details

  • Last updated: Tue, 29 Mar 2022 18:01:51 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by Elliot Blackburn, and Mike Francis.

0.1.8

6 months ago

0.1.7

7 months ago

0.1.6

8 months ago

0.1.5

2 years ago

0.1.4

3 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

7 years ago

0.1.0

7 years ago