@types/koa__router
Advanced tools
Comparing version 8.0.7 to 8.0.8
@@ -46,3 +46,3 @@ // Type definitions for @koa/router 8.x | ||
interface RouterParamContext<StateT = any, CustomT = {}> { | ||
interface RouterParamContext<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext> { | ||
/** | ||
@@ -55,3 +55,3 @@ * url params | ||
*/ | ||
router: Router<StateT, CustomT>; | ||
router: Router<StateT, ContextT>; | ||
/** | ||
@@ -64,5 +64,5 @@ * Matched route | ||
type RouterContext<StateT = any, CustomT = {}> = Koa.ParameterizedContext<StateT, CustomT & RouterParamContext<StateT, CustomT>>; | ||
type RouterContext<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext> = Koa.ParameterizedContext<StateT, ContextT & RouterParamContext<StateT, ContextT>>; | ||
type Middleware<StateT = any, CustomT = {}> = Koa.Middleware<StateT, CustomT & RouterParamContext<StateT, CustomT>>; | ||
type Middleware<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext> = Koa.Middleware<StateT, ContextT & RouterParamContext<StateT, ContextT>>; | ||
@@ -161,3 +161,3 @@ interface ParamMiddleware { | ||
declare class Router<StateT = any, CustomT = {}> { | ||
declare class Router<StateT = Koa.DefaultState, ContextT = Koa.DefaultContext> { | ||
params: object; | ||
@@ -178,7 +178,7 @@ stack: Router.Layer[]; | ||
*/ | ||
use(...middleware: Array<Router.Middleware<StateT, CustomT>>): Router<StateT, CustomT>; | ||
use(...middleware: Array<Router.Middleware<StateT, ContextT>>): Router<StateT, ContextT>; | ||
use( | ||
path: string | string[] | RegExp, | ||
...middleware: Array<Router.Middleware<StateT, CustomT>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT, ContextT>> | ||
): Router<StateT, ContextT>; | ||
@@ -191,8 +191,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
get<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -205,8 +205,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
post<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -219,8 +219,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
put<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -233,8 +233,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
link<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -247,8 +247,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
unlink<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -261,8 +261,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
delete<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -275,8 +275,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
del<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -289,8 +289,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
head<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -303,8 +303,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
options<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -317,8 +317,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
patch<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -331,8 +331,8 @@ /** | ||
path: string | RegExp, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
all<T = {}, U = {}>( | ||
path: string | RegExp | Array<string | RegExp>, | ||
...middleware: Array<Router.Middleware<StateT & T, CustomT & U>> | ||
): Router<StateT, CustomT>; | ||
...middleware: Array<Router.Middleware<StateT & T, ContextT & U>> | ||
): Router<StateT, ContextT>; | ||
@@ -342,3 +342,3 @@ /** | ||
*/ | ||
prefix(prefix: string): Router<StateT, CustomT>; | ||
prefix(prefix: string): Router<StateT, ContextT>; | ||
@@ -348,3 +348,3 @@ /** | ||
*/ | ||
routes(): Router.Middleware<StateT, CustomT>; | ||
routes(): Router.Middleware<StateT, ContextT>; | ||
@@ -354,3 +354,3 @@ /** | ||
*/ | ||
middleware(): Router.Middleware<StateT, CustomT>; | ||
middleware(): Router.Middleware<StateT, ContextT>; | ||
@@ -364,3 +364,3 @@ /** | ||
options?: Router.RouterAllowedMethodsOptions | ||
): Router.Middleware<StateT, CustomT>; | ||
): Router.Middleware<StateT, ContextT>; | ||
@@ -372,3 +372,3 @@ /** | ||
*/ | ||
redirect(source: string, destination: string, code?: number): Router<StateT, CustomT>; | ||
redirect(source: string, destination: string, code?: number): Router<StateT, ContextT>; | ||
@@ -381,3 +381,3 @@ /** | ||
methods: string[], | ||
middleware: Router.Middleware<StateT, CustomT> | Array<Router.Middleware<StateT, CustomT>>, | ||
middleware: Router.Middleware<StateT, ContextT> | Array<Router.Middleware<StateT, ContextT>>, | ||
opts?: Router.LayerOptions, | ||
@@ -422,3 +422,3 @@ ): Router.Layer; | ||
*/ | ||
param(param: string, middleware: Router.ParamMiddleware): Router<StateT, CustomT>; | ||
param(param: string, middleware: Router.ParamMiddleware): Router<StateT, ContextT>; | ||
@@ -425,0 +425,0 @@ /** |
{ | ||
"name": "@types/koa__router", | ||
"version": "8.0.7", | ||
"version": "8.0.8", | ||
"description": "TypeScript definitions for @koa/router", | ||
@@ -55,4 +55,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa__router", | ||
}, | ||
"typesPublisherContentHash": "66d001411a06551f6416b40ae922e254703ff42988e9a2094037ecad2d328512", | ||
"typeScriptVersion": "3.6" | ||
"typesPublisherContentHash": "c383fdbab74d52c4719aba31bb5398a4fed5b7e8f7f4b568023d1f5057c0bfa2", | ||
"typeScriptVersion": "3.7" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 09 Jul 2021 02:32:33 GMT | ||
* Last updated: Wed, 08 Sep 2021 08:01:24 GMT | ||
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa) | ||
@@ -14,0 +14,0 @@ * Global values: none |
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
16453