Home / File/ customEvent.d.ts — vite Source File

customEvent.d.ts — vite Source File

Architecture documentation for customEvent.d.ts, a typescript file in the vite codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  fa49128f_1b2e_bfe5_e09a_a0308064143b["customEvent.d.ts"]
  5cf9be80_40d1_d4d0_6303_aaacb93fbbbc["./hmrPayload.js"]
  fa49128f_1b2e_bfe5_e09a_a0308064143b --> 5cf9be80_40d1_d4d0_6303_aaacb93fbbbc
  style fa49128f_1b2e_bfe5_e09a_a0308064143b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type {
  ErrorPayload,
  FullReloadPayload,
  PrunePayload,
  UpdatePayload,
} from './hmrPayload.js'

export interface CustomEventMap {
  // client events
  'vite:beforeUpdate': UpdatePayload
  'vite:afterUpdate': UpdatePayload
  'vite:beforePrune': PrunePayload
  'vite:beforeFullReload': FullReloadPayload
  'vite:error': ErrorPayload
  'vite:invalidate': InvalidatePayload
  'vite:ws:connect': WebSocketConnectionPayload
  'vite:ws:disconnect': WebSocketConnectionPayload
  /** @internal */
  'vite:module-loaded': { modules: string[] }

  // server events
  'vite:client:connect': undefined
  'vite:client:disconnect': undefined
}

export interface WebSocketConnectionPayload {
  /**
   * @experimental
   * We expose this instance experimentally to see potential usage.
   * This might be removed in the future if we didn't find reasonable use cases.
   * If you find this useful, please open an issue with details so we can discuss and make it stable API.
   */
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
  webSocket: WebSocket
}

export interface InvalidatePayload {
  path: string
  message: string | undefined
  firstInvalidatedBy: string
}

/**
 * provides types for payloads of built-in Vite events
 */
export type InferCustomEventPayload<T extends string> =
  T extends keyof CustomEventMap ? CustomEventMap[T] : any

/**
 * provides types for names of built-in Vite events
 */
export type CustomEventName = keyof CustomEventMap | (string & {})

Domain

Dependencies

  • ./hmrPayload.js

Frequently Asked Questions

What does customEvent.d.ts do?
customEvent.d.ts is a source file in the vite codebase, written in typescript. It belongs to the HMRClient domain.
What does customEvent.d.ts depend on?
customEvent.d.ts imports 1 module(s): ./hmrPayload.js.
Where is customEvent.d.ts in the architecture?
customEvent.d.ts is located at packages/vite/types/customEvent.d.ts (domain: HMRClient, directory: packages/vite/types).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free