3.0.5 • Published 15 days ago

@types/express-mysql-session v3.0.5

Weekly downloads
2,806
License
MIT
Repository
github
Last release
15 days ago

Installation

npm install --save @types/express-mysql-session

Summary

This package contains type definitions for express-mysql-session (https://github.com/chill117/express-mysql-session#readme).

Details

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

index.d.ts

// Type definitions for express-mysql-session 2.1
// Project: https://github.com/chill117/express-mysql-session#readme
// Definitions by: Akim95 <https://github.com/Akim95>
//                 Sebastian Krüger <https://github.com/mathe42>
//                 Ionaru <https://github.com/Ionaru>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as expressSession from 'express-session';

export = MySQLStore;

declare function MySQLStore(session: typeof expressSession): typeof MySQLStoreClass;

declare namespace MySQLStore {
    interface Options {
        host?: string | undefined;
        port?: number | undefined;
        user?: string | undefined;
        password?: string | undefined;
        database?: string | undefined;
        checkExpirationInterval?: number | undefined;
        expiration?: number | undefined;
        createDatabaseTable?: boolean | undefined;
        connectionLimit?: number | undefined;
        schema?: Partial<Schema> | undefined;
    }
    interface Schema {
        tableName: string;
        columnNames: Partial<ColumnNames>;
    }
    interface ColumnNames {
        session_id: string;
        expires: string;
        data: string;
    }

    type MySQLStore = MySQLStoreClass;
}

declare class MySQLStoreClass extends expressSession.Store {
    constructor(options: MySQLStore.Options, connection?: any, callback?: (error: any) => void);

    setDefaultOptions(): void;

    setOptions(options: MySQLStore.Options): void;

    validateOptions(options: MySQLStore.Options): void;

    createDatabaseTable(callback?: (error: any) => void): void;

    get(sessionId: string, callback?: (error: any, session: any) => void): void;

    set(sessionId: string, data: any, callback?: (error: any) => void): void;

    touch(sessionId: string, data: any, callback?: (error: any) => void): void;

    destroy(sessionId: string, callback?: (error: any) => void): void;

    length(callback?: (error: any, count: any) => void): void;

    all(callback?: (error: any, sessions: any) => void): void;

    clear(callback?: (error: any) => void): void;

    clearExpiredSessions(callback?: (error: any) => void): void;

    query(sql: string, params: any, callback?: (error: any, rows: any, fields: any) => void): void;

    setExpirationInterval(interval: number): void;

    clearExpirationInterval(): void;

    close(callback?: () => void): void;
}

Additional Details

Credits

These definitions were written by Akim95, Sebastian Krüger, and Ionaru.

3.0.5

15 days ago

3.0.4

26 days ago

3.0.3

6 months ago

3.0.2

7 months ago

3.0.1

8 months ago

3.0.0

11 months ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

4 years ago

2.1.0

4 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago