rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
23 lines (22 loc) • 1.22 kB
TypeScript
import { type IRPCManager } from "../../common/rpc/IRPCManager";
import { type IClientRPCList, type IServerRPCList } from "../../../../shared/net/common/rpc/types";
type UIHandler = (...args: unknown[]) => unknown;
/**
* CCMP implementation of the rock-mod client RPC registry.
*
* The current gamemod routes UI RPC through the event bridge:
* `window.ccmp.emitClient(...)` -> `ccmp.on(...)` -> NetworkRPCService.
* `register` therefore keeps the same public contract as RageMP's
* `mp.events.addProc` without emitting noisy startup warnings.
*
* Native client->server RPC is still intentionally unsupported here. The
* gamemod uses its correlation-id protocol over `net.events` for that path.
*/
export declare class CCMPRPCManager implements IRPCManager {
private readonly _uiHandlers;
register<K extends keyof IClientRPCList>(rpcName: K, handler: (...args: Parameters<IClientRPCList[K]>) => ReturnType<IClientRPCList[K]>): void;
unregister<K extends keyof IClientRPCList>(rpcName: K): void;
emitServer<K extends keyof IServerRPCList>(rpcName: K, ...args: Parameters<IServerRPCList[K]>): Promise<ReturnType<IServerRPCList[K]>>;
getHandler(name: string): UIHandler | undefined;
}
export {};