diff --git a/types/koa-webpack/index.d.ts b/types/koa-webpack/index.d.ts index 951d8d58a2..5e9ccec4f5 100644 --- a/types/koa-webpack/index.d.ts +++ b/types/koa-webpack/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for koa-webpack 5.x -// Project: https://github.com/shellscape/koa-webpack#readme +// Type definitions for koa-webpack 5.0 +// Project: https://github.com/shellscape/koa-webpack // Definitions by: Luka Maljic // Lee Benson // miZyind +// Tomek Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,11 +26,15 @@ declare namespace koaWebpack { interface CombinedWebpackMiddleware { devMiddleware: webpackDevMiddleware.WebpackDevMiddleware; + /** + * @todo make this a `webpack-hot-client@^4.0.0` instance, no typings for v4 available yet + */ hotClient: { close: () => void; options: webpackHotClient.Options; server: any; }; + close(callback?: () => any): void; } } diff --git a/types/koa-webpack/koa-webpack-tests.ts b/types/koa-webpack/koa-webpack-tests.ts index de4990eea6..4821059a9b 100644 --- a/types/koa-webpack/koa-webpack-tests.ts +++ b/types/koa-webpack/koa-webpack-tests.ts @@ -53,4 +53,9 @@ koaWebpack({ middleware.hotClient.close(); middleware.hotClient.options; middleware.hotClient.server; + + // close the middleware + middleware.close(() => { + console.log('closed'); + }); });