At the moment, properties from ProcedureListenerInfo cannot be used in the rage environment because they are hardcoded and do not have all the required properties and methods.
function myFunction({ player /* :any */ }: rpc.ProcedureListenerInfo) { ... }
// should be
function myFunction({ player /* :PlayerMp */ }: rpc.ProcedureListenerInfo<PlayerMp>) { ... }
Current Behavior:
At the moment, properties from
ProcedureListenerInfo
cannot be used in the rage environment because they are hardcoded and do not have all the required properties and methods.https://github.com/LeonardSSH/rage-rpc/blob/928742602a99dfbeda577e687f072166cd0d073d/types/index.d.ts#L1-L10
Possible solution:
PlayerMp
with a generic type, with defaultany
, and let the developer pass as argument the corresponding interface for type-safe.