Skip to content

Commit

Permalink
fix(client): onRpc any to return type (#293)
Browse files Browse the repository at this point in the history
* Add LocalVehicle to LocalPlayer vehicle property (#287)

* Fix onRpc typing

---------

Co-authored-by: xshady <[email protected]>
  • Loading branch information
S0P4 and xxshady authored Dec 20, 2023
1 parent f69a3db commit 1bcddc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<K extends keyof shared.ICustomServerClientRpc>(rpcName: K, listener: (...args: Parameters<shared.ICustomServerClientRpc[K]>) => Promise<any> | ReturnType<any>): void;
export function onRpc<K extends keyof shared.ICustomServerClientRpc>(rpcName: K, listener: (...args: Parameters<shared.ICustomServerClientRpc[K]>) => Promise<ReturnType<shared.ICustomClientServerRpc[K]>> | ReturnType<shared.ICustomClientServerRpc[K]>): void;
export function onRpc<K extends string>(rpcName: Exclude<K, keyof shared.ICustomServerClientRpc>, listener: (...args: any[]) => Promise<any> | any): void;

/**
Expand Down

0 comments on commit 1bcddc0

Please sign in to comment.