import { EpanetModule } from '@model-create/epanet-engine'; export type EpanetMemoryType = "int" | "double" | "char" | "char-title"; export interface MemoryTypes { int: number; double: number; char: string; "char-title": string; } export interface InputArgDef { typeHint?: "string" | "number" | "enum" | "boolean" | "double[]" | "length" | string; /** Set to true if this JS string argument needs conversion to a char* pointer */ isStringPtr?: boolean; /** For length parameters, specifies which array parameter this length corresponds to */ lengthFor?: string; } export interface OutputArgDef { /** The name of the output property in the returned object */ name: string; /** The type of the output value */ type: EpanetMemoryType; } export interface ApiFunctionDefinition { /** The exact name exported by WASM (e.g., '_EN_getnodeindex') */ wasmFunctionName: keyof EpanetModule; /** Describes the INPUT arguments the JS function receives (excluding project handle) */ inputArgDefs: InputArgDef[]; /** List of output arguments with names and types */ outputArgDefs: OutputArgDef[]; /** Optional: Minimum EPANET version required */ minVersion?: number; /** Optional: Custom formatting for return values */ postProcess?: (results: any[]) => any; arrayInputs?: { [key: string]: { type: "double"; lengthParam: string; }; }; }