Files
SnowLuma/.pnpm-store/v11/files/49/acc3ac0b5d397ed768ac0dcd8a55a7ae2b92c25b6565d5524ead6615f6ef95231b68ce7de27e68f0a63ebc87c099ad9b6d81c514196ab9f0862253642397a1
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

80 lines
1.9 KiB
Plaintext

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:forward-console': ForwardConsolePayload
/** @internal */
'vite:module-loaded': { modules: string[]; clientId: 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
}
export type ForwardConsolePayload =
| {
type: 'error'
data: {
name: string
message: string
stack?: string
}
}
| {
type: 'unhandled-rejection'
data: {
name: string
message: string
stack?: string
}
}
| {
type: 'log'
data: {
level: string
message: 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 & {})