import { FoundationSimulator, FoundationSimulatorListening } from "./foundation/dist/index.mjs"; import { Operation } from "effection"; //#region src/simulation.d.ts /** * Spawn a child Node process to run a simulation factory. * * This runs `./run-simulation-child.mjs ` in a separate Node * process and reads the first JSON line printed to stdout to discover the * child's listening port. Optionally the simulacrum gateway port will be * passed to the child so it can fetch `globalData`. * * @param name - human-friendly name for logging * @param modulePath - path to the module exporting a simulation factory or instance * @returns an `Operation` that provides `FoundationSimulatorListening` from the child */ declare function useSimulationChildProcess(name: string, modulePath: string, options?: { nodeArgs?: string[]; }): Operation<{ port: number; pid: number; }>; /** * Run a simulator either in-process or in a child Node subprocess. * * When the second argument is a factory, `useSimulation` runs the simulator * in-process and resolves to the simulator's listening information. * * When the second argument is a module path string, `useSimulation` starts the * simulator in a fresh child process and resolves to the child's listening * information plus PID. * * If `globalData` is configured on the runner, this operation fetches the * data from the Simulacrum gateway and passes it as `initData` to the factory * or child module. * * @param name - human-friendly name used for logging * @param createFactory - factory function that returns a `FoundationSimulator` * @param modulePath - path to a module exporting a simulator factory * @param options - optional subprocess hint for overload resolution */ declare function useSimulation>(name: string, createFactory: (initData?: unknown) => FoundationSimulator, options?: { subprocess?: false; }): Operation>; declare function useSimulation(name: string, modulePath: string, options?: { subprocess?: true; nodeArgs?: string[]; }): Operation<{ port: number; pid: number; }>; //#endregion export { useSimulation, useSimulationChildProcess };