koa2-router
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "koa2-router", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "A express-liked router component for koa2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,2 +15,3 @@ // Type definitions for koa2-router | ||
import { Middleware, ParameterizedContext } from "koa" | ||
import { Path } from "path-to-regexp" | ||
@@ -42,3 +43,3 @@ declare module "koa" { | ||
export interface Route<StateT = any, CustomT = {}> { | ||
readonly path: string; | ||
readonly path: Path; | ||
all: (...middlewares: Middleware<StateT, CustomT>[]) => Route<StateT, CustomT>; | ||
@@ -79,14 +80,14 @@ head: (...middlewares: Middleware<StateT, CustomT>[]) => Route<StateT, CustomT>; | ||
_name: string; | ||
route(path: string): Route<StateT, CustomT>; | ||
route(path: Path): Route<StateT, CustomT>; | ||
param: <K extends string | number, V = any>(name: K, fn: ParamCallback<K, V, StateT, CustomT>) => Router<StateT, CustomT>; | ||
use: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
all: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
head: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
get: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
post: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
delete: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
del: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
put: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
patch: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
options: (pathOrMiddleware: string | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
use: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
all: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
head: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
get: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
post: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
delete: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
del: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
put: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
patch: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
options: (pathOrMiddleware: Path | Middleware<StateT, CustomT>, ...middlewares: Middleware<StateT, CustomT>[]) => Router<StateT, CustomT>; | ||
allowMethods: (options?: AllowOptions<StateT, CustomT>) => Middleware<StateT, CustomT>; | ||
@@ -93,0 +94,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40996
1083