index.d.cts 913 B

12345678910111213141516171819202122232425262728293031323334
  1. import { PluginOption } from 'vite';
  2. /**
  3. * Configuration for the watched paths.
  4. */
  5. interface Config {
  6. /**
  7. * Whether full reload should happen regardless of the file path.
  8. * @default true
  9. */
  10. always?: boolean;
  11. /**
  12. * How many milliseconds to wait before reloading the page after a file change.
  13. * @default 0
  14. */
  15. delay?: number;
  16. /**
  17. * Whether to log when a file change triggers a full reload.
  18. * @default true
  19. */
  20. log?: boolean;
  21. /**
  22. * Files will be resolved against this path.
  23. * @default process.cwd()
  24. */
  25. root?: string;
  26. }
  27. declare function normalizePaths(root: string, path: string | string[]): string[];
  28. /**
  29. * Allows to automatically reload the page when a watched file changes.
  30. */
  31. declare const _default: (paths: string | string[], config?: Config) => PluginOption;
  32. export { Config, _default as default, normalizePaths };