2.0.4 • Published 6 months ago

@types/passport-spotify v2.0.4

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

Installation

npm install --save @types/passport-spotify

Summary

This package contains type definitions for passport-spotify (https://github.com/jmperez/passport-spotify#readme).

Details

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

index.d.ts

// Type definitions for passport-spotify 2.0
// Project: https://github.com/jmperez/passport-spotify#readme
// Definitions by: Rishi Kodali <https://github.com/rishikodali>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import { Request } from 'express';

export interface Profile {
    provider: string;
    id: string;
    username: string;
    displayName: string;
    profileUrl: string | null;
    photos: [string] | null;
    country: string;
    followers: number | null;
    product: string | null;
    emails?: [{ value: string; type: null }] | undefined;
    _raw: string;
    _json: any;
}

export interface _StrategyOptionsBase {
    clientID: string;
    clientSecret: string;
    callbackURL: string;
    scope?: string[] | undefined;
    authorizationURL?: string | undefined;
    tokenURL?: string | undefined;
    scopeSeparator?: string | undefined;
    userProfileURL?: string | undefined;
    showDialog?: boolean | undefined;
}

export interface StrategyOptions extends _StrategyOptionsBase {
    passReqToCallback?: false | null | undefined;
}

export interface StrategyOptionsWithRequest extends _StrategyOptionsBase {
    passReqToCallback: true;
}

export type VerifyCallback = (error?: Error | null, user?: object, info?: object) => void;

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

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

export class Strategy {
    constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
    constructor(options: StrategyOptions, verify: VerifyFunction);

    name: string;
    authenticate(req: Request, options?: object): void;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 20:19:26 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by Rishi Kodali.

2.0.3

7 months ago

2.0.2

8 months ago

2.0.4

6 months ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

4 years ago