mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
Merge pull request #26298 from tlaziuk/koa-webpack
[koa-webpack] add close method
This commit is contained in:
9
types/koa-webpack/index.d.ts
vendored
9
types/koa-webpack/index.d.ts
vendored
@@ -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 <https://github.com/malj>
|
||||
// Lee Benson <https://github.com/leebenson>
|
||||
// miZyind <https://github.com/miZyind>
|
||||
// Tomek Łaziuk <https://github.com/tlaziuk>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,4 +53,9 @@ koaWebpack({
|
||||
middleware.hotClient.close();
|
||||
middleware.hotClient.options;
|
||||
middleware.hotClient.server;
|
||||
|
||||
// close the middleware
|
||||
middleware.close(() => {
|
||||
console.log('closed');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user