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

0.0.6 • Public • Published

Installation

npm install --save @types/koa2-session-redis

Summary

This package contains type definitions for koa2-session-redis (https://github.com/lonord/koa2-session-redis).

Details

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

index.d.ts

import * as session from "koa-session";
import * as Redis from "redis";

export = RedisStore;

declare class RedisStore implements session.stores {
    constructor(config?: Redis.ClientOpts);

    /**
     * get session object by key
     */
    get(key: string): any;

    /**
     * set session object for key, with a maxAge (in ms)
     */
    set(
        key: string,
        sess: Partial<session.Session> & { _expire?: number | undefined; _maxAge?: number | undefined },
        maxAge: session.opts["maxAge"],
    ): any;

    /**
     * destroy session for key
     */
    destroy(key: string): any;

    /**
     * sends the quit command to the redis server and ends cleanly right after all running commands were properly handled
     */
    quit(): void;
}

Additional Details

Credits

These definitions were written by Dima Mukhin.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/koa2-session-redis

Weekly Downloads

4

Version

0.0.6

License

MIT

Unpacked Size

4.34 kB

Total Files

5

Last publish

Collaborators

  • types