import { ConnectSocket, ConnectSocketOptions, SocketTask, SendSocketMessage, SendSocketMessageOptions, CloseSocket, CloseSocketOptions, OnSocketOpen, OnSocketOpenCallback, OnSocketError, OnSocketErrorCallback, OnSocketMessage, OnSocketMessageCallback, OnSocketClose, OnSocketCloseCallback } from "../interface"; import { WebSocketManager } from "./websocket/WebSocketManager" export const connectSocket : ConnectSocket = (options : ConnectSocketOptions) : SocketTask => { return WebSocketManager.getInstance().connectSocket(options); } export const sendSocketMessage : SendSocketMessage = (options : SendSocketMessageOptions) : void => { return WebSocketManager.getInstance().sendSocketMessage(options); } export const closeSocket : CloseSocket = (options : CloseSocketOptions) : void => { return WebSocketManager.getInstance().closeSocket(options); } export function onSocketOpen(callback : OnSocketOpenCallback) : void { return WebSocketManager.getInstance().onSocketOpen(callback); } export function onSocketMessage(callback : OnSocketMessageCallback) : void { return WebSocketManager.getInstance().onSocketMessage(callback); } export function onSocketClose(callback : OnSocketCloseCallback) : void { return WebSocketManager.getInstance().onSocketClose(callback); } export function onSocketError(callback : OnSocketErrorCallback) : void { return WebSocketManager.getInstance().onSocketError(callback); }