🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@types/connect-mongodb-session

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/connect-mongodb-session

TypeScript definitions for connect-mongodb-session

2.4.8
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
latest
Version published
Weekly downloads
6.3K
-11.27%
Maintainers
1
Weekly downloads
 
Created

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

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.

FAQs

Package last updated on 24 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts