@swmmrs/swmmrs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +264 -0
  2. package/dist/README.md +264 -0
  3. package/dist/serial/README.md +264 -0
  4. package/dist/serial/swmmrs.d.ts +395 -0
  5. package/dist/serial/swmmrs.js +3169 -0
  6. package/dist/serial/swmmrs_bg.wasm +0 -0
  7. package/dist/snippets/swmmrs-parallel-5d1c71108133e81d/worker-pool/browser.js +98 -0
  8. package/dist/swmmrs.d.ts +422 -0
  9. package/dist/swmmrs.js +3330 -0
  10. package/dist/swmmrs_bg.wasm +0 -0
  11. package/index.d.ts +2 -0
  12. package/index.js +2 -0
  13. package/lib/swmmrs/client.d.ts +11 -0
  14. package/lib/swmmrs/client.d.ts.map +1 -0
  15. package/lib/swmmrs/client.js +82 -0
  16. package/lib/swmmrs/client.js.map +1 -0
  17. package/lib/swmmrs/enums.d.ts +41 -0
  18. package/lib/swmmrs/enums.d.ts.map +1 -0
  19. package/lib/swmmrs/enums.js +2 -0
  20. package/lib/swmmrs/enums.js.map +1 -0
  21. package/lib/swmmrs/exceptions.d.ts +98 -0
  22. package/lib/swmmrs/exceptions.d.ts.map +1 -0
  23. package/lib/swmmrs/exceptions.js +86 -0
  24. package/lib/swmmrs/exceptions.js.map +1 -0
  25. package/lib/swmmrs/index.d.ts +27 -0
  26. package/lib/swmmrs/index.d.ts.map +1 -0
  27. package/lib/swmmrs/index.js +13 -0
  28. package/lib/swmmrs/index.js.map +1 -0
  29. package/lib/swmmrs/objects/amm.d.ts +114 -0
  30. package/lib/swmmrs/objects/amm.d.ts.map +1 -0
  31. package/lib/swmmrs/objects/amm.js +19 -0
  32. package/lib/swmmrs/objects/amm.js.map +1 -0
  33. package/lib/swmmrs/objects/collections.d.ts +109 -0
  34. package/lib/swmmrs/objects/collections.d.ts.map +1 -0
  35. package/lib/swmmrs/objects/collections.js +158 -0
  36. package/lib/swmmrs/objects/collections.js.map +1 -0
  37. package/lib/swmmrs/objects/definitions.d.ts +215 -0
  38. package/lib/swmmrs/objects/definitions.d.ts.map +1 -0
  39. package/lib/swmmrs/objects/definitions.js +69 -0
  40. package/lib/swmmrs/objects/definitions.js.map +1 -0
  41. package/lib/swmmrs/objects/lids.d.ts +446 -0
  42. package/lib/swmmrs/objects/lids.d.ts.map +1 -0
  43. package/lib/swmmrs/objects/lids.js +90 -0
  44. package/lib/swmmrs/objects/lids.js.map +1 -0
  45. package/lib/swmmrs/objects/links.d.ts +615 -0
  46. package/lib/swmmrs/objects/links.d.ts.map +1 -0
  47. package/lib/swmmrs/objects/links.js +90 -0
  48. package/lib/swmmrs/objects/links.js.map +1 -0
  49. package/lib/swmmrs/objects/nodes.d.ts +494 -0
  50. package/lib/swmmrs/objects/nodes.d.ts.map +1 -0
  51. package/lib/swmmrs/objects/nodes.js +147 -0
  52. package/lib/swmmrs/objects/nodes.js.map +1 -0
  53. package/lib/swmmrs/objects/options.d.ts +112 -0
  54. package/lib/swmmrs/objects/options.d.ts.map +1 -0
  55. package/lib/swmmrs/objects/options.js +27 -0
  56. package/lib/swmmrs/objects/options.js.map +1 -0
  57. package/lib/swmmrs/objects/rtk.d.ts +82 -0
  58. package/lib/swmmrs/objects/rtk.d.ts.map +1 -0
  59. package/lib/swmmrs/objects/rtk.js +19 -0
  60. package/lib/swmmrs/objects/rtk.js.map +1 -0
  61. package/lib/swmmrs/objects/subcatchments.d.ts +575 -0
  62. package/lib/swmmrs/objects/subcatchments.d.ts.map +1 -0
  63. package/lib/swmmrs/objects/subcatchments.js +243 -0
  64. package/lib/swmmrs/objects/subcatchments.js.map +1 -0
  65. package/lib/swmmrs/output.d.ts +412 -0
  66. package/lib/swmmrs/output.d.ts.map +1 -0
  67. package/lib/swmmrs/output.js +507 -0
  68. package/lib/swmmrs/output.js.map +1 -0
  69. package/lib/swmmrs/protocol.d.ts +80 -0
  70. package/lib/swmmrs/protocol.d.ts.map +1 -0
  71. package/lib/swmmrs/protocol.js +2 -0
  72. package/lib/swmmrs/protocol.js.map +1 -0
  73. package/lib/swmmrs/runtime.d.ts +22 -0
  74. package/lib/swmmrs/runtime.d.ts.map +1 -0
  75. package/lib/swmmrs/runtime.js +146 -0
  76. package/lib/swmmrs/runtime.js.map +1 -0
  77. package/lib/swmmrs/scenarios.d.ts +41 -0
  78. package/lib/swmmrs/scenarios.d.ts.map +1 -0
  79. package/lib/swmmrs/scenarios.js +2 -0
  80. package/lib/swmmrs/scenarios.js.map +1 -0
  81. package/lib/swmmrs/simulation.d.ts +249 -0
  82. package/lib/swmmrs/simulation.d.ts.map +1 -0
  83. package/lib/swmmrs/simulation.js +415 -0
  84. package/lib/swmmrs/simulation.js.map +1 -0
  85. package/lib/swmmrs/snapshots.d.ts +192 -0
  86. package/lib/swmmrs/snapshots.d.ts.map +1 -0
  87. package/lib/swmmrs/snapshots.js +2 -0
  88. package/lib/swmmrs/snapshots.js.map +1 -0
  89. package/lib/swmmrs/types.d.ts +123 -0
  90. package/lib/swmmrs/types.d.ts.map +1 -0
  91. package/lib/swmmrs/types.js +2 -0
  92. package/lib/swmmrs/types.js.map +1 -0
  93. package/lib/swmmrs/worker.d.ts +2 -0
  94. package/lib/swmmrs/worker.d.ts.map +1 -0
  95. package/lib/swmmrs/worker.js +488 -0
  96. package/lib/swmmrs/worker.js.map +1 -0
  97. package/package.json +33 -0
  98. package/src/swmmrs/client.ts +76 -0
  99. package/src/swmmrs/enums.ts +73 -0
  100. package/src/swmmrs/exceptions.ts +120 -0
  101. package/src/swmmrs/index.ts +79 -0
  102. package/src/swmmrs/objects/amm.ts +113 -0
  103. package/src/swmmrs/objects/collections.ts +153 -0
  104. package/src/swmmrs/objects/definitions.ts +246 -0
  105. package/src/swmmrs/objects/lids.ts +487 -0
  106. package/src/swmmrs/objects/links.ts +626 -0
  107. package/src/swmmrs/objects/nodes.ts +504 -0
  108. package/src/swmmrs/objects/options.ts +114 -0
  109. package/src/swmmrs/objects/rtk.ts +79 -0
  110. package/src/swmmrs/objects/subcatchments.ts +650 -0
  111. package/src/swmmrs/output.ts +798 -0
  112. package/src/swmmrs/protocol.ts +62 -0
  113. package/src/swmmrs/runtime.ts +188 -0
  114. package/src/swmmrs/scenarios.ts +40 -0
  115. package/src/swmmrs/simulation.ts +406 -0
  116. package/src/swmmrs/snapshots.ts +199 -0
  117. package/src/swmmrs/types.ts +123 -0
  118. package/src/swmmrs/worker.ts +233 -0
  119. package/worker-node.js +142 -0
  120. package/worker.js +1 -0
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Owner-bound node handle obtained with `simulation.nodes.get(id)`.
3
+ *
4
+ * The constructor is private. Use {@link NodeConfiguration.kind} to distinguish
5
+ * junctions, storage nodes, outfalls, and dividers; there are no public subtype
6
+ * classes. Reads return detached, frozen records. Mutations require explicit
7
+ * methods, not assignments to those records.
8
+ *
9
+ * Operations reject when the owner is closed or failed, or the requested operation
10
+ * is invalid for its lifecycle state or node kind. Wrong-kind calls do not mutate
11
+ * the model. Read {@link statistics} before ending the run; hydraulic and quality
12
+ * reads remain available in `ended`.
13
+ */
14
+ export class Node {
15
+ /** Canonical configured node ID. */
16
+ id;
17
+ #call;
18
+ constructor(id, call) { this.id = id; this.#call = call; Object.freeze(this); }
19
+ /** @internal */
20
+ static create(id, call) { return new Node(id, call); }
21
+ /**
22
+ * Read current hydraulics in `running`, `complete`, or `ended`.
23
+ * @returns A detached {@link NodeResults} record in project units, not a time series.
24
+ */
25
+ results() { return this.#call("node", this.id); }
26
+ /**
27
+ * Read common and kind-specific declarations in any healthy owner state.
28
+ * @returns A detached {@link NodeConfiguration}; non-applicable subtype fields are `null`.
29
+ */
30
+ configuration() { return this.#call("nodeConfiguration", this.id); }
31
+ /**
32
+ * Atomically update declarations in `open` or `ended`.
33
+ * An accepted edit in `ended` returns the owner to `open`.
34
+ * @param patch - Sparse {@link NodePatch}. Omitted top-level fields retain their values.
35
+ * @returns Resolves after the complete patch is accepted.
36
+ * @throws Rejects for an invalid patch, wrong node kind, or invalid lifecycle state;
37
+ * no part of a rejected patch is applied.
38
+ * @example
39
+ * ```typescript
40
+ * import type { Node } from "@swmmrs/swmmrs";
41
+ * declare const node: Node;
42
+ * await node.configure({ fullDepth: 4.5, initialDepth: 0.25 });
43
+ * ```
44
+ */
45
+ configure(patch) { return this.#call("configureNode", this.id, patch); }
46
+ /**
47
+ * Read the persistent additive API inflow in any healthy owner state.
48
+ * @returns Inflow in project flow units, excluding other inflow sources.
49
+ */
50
+ externalInflow() { return this.#call("nodeExternalInflow", this.id); }
51
+ /**
52
+ * Set persistent additive API inflow in `open`, `running`, or `ended`.
53
+ * @param flow - Inflow in project flow units. Zero removes the API contribution.
54
+ * @returns Resolves after the forcing is updated.
55
+ */
56
+ setExternalInflow(flow) { return this.#call("setNodeExternalInflow", this.id, flow); }
57
+ /**
58
+ * Set a persistent fixed-stage override in `open`, `running`, or `ended`.
59
+ * This runtime forcing is separate from {@link NodePatch.boundary}.
60
+ * @param stage - Outfall boundary elevation in project length units (ft or m).
61
+ * @returns Resolves after the forcing is updated.
62
+ * @throws Rejects for a non-outfall node or an invalid stage or lifecycle state.
63
+ */
64
+ setOutfallStage(stage) { return this.#call("setOutfallStage", this.id, stage); }
65
+ /**
66
+ * Read the effective fixed stage in any healthy owner state; outfalls only.
67
+ * @returns Runtime override if set, otherwise the declared fixed stage, in project
68
+ * length units; `null` when neither supplies a fixed stage.
69
+ * @throws Rejects for a non-outfall node.
70
+ */
71
+ fixedStage() { return this.#call("outfallFixedStage", this.id); }
72
+ /**
73
+ * Read current pollutant concentrations in `running`, `complete`, or `ended`.
74
+ * @returns Detached {@link NodeQuality} arrays aligned with their pollutant IDs.
75
+ */
76
+ quality() { return this.#call("nodeQuality", this.id); }
77
+ /**
78
+ * Queue concentration overrides for the next quality-routing step; requires `running`.
79
+ * The override expires after that step rather than becoming a persistent forcing.
80
+ * @param values - Sparse pollutant-ID map of nonnegative concentrations in each
81
+ * pollutant's configured concentration units.
82
+ * @returns Resolves after the overrides are queued.
83
+ * @throws Rejects invalid IDs, concentrations, or lifecycle states.
84
+ */
85
+ overridePollutantConcentrations(values) {
86
+ return this.#call("overrideNodePollutantConcentrations", this.id, values);
87
+ }
88
+ /**
89
+ * Read persistent external pollutant mass fluxes in `open`, `running`, or `ended`.
90
+ * @returns A detached {@link PollutantValues} map in configured pollutant mass-flux units.
91
+ */
92
+ externalPollutantMassFlux() {
93
+ return this.#call("nodeExternalPollutantMassFlux", this.id);
94
+ }
95
+ /**
96
+ * Read one persistent external mass flux in `open`, `running`, or `ended`.
97
+ * @param pollutantId - Configured pollutant ID.
98
+ * @returns The pollutant's external mass flux in its configured mass-flux units.
99
+ * @throws Rejects an unknown pollutant ID or invalid lifecycle state.
100
+ */
101
+ externalPollutantMassFluxValue(pollutantId) {
102
+ return this.#call("nodeExternalPollutantMassFluxValue", this.id, pollutantId);
103
+ }
104
+ /**
105
+ * Update persistent external pollutant mass fluxes in `open`, `running`, or `ended`.
106
+ * @param values - Sparse pollutant-ID map in configured pollutant mass-flux units.
107
+ * @param replace - Defaults to `false`: merge supplied IDs. With `true`, replace
108
+ * the complete mapping and reset omitted pollutants to zero.
109
+ * @returns Resolves after the atomic update.
110
+ * @throws Rejects invalid pollutant IDs, values, or lifecycle states.
111
+ */
112
+ updateExternalPollutantMassFlux(values, replace = false) {
113
+ return this.#call("updateNodeExternalPollutantMassFlux", this.id, values, replace);
114
+ }
115
+ /**
116
+ * Reset all persistent external pollutant mass fluxes to zero.
117
+ * Requires `open`, `running`, or `ended`; equivalent to
118
+ * `updateExternalPollutantMassFlux({}, true)`.
119
+ * @returns Resolves after the complete mapping is cleared.
120
+ */
121
+ clearExternalPollutantMassFlux() {
122
+ return this.updateExternalPollutantMassFlux({}, true);
123
+ }
124
+ /**
125
+ * Read cumulative node statistics in `running` or `complete`, before ending the run.
126
+ * @returns A detached {@link NodeStatistics} record for the current run.
127
+ */
128
+ statistics() { return this.#call("nodeStatistics", this.id); }
129
+ /**
130
+ * Read storage-only statistics in `running` or `complete`.
131
+ * @returns A detached {@link StorageStatistics} record for the current run.
132
+ * @throws Rejects for a non-storage node or invalid lifecycle state.
133
+ */
134
+ storageStatistics() { return this.#call("storageStatistics", this.id); }
135
+ /**
136
+ * Read outfall-only statistics in `running` or `complete`.
137
+ * @returns A detached {@link OutfallStatistics} record for the current run.
138
+ * @throws Rejects for a non-outfall node or invalid lifecycle state.
139
+ */
140
+ outfallStatistics() { return this.#call("outfallStatistics", this.id); }
141
+ /**
142
+ * Read cumulative total inflow volume in `running` or `complete`.
143
+ * @returns Volume in project volume units (ft³ or m³), not a flow rate.
144
+ */
145
+ totalInflowVolume() { return this.#call("nodeTotalInflowVolume", this.id); }
146
+ }
147
+ //# sourceMappingURL=nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../../src/swmmrs/objects/nodes.ts"],"names":[],"mappings":"AAqVA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,IAAI;IACf,oCAAoC;IAC3B,EAAE,CAAS;IACX,KAAK,CAAO;IACrB,YAAoB,EAAU,EAAE,IAAU,IAAI,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrG,gBAAgB;IAChB,MAAM,CAAC,MAAM,CAAC,EAAU,EAAE,IAAU,IAAU,OAAO,IAAI,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAE1E;;;OAGG;IACH,OAAO,KAA2B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEvE;;;OAGG;IACH,aAAa,KAAiC,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEhG;;;;;;;;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;IACH,+BAA+B,CAAC,MAAuB,EAAE,OAAO,GAAG,KAAK;QACtE,OAAO,IAAI,CAAC,KAAK,CAAC,qCAAqC,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;IAED;;;;;OAKG;IACH,8BAA8B;QAC5B,OAAO,IAAI,CAAC,+BAA+B,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACH,UAAU,KAA8B,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEvF;;;;OAIG;IACH,iBAAiB,KAAiC,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEpG;;;;OAIG;IACH,iBAAiB,KAAiC,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEpG;;;OAGG;IACH,iBAAiB,KAAsB,OAAO,IAAI,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC9F"}
@@ -0,0 +1,112 @@
1
+ import type { CustomEllipseModel, InertiaDamping, ModelTime, NormalFlowLimit, SurchargeMethod } from "../enums.js";
2
+ /** Calendar month and day for seasonal sweeping; validated by the native solver. */
3
+ export type SweepDay = readonly [month: number, day: number];
4
+ /** Sparse model-option update. Omitted fields retain their values; tolerances are not writable. */
5
+ export interface ModelOptionsPatch {
6
+ /** Nominal routing step in seconds. Resets Courant factor to zero unless both are supplied. */
7
+ routingStepSeconds?: number;
8
+ /** Binary report interval in whole seconds, independent of iterator observation cadence. */
9
+ reportStepSeconds?: number;
10
+ /** Enable detailed report tables; object selection still uses `includedInReport`. */
11
+ detailedReportingEnabled?: boolean;
12
+ /** Ellipse cross-section interpretation. */
13
+ customEllipseModel?: CustomEllipseModel;
14
+ /** Surcharge treatment. */
15
+ surchargeMethod?: SurchargeMethod;
16
+ /** Allow configured nodal surface ponding. */
17
+ allowPonding?: boolean;
18
+ /** Dynamic Wave inertia-damping rule. */
19
+ inertiaDamping?: InertiaDamping;
20
+ /** Normal-flow limiting rule. */
21
+ normalFlowLimit?: NormalFlowLimit;
22
+ /** Allow steady-state routing skips. */
23
+ skipSteadyState?: boolean;
24
+ /** Process rainfall; does not create missing definitions. */
25
+ rainfallEnabled?: boolean;
26
+ /** Process rainfall-dependent infiltration/inflow. */
27
+ rdiiEnabled?: boolean;
28
+ /** Process snowmelt. */
29
+ snowmeltEnabled?: boolean;
30
+ /** Process groundwater. */
31
+ groundwaterEnabled?: boolean;
32
+ /** Route hydraulic flow. */
33
+ routingEnabled?: boolean;
34
+ /** Process water quality. */
35
+ qualityEnabled?: boolean;
36
+ /** Control-rule interval in whole seconds. */
37
+ ruleStepSeconds?: number;
38
+ /** First month/day for seasonal sweeping. */
39
+ sweepStart?: SweepDay;
40
+ /** Last month/day for seasonal sweeping. */
41
+ sweepEnd?: SweepDay;
42
+ /** Maximum Dynamic Wave trial iterations. */
43
+ maximumTrials?: number;
44
+ /** Model-requested solver threads, distinct from the worker capacity in `SimulationOptions.threads`. */
45
+ requestedThreads?: number;
46
+ /** Lower bound for variable routing steps in seconds. */
47
+ minimumRoutingStepSeconds?: number;
48
+ /** Conduit-lengthening time step in seconds. */
49
+ lengtheningStepSeconds?: number;
50
+ /** Antecedent dry period in seconds. */
51
+ antecedentDrySeconds?: number;
52
+ /** Variable-step adjustment factor. Explicit writes must be positive; reads may contain the disabled value zero. */
53
+ courantFactor?: number;
54
+ /** Minimum nodal surface area in ft² or m². */
55
+ minimumSurfaceArea?: number;
56
+ /** Minimum conduit slope as a ratio, not a percentage. */
57
+ minimumConduitSlope?: number;
58
+ }
59
+ /** Complete read-only option record, including all writable fields and solver tolerances. */
60
+ export interface ModelOptions extends Readonly<Required<ModelOptionsPatch>> {
61
+ /** Read-only hydraulic head convergence tolerance. */
62
+ readonly headTolerance: number;
63
+ /** Read-only system-flow convergence tolerance. */
64
+ readonly systemFlowTolerance: number;
65
+ /** Read-only lateral-flow convergence tolerance. */
66
+ readonly lateralFlowTolerance: number;
67
+ }
68
+ /** Sparse calendar boundaries for `Simulation.updateSchedule()`; omitted times retain their values. */
69
+ export interface SchedulePatch {
70
+ /** Simulation start in timezone-free model calendar time. */
71
+ startTime?: ModelTime;
72
+ /** First reporting time in timezone-free model calendar time. */
73
+ reportStart?: ModelTime;
74
+ /** Simulation end in timezone-free model calendar time. */
75
+ endTime?: ModelTime;
76
+ }
77
+ /** Option-family operations added to the shared worker protocol. */
78
+ export interface OptionsOperations {
79
+ updateSchedule: {
80
+ args: [SchedulePatch];
81
+ result: void;
82
+ };
83
+ maximumRoutingStepSeconds: {
84
+ args: [];
85
+ result: number;
86
+ };
87
+ }
88
+ /** Stable model options. Updates are atomic and require an open or ended run. */
89
+ export declare class SimulationOptionsView {
90
+ #private;
91
+ private constructor();
92
+ /** Read the complete option record in a healthy owner state.
93
+ * @returns Detached {@link ModelOptions}, including read-only solver tolerances.
94
+ */
95
+ read(): Promise<ModelOptions>;
96
+ /** Atomically update model options in `open` or `ended`; accepted edits return `ended` to `open`.
97
+ * @param patch - Sparse option values. Unknown keys, invalid types/enums, and solver-invalid values reject the whole patch.
98
+ * @returns Resolves after all supplied fields are accepted.
99
+ * @example
100
+ * ```typescript
101
+ * import type { Simulation } from "@swmmrs/swmmrs";
102
+ * declare const simulation: Simulation;
103
+ * await simulation.options.update({ routingStepSeconds: 30, reportStepSeconds: 300, qualityEnabled: true });
104
+ * ```
105
+ */
106
+ update(patch: ModelOptionsPatch): Promise<void>;
107
+ /** Read the maximum routing interval allowed by current configuration.
108
+ * @returns Maximum routing interval in seconds.
109
+ */
110
+ maximumRoutingStepSeconds(): Promise<number>;
111
+ }
112
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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,OAAO,eAA+C;IAGtD;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CAAkC;IAC/D;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAkD;IACjG;;OAEG;IACH,yBAAyB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAoD;CACjG"}
@@ -0,0 +1,27 @@
1
+ /** Stable model options. Updates are atomic and require an open or ended run. */
2
+ export class SimulationOptionsView {
3
+ #call;
4
+ constructor(call) { this.#call = call; }
5
+ /** @internal */
6
+ static create(call) { return new SimulationOptionsView(call); }
7
+ /** Read the complete option record in a healthy owner state.
8
+ * @returns Detached {@link ModelOptions}, including read-only solver tolerances.
9
+ */
10
+ read() { return this.#call("options"); }
11
+ /** Atomically update model options in `open` or `ended`; accepted edits return `ended` to `open`.
12
+ * @param patch - Sparse option values. Unknown keys, invalid types/enums, and solver-invalid values reject the whole patch.
13
+ * @returns Resolves after all supplied fields are accepted.
14
+ * @example
15
+ * ```typescript
16
+ * import type { Simulation } from "@swmmrs/swmmrs";
17
+ * declare const simulation: Simulation;
18
+ * await simulation.options.update({ routingStepSeconds: 30, reportStepSeconds: 300, qualityEnabled: true });
19
+ * ```
20
+ */
21
+ update(patch) { return this.#call("configureOptions", patch); }
22
+ /** Read the maximum routing interval allowed by current configuration.
23
+ * @returns Maximum routing interval in seconds.
24
+ */
25
+ maximumRoutingStepSeconds() { return this.#call("maximumRoutingStepSeconds"); }
26
+ }
27
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/swmmrs/objects/options.ts"],"names":[],"mappings":"AAwFA,iFAAiF;AACjF,MAAM,OAAO,qBAAqB;IACvB,KAAK,CAAO;IACrB,YAAoB,IAAU,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;IACtD,gBAAgB;IAChB,MAAM,CAAC,MAAM,CAAC,IAAU,IAA2B,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5F;;OAEG;IACH,IAAI,KAA4B,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/D;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAwB,IAAmB,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjG;;OAEG;IACH,yBAAyB,KAAsB,OAAO,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;CACjG"}
@@ -0,0 +1,82 @@
1
+ /** One detached RTK short-, medium-, or long-response parameter set. */
2
+ export interface UnitHydrographResponse {
3
+ /** Fraction of rainfall converted to RDII. */
4
+ readonly rainfallFraction: number;
5
+ /** Time to peak in hours. */
6
+ readonly timeToPeakHours: number;
7
+ /** Recession-to-time-to-peak ratio. */
8
+ readonly recessionRatio: number;
9
+ /** Maximum initial abstraction depth in inches or millimetres. */
10
+ readonly maximumInitialAbstraction: number;
11
+ /** Initial abstraction recovery rate in rainfall-depth units per day. */
12
+ readonly initialAbstractionRecoveryRate: number;
13
+ /** Initial abstraction depth at start in inches or millimetres. */
14
+ readonly initialAbstractionAtStart: number;
15
+ }
16
+ /** One calendar month's named RTK responses. */
17
+ export interface UnitHydrographMonth {
18
+ /** Short-response parameters. */
19
+ readonly short: UnitHydrographResponse;
20
+ /** Medium-response parameters. */
21
+ readonly medium: UnitHydrographResponse;
22
+ /** Long-response parameters. */
23
+ readonly long: UnitHydrographResponse;
24
+ }
25
+ /** Complete January-through-December RTK response matrix. */
26
+ export interface UnitHydrographConfiguration {
27
+ /** Canonical rain-gage ID. */
28
+ readonly rainGage: string;
29
+ /** Exactly twelve monthly records, January through December. */
30
+ readonly monthlyResponses: readonly UnitHydrographMonth[];
31
+ }
32
+ /** Sparse RTK update. Omitted fields retain their current values. */
33
+ export interface UnitHydrographPatch {
34
+ /** Replacement rain-gage ID. */
35
+ rainGage?: string;
36
+ /** Replacement complete January-through-December array, exactly twelve entries. */
37
+ monthlyResponses?: readonly UnitHydrographMonth[];
38
+ }
39
+ /** Detached RTK RDII node assignment in native project units. IDs are canonical. */
40
+ export interface RdiiAssignment {
41
+ /** Canonical receiving node ID. */
42
+ readonly node: string;
43
+ /** Canonical RTK unit-hydrograph ID. */
44
+ readonly unitHydrograph: string;
45
+ /** Assigned land area in acres (US) or hectares (SI). */
46
+ readonly area: number;
47
+ }
48
+ export interface RtkOperations {
49
+ unitHydrographConfiguration: {
50
+ args: [string];
51
+ result: UnitHydrographConfiguration;
52
+ };
53
+ configureUnitHydrograph: {
54
+ args: [string, UnitHydrographPatch];
55
+ result: void;
56
+ };
57
+ rdiiAssignments: {
58
+ args: [];
59
+ result: readonly RdiiAssignment[];
60
+ };
61
+ replaceRdiiAssignments: {
62
+ args: [readonly RdiiAssignment[]];
63
+ result: void;
64
+ };
65
+ }
66
+ /** Editable RTK definition from `simulation.unitHydrographs`; node assignments are separate. */
67
+ export declare class UnitHydrograph {
68
+ #private;
69
+ /** Canonical configured hydrograph ID. */
70
+ readonly id: string;
71
+ private constructor();
72
+ /** Read the definition in any healthy owner state.
73
+ * @returns Detached rain-gage identity and complete twelve-month response matrix.
74
+ */
75
+ configuration(): Promise<UnitHydrographConfiguration>;
76
+ /** Atomically update an RTK definition in `open` or `ended`; accepted edits return the owner to `open`.
77
+ * @param patch - Sparse fields; a monthly array replaces all twelve months.
78
+ * @returns Resolves after the complete patch is accepted.
79
+ */
80
+ configure(patch: UnitHydrographPatch): Promise<void>;
81
+ }
82
+ //# sourceMappingURL=rtk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtk.d.ts","sourceRoot":"","sources":["../../../src/swmmrs/objects/rtk.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,gBAAgB,E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AA;KAAE,CAAC;IACrF,uBAAuB,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;QAAC,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC;IAC/E,eAAe,EAAE;QAAE,IAAI,EAAE,EAAE,CAAC;QAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;KAAE,CAAC;IACjE,sBAAsB,EAAE;QAAE,IAAI,EAAE,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;QAAC,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC;CAC7E;AAED,gGAAgG;AAChG,qBAAa,cAAc;;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,OAAO,eAA8F;IAGrG;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAA+D;IACpH;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAkE;CACvH"}
@@ -0,0 +1,19 @@
1
+ /** Editable RTK definition from `simulation.unitHydrographs`; node assignments are separate. */
2
+ export class UnitHydrograph {
3
+ /** Canonical configured hydrograph ID. */
4
+ id;
5
+ #call;
6
+ constructor(id, call) { this.id = id; this.#call = call; Object.freeze(this); }
7
+ /** @internal */
8
+ static create(id, call) { return new UnitHydrograph(id, call); }
9
+ /** Read the definition in any healthy owner state.
10
+ * @returns Detached rain-gage identity and complete twelve-month response matrix.
11
+ */
12
+ configuration() { return this.#call("unitHydrographConfiguration", this.id); }
13
+ /** Atomically update an RTK definition in `open` or `ended`; accepted edits return the owner to `open`.
14
+ * @param patch - Sparse fields; a monthly array replaces all twelve months.
15
+ * @returns Resolves after the complete patch is accepted.
16
+ */
17
+ configure(patch) { return this.#call("configureUnitHydrograph", this.id, patch); }
18
+ }
19
+ //# sourceMappingURL=rtk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtk.js","sourceRoot":"","sources":["../../../src/swmmrs/objects/rtk.ts"],"names":[],"mappings":"AA6DA,gGAAgG;AAChG,MAAM,OAAO,cAAc;IACzB,0CAA0C;IACjC,EAAE,CAAS;IACX,KAAK,CAAO;IACrB,YAAoB,EAAU,EAAE,IAAU,IAAI,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrG,gBAAgB;IAChB,MAAM,CAAC,MAAM,CAAC,EAAU,EAAE,IAAU,IAAoB,OAAO,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9F;;OAEG;IACH,aAAa,KAA2C,OAAO,IAAI,CAAC,KAAK,CAAC,6BAA6B,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpH;;;OAGG;IACH,SAAS,CAAC,KAA0B,IAAmB,OAAO,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACvH"}