3.7.10 • Published 6 months ago

@types/passport.socketio v3.7.10

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

Installation

npm install --save @types/passport.socketio

Summary

This package contains type definitions for passport.socketio (https://github.com/jfromaniello/passport.socketio#readme).

Details

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

index.d.ts

// Type definitions for passport.socketio 3.7
// Project: https://github.com/jfromaniello/passport.socketio#readme
// Definitions by: Jack Scotson <https://github.com/Scotsoo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0

import { Store } from 'express-session';
import { RequestHandler } from 'express';
import { PassportStatic } from 'passport';
import { Server, Socket } from 'socket.io';

export interface PassportSocketIoOptions {
    /**
     * the name of the cookie where express/connect stores its session_id.
     */
    key?: string | undefined;

    /**
     * the session_secret to parse the cookie.
     */
    secret?: string | undefined;

    /**
     * we NEED to use a sessionstore. No MemoryStore please.
     */
    store: Store;

    /**
     * the same middleware you registrer in express.
     */
    cookieParser?: RequestHandler | undefined;
    passport?: PassportStatic | undefined;

    /**
     * callback on success.
     */
    success?: ((data: any, accept: (err?: any, accepted?: boolean) => void) => void) | undefined;

    /**
     * callback on fail/error.
     */
    fail?: ((data: any, message: string, critical: boolean, accept: (err?: any, accepted?: boolean) => void) => void) | undefined;
}

export function authorize(options: PassportSocketIoOptions): (socket: Socket, fn: (err?: any) => void) => void;
export function filterSocketsByUser(io: Server, filter: (user: any) => boolean): Socket[];

Additional Details

Credits

These definitions were written by Jack Scotson.

3.7.10

6 months ago

3.7.9

7 months ago

3.7.8

8 months ago

3.7.7

2 years ago

3.7.6

3 years ago

3.7.5

3 years ago

3.7.4

3 years ago

3.7.3

4 years ago

3.7.2

4 years ago

3.7.1

5 years ago

3.7.0

5 years ago