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

3.0.11 • Public • Published

Installation

npm install --save @types/koa-session-minimal

Summary

This package contains type definitions for koa-session-minimal (https://github.com/longztian/koa-session-minimal).

Details

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

index.d.ts

/* =================== USAGE ===================

    import * as Koa from "koa";
    import session = require("koa-session-minimal");

    const app = new Koa();
    app.use(session());

 =============================================== */

import * as cookies from "cookies";
import * as Koa from "koa";

declare module "koa" {
    interface Context {
        session: any;
        sessionHandler: { regenerateId: () => void };
    }
}

declare function session(opts?: {
    /**
     * session cookie name and store key prefix. Default is 'koa:sess'
     */
    key?: string | undefined;

    /**
     * cookie options
     */
    cookie?: cookies.IOptions | { (ctx?: Koa.Context): cookies.IOptions } | undefined;

    /**
     * session store
     */
    store?: any;
}): Koa.Middleware;

declare namespace session {}
export = session;

Additional Details

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/koa-session-minimal

Weekly Downloads

32

Version

3.0.11

License

MIT

Unpacked Size

4.27 kB

Total Files

5

Last publish

Collaborators

  • types