mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Add open interfaces
Just link https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/express/express.d.ts#L16
This commit is contained in:
18
koa/koa-1.1.2.d.ts
vendored
18
koa/koa-1.1.2.d.ts
vendored
@@ -13,13 +13,22 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../cookies/cookies.d.ts" />
|
||||
|
||||
declare module Koa {
|
||||
|
||||
// These open interfaces may be extended in an application-specific manner via declaration merging.
|
||||
// See for example method-override.d.ts (https://github.com/borisyankov/DefinitelyTyped/blob/master/method-override/method-override.d.ts)
|
||||
export interface Request { }
|
||||
export interface Response { }
|
||||
export interface Application { }
|
||||
}
|
||||
|
||||
declare module "koa" {
|
||||
import * as net from 'net';
|
||||
import * as http from 'http';
|
||||
import * as events from 'events';
|
||||
import * as Cookies from 'cookies';
|
||||
|
||||
interface IRequest {
|
||||
interface IRequest extends Koa.Request {
|
||||
/**
|
||||
* Return request header.
|
||||
*
|
||||
@@ -272,7 +281,7 @@ declare module "koa" {
|
||||
get(field: string): string;
|
||||
}
|
||||
|
||||
interface IResponse {
|
||||
interface IResponse extends Koa.Response{
|
||||
/**
|
||||
* Get/Set response status code.
|
||||
*/
|
||||
@@ -543,7 +552,7 @@ declare module "koa" {
|
||||
state: any;
|
||||
}
|
||||
|
||||
interface Application extends events.EventEmitter {
|
||||
interface Application extends events.EventEmitter , Koa.Application{
|
||||
env: string;
|
||||
subdomainOffset: number;
|
||||
middleware: any[];
|
||||
@@ -560,6 +569,7 @@ declare module "koa" {
|
||||
listen(port: number, hostname?: string, callback?: Function): http.Server;
|
||||
listen(path: string, callback?: Function): http.Server;
|
||||
listen(handle: any, listeningListener?: Function): http.Server;
|
||||
listen(): http.Server;
|
||||
/**
|
||||
* Return JSON representation.
|
||||
* We only bother showing settings.
|
||||
@@ -602,4 +612,4 @@ declare module "koa" {
|
||||
var koa: KoaStatic;
|
||||
|
||||
export = koa;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user