import * as Koa from 'koa'; import { IRequest } from './IRequest'; import { IResponse } from './IResponse'; export interface BaseContext { send(data: string, status?: number): void; json(data: Object): void; jsonp(data: Object, callbackField?: string): void; view(viewPath: string, locals?: any): Promise; userAgent: string; param: any; setHeader(name: string | any, value?: string | string[]): void; getHeader(name: string | any): any; } export interface IContext extends Koa.Context, BaseContext { request: IRequest; response: IResponse; }