Add generic support for [@types/koa-mount] (#36365)

* Add generic support

* fix: lint errors

* fix: unnecessary semicolon

* feat: add generic types in overload
This commit is contained in:
Vladislav Polyakov
2019-06-27 10:49:21 -07:00
committed by Benjamin Lichtman
parent c98d58d673
commit 4070665056
+9 -3
View File
@@ -1,15 +1,21 @@
// Type definitions for koa-mount 3.0
// Type definitions for koa-mount 4.0
// Project: https://github.com/koajs/mount
// Definitions by: AmirSaber Sharifi <https://github.com/amirsaber>
// Tomek Łaziuk <https://github.com/tlaziuk>
// Vladislav Polyakov <https://github.com/polrk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import Koa = require("koa");
declare function mount(app: Koa.Middleware | Koa): Koa.Middleware;
declare function mount<StateT = any, CustomT = {}>(
app: Koa.Middleware<StateT, CustomT> | Koa<StateT, CustomT>
): Koa.Middleware<StateT, CustomT>;
declare function mount(prefix: string, app: Koa.Middleware | Koa): Koa.Middleware;
declare function mount<StateT = any, CustomT = {}>(
prefix: string,
app: Koa.Middleware<StateT, CustomT> | Koa<StateT, CustomT>
): Koa.Middleware<StateT, CustomT>;
declare namespace mount { }