From 2ea6e56f9b8f0f53ac1c0a4445d529483aebbeda Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 23 Jan 2022 19:55:56 +0100 Subject: [PATCH] fix(typings): ensure compatibility with TypeScript 3.x 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: 0cb6ac9 --- 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,