import { SocketConnectOption } from "phoenix"; declare module "phoenix" { interface Socket { reconnectTimer: Timer; } } export type Transport = SocketConnectOption["transport"]; export type IConnection = { connect: (getToken: () => string, baseURL: string) => void; disconnect: () => void; isConnected: () => boolean; on: (eventName: string, func: Function) => void; }; /** * Returns a Connection object that you can use to interact with the * remote AgentHub service. If running in a browser, the `transport` * is not required. If running in Node.js or Bun, you can pass the * transport from the `isomorphic-ws` package. * * @param {object} transport - The transport object (optional). * @returns A Connection object with methods to connect, disconnect, receive events, etc... * * @example * import transport from "isomorphic-ws" * const conn = Connection(transport) */ export declare function Connection(transport?: Transport): IConnection;