index.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. export default StylelintWebpackPlugin;
  2. export type Compiler = import('webpack').Compiler;
  3. export type Module = import('webpack').Module;
  4. export type Options = import('./options').Options;
  5. export type FileSystemInfoEntry = Partial<
  6. | {
  7. timestamp: number;
  8. }
  9. | number
  10. >;
  11. declare class StylelintWebpackPlugin {
  12. /**
  13. * @param {Options} options
  14. */
  15. constructor(options?: Options);
  16. key: string;
  17. options: Partial<import('./options').PluginOptions>;
  18. /**
  19. * @param {Compiler} compiler
  20. */
  21. run(compiler: Compiler): Promise<void>;
  22. startTime: number;
  23. /** @type {ReadonlyMap<string, null | FileSystemInfoEntry | "ignore" | undefined>} */
  24. prevTimestamps: ReadonlyMap<
  25. string,
  26. 'ignore' | FileSystemInfoEntry | null | undefined
  27. >;
  28. /**
  29. * @param {Compiler} compiler
  30. * @returns {void}
  31. */
  32. apply(compiler: Compiler): void;
  33. /**
  34. *
  35. * @param {Compiler} compiler
  36. * @returns {string}
  37. */
  38. getContext(compiler: Compiler): string;
  39. /**
  40. * @param {Compiler} compiler
  41. * @param {string[]} wanted
  42. * @param {string[]} exclude
  43. * @returns {string[]}
  44. */
  45. getFiles(compiler: Compiler, wanted: string[], exclude: string[]): string[];
  46. /**
  47. * @param {ReadonlyMap<string, null | FileSystemInfoEntry | "ignore" | undefined>} fileTimestamps
  48. * @returns {string[]}
  49. */
  50. getChangedFiles(
  51. fileTimestamps: ReadonlyMap<
  52. string,
  53. 'ignore' | FileSystemInfoEntry | null | undefined
  54. >
  55. ): string[];
  56. }