@types/koa
Advanced tools
Comparing version 2.0.47 to 2.0.48
@@ -434,8 +434,8 @@ // Type definitions for Koa 2.x | ||
declare class Application extends EventEmitter { | ||
declare class Application<StateT = any, CustomT = {}> extends EventEmitter { | ||
proxy: boolean; | ||
middleware: Application.Middleware[]; | ||
middleware: Application.Middleware<StateT, CustomT>[]; | ||
subdomainOffset: number; | ||
env: string; | ||
context: Application.BaseContext; | ||
context: Application.BaseContext & CustomT; | ||
request: Application.BaseRequest; | ||
@@ -501,3 +501,5 @@ response: Application.BaseResponse; | ||
*/ | ||
use(middleware: Application.Middleware): this; | ||
use<NewStateT = {}, NewCustomT = {}>( | ||
middleware: Application.Middleware<StateT & NewStateT, CustomT & NewCustomT>, | ||
): Application<StateT & NewStateT, CustomT & NewCustomT>; | ||
@@ -515,6 +517,6 @@ /** | ||
*/ | ||
createContext( | ||
createContext<StateT = any>( | ||
req: IncomingMessage, | ||
res: ServerResponse, | ||
): Application.Context; | ||
): Application.ParameterizedContext<StateT>; | ||
@@ -530,3 +532,3 @@ /** | ||
declare namespace Application { | ||
type Middleware = compose.Middleware<Context>; | ||
type Middleware<StateT = any, CustomT = {}> = compose.Middleware<ParameterizedContext<StateT, CustomT>>; | ||
@@ -691,3 +693,3 @@ interface BaseRequest extends ContextDelegatedRequest { | ||
interface Context extends BaseContext { | ||
type ParameterizedContext<StateT = any, CustomT = {}> = BaseContext & { | ||
app: Application; | ||
@@ -701,3 +703,3 @@ request: Request; | ||
accept: accepts.Accepts; | ||
state: any; | ||
state: StateT; | ||
/** | ||
@@ -707,5 +709,7 @@ * To bypass Koa's built-in response handling, you may explicitly set `ctx.respond = false;` | ||
respond?: boolean; | ||
} | ||
} & CustomT; | ||
interface Context extends ParameterizedContext {} | ||
} | ||
export = Application; |
{ | ||
"name": "@types/koa", | ||
"version": "2.0.47", | ||
"version": "2.0.48", | ||
"description": "TypeScript definitions for Koa", | ||
@@ -38,4 +38,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "5501a2ebc4e7459e9480137503bbd4db510d0726f098b8075badffcb5dfb13ea", | ||
"typesPublisherContentHash": "4e42b1f8788df94b78f945a8453180d4f8606de73f9c60e52dcce84ad6c99f7a", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,4 +11,4 @@ # Installation | ||
Additional Details | ||
* Last updated: Tue, 20 Nov 2018 18:02:56 GMT | ||
* Dependencies: accepts, cookies, http-assert, keygrip, koa-compose, node | ||
* Last updated: Mon, 31 Dec 2018 18:46:29 GMT | ||
* Dependencies: @types/accepts, @types/cookies, @types/http-assert, @types/keygrip, @types/koa-compose, @types/node | ||
* Global values: none | ||
@@ -15,0 +15,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
21622
628