import * as plugins from './smartsocket.plugins.js'; import * as pluginsTyped from './smartsocket.pluginstyped.js'; import * as interfaces from './interfaces/index.js'; import { SocketConnection } from './smartsocket.classes.socketconnection.js'; import { SocketFunction } from './smartsocket.classes.socketfunction.js'; import { SocketRequest } from './smartsocket.classes.socketrequest.js'; export interface ISmartsocketConstructorOptions { alias: string; port?: number; } export declare class Smartsocket { /** * a unique id to detect server restarts */ alias: string; smartenv: plugins.smartenv.Smartenv; options: ISmartsocketConstructorOptions; socketConnections: plugins.lik.ObjectMap; socketFunctions: plugins.lik.ObjectMap>; socketRequests: plugins.lik.ObjectMap>; eventSubject: plugins.smartrx.rxjs.Subject; private socketServer; constructor(optionsArg: ISmartsocketConstructorOptions); /** * Returns WebSocket hooks for integration with smartserve * Pass these hooks to SmartServe's websocket config */ getSmartserveWebSocketHooks(): pluginsTyped.ISmartserveWebSocketHooks; /** * starts smartsocket */ start(): Promise; /** * Handle a new WebSocket connection * Called by SocketServer when a new connection is established */ handleNewConnection(socket: pluginsTyped.TWebSocket | pluginsTyped.IWebSocketLike): Promise; /** * stops smartsocket */ stop(): Promise; /** * allows call to specific client. */ clientCall(functionNameArg: T['method'], dataArg: T['request'], targetSocketConnectionArg: SocketConnection): Promise; addSocketFunction(socketFunction: SocketFunction): void; }