# Socket Type alias

Module
import { Socket } from "@tsed/socketio"
Source/packages/socketio/src/decorators/socket.ts

# Overview

type Socket = SocketType;
/**
 * Inject the Socket instance in the decorated parameter.
 *
 * ### Example
 *
 * ```typescript
 * @SocketService("/nsp")
 * export class MyWS {
 *
 *   @Input("event")
 *   myMethod(@Socket socket) {
 *
 *   }
 * }
 * ```
 *
 * @experimental
 * @param target
 * @param {string} propertyKey
 * @param {number} index
 * @decorator
 */
export function Socket(target: any, propertyKey: string, index: number): any;

Other topics