@types/webpack-dev-middleware
Advanced tools
Comparing version 3.7.2 to 4.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for webpack-dev-middleware 3.7 | ||
// Type definitions for webpack-dev-middleware 4.0 | ||
// Project: https://github.com/webpack/webpack-dev-middleware | ||
@@ -7,8 +7,7 @@ // Definitions by: Benjamin Lim <https://github.com/bumbleblym> | ||
// Piotr Błażejewicz <https://github.com/peterblazejewicz> | ||
// Ma Tianqi <https://github.com/tqma113> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
import * as webpack from 'webpack'; | ||
import * as loglevel from 'loglevel'; | ||
import { NextHandleFunction } from 'connect'; | ||
import MemoryFileSystem = require('memory-fs'); | ||
@@ -18,3 +17,3 @@ export = WebpackDevMiddleware; | ||
declare function WebpackDevMiddleware( | ||
compiler: webpack.ICompiler, | ||
compiler: webpack.Compiler, | ||
options?: WebpackDevMiddleware.Options, | ||
@@ -25,34 +24,12 @@ ): WebpackDevMiddleware.WebpackDevMiddleware & NextHandleFunction; | ||
interface Options { | ||
filename?: string; | ||
/** | ||
* Set the default file system which will be used by webpack as primary destination of generated files | ||
* This property allows a user to register custom mime types or extension mappings | ||
*/ | ||
fs?: MemoryFileSystem; | ||
/** This property allows a user to pass custom HTTP headers on each request. eg. { "X-Custom-Header": "yes" } */ | ||
headers?: { | ||
[name: string]: string; | ||
}; | ||
mimeTypes?: MimeTypeMap; | ||
/** | ||
* 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. | ||
* 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 | ||
*/ | ||
index?: string | boolean; | ||
writeToDisk?: boolean | ((filename: 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. | ||
@@ -62,52 +39,45 @@ * @default [ 'GET', 'HEAD' ] | ||
methods?: string[]; | ||
/** | ||
* This property allows a user to register custom mime types or extension mappings | ||
* @default null | ||
*/ | ||
mimeTypes?: MimeTypeMap | OverrideMimeTypeMap | null; | ||
/** This property allows a user to pass custom HTTP headers on each request. eg. { "X-Custom-Header": "yes" } */ | ||
headers?: { | ||
[name: string]: string; | ||
}; | ||
/** 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 | ||
* Set the default file system which will be used by webpack as primary destination of generated files | ||
*/ | ||
writeToDisk?: boolean | ((filename: string) => boolean); | ||
outputFileSystem?: webpack.Compiler['outputFileSystem']; | ||
/** | ||
* 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; | ||
} | ||
interface MimeTypeMap { | ||
[type: string]: string[]; | ||
[type: string]: string; | ||
} | ||
interface OverrideMimeTypeMap { | ||
typeMap: MimeTypeMap; | ||
force: boolean; | ||
} | ||
type Callback = (stats?: webpack.Stats) => void; | ||
interface ReporterOptions { | ||
interface Context { | ||
state: boolean; | ||
stats?: webpack.Stats; | ||
log: Logger; | ||
stats: webpack.Stats | null; | ||
callbacks: Callback[]; | ||
options: Options; | ||
compiler: webpack.Compiler; | ||
watching: webpack.Watching | null; | ||
} | ||
type Logger = loglevel.Logger; | ||
type Reporter = (middlewareOptions: Options, reporterOptions: ReporterOptions) => void; | ||
interface WebpackDevMiddleware { | ||
/** Executes a callback function when the compiler bundle is valid, typically after compilation */ | ||
waitUntilValid(callback?: Callback): void; | ||
/** Instructs a webpack-dev-middleware instance to recompile the bundle. e.g. after a change to the configuration. */ | ||
invalidate(callback?: Callback): void; | ||
/** 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; | ||
context: Context; | ||
} | ||
} |
{ | ||
"name": "@types/webpack-dev-middleware", | ||
"version": "3.7.2", | ||
"version": "4.0.0", | ||
"description": "TypeScript definitions for webpack-dev-middleware", | ||
@@ -26,2 +26,7 @@ "license": "MIT", | ||
"githubUsername": "peterblazejewicz" | ||
}, | ||
{ | ||
"name": "Ma Tianqi", | ||
"url": "https://github.com/tqma113", | ||
"githubUsername": "tqma113" | ||
} | ||
@@ -39,8 +44,6 @@ ], | ||
"@types/connect": "*", | ||
"@types/memory-fs": "*", | ||
"@types/webpack": "*", | ||
"loglevel": "^1.6.2" | ||
"@types/webpack": "*" | ||
}, | ||
"typesPublisherContentHash": "321ef682e04abd6821dc1fb6cba17ea1e082b07eee1ac2da4e362371f77b9419", | ||
"typeScriptVersion": "3.0" | ||
"typesPublisherContentHash": "3e39ee7032c8a6f34b42b25231e0bd934e51ef8e0aeae268de4a413318e0c998", | ||
"typeScriptVersion": "3.3" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 18 Aug 2020 22:46:42 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) | ||
* Last updated: Mon, 11 Jan 2021 22:13:31 GMT | ||
* Dependencies: [@types/webpack](https://npmjs.com/package/@types/webpack), [@types/connect](https://npmjs.com/package/@types/connect) | ||
* Global values: none | ||
# Credits | ||
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). | ||
These definitions were written by [Benjamin Lim](https://github.com/bumbleblym), [reduckted](https://github.com/reduckted), [Chris Abrams](https://github.com/chrisabrams), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Ma Tianqi](https://github.com/tqma113). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
6689
71
- Removed@types/memory-fs@*
- Removedloglevel@^1.6.2
- Removed@types/memory-fs@0.3.7(transitive)
- Removedloglevel@1.9.2(transitive)