From 02c87a85614e217b8e7b93753f315790ae9d99f6 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Tue, 25 Jan 2022 01:25:05 +0100 Subject: [PATCH] fix(typings): ensure compatibility with TypeScript 3.x (#4259) Labeled tuple elements were added in TypeScript 4.0. Reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements Related: https://github.com/socketio/socket.io/commit/44e20ba5bfcb54f5bbe678fc1bf7f30bb9d90274 --- lib/socket.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/socket.ts b/lib/socket.ts index a5d738a810..e5e43dbd72 100644 --- a/lib/socket.ts +++ b/lib/socket.ts @@ -107,7 +107,10 @@ export interface Handshake { auth: { [key: string]: any }; } -export type Event = [eventName: string, ...args: any[]]; +/** + * `[eventName, ...args]` + */ +export type Event = [string, ...any[]]; export class Socket< ListenEvents extends EventsMap = DefaultEventsMap,