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

3.2.8 • Public • Published

Installation

npm install --save @types/koa-route

Summary

This package contains type definitions for koa-route (https://github.com/koajs/route#readme).

Details

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

index.d.ts

import * as Koa from "koa";
import * as pathToRegexp from "path-to-regexp";

declare namespace KoaRoute {
    type Path = string | RegExp | Array<string | RegExp>;

    /**
     * The Koa handler will receive parameters extracted from the route as extra arguments.
     */
    type Handler = (this: Koa.Context, ctx: Koa.Context, ...params: any[]) => any;

    type CreateRoute = (routeFunc: Handler) => Koa.Middleware;

    interface Method {
        (path: Path): CreateRoute;
        (path: Path, fn: Handler, opts?: pathToRegexp.ParseOptions & pathToRegexp.RegExpOptions): Koa.Middleware;
    }

    type CreateMethod = (method: string) => Method;

    interface Routes {
        all: Method;
        acl: Method;
        bind: Method;
        checkout: Method;
        connect: Method;
        copy: Method;
        delete: Method;
        del: Method;
        get: Method;
        head: Method;
        link: Method;
        lock: Method;
        msearch: Method;
        merge: Method;
        mkactivity: Method;
        mkcalendar: Method;
        mkcol: Method;
        move: Method;
        notify: Method;
        options: Method;
        patch: Method;
        post: Method;
        propfind: Method;
        proppatch: Method;
        purge: Method;
        put: Method;
        rebind: Method;
        report: Method;
        search: Method;
        subscribe: Method;
        trace: Method;
        unbind: Method;
        unlink: Method;
        unlock: Method;
        unsubscribe: Method;
    }
}

declare const routes: KoaRoute.Routes;

export = routes;

Additional Details

Credits

These definitions were written by Mike Cook, and Jaco Greeff.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.2.20ts2.2
3.2.83,269ts5.6
3.2.83,269latest
3.2.83,269ts4.5
3.2.83,269ts4.6
3.2.83,269ts4.7
3.2.83,269ts4.8
3.2.83,269ts4.9
3.2.83,269ts5.0
3.2.83,269ts5.1
3.2.83,269ts5.2
3.2.83,269ts5.3
3.2.83,269ts5.4
3.2.83,269ts5.5
3.2.83,269ts5.7
3.2.5773ts3.7
3.2.5773ts3.8
3.2.5773ts3.9
3.2.5773ts4.0
3.2.5773ts4.1
3.2.5773ts4.2
3.2.5773ts4.3
3.2.5773ts4.4
3.2.4726ts2.3
3.2.4726ts2.4
3.2.4726ts2.5
3.2.4726ts2.6
3.2.4726ts2.7
3.2.4726ts2.8
3.2.4726ts2.9
3.2.4726ts3.0
3.2.4726ts3.1
3.2.4726ts3.2
3.2.4726ts3.3
3.2.4726ts3.4
3.2.4726ts3.5
3.2.4726ts3.6

Version History

VersionDownloads (Last 7 Days)Published
3.2.83,269
3.2.72
3.2.616
3.2.5773
3.2.4726
3.2.39
3.2.20
3.2.10
3.2.00

Package Sidebar

Install

npm i @types/koa-route

Weekly Downloads

4,795

Version

3.2.8

License

MIT

Unpacked Size

6.05 kB

Total Files

5

Last publish

Collaborators

  • types