diff --git a/guide/api-hmr.md b/guide/api-hmr.md index 18c509ab..109f0643 100644 --- a/guide/api-hmr.md +++ b/guide/api-hmr.md @@ -10,7 +10,10 @@ Vite は特別な `import.meta.hot` オブジェクトを介して、マニュ ```ts twoslash import type { ModuleNamespace } from 'vite/types/hot.d.ts' -import type { InferCustomEventPayload } from 'vite/types/customEvent.d.ts' +import type { + CustomEventName, + InferCustomEventPayload, +} from 'vite/types/customEvent.d.ts' // ---cut--- interface ImportMeta { @@ -32,15 +35,18 @@ interface ViteHotContext { prune(cb: (data: any) => void): void invalidate(message?: string): void - on( + on( event: T, cb: (payload: InferCustomEventPayload) => void, ): void - off( + off( event: T, cb: (payload: InferCustomEventPayload) => void, ): void - send(event: T, data?: InferCustomEventPayload): void + send( + event: T, + data?: InferCustomEventPayload, + ): void } ```