Skip to content

Commit

Permalink
add event constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardssh committed May 21, 2022
1 parent dbb0a87 commit b915553
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,17 @@ declare interface IClientEvents {
playerExitColshape: (shape: ColshapeMp) => void;
}

declare class EventMp {
// @ts-ignore
constructor<K extends keyof IClientEvents>(eventName: K, callback: IClientEvents[K]);
constructor(eventName: string, callback: (...args: any[]) => void);

/**
* Destroys the event
*/
public destroy(): void;
}

declare type MultiEventHandlers = Partial<IClientEvents> & Record<string, (...args: any) => void>;

declare interface EventMpPool {
Expand Down Expand Up @@ -3150,6 +3161,7 @@ declare interface Mp {
system: SystemMp;
voiceChat: VoiceChatMp;
raycasting: RaycastingMp;
Event: typeof EventMp;
events: EventMpPool;
browsers: BrowserMpPool;
checkpoints: CheckpointMpPool;
Expand Down

0 comments on commit b915553

Please sign in to comment.