Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events::Event on client #32

Merged
merged 2 commits into from May 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions 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