diff --git a/packages/websockets/decorators/socket-gateway.decorator.ts b/packages/websockets/decorators/socket-gateway.decorator.ts index 8fc1c9baef1..e0d9e1a7e6f 100644 --- a/packages/websockets/decorators/socket-gateway.decorator.ts +++ b/packages/websockets/decorators/socket-gateway.decorator.ts @@ -8,15 +8,17 @@ import { GatewayMetadata } from '../interfaces'; * @publicApi */ export function WebSocketGateway(port?: number): ClassDecorator; -export function WebSocketGateway< - T extends Record = GatewayMetadata, ->(options?: T): ClassDecorator; -export function WebSocketGateway< - T extends Record = GatewayMetadata, ->(port?: number, options?: T): ClassDecorator; -export function WebSocketGateway< - T extends Record = GatewayMetadata, ->(portOrOptions?: number | T, options?: T): ClassDecorator { +export function WebSocketGateway( + options?: T, +): ClassDecorator; +export function WebSocketGateway( + port?: number, + options?: T, +): ClassDecorator; +export function WebSocketGateway( + portOrOptions?: number | T, + options?: T, +): ClassDecorator { const isPortInt = Number.isInteger(portOrOptions as number); // eslint-disable-next-line prefer-const let [port, opt] = isPortInt ? [portOrOptions, options] : [0, portOrOptions];