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

1.0.5 • Public • Published

Installation

npm install --save @types/passport-steam

Summary

This package contains type definitions for passport-steam (https://github.com/liamcurry/passport-steam).

Details

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

index.d.ts

import { Request } from "express";
import * as Passport from "passport";

declare class SteamStrategy<T extends SteamStrategyOptions> extends Passport.Strategy {
    constructor(options: T, validate: ValidateFn<T>);
}

declare namespace SteamStrategy {
    const Strategy: typeof SteamStrategy;
    const version: string;
}

interface SteamStrategyOptions {
    returnURL: string;
    realm: string;
    apiKey: string;
    passReqToCallback?: boolean;
}

type ValidateFn<T extends SteamStrategyOptions> = T["passReqToCallback"] extends true
    ? (req: Request, identifier: SteamIdentifier, profile: SteamProfile, done: DoneFn) => void
    : (identifier: SteamIdentifier, profile: SteamProfile, done: DoneFn) => void;

type DoneFn = (err: unknown, user?: Express.User | false | null) => void;

type SteamIdentifier = string;

interface SteamProfile {
    provider: "steam";
    _json: {
        steamid: string;
        communityvisibilitystate: number;
        profilestate: number;
        personaname: string;
        commentpermission: number;
        profileurl: string;
        avatar: string;
        avatarmedium: string;
        avatarfull: string;
        avatarhash: string;
        lastlogoff: number;
        personastate: number;
        realname: string;
        primaryclanid: string;
        timecreated: number;
        personastateflags: number;
        loccountrycode: string;
        locstatecode: string;
    };
    id: string;
    displayName: string;
    photos: Array<{ value: string }>;
}

export = SteamStrategy;

Additional Details

Credits

These definitions were written by Jonas D..

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-steam

Weekly Downloads

2,337

Version

1.0.5

License

MIT

Unpacked Size

5.83 kB

Total Files

5

Last publish

Collaborators

  • types