Skip to content

Types and enums

Source-generated reference for runtime options, metadata, calendar times, and public categorical unions. See Units and time and Lifecycle and ownership for explanations. Model declaration options are on the Simulation options page.

SimulationOptions

Worker creation options, distinct from the INP model options.

Properties

Property Type Description
threads? number Positive integer worker capacity. Node defaults to 1; isolated browser pages may use hardware concurrency. One selects serial WASM; higher values require browser cross-origin isolation. Effective solver threads may be capped by the model.
workerUrl? string | URL Worker asset URL override; otherwise resolved relative to the compiled module.

RunOptions

Options for starting a run or executing one model to completion.

Extended by

Properties

Property Type Description
saveResults? boolean Retain binary report-period results; defaults to true. False returns empty output bytes.

StepOptions

Automatic advancement and observation cadence for Simulation.steps().

Extends

Properties

Property Type Description Inherited from
saveResults? boolean Retain binary report-period results; defaults to true. False returns empty output bytes. RunOptions.saveResults
seconds? number Positive 32-bit integer seconds between observations. Omit for each routing step. -
strict? boolean Land exactly on observation boundaries; defaults to true. Ignored without seconds. False allows overshoot by a routing step. -

SimulationInfo

Detached model identities, solver metadata, and configured schedule from simulation.info().

Properties

Property Modifier Type Description
flowUnits readonly FlowUnits Configured project flow units.
unitSystem readonly UnitSystem Configured US or SI unit system.
solverVersion readonly string Native solver release.
solverBuildId readonly string Embedded native solver build identifier.
routeModel readonly RoutingModel Configured routing model.
effectiveThreads readonly number Effective solver thread count after runtime and model caps.
nodeIds readonly readonly string[] Canonical node IDs in configured order.
linkIds readonly readonly string[] Canonical link IDs in configured order.
subcatchmentIds readonly readonly string[] Canonical subcatchment IDs in configured order.
rainGageIds readonly readonly string[] Canonical rain-gage IDs in configured order.
pollutantIds readonly readonly string[] Canonical pollutant IDs in configured order.
landUseIds readonly readonly string[] Canonical land-use IDs in configured order.
timePatternIds readonly readonly string[] Canonical time-pattern IDs in configured order.
curveIds readonly readonly string[] Canonical curve IDs in configured order.
timeSeriesIds readonly readonly string[] Canonical time-series IDs in configured order.
controlIds readonly readonly string[] Canonical control-rule IDs in configured order.
transectIds readonly readonly string[] Canonical transect IDs in configured order.
aquiferIds readonly readonly string[] Canonical aquifer IDs in configured order.
snowmeltIds readonly readonly string[] Canonical snowmelt parameter-set IDs in configured order.
shapeIds readonly readonly string[] Canonical custom-shape IDs in configured order.
streetIds readonly readonly string[] Canonical street IDs in configured order.
inletDesignIds readonly readonly string[] Canonical inlet-design IDs in configured order.
ammModelIds readonly readonly string[] Canonical AMM-model IDs in configured order.
unitHydrographIds readonly readonly string[] Canonical RTK unit-hydrograph IDs in configured order.
lidControlIds readonly readonly string[] Canonical LID-control IDs in configured order.
startTime readonly string Configured simulation start, without a timezone.
endTime readonly string Configured simulation end, without a timezone.
reportStart readonly string First reporting time, without a timezone.

SimulationStatus

Detached lifecycle/progress record. simulation.status() is unavailable after close.

Properties

Property Modifier Type Description
state readonly SimulationState Current owner lifecycle state.
isOpen readonly boolean Whether the native project is open.
isStarted readonly boolean Whether a solver run has started.
configurationDirty readonly boolean Whether accepted declaration changes need solver preparation.
saveResults readonly boolean Whether this run retains binary report-period results.
currentTime readonly string | null Current model time, or null before a result time exists.
elapsedSeconds readonly number Elapsed simulation time in seconds.
durationSeconds readonly number Configured simulation duration in seconds.
percentComplete readonly number Completion in the range 0 to 100.
stepCount readonly number Number of routing steps executed.
reportPeriodCount readonly number Number of report periods written.
warningCount readonly number Native warning count.

