import type { RPCLists } from "@sammo/server_util"; import type { ActionRequest, ActionResult } from "./GameEngine.js"; import type { MessagePort } from "node:worker_threads"; import type { CityID, GeneralID, NationID, TroopID } from "@sammo/game_logic/src/defs.js"; import type { ActionPackDef } from "@sammo/game_logic"; import type { ActionRequestList, QueueType } from "@sammo/game_logic/src/ActionRequest/index.js"; //Remove Third argument. Use Infer export type MapRscActionRequest = { [P in keyof T]: (invoker: Parameters[1] & QueueType, arg: Parameters[1]) => ReturnType } export type ActionPack = MapRscActionRequest; export type GameEngineRPCDefs = { stop: () => Promise, pushAPIAction: (action: ActionRequest) => Promise, pushServerAction: (action: ActionRequest) => Promise, }; type WorkerUpdate = { type: 'update', lastExecuted: string, } export type GameEngineMsg = WorkerUpdate; type WorkerInit = { type: 'init', port: MessagePort, guid: string, } export type GameEngineWorkerMsg = WorkerInit;