import { getMeta , SocketClass , SocketMeta , EventType } from '../meta' ; import { Type } from '../middleware' ; param { EventType } type param { string } event param { Type [ ] } middleware function makeDecorator ( type , event , middleware ? ) { return ( target , methodName , descriptor ? ) => { const meta = getMeta ( target ) ; meta . listeners . push ( { event , type , middleware , methodName } ) ; return descriptor ; } ; } see param { Type [ ] } middleware export function Connection ( middleware ? ) { return makeDecorator ( EventType . IO , 'connection' , middleware ) ; } alias export const Connect = Connection ; see param { string } event param { Type [ ] } middleware export function GlobalEvent ( event , middleware ? ) { return makeDecorator ( EventType . IO , event , middleware ) ; } see param { Type [ ] } middleware export function Disconnect ( middleware ? ) { return makeDecorator ( EventType . Socket , 'disconnect' , middleware ) ; } see param { string } event param { Type [ ] } middleware export function Event ( event , middleware ? ) { return makeDecorator ( EventType . Socket , event , middleware ) ; } ;