From 1bcddc0fe37e549e5e4585fbe81d037f52803955 Mon Sep 17 00:00:00 2001 From: S0P4 Date: Wed, 20 Dec 2023 19:51:42 -0300 Subject: [PATCH] fix(client): onRpc any to return type (#293) * Add LocalVehicle to LocalPlayer vehicle property (#287) * Fix onRpc typing --------- Co-authored-by: xshady <54737754+xxshady@users.noreply.github.com> --- client/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/index.d.ts b/client/index.d.ts index 86b59c8b..aa6920db 100644 --- a/client/index.d.ts +++ b/client/index.d.ts @@ -987,7 +987,7 @@ declare module "alt-client" { public readonly name: string; /** Player's vehicle, null if player is not in any vehicle */ - public readonly vehicle: Vehicle | null; + public readonly vehicle: Vehicle | LocalVehicle | null; public readonly isDead: boolean; @@ -2578,7 +2578,7 @@ declare module "alt-client" { * @remarks The return value of the listener function determines the response clients will receive. When returning multiple values, use an array. Returning an Error object will cause the promise on the server to throw an exception which has to be caught. * */ - export function onRpc(rpcName: K, listener: (...args: Parameters) => Promise | ReturnType): void; + export function onRpc(rpcName: K, listener: (...args: Parameters) => Promise> | ReturnType): void; export function onRpc(rpcName: Exclude, listener: (...args: any[]) => Promise | any): void; /**