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 const onSocketOpen : OnSocketOpen = (callback : OnSocketOpenCallback) : void => { return WebSocketManager.getInstance().onSocketOpen(callback); } export const onSocketMessage : OnSocketMessage = (callback : OnSocketMessageCallback) : void => { return WebSocketManager.getInstance().onSocketMessage(callback); } export const onSocketClose : OnSocketClose = (callback : OnSocketCloseCallback) : void => { return WebSocketManager.getInstance().onSocketClose(callback); } export const onSocketError : OnSocketError = (callback : OnSocketErrorCallback) : void => { return WebSocketManager.getInstance().onSocketError(callback); }