No Purchase Made

    @types/connect-mongodb-session
    TypeScript icon, indicating that this package has built-in type declarations

    2.4.4 • Public • Published

    Installation

    npm install --save @types/connect-mongodb-session

    Summary

    This package contains type definitions for connect-mongodb-session (https://github.com/mongodb-js/connect-mongodb-session#readme).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect-mongodb-session.

    index.d.ts

    // Type definitions for connect-mongodb-session 2.4
    // Project: https://github.com/mongodb-js/connect-mongodb-session#readme
    // Definitions by: Nattapong Sirilappanich <https://github.com/NattapongSiri>
    //                 Ravi van Rooijen <https://github.com/HoldYourWaffle>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // Minimum TypeScript Version: 4.1
    
    import session = require('express-session');
    import { MongoClient, MongoClientOptions } from 'mongodb';
    
    export = ConnectMongoDBSession;
    
    declare function ConnectMongoDBSession(fn: typeof session): typeof ConnectMongoDBSession.MongoDBStore;
    
    declare namespace ConnectMongoDBSession {
        class MongoDBStore extends session.Store {
            constructor(connection?: MongoDBSessionOptions, callback?: (error: Error) => void);
            client: MongoClient;
    
            get(sid: string, callback: (err: any, session?: session.SessionData | null) => void): void;
            set(sid: string, session: session.SessionData, callback?: (err?: any) => void): void;
            destroy(sid: string, callback?: (err?: any) => void): void;
            all(callback: (err: any, obj?: session.SessionData[] | { [sid: string]: session.SessionData; } | null) => void): void;
            clear(callback?: (err?: any) => void): void;
        }
    
        interface MongoDBSessionOptions {
            uri: string;
            collection: string;
            expires?: number | undefined;
            databaseName?: string | undefined;
            connectionOptions?: MongoClientOptions | undefined;
            idField?: string | undefined;
            expiresKey?: string | undefined;
            expiresAfterSeconds?: number | undefined;
        }
    }

    Additional Details

    Credits

    These definitions were written by Nattapong Sirilappanich, and Ravi van Rooijen.

    Keywords

    none

    Install

    npm i @types/connect-mongodb-session

    DownloadsWeekly Downloads

    2,975

    Version

    2.4.4

    License

    MIT

    Unpacked Size

    6.44 kB

    Total Files

    5

    Last publish

    Collaborators

    • types