import {Enum,Keys} from "@onebro/oba-common"; import {Server,Socket,Namespace} from "socket.io"; export type SocketEventPayload = void|boolean|Namespace|Socket; export type BaseSocketEvents = Enum; export type SocketEvent = (data:SocketData) => SocketEventPayload|Promise; export type SocketEventCreator = (io:Server,s?:Socket) => SocketEvent; export type SocketEvents = {[k in Keys]:SocketEventCreator;}; export type OBAExpressApiSocketsConfigType = SocketEvents; export type OBAExpressApiSocketsServer = (o:OBAExpressApiSocketsConfigType) => Server;