6a5fdf7e55f2da106a8686450b72448a47efd1e4df5aa22f0ce66f06819632d56769787d50205d177036be1f47acdf6f3ea54dd27ada2450d55d419ddfdaa7 1022 B

1234567891011121314151617181920212223242526272829303132333435
  1. import type {
  2. ErrorPayload,
  3. FullReloadPayload,
  4. PrunePayload,
  5. UpdatePayload,
  6. } from './hmrPayload'
  7. export interface CustomEventMap {
  8. 'vite:beforeUpdate': UpdatePayload
  9. 'vite:afterUpdate': UpdatePayload
  10. 'vite:beforePrune': PrunePayload
  11. 'vite:beforeFullReload': FullReloadPayload
  12. 'vite:error': ErrorPayload
  13. 'vite:invalidate': InvalidatePayload
  14. 'vite:ws:connect': WebSocketConnectionPayload
  15. 'vite:ws:disconnect': WebSocketConnectionPayload
  16. }
  17. export interface WebSocketConnectionPayload {
  18. /**
  19. * @experimental
  20. * We expose this instance experimentally to see potential usage.
  21. * This might be removed in the future if we didn't find reasonable use cases.
  22. * If you find this useful, please open an issue with details so we can discuss and make it stable API.
  23. */
  24. webSocket: WebSocket
  25. }
  26. export interface InvalidatePayload {
  27. path: string
  28. message: string | undefined
  29. }
  30. export type InferCustomEventPayload<T extends string> =
  31. T extends keyof CustomEventMap ? CustomEventMap[T] : any