import { createContext } from "react";
import type { WsClient } from "./ws-client.js";

export type WsContextValue = {
  client: WsClient;
  isConnected: boolean;
  connect: (url: string) => Promise<void>;
  disconnect: () => void;
};

export const WsContext = createContext<WsContextValue | null>(null);
