feat: 服務端 Api 可以持有 client socket

This commit is contained in:
CrescentLeaf
2025-09-21 14:12:06 +08:00
parent f600245d3b
commit 28ffd134df
3 changed files with 23 additions and 11 deletions

View File

@@ -1,9 +1,11 @@
import ApiCallbackMessage from "../api/ApiCallbackMessage.ts"
import * as SocketIo from "socket.io"
type EventCallbackFunction = (args: { [key: string]: unknown }, clientInfo: {
userId: string
deviceId: string
ip: string
socket: SocketIo.Socket<SocketIo.DefaultEventsMap, SocketIo.DefaultEventsMap, SocketIo.DefaultEventsMap, any>
}) => ApiCallbackMessage
export default EventCallbackFunction