diff --git a/packages/core/useWebSocket/index.ts b/packages/core/useWebSocket/index.ts index 9f8f53786f8..a1d222b15d4 100644 --- a/packages/core/useWebSocket/index.ts +++ b/packages/core/useWebSocket/index.ts @@ -6,7 +6,7 @@ import { useEventListener } from '../useEventListener' export type WebSocketStatus = 'OPEN' | 'CONNECTING' | 'CLOSED' -export interface WebSocketOptions { +export interface UseWebSocketOptions { onConnected?: (ws: WebSocket) => void onDisconnected?: (ws: WebSocket, event: CloseEvent) => void onError?: (ws: WebSocket, event: Event) => void @@ -83,7 +83,7 @@ export interface WebSocketOptions { protocols?: string[] } -export interface WebSocketResult { +export interface UseWebSocketReturn { /** * Reference to the latest data received via the websocket, * can be watched to respond to incoming messages @@ -135,8 +135,8 @@ function resolveNestedOptions(options: T | true): T { */ export function useWebSocket( url: string, - options: WebSocketOptions = {}, -): WebSocketResult { + options: UseWebSocketOptions = {}, +): UseWebSocketReturn { const { onConnected, onDisconnected,