RunResults

Finalized, caller-owned files returned by run(), finish(), or runSwmm().

Properties

Property Modifier Type Description
report readonly string Finalized report text.
output readonly Uint8Array Finalized binary output bytes; empty with saveResults: false. Not a live worker view.

SimulationState

type SimulationState = "open" | "running" | "complete" | "ended" | "failed" | "closed";

Owner lifecycle state. A type-only union, not a runtime enum.


FlowUnits

type FlowUnits = "Cfs" | "Gpm" | "Mgd" | "Cms" | "Lps" | "Mld";

Project flow units: ft³/s, US gal/min, million US gal/day, m³/s, L/s, or million L/day.


RoutingModel

type RoutingModel = "NoRouting" | "Sf" | "Kw" | "Ekw" | "Dw";

No routing, steady flow, kinematic wave, extended kinematic wave, or Dynamic Wave.


NodeKind

type NodeKind = "Junction" | "Outfall" | "Storage" | "Divider";

Configured node kind. A type-only string union, not a JavaScript enum object.


LinkKind

type LinkKind = "Conduit" | "Pump" | "Orifice" | "Weir" | "Outlet";

Configured hydraulic link family; handles do not have public subtype subclasses.


ModelTime

type ModelTime = string;

Model calendar time, YYYY-MM-DDTHH🇲🇲ss, with no timezone.


UnitSystem

type UnitSystem = "us" | "si";

Model unit system: US customary or SI.


CustomEllipseModel

type CustomEllipseModel = "epa_legacy" | "true_ellipse";

Legacy EPA ellipse interpretation or true-ellipse geometry.


SurchargeMethod

type SurchargeMethod = "extran" | "slot";

EXTRAN surcharge treatment or the slot method.


InertiaDamping

type InertiaDamping = "none" | "partial" | "full";

Dynamic Wave inertial-term damping.


NormalFlowLimit

type NormalFlowLimit = "slope" | "froude" | "both" | "neither";

Criterion for limiting flow to the normal-flow value.


OrificeKind

type OrificeKind = "side" | "bottom";

Side or bottom orifice orientation.


WeirKind

type WeirKind = "transverse" | "sideflow" | "v_notch" | "trapezoidal" | "roadway";

Supported weir geometries.


RoadSurface

type RoadSurface = "unspecified" | "paved" | "gravel";

Roadway-weir surface used by its discharge relationship.


OutletHeadBasis

type OutletHeadBasis = "depth" | "head";

Outlet rating uses upstream depth or hydraulic head difference.


StandardCrossSectionShape

type StandardCrossSectionShape = 
  | "dummy"
  | "circular"
  | "filled_circular"
  | "rect_closed"
  | "rect_open"
  | "trapezoidal"
  | "triangular"
  | "parabolic"
  | "power_function"
  | "rect_triangular"
  | "rect_round"
  | "modified_basket"
  | "horizontal_ellipse"
  | "vertical_ellipse"
  | "arch"
  | "egg_shaped"
  | "horseshoe"
  | "gothic"
  | "catenary"
  | "semi_elliptical"
  | "basket_handle"
  | "semi_circular"
  | "force_main";

Native standard cross-section shape names; geometry interpretation depends on the shape.


InfilKind

type InfilKind = 
  | "horton"
  | "modified_horton"
  | "green_ampt"
  | "modified_green_ampt"
  | "curve_number";

Supported Horton, Green-Ampt, and curve-number infiltration models.


OutKind

type OutKind = "node" | "subcatchment";

Receiving object family for a subcatchment outlet.


FlowClass

