Socket
Socket
Sign inDemoInstall

@types/webpack-dev-middleware

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/webpack-dev-middleware - npm Package Compare versions

Comparing version 2.0.3 to 3.7.0

122

webpack-dev-middleware/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for webpack-dev-middleware 2.0
// Type definitions for webpack-dev-middleware 3.7
// Project: https://github.com/webpack/webpack-dev-middleware

@@ -6,4 +6,4 @@ // Definitions by: Benjamin Lim <https://github.com/bumbleblym>

// Chris Abrams <https://github.com/chrisabrams>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

@@ -18,40 +18,94 @@ import * as webpack from 'webpack';

declare function WebpackDevMiddleware(
compiler: webpack.ICompiler,
options?: WebpackDevMiddleware.Options
compiler: webpack.ICompiler,
options?: WebpackDevMiddleware.Options,
): WebpackDevMiddleware.WebpackDevMiddleware & NextHandleFunction;
declare namespace WebpackDevMiddleware {
interface Options {
logLevel?: string;
lazy?: boolean;
watchOptions?: webpack.Options.WatchOptions;
publicPath: string;
index?: string | boolean;
headers?: {
[name: string]: string;
};
stats?: webpack.Options.Stats;
reporter?: Reporter | null;
serverSideRender?: boolean;
logger?: Logger;
filename?: string;
writeToDisk?: boolean | ((filename: string) => boolean);
}
interface Options {
filename?: string;
/**
* Set the default file system which will be used by webpack as primary destination of generated files
*/
fs?: MemoryFileSystem;
/** This property allows a user to pass custom HTTP headers on each request. eg. { "X-Custom-Header": "yes" } */
headers?: {
[name: string]: string;
};
/**
* The index path for web server, defaults to "index.html".
* If falsy (but not undefined), the server will not respond to requests to the root URL.
*/
index?: string | boolean;
/**
* This option instructs the module to operate in 'lazy' mode,
* meaning that it won't recompile when files change, but rather on each request.
*/
lazy?: boolean;
/**
* In the rare event that a user would like to provide a custom logging interface,
* this property allows the user to assign one
*/
logger?: Logger;
/** This property defines the level of messages that the module will log */
logLevel?: 'info' | 'warn' | 'error' | 'trace' | 'debug' | 'silent';
/**
* If true the log output of the module will be prefixed by a timestamp in the HH:mm:ss format.
* @default false
*/
logTime?: boolean;
/**
* This property allows a user to pass the list of HTTP request methods accepted by the server.
* @default [ 'GET', 'HEAD' ]
*/
methods?: string[];
/**
* This property allows a user to register custom mime types or extension mappings
* @default null
*/
mimeTypes?: MimeTypeMap | OverrideMimeTypeMap | null;
/** The public path that the middleware is bound to */
publicPath: string;
/** Allows users to provide a custom reporter to handle logging within the module */
reporter?: Reporter | null;
/** Instructs the module to enable or disable the server-side rendering mode */
serverSideRender?: boolean;
/** Options for formatting statistics displayed during and after compile */
stats?: webpack.Options.Stats;
/** The module accepts an Object containing options for file watching, which is passed directly to the compiler provided */
watchOptions?: webpack.Options.WatchOptions;
/**
* If true, the option will instruct the module to write files to the configured location on disk as specified in your webpack config file
* This option also accepts a Function value, which can be used to filter which files are written to disk
*/
writeToDisk?: boolean | ((filename: string) => boolean);
}
interface ReporterOptions {
state: boolean;
stats?: webpack.Stats;
log: Logger;
}
interface MimeTypeMap {
[type: string]: string[];
}
type Logger = loglevel.Logger;
type Reporter = (middlewareOptions: Options, reporterOptions: ReporterOptions) => void;
interface OverrideMimeTypeMap {
typeMap: MimeTypeMap;
force: boolean;
}
interface WebpackDevMiddleware {
close(callback?: () => void): void;
invalidate(callback?: (stats: webpack.Stats) => void): void;
waitUntilValid(callback?: (stats: webpack.Stats) => void): void;
getFilenameFromUrl: (url: string) => string | false;
fileSystem: MemoryFileSystem;
}
interface ReporterOptions {
state: boolean;
stats?: webpack.Stats;
log: Logger;
}
type Logger = loglevel.Logger;
type Reporter = (middlewareOptions: Options, reporterOptions: ReporterOptions) => void;
interface WebpackDevMiddleware {
/** A function executed once the middleware has stopped watching. */
close(callback?: () => void): void;
/** Instructs a webpack-dev-middleware instance to recompile the bundle. e.g. after a change to the configuration. */
invalidate(callback?: (stats?: webpack.Stats) => void): void;
/** Executes a callback function when the compiler bundle is valid, typically after compilation */
waitUntilValid(callback?: (stats?: webpack.Stats) => void): void;
getFilenameFromUrl: (url: string) => string | false;
fileSystem: MemoryFileSystem;
}
}
{
"name": "@types/webpack-dev-middleware",
"version": "2.0.3",
"version": "3.7.0",
"description": "TypeScript definitions for webpack-dev-middleware",

@@ -21,6 +21,11 @@ "license": "MIT",

"githubUsername": "chrisabrams"
},
{
"name": "Piotr Błażejewicz",
"url": "https://github.com/peterblazejewicz",
"githubUsername": "peterblazejewicz"
}
],
"main": "",
"types": "index",
"types": "index.d.ts",
"repository": {

@@ -38,4 +43,4 @@ "type": "git",

},
"typesPublisherContentHash": "33305952b504d317059989c1f5fd061ea144944eb511c68d7e07b13a5b22e649",
"typeScriptVersion": "2.3"
"typesPublisherContentHash": "b139ee840542d8d487c1111a0e7e47457b973e1d282347926a3188c3df2e7833",
"typeScriptVersion": "2.8"
}

@@ -8,10 +8,10 @@ # Installation

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-dev-middleware
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-dev-middleware.
Additional Details
* Last updated: Mon, 24 Jun 2019 19:34:55 GMT
* Dependencies: @types/webpack, @types/loglevel, @types/connect, @types/memory-fs
### Additional Details
* Last updated: Wed, 26 Feb 2020 00:57:12 GMT
* Dependencies: [@types/webpack](https://npmjs.com/package/@types/webpack), [@types/loglevel](https://npmjs.com/package/@types/loglevel), [@types/connect](https://npmjs.com/package/@types/connect), [@types/memory-fs](https://npmjs.com/package/@types/memory-fs)
* Global values: none
# Credits
These definitions were written by Benjamin Lim <https://github.com/bumbleblym>, reduckted <https://github.com/reduckted>, and Chris Abrams <https://github.com/chrisabrams>.
These definitions were written by [Benjamin Lim](https://github.com/bumbleblym), [reduckted](https://github.com/reduckted), [Chris Abrams](https://github.com/chrisabrams), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc