mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 13:27:15 +08:00
Add http2 types for "callback"
Currently is typed against IncomingMessage / ServerResponse, changing to be a union type including the new Http2ServerRequest & Http2ServerResponse
This commit is contained in:
5
types/koa/index.d.ts
vendored
5
types/koa/index.d.ts
vendored
@@ -21,6 +21,7 @@ import * as accepts from "accepts";
|
||||
import * as Cookies from "cookies";
|
||||
import { EventEmitter } from "events";
|
||||
import { IncomingMessage, ServerResponse, Server } from "http";
|
||||
import { Http2ServerRequest, Http2ServerResponse } from 'http2';
|
||||
import httpAssert = require("http-assert");
|
||||
import * as Keygrip from "keygrip";
|
||||
import * as compose from "koa-compose";
|
||||
@@ -500,9 +501,9 @@ declare class Application extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Return a request handler callback
|
||||
* for node's native http server.
|
||||
* for node's native http/http2 server.
|
||||
*/
|
||||
callback(): (req: IncomingMessage, res: ServerResponse) => void;
|
||||
callback(): (req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse) => void;
|
||||
|
||||
/**
|
||||
* Initialize a new context.
|
||||
|
||||
Reference in New Issue
Block a user