From 1196a23797cc0e6e61f06793778c2ecdd7fc6722 Mon Sep 17 00:00:00 2001 From: YannBcf Date: Mon, 19 Jun 2023 20:43:28 +0200 Subject: [PATCH] feat: improve types --- package.json | 2 +- src/events/client.ts | 6 +++--- src/events/server.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3192435..e272668 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yannbcf/altv-rpc", - "version": "0.4.3", + "version": "0.4.4", "type": "module", "author": "YannBcf", "main": "./dist/index.js", diff --git a/src/events/client.ts b/src/events/client.ts index 26678e1..18faf18 100644 --- a/src/events/client.ts +++ b/src/events/client.ts @@ -46,9 +46,9 @@ export type AltClientEvent = { entityHitEntity: { damager: alt.Entity; target: alt.Entity; weaponHash: number }; }; -export type ClientEvent = AltClientEvent & { - removeEvent: () => void; -}; +export type ClientEvent = { + [K in keyof AltClientEvent]: AltClientEvent[K] & { removeEvent: () => void } +} export function getAltClientEventKeys(): (keyof alt.IClientEvent)[] { const events = [ diff --git a/src/events/server.ts b/src/events/server.ts index 9b62d0c..c96cdfd 100644 --- a/src/events/server.ts +++ b/src/events/server.ts @@ -51,9 +51,9 @@ export type AltServerEvent = { metaChange: { target: alt.BaseObject; key: string; value: AllowedAny; oldValue: AllowedAny }; }; -export type ServerEvent = AltServerEvent & { - removeEvent: () => void; -}; +export type ServerEvent = { + [K in keyof AltServerEvent]: AltServerEvent[K] & { removeEvent: () => void } +} export function getAltServerEventKeys(): (keyof alt.IServerEvent)[] { const events = [