diff --git a/types/koa/koa-tests.ts b/types/koa/koa-tests.ts index 2eff16857a..2ddf9b41e2 100644 --- a/types/koa/koa-tests.ts +++ b/types/koa/koa-tests.ts @@ -1,9 +1,12 @@ import Koa = require("koa"); declare module 'koa' { - export interface Context { + export interface BaseContext { db(): void; } + export interface Context { + user: {}; + } } const app = new Koa(); @@ -12,6 +15,7 @@ app.context.db = () => {}; app.use(async ctx => { console.log(ctx.db); + ctx.user = {}; }); app.use((ctx, next) => {