index.d.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import { RpcProvider } from 'worker-rpc';
  2. import { FormatterType, FormatterOptions } from './formatter';
  3. import { VueOptions } from './types/vue-options';
  4. import { Options as EslintOptions } from './types/eslint';
  5. declare namespace ForkTsCheckerWebpackPlugin {
  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. eslint: boolean;
  16. /** Options to supply to eslint https://eslint.org/docs/developer-guide/nodejs-api#cliengine */
  17. eslintOptions: EslintOptions;
  18. async: boolean;
  19. ignoreDiagnostics: number[];
  20. ignoreLints: string[];
  21. ignoreLintWarnings: boolean;
  22. reportFiles: string[];
  23. logger: Logger;
  24. formatter: FormatterType;
  25. formatterOptions: FormatterOptions;
  26. silent: boolean;
  27. checkSyntacticErrors: boolean;
  28. memoryLimit: number;
  29. vue: boolean | Partial<VueOptions>;
  30. useTypescriptIncrementalApi: boolean;
  31. measureCompilationTime: boolean;
  32. resolveModuleNameModule: string;
  33. resolveTypeReferenceDirectiveModule: string;
  34. }
  35. }
  36. /**
  37. * ForkTsCheckerWebpackPlugin
  38. * Runs typescript type checker and linter on separate process.
  39. * This speed-ups build a lot.
  40. *
  41. * Options description in README.md
  42. */
  43. declare class ForkTsCheckerWebpackPlugin {
  44. static readonly DEFAULT_MEMORY_LIMIT = 2048;
  45. static getCompilerHooks(compiler: any): Record<import("./hooks").ForkTsCheckerHooks, import("tapable").SyncHook<any, any, any> | import("tapable").AsyncSeriesHook<any, any, any>>;
  46. readonly options: Partial<ForkTsCheckerWebpackPlugin.Options>;
  47. private tsconfig;
  48. private compilerOptions;
  49. private eslint;
  50. private eslintOptions;
  51. private ignoreDiagnostics;
  52. private ignoreLints;
  53. private ignoreLintWarnings;
  54. private reportFiles;
  55. private logger;
  56. private silent;
  57. private async;
  58. private checkSyntacticErrors;
  59. private memoryLimit;
  60. private formatter;
  61. private rawFormatter;
  62. private useTypescriptIncrementalApi;
  63. private resolveModuleNameModule;
  64. private resolveTypeReferenceDirectiveModule;
  65. private tsconfigPath;
  66. private compiler;
  67. private started;
  68. private elapsed;
  69. private cancellationToken;
  70. private isWatching;
  71. private checkDone;
  72. private compilationDone;
  73. private diagnostics;
  74. private lints;
  75. private emitCallback;
  76. private doneCallback;
  77. private typescriptPath;
  78. private typescript;
  79. private typescriptVersion;
  80. private eslintVersion;
  81. private service?;
  82. protected serviceRpc?: RpcProvider;
  83. private vue;
  84. private measureTime;
  85. private performance;
  86. private startAt;
  87. protected nodeArgs: string[];
  88. constructor(options?: Partial<ForkTsCheckerWebpackPlugin.Options>);
  89. private validateTypeScript;
  90. private validateEslint;
  91. private static prepareVueOptions;
  92. apply(compiler: any): void;
  93. private computeContextPath;
  94. private pluginStart;
  95. private pluginStop;
  96. private pluginCompile;
  97. private pluginEmit;
  98. private pluginDone;
  99. private spawnService;
  100. private killService;
  101. private handleServiceMessage;
  102. private handleServiceExit;
  103. private createEmitCallback;
  104. private createNoopEmitCallback;
  105. private printLoggerMessage;
  106. private createDoneCallback;
  107. }
  108. export = ForkTsCheckerWebpackPlugin;