From b6fab917e4f3816476b9cdd9087d735ebfb8e940 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 a4f7d477..92ea45ad 100644 --- a/client/index.d.ts +++ b/client/index.d.ts @@ -980,7 +980,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; @@ -2571,7 +2571,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; /**