3.0.11 • Published 6 months ago

@types/koa-session-minimal v3.0.11

Weekly downloads
78
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for koa-session-minimal v3.x
// Project: https://github.com/longztian/koa-session-minimal
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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

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

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

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

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

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 DefinitelyTyped.

3.0.10

7 months ago

3.0.11

6 months ago

3.0.9

8 months ago

3.0.8

2 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

6 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

8 years ago