Skip to content

Commit

Permalink
fix: update ws types (#7605)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Apr 4, 2022
1 parent 212d454 commit b620587
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vite/src/node/server/ws.ts
Expand Up @@ -5,6 +5,7 @@ import type { ServerOptions as HttpsServerOptions } from 'https'
import { createServer as createHttpsServer } from 'https'
import type { ServerOptions, WebSocket as WebSocketRaw } from 'ws'
import { WebSocketServer as WebSocketServerRaw } from 'ws'
import type { WebSocket as WebSocketTypes } from 'types/ws'
import type { CustomPayload, ErrorPayload, HMRPayload } from 'types/hmrPayload'
import type { InferCustomEventPayload } from 'types/customEvent'
import type { ResolvedConfig } from '..'
Expand Down Expand Up @@ -38,7 +39,7 @@ export interface WebSocketServer {
/**
* Handle custom event emitted by `import.meta.hot.send`
*/
on: WebSocketServerRaw['on'] & {
on: WebSocketTypes.Server['on'] & {
<T extends string>(
event: T,
listener: WebSocketCustomListener<InferCustomEventPayload<T>>
Expand All @@ -47,7 +48,7 @@ export interface WebSocketServer {
/**
* Unregister event listener.
*/
off: WebSocketServerRaw['off'] & {
off: WebSocketTypes.Server['off'] & {
(event: string, listener: Function): void
}
}
Expand All @@ -65,7 +66,7 @@ export interface WebSocketClient {
* The raw WebSocket instance
* @advanced
*/
socket: WebSocketRaw
socket: WebSocketTypes
}

const wsServerEvents = [
Expand Down

0 comments on commit b620587

Please sign in to comment.