UNPKG

3.94 kBTypeScriptView Raw
1import { RpcProvider } from 'worker-rpc';
2import { NormalizedMessage } from './NormalizedMessage';
3import { ForkTsCheckerHooks } from './hooks';
4declare namespace ForkTsCheckerWebpackPlugin {
5 type Formatter = (message: NormalizedMessage, useColors: boolean) => string;
6 interface Logger {
7 error(message?: any): void;
8 warn(message?: any): void;
9 info(message?: any): void;
10 }
11 interface Options {
12 typescript: string;
13 tsconfig: string;
14 compilerOptions: object;
15 tslint: string | true | undefined;
16 tslintAutoFix: boolean;
17 eslint: boolean;
18 /** Options to supply to eslint https://eslint.org/docs/1.0.0/developer-guide/nodejs-api#cliengine */
19 eslintOptions: object;
20 watch: string | string[];
21 async: boolean;
22 ignoreDiagnostics: number[];
23 ignoreLints: string[];
24 ignoreLintWarnings: boolean;
25 reportFiles: string[];
26 colors: boolean;
27 logger: Logger;
28 formatter: 'default' | 'codeframe' | Formatter;
29 formatterOptions: any;
30 silent: boolean;
31 checkSyntacticErrors: boolean;
32 memoryLimit: number;
33 workers: number;
34 vue: boolean;
35 useTypescriptIncrementalApi: boolean;
36 measureCompilationTime: boolean;
37 resolveModuleNameModule: string;
38 resolveTypeReferenceDirectiveModule: string;
39 }
40}
41/**
42 * ForkTsCheckerWebpackPlugin
43 * Runs typescript type checker and linter (tslint) on separate process.
44 * This speed-ups build a lot.
45 *
46 * Options description in README.md
47 */
48declare class ForkTsCheckerWebpackPlugin {
49 static readonly DEFAULT_MEMORY_LIMIT = 2048;
50 static readonly ONE_CPU = 1;
51 static readonly ALL_CPUS: number;
52 static readonly ONE_CPU_FREE: number;
53 static readonly TWO_CPUS_FREE: number;
54 static getCompilerHooks(compiler: any): Record<ForkTsCheckerHooks, any>;
55 readonly options: Partial<ForkTsCheckerWebpackPlugin.Options>;
56 private tsconfig;
57 private compilerOptions;
58 private tslint;
59 private eslint;
60 private eslintOptions;
61 private tslintAutoFix;
62 private watch;
63 private ignoreDiagnostics;
64 private ignoreLints;
65 private ignoreLintWarnings;
66 private reportFiles;
67 private logger;
68 private silent;
69 private async;
70 private checkSyntacticErrors;
71 private workersNumber;
72 private memoryLimit;
73 private useColors;
74 private colors;
75 private formatter;
76 private useTypescriptIncrementalApi;
77 private resolveModuleNameModule;
78 private resolveTypeReferenceDirectiveModule;
79 private tsconfigPath;
80 private tslintPath;
81 private watchPaths;
82 private compiler;
83 private started;
84 private elapsed;
85 private cancellationToken;
86 private isWatching;
87 private checkDone;
88 private compilationDone;
89 private diagnostics;
90 private lints;
91 private emitCallback;
92 private doneCallback;
93 private typescriptPath;
94 private typescript;
95 private typescriptVersion;
96 private tslintVersion;
97 private eslintVersion;
98 private service?;
99 protected serviceRpc?: RpcProvider;
100 private vue;
101 private measureTime;
102 private performance;
103 private startAt;
104 protected nodeArgs: string[];
105 constructor(options?: Partial<ForkTsCheckerWebpackPlugin.Options>);
106 private validateTypeScript;
107 private validateTslint;
108 private validateEslint;
109 private static createFormatter;
110 apply(compiler: any): void;
111 private computeContextPath;
112 private pluginStart;
113 private pluginStop;
114 private pluginCompile;
115 private pluginEmit;
116 private pluginDone;
117 private spawnService;
118 private killService;
119 private handleServiceMessage;
120 private handleServiceExit;
121 private createEmitCallback;
122 private createNoopEmitCallback;
123 private printLoggerMessage;
124 private createDoneCallback;
125}
126export = ForkTsCheckerWebpackPlugin;