UNPKG

1.28 kBTypeScriptView Raw
1// Type definitions for friendly-errors-webpack-plugin 0.1
2// Project: https://github.com/geowarin/friendly-errors-webpack-plugin
3// Definitions by: Arne Bahlo <https://github.com/bahlo>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 3.7
6
7import { Compiler, Plugin } from "webpack";
8
9export = FriendlyErrorsWebpackPlugin;
10
11declare class FriendlyErrorsWebpackPlugin extends Plugin {
12 constructor(options?: FriendlyErrorsWebpackPlugin.Options);
13
14 apply(compiler: Compiler): void;
15}
16
17declare namespace FriendlyErrorsWebpackPlugin {
18 enum Severity {
19 Error = "error",
20 Warning = "warning",
21 }
22
23 interface Options {
24 compilationSuccessInfo?: {
25 messages: string[];
26 notes: string[];
27 } | undefined;
28 onErrors?(severity: Severity, errors: string): void;
29 clearConsole?: boolean | undefined;
30 additionalFormatters?: Array<(errors: WebpackError[], type: Severity) => string[]> | undefined;
31 additionalTransformers?: Array<(error: any) => any> | undefined;
32 }
33
34 interface WebpackError {
35 message: string;
36 file: string;
37 origin: string;
38 name: string;
39 severity: Severity;
40 webpackError: any;
41 }
42}