Neolithic Programming Machine

    @types/socketio-jwt-auth
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.2 • Public • Published

    Installation

    npm install --save @types/socketio-jwt-auth

    Summary

    This package contains type definitions for socketio-jwt-auth (https://github.com/adcentury/socketio-jwt-auth#readme).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/socketio-jwt-auth.

    index.d.ts

    // Type definitions for socketio-jwt-auth 0.0
    // Project: https://github.com/adcentury/socketio-jwt-auth#readme
    // Definitions by: Peter Harris <https://github.com/codeanimal>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.1
    
    import SocketIO = require("socket.io");
    
    /**
     * This function returns a middleware function for use with Socket.IO that authenticates a new connection.
     *
     * @param options is an object literal that contains options.
     * @param verify is a function with two args payload, and done.
     */
    export function authenticate(options: authOptions, verify: verifyFunc): (socket: SocketIO.Socket, fn: (err?: any) => void) => void;
    
    /**
     * This is an object literal that contains options.
     */
    export interface authOptions {
        secret: string;
        algorithm?: string | undefined;
        succeedWithoutToken?: boolean | undefined;
    }
    
    /**
     * This is a function with two args payload, and done.
     *
     * `payload` is the decoded JWT payload
     * `done` is an error-first callback with three args: done(err, user, message).
     */
    export type verifyFunc = (payload: any, done: (err?: Error | null, user?: any, message?: string) => void) => void;

    Additional Details

    • Last updated: Tue, 06 Jul 2021 16:35:04 GMT
    • Dependencies: @types/socket.io
    • Global values: none

    Credits

    These definitions were written by Peter Harris.

    Keywords

    none

    Install

    npm i @types/socketio-jwt-auth

    DownloadsWeekly Downloads

    756

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    5.12 kB

    Total Files

    4

    Last publish

    Collaborators

    • types