// generated by diplomat-tool import type { ExecutionMode } from "./ExecutionMode.mjs" import type { IoLayout } from "./IoLayout.mjs" import type { MchprsWorld } from "./MchprsWorld.mjs" import type { NucleationError } from "./NucleationError.mjs" import type { Schematic } from "./Schematic.mjs" import type { Value } from "./Value.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * A typed circuit executor. Wraps * {@link crate::simulation::typed_executor::TypedCircuitExecutor}. */ export class TypedCircuitExecutor { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Create from a world and layout. Builds a fresh world from the * world's schematic (matches the old ABI, which cloned internally). */ static fromLayout(world: MchprsWorld, layout: IoLayout): TypedCircuitExecutor; /** * Create from a world and layout with simulation options. */ static fromLayoutWithOptions(world: MchprsWorld, layout: IoLayout, optimize: boolean, ioOnly: boolean): TypedCircuitExecutor; /** * Create from Insign annotations in a schematic. */ static fromInsign(schematic: Schematic): TypedCircuitExecutor; /** * Create from Insign annotations with options. */ static fromInsignWithOptions(schematic: Schematic, optimize: boolean, ioOnly: boolean): TypedCircuitExecutor; /** * Set the state mode ("stateless" | "stateful" | "manual"). */ setStateMode(mode: string): void; /** * Reset the executor to its initial state. */ reset(): void; /** * Advance the simulation by `ticks` ticks. */ tick(ticks: number): void; /** * Flush pending changes. */ flush(): void; /** * Set a single input value. */ setInput(name: string, value: Value): void; /** * Read a single output value. */ readOutput(name: string): Value; /** * Execute the circuit. `inputs_json` is a JSON object like * `{"input_name": {"type": "u32", "value": 42}}`; writes a JSON * object with `outputs`, `ticks_elapsed` and `condition_met`. */ execute(inputsJson: string, mode: ExecutionMode): string; /** * Input names as a JSON array string. */ inputNamesJson(): string; /** * Output names as a JSON array string. */ outputNamesJson(): string; /** * Layout info as a JSON object string * (old ABI: `typed_executor_get_layout_info`). */ layoutInfoJson(): string; /** * Sync the simulation state and return the schematic (cloned). */ syncToSchematic(): Schematic; }