type FlowClass = 
  | "dry"
  | "upstream_dry"
  | "downstream_dry"
  | "subcritical"
  | "supercritical"
  | "upstream_critical"
  | "downstream_critical";

Seven hydraulic flow classes, in the same order used by link statistics duration arrays.


SolverErrorCode

type SolverErrorCode = 
  | "memory"
  | "kinwave"
  | "ode_solver"
  | "timestep"
  | "subcatch_outlet"
  | "aquifer_params"
  | "ground_elev"
  | "length"
  | "elev_drop"
  | "roughness"
  | "barrels"
  | "slope"
  | "no_xsect"
  | "xsect"
  | "no_curve"
  | "pump_limits"
  | "loop"
  | "multi_outlet"
  | "dummy_link"
  | "divider"
  | "divider_link"
  | "weir_divider"
  | "node_depth"
  | "regulator"
  | "storage_volume"
  | "outfall"
  | "regulator_shape"
  | "no_outlets"
  | "unithyd_times"
  | "unithyd_ratios"
  | "rdii_area"
  | "rain_file_conflict"
  | "rain_gage_format"
  | "rain_gage_tseries"
  | "rain_gage_interval"
  | "cyclic_treatment"
  | "curve_sequence"
  | "timeseries_sequence"
  | "snowmelt_params"
  | "snowpack_params"
  | "lid_type"
  | "lid_layer"
  | "lid_params"
  | "lid_areas"
  | "lid_capture_area"
  | "start_date"
  | "report_date"
  | "report_step"
  | "input"
  | "line_length"
  | "items"
  | "keyword"
  | "dup_name"
  | "name"
  | "number"
  | "datetime"
  | "rule"
  | "transect_unknown"
  | "transect_sequence"
  | "transect_too_few"
  | "transect_too_many"
  | "transect_manning"
  | "transect_overbank"
  | "transect_no_depth"
  | "math_expr"
  | "infil_params"
  | "file_name"
  | "inp_file"
  | "rpt_file"
  | "out_file"
  | "out_size"
  | "out_write"
  | "out_read"
  | "rain_file_scratch"
  | "rain_file_open"
  | "rain_file_data"
  | "rain_file_sequence"
  | "rain_file_format"
  | "rain_iface_format"
  | "rain_file_gage"
  | "runoff_file_open"
  | "runoff_file_format"
  | "runoff_file_end"
  | "runoff_file_read"
  | "hotstart_file_open"
  | "hotstart_file_format"
  | "hotstart_file_read"
  | "no_climate_file"
  | "climate_file_open"
  | "climate_file_read"
  | "climate_end_of_file"
  | "rdii_file_scratch"
  | "rdii_file_open"
  | "rdii_file_format"
  | "routing_file_open"
  | "routing_file_format"
  | "routing_file_nomatch"
  | "routing_file_names"
  | "table_file_open"
  | "table_file_read"
  | "checkpoint_invalid"
  | "checkpoint_unsupported_feature"
  | "checkpoint_integrity"
  | "checkpoint_external_dependency"
  | "checkpoint_sidecar_validation"
  | "checkpoint_rebuild"
  | "checkpoint_compatibility"
  | "checkpoint_decode"
  | "checkpoint_source_identity"
  | "checkpoint_destination_open"
  | "checkpoint_destination_validation"
  | "checkpoint_source_flush"
  | "checkpoint_source_preflight"
  | "checkpoint_sidecar_copy"
  | "checkpoint_rain_resource"
  | "checkpoint_sidecar_absent"
  | "checkpoint_rdii_resource"
  | "checkpoint_routing_interface"
  | "checkpoint_runoff_interface"
  | "checkpoint_read"
  | "checkpoint_append_role"
  | "system";

Known semantic solver categories. Numeric native codes remain available on errors.


FileContents

type FileContents = string | Blob | ArrayBuffer | ArrayBufferView;

File contents, never a host path. Strings are text; Blob includes browser File values. Byte views use their byte offset and length; Node Buffer is accepted.