BREAKING CHANGE(socketconnection): Stricter typings, smartserve hooks, connection fixes, and tag API change

This commit is contained in:
2025-12-04 07:59:44 +00:00
parent 5b21955e04
commit 0499db71b8
12 changed files with 1039 additions and 2864 deletions

View File

@@ -58,7 +58,7 @@ export class Smartsocket {
* Handle a new WebSocket connection
* Called by SocketServer when a new connection is established
*/
public async handleNewConnection(socket: WebSocket | pluginsTyped.ws.WebSocket) {
public async handleNewConnection(socket: pluginsTyped.TWebSocket | pluginsTyped.IWebSocketLike) {
const socketConnection: SocketConnection = new SocketConnection({
alias: undefined,
authenticated: false,
@@ -76,8 +76,8 @@ export class Smartsocket {
socketConnection.eventSubject.next('disconnected');
};
socket.addEventListener('close', handleClose);
socket.addEventListener('error', handleClose);
(socket as pluginsTyped.IWebSocketLike).addEventListener('close', handleClose);
(socket as pluginsTyped.IWebSocketLike).addEventListener('error', handleClose);
try {
await socketConnection.authenticate();