From b9155536065b7cd615522f09028785267d71acbb Mon Sep 17 00:00:00 2001 From: Narcis B Date: Sat, 21 May 2022 23:41:12 +0300 Subject: [PATCH] add event constructor --- packages/client/index.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/client/index.d.ts b/packages/client/index.d.ts index d8879b5..2b08870 100644 --- a/packages/client/index.d.ts +++ b/packages/client/index.d.ts @@ -1018,6 +1018,17 @@ declare interface IClientEvents { playerExitColshape: (shape: ColshapeMp) => void; } +declare class EventMp { + // @ts-ignore + constructor(eventName: K, callback: IClientEvents[K]); + constructor(eventName: string, callback: (...args: any[]) => void); + + /** + * Destroys the event + */ + public destroy(): void; +} + declare type MultiEventHandlers = Partial & Record void>; declare interface EventMpPool { @@ -3150,6 +3161,7 @@ declare interface Mp { system: SystemMp; voiceChat: VoiceChatMp; raycasting: RaycastingMp; + Event: typeof EventMp; events: EventMpPool; browsers: BrowserMpPool; checkpoints: CheckpointMpPool;