@swmmrs/swmmrs 0.1.0 → 0.2.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.
- package/README.md +264 -264
- package/dist/README.md +264 -264
- package/dist/serial/README.md +264 -264
- package/dist/serial/swmmrs_bg.wasm +0 -0
- package/dist/swmmrs.d.ts +4 -4
- package/dist/swmmrs.js +13 -13
- package/dist/swmmrs_bg.wasm +0 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +53 -33
- package/src/swmmrs/client.ts +76 -76
- package/src/swmmrs/enums.ts +73 -73
- package/src/swmmrs/exceptions.ts +120 -120
- package/src/swmmrs/index.ts +79 -79
- package/src/swmmrs/objects/amm.ts +113 -113
- package/src/swmmrs/objects/collections.ts +153 -153
- package/src/swmmrs/objects/definitions.ts +246 -246
- package/src/swmmrs/objects/lids.ts +487 -487
- package/src/swmmrs/objects/links.ts +626 -626
- package/src/swmmrs/objects/nodes.ts +504 -504
- package/src/swmmrs/objects/options.ts +114 -114
- package/src/swmmrs/objects/rtk.ts +79 -79
- package/src/swmmrs/objects/subcatchments.ts +650 -650
- package/src/swmmrs/output.ts +798 -798
- package/src/swmmrs/protocol.ts +62 -62
- package/src/swmmrs/runtime.ts +188 -188
- package/src/swmmrs/scenarios.ts +40 -40
- package/src/swmmrs/simulation.ts +406 -406
- package/src/swmmrs/snapshots.ts +199 -199
- package/src/swmmrs/worker.ts +233 -233
- package/worker-node.js +142 -142
- package/worker.js +1 -1
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import type { CustomEllipseModel, InertiaDamping, ModelTime, NormalFlowLimit, SurchargeMethod } from "../enums.js";
|
|
2
|
-
import type { Call } from "../protocol.js";
|
|
3
|
-
|
|
4
|
-
/** Calendar month and day for seasonal sweeping; validated by the native solver. */
|
|
5
|
-
export type SweepDay = readonly [month: number, day: number];
|
|
6
|
-
|
|
7
|
-
/** Sparse model-option update. Omitted fields retain their values; tolerances are not writable. */
|
|
8
|
-
export interface ModelOptionsPatch {
|
|
9
|
-
/** Nominal routing step in seconds. Resets Courant factor to zero unless both are supplied. */
|
|
10
|
-
routingStepSeconds?: number;
|
|
11
|
-
/** Binary report interval in whole seconds, independent of iterator observation cadence. */
|
|
12
|
-
reportStepSeconds?: number;
|
|
13
|
-
/** Enable detailed report tables; object selection still uses `includedInReport`. */
|
|
14
|
-
detailedReportingEnabled?: boolean;
|
|
15
|
-
/** Ellipse cross-section interpretation. */
|
|
16
|
-
customEllipseModel?: CustomEllipseModel;
|
|
17
|
-
/** Surcharge treatment. */
|
|
18
|
-
surchargeMethod?: SurchargeMethod;
|
|
19
|
-
/** Allow configured nodal surface ponding. */
|
|
20
|
-
allowPonding?: boolean;
|
|
21
|
-
/** Dynamic Wave inertia-damping rule. */
|
|
22
|
-
inertiaDamping?: InertiaDamping;
|
|
23
|
-
/** Normal-flow limiting rule. */
|
|
24
|
-
normalFlowLimit?: NormalFlowLimit;
|
|
25
|
-
/** Allow steady-state routing skips. */
|
|
26
|
-
skipSteadyState?: boolean;
|
|
27
|
-
/** Process rainfall; does not create missing definitions. */
|
|
28
|
-
rainfallEnabled?: boolean;
|
|
29
|
-
/** Process rainfall-dependent infiltration/inflow. */
|
|
30
|
-
rdiiEnabled?: boolean;
|
|
31
|
-
/** Process snowmelt. */
|
|
32
|
-
snowmeltEnabled?: boolean;
|
|
33
|
-
/** Process groundwater. */
|
|
34
|
-
groundwaterEnabled?: boolean;
|
|
35
|
-
/** Route hydraulic flow. */
|
|
36
|
-
routingEnabled?: boolean;
|
|
37
|
-
/** Process water quality. */
|
|
38
|
-
qualityEnabled?: boolean;
|
|
39
|
-
/** Control-rule interval in whole seconds. */
|
|
40
|
-
ruleStepSeconds?: number;
|
|
41
|
-
/** First month/day for seasonal sweeping. */
|
|
42
|
-
sweepStart?: SweepDay;
|
|
43
|
-
/** Last month/day for seasonal sweeping. */
|
|
44
|
-
sweepEnd?: SweepDay;
|
|
45
|
-
/** Maximum Dynamic Wave trial iterations. */
|
|
46
|
-
maximumTrials?: number;
|
|
47
|
-
/** Model-requested solver threads, distinct from the worker capacity in `SimulationOptions.threads`. */
|
|
48
|
-
requestedThreads?: number;
|
|
49
|
-
/** Lower bound for variable routing steps in seconds. */
|
|
50
|
-
minimumRoutingStepSeconds?: number;
|
|
51
|
-
/** Conduit-lengthening time step in seconds. */
|
|
52
|
-
lengtheningStepSeconds?: number;
|
|
53
|
-
/** Antecedent dry period in seconds. */
|
|
54
|
-
antecedentDrySeconds?: number;
|
|
55
|
-
/** Variable-step adjustment factor. Explicit writes must be positive; reads may contain the disabled value zero. */
|
|
56
|
-
courantFactor?: number;
|
|
57
|
-
/** Minimum nodal surface area in ft² or m². */
|
|
58
|
-
minimumSurfaceArea?: number;
|
|
59
|
-
/** Minimum conduit slope as a ratio, not a percentage. */
|
|
60
|
-
minimumConduitSlope?: number;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** Complete read-only option record, including all writable fields and solver tolerances. */
|
|
64
|
-
export interface ModelOptions extends Readonly<Required<ModelOptionsPatch>> {
|
|
65
|
-
/** Read-only hydraulic head convergence tolerance. */
|
|
66
|
-
readonly headTolerance: number;
|
|
67
|
-
/** Read-only system-flow convergence tolerance. */
|
|
68
|
-
readonly systemFlowTolerance: number;
|
|
69
|
-
/** Read-only lateral-flow convergence tolerance. */
|
|
70
|
-
readonly lateralFlowTolerance: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Sparse calendar boundaries for `Simulation.updateSchedule()`; omitted times retain their values. */
|
|
74
|
-
export interface SchedulePatch {
|
|
75
|
-
/** Simulation start in timezone-free model calendar time. */
|
|
76
|
-
startTime?: ModelTime;
|
|
77
|
-
/** First reporting time in timezone-free model calendar time. */
|
|
78
|
-
reportStart?: ModelTime;
|
|
79
|
-
/** Simulation end in timezone-free model calendar time. */
|
|
80
|
-
endTime?: ModelTime;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Option-family operations added to the shared worker protocol. */
|
|
84
|
-
export interface OptionsOperations {
|
|
85
|
-
updateSchedule: { args: [SchedulePatch]; result: void };
|
|
86
|
-
maximumRoutingStepSeconds: { args: []; result: number };
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** Stable model options. Updates are atomic and require an open or ended run. */
|
|
90
|
-
export class SimulationOptionsView {
|
|
91
|
-
readonly #call: Call;
|
|
92
|
-
private constructor(call: Call) { this.#call = call; }
|
|
93
|
-
/** @internal */
|
|
94
|
-
static create(call: Call): SimulationOptionsView { return new SimulationOptionsView(call); }
|
|
95
|
-
/** Read the complete option record in a healthy owner state.
|
|
96
|
-
* @returns Detached {@link ModelOptions}, including read-only solver tolerances.
|
|
97
|
-
*/
|
|
98
|
-
read(): Promise<ModelOptions> { return this.#call("options"); }
|
|
99
|
-
/** Atomically update model options in `open` or `ended`; accepted edits return `ended` to `open`.
|
|
100
|
-
* @param patch - Sparse option values. Unknown keys, invalid types/enums, and solver-invalid values reject the whole patch.
|
|
101
|
-
* @returns Resolves after all supplied fields are accepted.
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* import type { Simulation } from "@swmmrs/swmmrs";
|
|
105
|
-
* declare const simulation: Simulation;
|
|
106
|
-
* await simulation.options.update({ routingStepSeconds: 30, reportStepSeconds: 300, qualityEnabled: true });
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
update(patch: ModelOptionsPatch): Promise<void> { return this.#call("configureOptions", patch); }
|
|
110
|
-
/** Read the maximum routing interval allowed by current configuration.
|
|
111
|
-
* @returns Maximum routing interval in seconds.
|
|
112
|
-
*/
|
|
113
|
-
maximumRoutingStepSeconds(): Promise<number> { return this.#call("maximumRoutingStepSeconds"); }
|
|
114
|
-
}
|
|
1
|
+
import type { CustomEllipseModel, InertiaDamping, ModelTime, NormalFlowLimit, SurchargeMethod } from "../enums.js";
|
|
2
|
+
import type { Call } from "../protocol.js";
|
|
3
|
+
|
|
4
|
+
/** Calendar month and day for seasonal sweeping; validated by the native solver. */
|
|
5
|
+
export type SweepDay = readonly [month: number, day: number];
|
|
6
|
+
|
|
7
|
+
/** Sparse model-option update. Omitted fields retain their values; tolerances are not writable. */
|
|
8
|
+
export interface ModelOptionsPatch {
|
|
9
|
+
/** Nominal routing step in seconds. Resets Courant factor to zero unless both are supplied. */
|
|
10
|
+
routingStepSeconds?: number;
|
|
11
|
+
/** Binary report interval in whole seconds, independent of iterator observation cadence. */
|
|
12
|
+
reportStepSeconds?: number;
|
|
13
|
+
/** Enable detailed report tables; object selection still uses `includedInReport`. */
|
|
14
|
+
detailedReportingEnabled?: boolean;
|
|
15
|
+
/** Ellipse cross-section interpretation. */
|
|
16
|
+
customEllipseModel?: CustomEllipseModel;
|
|
17
|
+
/** Surcharge treatment. */
|
|
18
|
+
surchargeMethod?: SurchargeMethod;
|
|
19
|
+
/** Allow configured nodal surface ponding. */
|
|
20
|
+
allowPonding?: boolean;
|
|
21
|
+
/** Dynamic Wave inertia-damping rule. */
|
|
22
|
+
inertiaDamping?: InertiaDamping;
|
|
23
|
+
/** Normal-flow limiting rule. */
|
|
24
|
+
normalFlowLimit?: NormalFlowLimit;
|
|
25
|
+
/** Allow steady-state routing skips. */
|
|
26
|
+
skipSteadyState?: boolean;
|
|
27
|
+
/** Process rainfall; does not create missing definitions. */
|
|
28
|
+
rainfallEnabled?: boolean;
|
|
29
|
+
/** Process rainfall-dependent infiltration/inflow. */
|
|
30
|
+
rdiiEnabled?: boolean;
|
|
31
|
+
/** Process snowmelt. */
|
|
32
|
+
snowmeltEnabled?: boolean;
|
|
33
|
+
/** Process groundwater. */
|
|
34
|
+
groundwaterEnabled?: boolean;
|
|
35
|
+
/** Route hydraulic flow. */
|
|
36
|
+
routingEnabled?: boolean;
|
|
37
|
+
/** Process water quality. */
|
|
38
|
+
qualityEnabled?: boolean;
|
|
39
|
+
/** Control-rule interval in whole seconds. */
|
|
40
|
+
ruleStepSeconds?: number;
|
|
41
|
+
/** First month/day for seasonal sweeping. */
|
|
42
|
+
sweepStart?: SweepDay;
|
|
43
|
+
/** Last month/day for seasonal sweeping. */
|
|
44
|
+
sweepEnd?: SweepDay;
|
|
45
|
+
/** Maximum Dynamic Wave trial iterations. */
|
|
46
|
+
maximumTrials?: number;
|
|
47
|
+
/** Model-requested solver threads, distinct from the worker capacity in `SimulationOptions.threads`. */
|
|
48
|
+
requestedThreads?: number;
|
|
49
|
+
/** Lower bound for variable routing steps in seconds. */
|
|
50
|
+
minimumRoutingStepSeconds?: number;
|
|
51
|
+
/** Conduit-lengthening time step in seconds. */
|
|
52
|
+
lengtheningStepSeconds?: number;
|
|
53
|
+
/** Antecedent dry period in seconds. */
|
|
54
|
+
antecedentDrySeconds?: number;
|
|
55
|
+
/** Variable-step adjustment factor. Explicit writes must be positive; reads may contain the disabled value zero. */
|
|
56
|
+
courantFactor?: number;
|
|
57
|
+
/** Minimum nodal surface area in ft² or m². */
|
|
58
|
+
minimumSurfaceArea?: number;
|
|
59
|
+
/** Minimum conduit slope as a ratio, not a percentage. */
|
|
60
|
+
minimumConduitSlope?: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Complete read-only option record, including all writable fields and solver tolerances. */
|
|
64
|
+
export interface ModelOptions extends Readonly<Required<ModelOptionsPatch>> {
|
|
65
|
+
/** Read-only hydraulic head convergence tolerance. */
|
|
66
|
+
readonly headTolerance: number;
|
|
67
|
+
/** Read-only system-flow convergence tolerance. */
|
|
68
|
+
readonly systemFlowTolerance: number;
|
|
69
|
+
/** Read-only lateral-flow convergence tolerance. */
|
|
70
|
+
readonly lateralFlowTolerance: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Sparse calendar boundaries for `Simulation.updateSchedule()`; omitted times retain their values. */
|
|
74
|
+
export interface SchedulePatch {
|
|
75
|
+
/** Simulation start in timezone-free model calendar time. */
|
|
76
|
+
startTime?: ModelTime;
|
|
77
|
+
/** First reporting time in timezone-free model calendar time. */
|
|
78
|
+
reportStart?: ModelTime;
|
|
79
|
+
/** Simulation end in timezone-free model calendar time. */
|
|
80
|
+
endTime?: ModelTime;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Option-family operations added to the shared worker protocol. */
|
|
84
|
+
export interface OptionsOperations {
|
|
85
|
+
updateSchedule: { args: [SchedulePatch]; result: void };
|
|
86
|
+
maximumRoutingStepSeconds: { args: []; result: number };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Stable model options. Updates are atomic and require an open or ended run. */
|
|
90
|
+
export class SimulationOptionsView {
|
|
91
|
+
readonly #call: Call;
|
|
92
|
+
private constructor(call: Call) { this.#call = call; }
|
|
93
|
+
/** @internal */
|
|
94
|
+
static create(call: Call): SimulationOptionsView { return new SimulationOptionsView(call); }
|
|
95
|
+
/** Read the complete option record in a healthy owner state.
|
|
96
|
+
* @returns Detached {@link ModelOptions}, including read-only solver tolerances.
|
|
97
|
+
*/
|
|
98
|
+
read(): Promise<ModelOptions> { return this.#call("options"); }
|
|
99
|
+
/** Atomically update model options in `open` or `ended`; accepted edits return `ended` to `open`.
|
|
100
|
+
* @param patch - Sparse option values. Unknown keys, invalid types/enums, and solver-invalid values reject the whole patch.
|
|
101
|
+
* @returns Resolves after all supplied fields are accepted.
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* import type { Simulation } from "@swmmrs/swmmrs";
|
|
105
|
+
* declare const simulation: Simulation;
|
|
106
|
+
* await simulation.options.update({ routingStepSeconds: 30, reportStepSeconds: 300, qualityEnabled: true });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
update(patch: ModelOptionsPatch): Promise<void> { return this.#call("configureOptions", patch); }
|
|
110
|
+
/** Read the maximum routing interval allowed by current configuration.
|
|
111
|
+
* @returns Maximum routing interval in seconds.
|
|
112
|
+
*/
|
|
113
|
+
maximumRoutingStepSeconds(): Promise<number> { return this.#call("maximumRoutingStepSeconds"); }
|
|
114
|
+
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import type { Call } from "../protocol.js";
|
|
2
|
-
|
|
3
|
-
/** One detached RTK short-, medium-, or long-response parameter set. */
|
|
4
|
-
export interface UnitHydrographResponse {
|
|
5
|
-
/** Fraction of rainfall converted to RDII. */
|
|
6
|
-
readonly rainfallFraction: number;
|
|
7
|
-
/** Time to peak in hours. */
|
|
8
|
-
readonly timeToPeakHours: number;
|
|
9
|
-
/** Recession-to-time-to-peak ratio. */
|
|
10
|
-
readonly recessionRatio: number;
|
|
11
|
-
/** Maximum initial abstraction depth in inches or millimetres. */
|
|
12
|
-
readonly maximumInitialAbstraction: number;
|
|
13
|
-
/** Initial abstraction recovery rate in rainfall-depth units per day. */
|
|
14
|
-
readonly initialAbstractionRecoveryRate: number;
|
|
15
|
-
/** Initial abstraction depth at start in inches or millimetres. */
|
|
16
|
-
readonly initialAbstractionAtStart: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** One calendar month's named RTK responses. */
|
|
20
|
-
export interface UnitHydrographMonth {
|
|
21
|
-
/** Short-response parameters. */
|
|
22
|
-
readonly short: UnitHydrographResponse;
|
|
23
|
-
/** Medium-response parameters. */
|
|
24
|
-
readonly medium: UnitHydrographResponse;
|
|
25
|
-
/** Long-response parameters. */
|
|
26
|
-
readonly long: UnitHydrographResponse;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Complete January-through-December RTK response matrix. */
|
|
30
|
-
export interface UnitHydrographConfiguration {
|
|
31
|
-
/** Canonical rain-gage ID. */
|
|
32
|
-
readonly rainGage: string;
|
|
33
|
-
/** Exactly twelve monthly records, January through December. */
|
|
34
|
-
readonly monthlyResponses: readonly UnitHydrographMonth[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** Sparse RTK update. Omitted fields retain their current values. */
|
|
38
|
-
export interface UnitHydrographPatch {
|
|
39
|
-
/** Replacement rain-gage ID. */
|
|
40
|
-
rainGage?: string;
|
|
41
|
-
/** Replacement complete January-through-December array, exactly twelve entries. */
|
|
42
|
-
monthlyResponses?: readonly UnitHydrographMonth[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** Detached RTK RDII node assignment in native project units. IDs are canonical. */
|
|
46
|
-
export interface RdiiAssignment {
|
|
47
|
-
/** Canonical receiving node ID. */
|
|
48
|
-
readonly node: string;
|
|
49
|
-
/** Canonical RTK unit-hydrograph ID. */
|
|
50
|
-
readonly unitHydrograph: string;
|
|
51
|
-
/** Assigned land area in acres (US) or hectares (SI). */
|
|
52
|
-
readonly area: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface RtkOperations {
|
|
56
|
-
unitHydrographConfiguration: { args: [string]; result: UnitHydrographConfiguration };
|
|
57
|
-
configureUnitHydrograph: { args: [string, UnitHydrographPatch]; result: void };
|
|
58
|
-
rdiiAssignments: { args: []; result: readonly RdiiAssignment[] };
|
|
59
|
-
replaceRdiiAssignments: { args: [readonly RdiiAssignment[]]; result: void };
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** Editable RTK definition from `simulation.unitHydrographs`; node assignments are separate. */
|
|
63
|
-
export class UnitHydrograph {
|
|
64
|
-
/** Canonical configured hydrograph ID. */
|
|
65
|
-
readonly id: string;
|
|
66
|
-
readonly #call: Call;
|
|
67
|
-
private constructor(id: string, call: Call) { this.id = id; this.#call = call; Object.freeze(this); }
|
|
68
|
-
/** @internal */
|
|
69
|
-
static create(id: string, call: Call): UnitHydrograph { return new UnitHydrograph(id, call); }
|
|
70
|
-
/** Read the definition in any healthy owner state.
|
|
71
|
-
* @returns Detached rain-gage identity and complete twelve-month response matrix.
|
|
72
|
-
*/
|
|
73
|
-
configuration(): Promise<UnitHydrographConfiguration> { return this.#call("unitHydrographConfiguration", this.id); }
|
|
74
|
-
/** Atomically update an RTK definition in `open` or `ended`; accepted edits return the owner to `open`.
|
|
75
|
-
* @param patch - Sparse fields; a monthly array replaces all twelve months.
|
|
76
|
-
* @returns Resolves after the complete patch is accepted.
|
|
77
|
-
*/
|
|
78
|
-
configure(patch: UnitHydrographPatch): Promise<void> { return this.#call("configureUnitHydrograph", this.id, patch); }
|
|
79
|
-
}
|
|
1
|
+
import type { Call } from "../protocol.js";
|
|
2
|
+
|
|
3
|
+
/** One detached RTK short-, medium-, or long-response parameter set. */
|
|
4
|
+
export interface UnitHydrographResponse {
|
|
5
|
+
/** Fraction of rainfall converted to RDII. */
|
|
6
|
+
readonly rainfallFraction: number;
|
|
7
|
+
/** Time to peak in hours. */
|
|
8
|
+
readonly timeToPeakHours: number;
|
|
9
|
+
/** Recession-to-time-to-peak ratio. */
|
|
10
|
+
readonly recessionRatio: number;
|
|
11
|
+
/** Maximum initial abstraction depth in inches or millimetres. */
|
|
12
|
+
readonly maximumInitialAbstraction: number;
|
|
13
|
+
/** Initial abstraction recovery rate in rainfall-depth units per day. */
|
|
14
|
+
readonly initialAbstractionRecoveryRate: number;
|
|
15
|
+
/** Initial abstraction depth at start in inches or millimetres. */
|
|
16
|
+
readonly initialAbstractionAtStart: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** One calendar month's named RTK responses. */
|
|
20
|
+
export interface UnitHydrographMonth {
|
|
21
|
+
/** Short-response parameters. */
|
|
22
|
+
readonly short: UnitHydrographResponse;
|
|
23
|
+
/** Medium-response parameters. */
|
|
24
|
+
readonly medium: UnitHydrographResponse;
|
|
25
|
+
/** Long-response parameters. */
|
|
26
|
+
readonly long: UnitHydrographResponse;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Complete January-through-December RTK response matrix. */
|
|
30
|
+
export interface UnitHydrographConfiguration {
|
|
31
|
+
/** Canonical rain-gage ID. */
|
|
32
|
+
readonly rainGage: string;
|
|
33
|
+
/** Exactly twelve monthly records, January through December. */
|
|
34
|
+
readonly monthlyResponses: readonly UnitHydrographMonth[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Sparse RTK update. Omitted fields retain their current values. */
|
|
38
|
+
export interface UnitHydrographPatch {
|
|
39
|
+
/** Replacement rain-gage ID. */
|
|
40
|
+
rainGage?: string;
|
|
41
|
+
/** Replacement complete January-through-December array, exactly twelve entries. */
|
|
42
|
+
monthlyResponses?: readonly UnitHydrographMonth[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Detached RTK RDII node assignment in native project units. IDs are canonical. */
|
|
46
|
+
export interface RdiiAssignment {
|
|
47
|
+
/** Canonical receiving node ID. */
|
|
48
|
+
readonly node: string;
|
|
49
|
+
/** Canonical RTK unit-hydrograph ID. */
|
|
50
|
+
readonly unitHydrograph: string;
|
|
51
|
+
/** Assigned land area in acres (US) or hectares (SI). */
|
|
52
|
+
readonly area: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface RtkOperations {
|
|
56
|
+
unitHydrographConfiguration: { args: [string]; result: UnitHydrographConfiguration };
|
|
57
|
+
configureUnitHydrograph: { args: [string, UnitHydrographPatch]; result: void };
|
|
58
|
+
rdiiAssignments: { args: []; result: readonly RdiiAssignment[] };
|
|
59
|
+
replaceRdiiAssignments: { args: [readonly RdiiAssignment[]]; result: void };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Editable RTK definition from `simulation.unitHydrographs`; node assignments are separate. */
|
|
63
|
+
export class UnitHydrograph {
|
|
64
|
+
/** Canonical configured hydrograph ID. */
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly #call: Call;
|
|
67
|
+
private constructor(id: string, call: Call) { this.id = id; this.#call = call; Object.freeze(this); }
|
|
68
|
+
/** @internal */
|
|
69
|
+
static create(id: string, call: Call): UnitHydrograph { return new UnitHydrograph(id, call); }
|
|
70
|
+
/** Read the definition in any healthy owner state.
|
|
71
|
+
* @returns Detached rain-gage identity and complete twelve-month response matrix.
|
|
72
|
+
*/
|
|
73
|
+
configuration(): Promise<UnitHydrographConfiguration> { return this.#call("unitHydrographConfiguration", this.id); }
|
|
74
|
+
/** Atomically update an RTK definition in `open` or `ended`; accepted edits return the owner to `open`.
|
|
75
|
+
* @param patch - Sparse fields; a monthly array replaces all twelve months.
|
|
76
|
+
* @returns Resolves after the complete patch is accepted.
|
|
77
|
+
*/
|
|
78
|
+
configure(patch: UnitHydrographPatch): Promise<void> { return this.#call("configureUnitHydrograph", this.id, patch); }
|
|
79
|
+
}
|