Appearance
API Reference
Technical documentation for ErgoPlanner's TypeScript APIs.
Overview
ErgoPlanner provides comprehensive TypeScript APIs for wastewater treatment process modeling and simulation. This reference documents all core interfaces, types, and methods used throughout the application.
Core APIs
Simulation Engine API
Core calculation engine interfaces including simulation context, calculation graphs, stream data, and basic calculation results.
Key Interfaces:
SimulationContext- Runtime context for simulationsCalculationGraph- Process flow graph structureStreamData- Flow and quality data at connection pointsFlowConditionSet- Multi-condition flow scenariosBasicCalculationResult- Hydraulic calculation results
Process Units API
Complete library of 160+ wastewater treatment process unit types and their configuration parameters.
Key Types:
ProcessUnitType- Enumeration of all supported process unitsProcessUnitParameters- Configuration parameters for unitsProcessUnitConfig- Quantity, duty/standby, and status configurationCalculationNode- Node representation in calculation graph
Categories:
- Preliminary Treatment (screens, grit chambers)
- Primary Treatment (clarifiers)
- Secondary Treatment (activated sludge, biofilters)
- Tertiary Treatment (filtration, disinfection, membranes)
- Sludge Treatment (thickening, digestion, dewatering)
- Flow Control (splitters, combiners, pumps)
- Chemical Dosing and Utilities
Controllers API
Process control interfaces for PID controllers and advanced control strategies.
Key Interfaces:
ControllerConfig- Base controller configurationPIDConfiguration- Complete PID tuning parametersControllerState- Runtime controller stateControllerOutput- Controller execution results- Extended controller types (Cascade, Ratio, Feedforward, etc.)
Data APIs
Mass Balance API
Integrated mass balance calculations for stream-by-stream process analysis.
Key Interfaces:
ProcessCalcMassBalance- Complete mass balance structureStreamBalance- Stream flow and quality dataStreamMassLoads- Mass loading calculations (kg/d)StreamConcentrations- Quality concentrations (mg/L)BalanceCheck- Mass conservation verification
Biokinetic Models API
ASM and ADM biokinetic model parameter interfaces.
Note: Biokinetic model types are currently being consolidated. This section will document ASM1, ASM2d, ASM3, and ADM1 parameters when available.
Export APIs
Export Formats API
File format specifications for project data export and import.
Formats:
- JSON - Project file schema
- CSV - Mass balance and results export
- PDF - Report generation structure
- DXF - CAD drawing export
Type Conventions
Optional Properties
Properties marked with ? are optional:
typescript
interface Example {
required: number; // Must be provided
optional?: number; // May be omitted
}Union Types
Types using | indicate multiple valid options:
typescript
type FlowConditionType = 'DWF' | 'avgFlow' | 'maxDaily';Enumerations
Many types use string literal unions for type safety:
typescript
type EquipmentStatus = 'existing' | 'new' | 'to-be-removed' | 'future';Units
ErgoPlanner uses consistent SI units throughout:
Flow:
- m³/d (cubic meters per day) for daily flows
- L/s (liters per second) for instantaneous flows
Concentrations:
- mg/L (milligrams per liter) for water quality parameters
- % (percent) for solids content
Mass Loads:
- kg/d (kilograms per day) for mass loading rates
- kg DS/d (kilograms dry solids per day) for sludge production
Time:
- hours (h) for hydraulic retention time
- days (d) for solids retention time
Energy:
- kWh/d (kilowatt-hours per day) for energy consumption
Using This Reference
Each API section includes:
- Interface Definitions - Complete TypeScript type definitions
- Property Tables - Detailed property descriptions with types
- Code Examples - Practical usage examples in TypeScript
- Related Types - Cross-references to related interfaces
- Implementation Notes - Important constraints and considerations
Version Information
This API reference corresponds to ErgoPlanner version 1.0.0 (in development).
API interfaces are subject to change during active development. Breaking changes will be documented in release notes.