Fixed dtslint warnings

This commit is contained in:
Luka Maljic
2017-12-13 10:13:46 +01:00
parent bf037c9886
commit 329c092b7e
3 changed files with 29 additions and 34 deletions
+16 -19
View File
@@ -3,31 +3,28 @@
// Definitions by: Luka Maljic <https://github.com/malj>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Koa from 'koa'
import * as webpack from 'webpack'
import * as webpackDevMiddleware from 'webpack-dev-middleware'
import * as webpackHotMiddleware from 'webpack-hot-middleware'
import { NextHandleFunction } from 'connect'
import * as Koa from 'koa';
import * as webpack from 'webpack';
import * as webpackDevMiddleware from 'webpack-dev-middleware';
import * as webpackHotMiddleware from 'webpack-hot-middleware';
import { NextHandleFunction } from 'connect';
declare function koaWebpack(
options?: koaWebpack.Options
): Koa.Middleware & koaWebpack.CombinedWebpackMiddleware
): Koa.Middleware & koaWebpack.CombinedWebpackMiddleware;
declare namespace koaWebpack
{
interface Options
{
compiler?: webpack.Compiler
config?: webpack.Configuration
dev?: webpackDevMiddleware.Options
hot?: webpackHotMiddleware.Options
declare namespace koaWebpack {
interface Options {
compiler?: webpack.Compiler;
config?: webpack.Configuration;
dev?: webpackDevMiddleware.Options;
hot?: webpackHotMiddleware.Options;
}
interface CombinedWebpackMiddleware
{
dev: NextHandleFunction & webpackDevMiddleware.WebpackDevMiddleware
hot: NextHandleFunction & webpackHotMiddleware.EventStream
interface CombinedWebpackMiddleware {
dev: NextHandleFunction & webpackDevMiddleware.WebpackDevMiddleware;
hot: NextHandleFunction & webpackHotMiddleware.EventStream;
}
}
export = koaWebpack
export = koaWebpack;
+12 -15
View File
@@ -1,11 +1,10 @@
import * as Koa from 'koa'
import * as webpack from 'webpack'
import * as koaWebpack from 'koa-webpack'
const app = new Koa()
const config: webpack.Configuration = {}
const compiler = webpack(config)
import * as Koa from 'koa';
import * as webpack from 'webpack';
import * as koaWebpack from 'koa-webpack';
const app = new Koa();
const config: webpack.Configuration = {};
const compiler = webpack(config);
// Using the middleware
@@ -36,15 +35,13 @@ const middleware = koaWebpack({
path: '/__what',
heartbeat: 2000
}
})
app.use(middleware)
});
app.use(middleware);
// Accessing the underlying middleware
middleware.dev.close()
middleware.dev.invalidate()
middleware.dev.waitUntilValid()
middleware.hot.publish(null)
middleware.dev.close();
middleware.dev.invalidate();
middleware.dev.waitUntilValid();
middleware.hot.publish(null);
+1
View File
@@ -7,6 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"