@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.
- package/README.md +264 -0
- package/dist/README.md +264 -0
- package/dist/serial/README.md +264 -0
- package/dist/serial/swmmrs.d.ts +395 -0
- package/dist/serial/swmmrs.js +3169 -0
- package/dist/serial/swmmrs_bg.wasm +0 -0
- package/dist/snippets/swmmrs-parallel-5d1c71108133e81d/worker-pool/browser.js +98 -0
- package/dist/swmmrs.d.ts +422 -0
- package/dist/swmmrs.js +3330 -0
- package/dist/swmmrs_bg.wasm +0 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/lib/swmmrs/client.d.ts +11 -0
- package/lib/swmmrs/client.d.ts.map +1 -0
- package/lib/swmmrs/client.js +82 -0
- package/lib/swmmrs/client.js.map +1 -0
- package/lib/swmmrs/enums.d.ts +41 -0
- package/lib/swmmrs/enums.d.ts.map +1 -0
- package/lib/swmmrs/enums.js +2 -0
- package/lib/swmmrs/enums.js.map +1 -0
- package/lib/swmmrs/exceptions.d.ts +98 -0
- package/lib/swmmrs/exceptions.d.ts.map +1 -0
- package/lib/swmmrs/exceptions.js +86 -0
- package/lib/swmmrs/exceptions.js.map +1 -0
- package/lib/swmmrs/index.d.ts +27 -0
- package/lib/swmmrs/index.d.ts.map +1 -0
- package/lib/swmmrs/index.js +13 -0
- package/lib/swmmrs/index.js.map +1 -0
- package/lib/swmmrs/objects/amm.d.ts +114 -0
- package/lib/swmmrs/objects/amm.d.ts.map +1 -0
- package/lib/swmmrs/objects/amm.js +19 -0
- package/lib/swmmrs/objects/amm.js.map +1 -0
- package/lib/swmmrs/objects/collections.d.ts +109 -0
- package/lib/swmmrs/objects/collections.d.ts.map +1 -0
- package/lib/swmmrs/objects/collections.js +158 -0
- package/lib/swmmrs/objects/collections.js.map +1 -0
- package/lib/swmmrs/objects/definitions.d.ts +215 -0
- package/lib/swmmrs/objects/definitions.d.ts.map +1 -0
- package/lib/swmmrs/objects/definitions.js +69 -0
- package/lib/swmmrs/objects/definitions.js.map +1 -0
- package/lib/swmmrs/objects/lids.d.ts +446 -0
- package/lib/swmmrs/objects/lids.d.ts.map +1 -0
- package/lib/swmmrs/objects/lids.js +90 -0
- package/lib/swmmrs/objects/lids.js.map +1 -0
- package/lib/swmmrs/objects/links.d.ts +615 -0
- package/lib/swmmrs/objects/links.d.ts.map +1 -0
- package/lib/swmmrs/objects/links.js +90 -0
- package/lib/swmmrs/objects/links.js.map +1 -0
- package/lib/swmmrs/objects/nodes.d.ts +494 -0
- package/lib/swmmrs/objects/nodes.d.ts.map +1 -0
- package/lib/swmmrs/objects/nodes.js +147 -0
- package/lib/swmmrs/objects/nodes.js.map +1 -0
- package/lib/swmmrs/objects/options.d.ts +112 -0
- package/lib/swmmrs/objects/options.d.ts.map +1 -0
- package/lib/swmmrs/objects/options.js +27 -0
- package/lib/swmmrs/objects/options.js.map +1 -0
- package/lib/swmmrs/objects/rtk.d.ts +82 -0
- package/lib/swmmrs/objects/rtk.d.ts.map +1 -0
- package/lib/swmmrs/objects/rtk.js +19 -0
- package/lib/swmmrs/objects/rtk.js.map +1 -0
- package/lib/swmmrs/objects/subcatchments.d.ts +575 -0
- package/lib/swmmrs/objects/subcatchments.d.ts.map +1 -0
- package/lib/swmmrs/objects/subcatchments.js +243 -0
- package/lib/swmmrs/objects/subcatchments.js.map +1 -0
- package/lib/swmmrs/output.d.ts +412 -0
- package/lib/swmmrs/output.d.ts.map +1 -0
- package/lib/swmmrs/output.js +507 -0
- package/lib/swmmrs/output.js.map +1 -0
- package/lib/swmmrs/protocol.d.ts +80 -0
- package/lib/swmmrs/protocol.d.ts.map +1 -0
- package/lib/swmmrs/protocol.js +2 -0
- package/lib/swmmrs/protocol.js.map +1 -0
- package/lib/swmmrs/runtime.d.ts +22 -0
- package/lib/swmmrs/runtime.d.ts.map +1 -0
- package/lib/swmmrs/runtime.js +146 -0
- package/lib/swmmrs/runtime.js.map +1 -0
- package/lib/swmmrs/scenarios.d.ts +41 -0
- package/lib/swmmrs/scenarios.d.ts.map +1 -0
- package/lib/swmmrs/scenarios.js +2 -0
- package/lib/swmmrs/scenarios.js.map +1 -0
- package/lib/swmmrs/simulation.d.ts +249 -0
- package/lib/swmmrs/simulation.d.ts.map +1 -0
- package/lib/swmmrs/simulation.js +415 -0
- package/lib/swmmrs/simulation.js.map +1 -0
- package/lib/swmmrs/snapshots.d.ts +192 -0
- package/lib/swmmrs/snapshots.d.ts.map +1 -0
- package/lib/swmmrs/snapshots.js +2 -0
- package/lib/swmmrs/snapshots.js.map +1 -0
- package/lib/swmmrs/types.d.ts +123 -0
- package/lib/swmmrs/types.d.ts.map +1 -0
- package/lib/swmmrs/types.js +2 -0
- package/lib/swmmrs/types.js.map +1 -0
- package/lib/swmmrs/worker.d.ts +2 -0
- package/lib/swmmrs/worker.d.ts.map +1 -0
- package/lib/swmmrs/worker.js +488 -0
- package/lib/swmmrs/worker.js.map +1 -0
- package/package.json +33 -0
- package/src/swmmrs/client.ts +76 -0
- package/src/swmmrs/enums.ts +73 -0
- package/src/swmmrs/exceptions.ts +120 -0
- package/src/swmmrs/index.ts +79 -0
- package/src/swmmrs/objects/amm.ts +113 -0
- package/src/swmmrs/objects/collections.ts +153 -0
- package/src/swmmrs/objects/definitions.ts +246 -0
- package/src/swmmrs/objects/lids.ts +487 -0
- package/src/swmmrs/objects/links.ts +626 -0
- package/src/swmmrs/objects/nodes.ts +504 -0
- package/src/swmmrs/objects/options.ts +114 -0
- package/src/swmmrs/objects/rtk.ts +79 -0
- package/src/swmmrs/objects/subcatchments.ts +650 -0
- package/src/swmmrs/output.ts +798 -0
- package/src/swmmrs/protocol.ts +62 -0
- package/src/swmmrs/runtime.ts +188 -0
- package/src/swmmrs/scenarios.ts +40 -0
- package/src/swmmrs/simulation.ts +406 -0
- package/src/swmmrs/snapshots.ts +199 -0
- package/src/swmmrs/types.ts +123 -0
- package/src/swmmrs/worker.ts +233 -0
- package/worker-node.js +142 -0
- package/worker.js +1 -0
|
Binary file
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Worker lifecycle and cold atomic parking for the SWMMRS parallel Wasm backend.
|
|
2
|
+
let workers = [];
|
|
3
|
+
let hostModule;
|
|
4
|
+
let sharedMemory;
|
|
5
|
+
let atomicView;
|
|
6
|
+
|
|
7
|
+
function memoryView() {
|
|
8
|
+
if (!atomicView || atomicView.buffer !== sharedMemory.buffer) {
|
|
9
|
+
atomicView = new Int32Array(sharedMemory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return atomicView;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function waitForChange(address, expected, micros) {
|
|
15
|
+
// Only child Workers park. The caller joins by polling in Wasm.
|
|
16
|
+
Atomics.wait(memoryView(), address >>> 2, expected | 0, micros / 1000);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function notifyChange(address) {
|
|
20
|
+
Atomics.notify(memoryView(), address >>> 2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function runCaller() {
|
|
24
|
+
hostModule.swmmrsParallelCaller();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function stopWorkers() {
|
|
28
|
+
for (const worker of workers) worker.terminate();
|
|
29
|
+
workers = [];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function startWorkers(module, memory, moduleUrl, threads) {
|
|
33
|
+
if (!(memory.buffer instanceof SharedArrayBuffer) || !globalThis.crossOriginIsolated) {
|
|
34
|
+
throw new Error("SWMMRS parallel requires shared Wasm memory and cross-origin isolation");
|
|
35
|
+
}
|
|
36
|
+
sharedMemory = memory;
|
|
37
|
+
hostModule = await import(moduleUrl);
|
|
38
|
+
for (const name of ["initSync", "swmmrsParallelWorker", "swmmrsParallelWorkerFailed", "swmmrsParallelCaller"]) {
|
|
39
|
+
if (typeof hostModule[name] !== "function") {
|
|
40
|
+
throw new Error(`SWMMRS parallel module is missing export ${name}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
await Promise.all(Array.from({ length: threads - 1 }, (_, index) => {
|
|
45
|
+
const lane = index + 1;
|
|
46
|
+
const worker = new Worker(new URL(import.meta.url), {
|
|
47
|
+
type: "module",
|
|
48
|
+
name: "swmmrs_parallel_worker",
|
|
49
|
+
});
|
|
50
|
+
workers.push(worker);
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
const onError = event => {
|
|
53
|
+
reject(new Error(`SWMMRS parallel worker ${lane} failed: ${event.message || "message error"}`));
|
|
54
|
+
};
|
|
55
|
+
const onMessage = event => {
|
|
56
|
+
if (event.data?.type === "swmmrs_parallel_ready") {
|
|
57
|
+
worker.removeEventListener("message", onMessage);
|
|
58
|
+
worker.removeEventListener("error", onError);
|
|
59
|
+
worker.removeEventListener("messageerror", onError);
|
|
60
|
+
resolve();
|
|
61
|
+
} else if (event.data?.type === "swmmrs_parallel_error") {
|
|
62
|
+
reject(new Error(`SWMMRS parallel worker ${lane}: ${event.data.message}`));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
worker.addEventListener("message", onMessage);
|
|
66
|
+
worker.addEventListener("error", onError);
|
|
67
|
+
worker.addEventListener("messageerror", onError);
|
|
68
|
+
worker.postMessage({ type: "swmmrs_parallel_init", module, memory, moduleUrl, lane });
|
|
69
|
+
});
|
|
70
|
+
}));
|
|
71
|
+
} catch (error) {
|
|
72
|
+
stopWorkers();
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (globalThis.name === "swmmrs_parallel_worker") {
|
|
78
|
+
self.addEventListener("message", async function initialize(event) {
|
|
79
|
+
if (event.data?.type !== "swmmrs_parallel_init") return;
|
|
80
|
+
self.removeEventListener("message", initialize);
|
|
81
|
+
const { module, memory, moduleUrl, lane } = event.data;
|
|
82
|
+
let pkg;
|
|
83
|
+
let initialized = false;
|
|
84
|
+
try {
|
|
85
|
+
sharedMemory = memory;
|
|
86
|
+
pkg = await import(moduleUrl);
|
|
87
|
+
pkg.initSync({ module, memory });
|
|
88
|
+
initialized = true;
|
|
89
|
+
self.postMessage({ type: "swmmrs_parallel_ready" });
|
|
90
|
+
pkg.swmmrsParallelWorker(lane);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// This executes on the failed Worker, so the shared join is released
|
|
93
|
+
// even while the Simulation Worker is synchronously waiting for it.
|
|
94
|
+
if (initialized) pkg.swmmrsParallelWorkerFailed(lane);
|
|
95
|
+
self.postMessage({ type: "swmmrs_parallel_error", message: String(error) });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
package/dist/swmmrs.d.ts
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Standalone reader owning one validated SWMM output byte buffer.
|
|
6
|
+
*/
|
|
7
|
+
export class OutputReader {
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
/**
|
|
11
|
+
* Opens and validates one finalized or recoverable output byte buffer.
|
|
12
|
+
*/
|
|
13
|
+
constructor(bytes: Uint8Array);
|
|
14
|
+
/**
|
|
15
|
+
* Reads one link series identified by an already-resolved index/code pair.
|
|
16
|
+
*/
|
|
17
|
+
outputLinkSeries(index: number, code: number, start: number, end: number): any;
|
|
18
|
+
/**
|
|
19
|
+
* Returns immutable output metadata.
|
|
20
|
+
*/
|
|
21
|
+
outputMetadata(): any;
|
|
22
|
+
/**
|
|
23
|
+
* Reads one node series identified by an already-resolved index/code pair.
|
|
24
|
+
*/
|
|
25
|
+
outputNodeSeries(index: number, code: number, start: number, end: number): any;
|
|
26
|
+
/**
|
|
27
|
+
* Reads selected cells through the deduplicated adjacent-run strategy.
|
|
28
|
+
*/
|
|
29
|
+
outputReadBulkSeries(selections: any, start: number, end: number): any;
|
|
30
|
+
/**
|
|
31
|
+
* Reads selected cells through one complete payload per period.
|
|
32
|
+
*/
|
|
33
|
+
outputReadBulkSeriesByPeriod(selections: any, start: number, end: number): any;
|
|
34
|
+
/**
|
|
35
|
+
* Reads exact stored report-date serial values over a period range.
|
|
36
|
+
*/
|
|
37
|
+
outputReadStoredDates(start: number, end: number): any;
|
|
38
|
+
/**
|
|
39
|
+
* Reads one subcatchment series identified by an already-resolved index/code pair.
|
|
40
|
+
*/
|
|
41
|
+
outputSubcatchmentSeries(index: number, code: number, start: number, end: number): any;
|
|
42
|
+
/**
|
|
43
|
+
* Reads one system series identified by its stored result code.
|
|
44
|
+
*/
|
|
45
|
+
outputSystemSeries(code: number, start: number, end: number): any;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An isolated project. Call close before freeing it to report cleanup errors.
|
|
50
|
+
*/
|
|
51
|
+
export class Simulation {
|
|
52
|
+
free(): void;
|
|
53
|
+
[Symbol.dispose](): void;
|
|
54
|
+
ammAssignments(): any;
|
|
55
|
+
ammModelConfiguration(id: string): any;
|
|
56
|
+
aquiferConfiguration(id: string): any;
|
|
57
|
+
close(): void;
|
|
58
|
+
configureAmmModel(id: string, patch: any): void;
|
|
59
|
+
configureAquifer(id: string, value: any): void;
|
|
60
|
+
configureLidControl(id: string, layer: string, patch: any): void;
|
|
61
|
+
configureLidUnit(subcatchment_id: string, unit_index: number, patch: any): void;
|
|
62
|
+
configureLink(id: string, patch: any): void;
|
|
63
|
+
configureNode(id: string, patch: any): void;
|
|
64
|
+
configureOptions(patch: any): void;
|
|
65
|
+
configureSnowmelt(id: string, value: any): void;
|
|
66
|
+
configureSnowmeltSurface(id: string, surface: string, value: any): void;
|
|
67
|
+
configureSubcatchment(id: string, patch: any): void;
|
|
68
|
+
configureUnitHydrograph(id: string, patch: any): void;
|
|
69
|
+
/**
|
|
70
|
+
* Ends computation and flushes output and summary statistics without detailed report tables.
|
|
71
|
+
*/
|
|
72
|
+
end(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Publishes the complete core checkpoint and detaches it into bytes.
|
|
75
|
+
*/
|
|
76
|
+
exportCheckpoint(): any;
|
|
77
|
+
/**
|
|
78
|
+
* Appends only the runtime footer to an ended run's summary report.
|
|
79
|
+
*/
|
|
80
|
+
finalizeReport(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Finalizes binary output, requested detailed report tables, and the runtime footer.
|
|
83
|
+
*/
|
|
84
|
+
finish(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Project units, object IDs, and the effective hydraulic lane count.
|
|
87
|
+
*/
|
|
88
|
+
info(): any;
|
|
89
|
+
inletResults(id: string): any;
|
|
90
|
+
lidControlConfiguration(id: string): any;
|
|
91
|
+
lidUnitConfiguration(subcatchment_id: string, unit_index: number): any;
|
|
92
|
+
lidUnitCount(subcatchment_id: string): number;
|
|
93
|
+
lidUnitSnapshot(subcatchment_id: string, unit_index: number): any;
|
|
94
|
+
link(id: string): any;
|
|
95
|
+
linkConfiguration(id: string): any;
|
|
96
|
+
linkExternalPollutantMassFlux(id: string): any;
|
|
97
|
+
linkExternalPollutantMassFluxValue(id: string, pollutant_id: string): number;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the complete optional inlet placement owned by a link.
|
|
100
|
+
*/
|
|
101
|
+
linkInlet(id: string): any;
|
|
102
|
+
linkQuality(id: string): any;
|
|
103
|
+
linkQualitySnapshot(ids?: string[] | null): any;
|
|
104
|
+
linkStatistics(id: string): any;
|
|
105
|
+
linkStatisticsSnapshot(ids?: string[] | null): any;
|
|
106
|
+
links(ids?: string[] | null): any;
|
|
107
|
+
/**
|
|
108
|
+
* Imports only the core physical checkpoint state into this open owner.
|
|
109
|
+
*/
|
|
110
|
+
loadCheckpointState(value: any): void;
|
|
111
|
+
maximumRoutingStepSeconds(): number;
|
|
112
|
+
/**
|
|
113
|
+
* Input and external files are bytes; external names are relative to the model.
|
|
114
|
+
*/
|
|
115
|
+
constructor(input: Uint8Array, files: any);
|
|
116
|
+
node(id: string): any;
|
|
117
|
+
nodeConfiguration(id: string): any;
|
|
118
|
+
nodeExternalInflow(id: string): number;
|
|
119
|
+
nodeExternalPollutantMassFlux(id: string): any;
|
|
120
|
+
nodeExternalPollutantMassFluxValue(id: string, pollutant_id: string): number;
|
|
121
|
+
nodeQuality(id: string): any;
|
|
122
|
+
nodeQualitySnapshot(ids?: string[] | null): any;
|
|
123
|
+
nodeStatistics(id: string): any;
|
|
124
|
+
nodeStatisticsSnapshot(ids?: string[] | null): any;
|
|
125
|
+
nodeTotalInflowVolume(id: string): number;
|
|
126
|
+
/**
|
|
127
|
+
* One coherent columnar snapshot, preserving the requested ID order.
|
|
128
|
+
*/
|
|
129
|
+
nodes(ids?: string[] | null): any;
|
|
130
|
+
options(): any;
|
|
131
|
+
outfallFixedStage(id: string): any;
|
|
132
|
+
outfallStatistics(id: string): any;
|
|
133
|
+
overrideLinkPollutantConcentrations(id: string, values: any): void;
|
|
134
|
+
overrideNodePollutantConcentrations(id: string, values: any): void;
|
|
135
|
+
pumpStatistics(id: string): any;
|
|
136
|
+
rainGage(id: string): any;
|
|
137
|
+
rainGageExternalPrecipitationRate(id: string): any;
|
|
138
|
+
rainGageRainfallOverride(id: string): any;
|
|
139
|
+
rdiiAssignments(): any;
|
|
140
|
+
/**
|
|
141
|
+
* Reads an input or generated file before close removes the project.
|
|
142
|
+
*/
|
|
143
|
+
readFile(name: string): Uint8Array;
|
|
144
|
+
replaceAmmAssignments(assignments: any): void;
|
|
145
|
+
replaceRdiiAssignments(assignments: any): void;
|
|
146
|
+
/**
|
|
147
|
+
* Generates the requested report tables and footer on demand.
|
|
148
|
+
*/
|
|
149
|
+
report(): void;
|
|
150
|
+
resetSolver(): void;
|
|
151
|
+
static resumeCheckpoint(value: any): Simulation;
|
|
152
|
+
/**
|
|
153
|
+
* Runs to completion without a worker message for every routing step.
|
|
154
|
+
*/
|
|
155
|
+
run(save_results?: boolean | null): void;
|
|
156
|
+
/**
|
|
157
|
+
* Writes an EPA hotstart from the current active run and returns its bytes.
|
|
158
|
+
*/
|
|
159
|
+
saveHotstart(): Uint8Array;
|
|
160
|
+
setLinkFlowLimit(id: string, value: any): void;
|
|
161
|
+
setLinkTargetSetting(id: string, setting: any): void;
|
|
162
|
+
setNodeExternalInflow(id: string, flow: any): void;
|
|
163
|
+
setOutfallStage(id: string, value: any): void;
|
|
164
|
+
setRainGagePrecipitation(id: string, value: any): void;
|
|
165
|
+
setRainGageRainfallOverride(id: string, value: any): void;
|
|
166
|
+
setSubcatchmentExternalRainfall(id: string, value: any): void;
|
|
167
|
+
setSubcatchmentExternalSnowfall(id: string, value: any): void;
|
|
168
|
+
setSubcatchmentPrecipitationScaleFactors(id: string, rainfall: any, snowfall: any): void;
|
|
169
|
+
sleepWorkers(): void;
|
|
170
|
+
snowmeltConfiguration(id: string): any;
|
|
171
|
+
snowmeltSurfaceConfiguration(id: string, surface: string): any;
|
|
172
|
+
start(save_results?: boolean | null): void;
|
|
173
|
+
statistics(): any;
|
|
174
|
+
/**
|
|
175
|
+
* Lifecycle, model-time, progress, and warning state in one owner read.
|
|
176
|
+
*/
|
|
177
|
+
status(): any;
|
|
178
|
+
/**
|
|
179
|
+
* Timezone-free model timestamp, or undefined at natural completion.
|
|
180
|
+
*/
|
|
181
|
+
step(): string | undefined;
|
|
182
|
+
storageStatistics(id: string): any;
|
|
183
|
+
/**
|
|
184
|
+
* Advances by a positive whole number of seconds.
|
|
185
|
+
*/
|
|
186
|
+
stride(seconds: number, strict: boolean): string | undefined;
|
|
187
|
+
subcatchment(id: string): any;
|
|
188
|
+
subcatchmentConfiguration(id: string): any;
|
|
189
|
+
subcatchmentExternalForcing(id: string): any;
|
|
190
|
+
subcatchmentExternalPollutantBuildupIncrement(id: string): any;
|
|
191
|
+
subcatchmentExternalPollutantBuildupIncrementValue(id: string, pollutant_id: string): number;
|
|
192
|
+
subcatchmentLidSnapshot(subcatchment_id: string): any;
|
|
193
|
+
subcatchmentNamedSetting(id: string, kind: string, name: string): number;
|
|
194
|
+
subcatchmentNamedSettings(id: string, kind: string): any;
|
|
195
|
+
subcatchmentPrecipitationScaleFactors(id: string): any;
|
|
196
|
+
subcatchmentQuality(id: string): any;
|
|
197
|
+
subcatchmentQualitySnapshot(ids?: string[] | null): any;
|
|
198
|
+
subcatchmentStatistics(id: string): any;
|
|
199
|
+
subcatchmentStatisticsSnapshot(ids?: string[] | null): any;
|
|
200
|
+
subcatchments(ids?: string[] | null): any;
|
|
201
|
+
unitHydrographConfiguration(id: string): any;
|
|
202
|
+
updateInlet(id: string, patch: any): void;
|
|
203
|
+
updateLinkExternalPollutantMassFlux(id: string, values: any, replace: boolean): void;
|
|
204
|
+
updateNodeExternalPollutantMassFlux(id: string, values: any, replace: boolean): void;
|
|
205
|
+
updateSchedule(patch: any): void;
|
|
206
|
+
updateSubcatchmentExternalPollutantBuildupIncrement(id: string, values: any, replace: boolean): void;
|
|
207
|
+
updateSubcatchmentNamedSettings(id: string, kind: string, values: any, replace: boolean): void;
|
|
208
|
+
/**
|
|
209
|
+
* Configures or clears an EPA hotstart input from caller-owned bytes.
|
|
210
|
+
*/
|
|
211
|
+
useHotstart(value: any): void;
|
|
212
|
+
useRainGageExternalPrecipitation(id: string, value: any): void;
|
|
213
|
+
readonly state: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Starts a caller-inclusive team using this module's shared Wasm memory.
|
|
218
|
+
*
|
|
219
|
+
* # Arguments
|
|
220
|
+
* * `threads` - Total lanes, including the calling JavaScript thread.
|
|
221
|
+
* * `module_url` - Absolute URL of the generated wasm-bindgen JavaScript entry.
|
|
222
|
+
*
|
|
223
|
+
* # Errors
|
|
224
|
+
* Rejects invalid counts, concurrent initialization, or failed Worker startup.
|
|
225
|
+
*/
|
|
226
|
+
export function initThreadPool(threads: number, module_url: string): Promise<void>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Executes the published caller lane through JavaScript's trap boundary.
|
|
230
|
+
*/
|
|
231
|
+
export function swmmrsParallelCaller(): void;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Runs one initialized child Worker's dispatch loop until host termination.
|
|
235
|
+
*
|
|
236
|
+
* # Arguments
|
|
237
|
+
* * `lane` - Nonzero physical Worker lane established by `initThreadPool`.
|
|
238
|
+
*/
|
|
239
|
+
export function swmmrsParallelWorker(lane: number): void;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Marks a trapped child Worker and releases its outstanding join contribution.
|
|
243
|
+
*
|
|
244
|
+
* # Arguments
|
|
245
|
+
* * `lane` - Worker that caught a Wasm trap at the JavaScript boundary.
|
|
246
|
+
*/
|
|
247
|
+
export function swmmrsParallelWorkerFailed(lane: number): void;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Terminates child Workers after all pool handles have finished their work.
|
|
251
|
+
*
|
|
252
|
+
* # Errors
|
|
253
|
+
* Rejects shutdown during initialization or an active dispatch.
|
|
254
|
+
*/
|
|
255
|
+
export function terminateThreadPool(): void;
|
|
256
|
+
|
|
257
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
258
|
+
|
|
259
|
+
export interface InitOutput {
|
|
260
|
+
readonly __wbg_simulation_free: (a: number, b: number) => void;
|
|
261
|
+
readonly simulation_close: (a: number, b: number) => void;
|
|
262
|
+
readonly simulation_end: (a: number, b: number) => void;
|
|
263
|
+
readonly simulation_finalizeReport: (a: number, b: number) => void;
|
|
264
|
+
readonly simulation_finish: (a: number, b: number) => void;
|
|
265
|
+
readonly simulation_info: (a: number, b: number) => void;
|
|
266
|
+
readonly simulation_link: (a: number, b: number, c: number, d: number) => void;
|
|
267
|
+
readonly simulation_links: (a: number, b: number, c: number, d: number) => void;
|
|
268
|
+
readonly simulation_new: (a: number, b: number, c: number, d: number) => void;
|
|
269
|
+
readonly simulation_node: (a: number, b: number, c: number, d: number) => void;
|
|
270
|
+
readonly simulation_nodes: (a: number, b: number, c: number, d: number) => void;
|
|
271
|
+
readonly simulation_readFile: (a: number, b: number, c: number, d: number) => void;
|
|
272
|
+
readonly simulation_report: (a: number, b: number) => void;
|
|
273
|
+
readonly simulation_resetSolver: (a: number, b: number) => void;
|
|
274
|
+
readonly simulation_run: (a: number, b: number, c: number) => void;
|
|
275
|
+
readonly simulation_setLinkTargetSetting: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
276
|
+
readonly simulation_setNodeExternalInflow: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
277
|
+
readonly simulation_sleepWorkers: (a: number, b: number) => void;
|
|
278
|
+
readonly simulation_start: (a: number, b: number, c: number) => void;
|
|
279
|
+
readonly simulation_state: (a: number, b: number) => void;
|
|
280
|
+
readonly simulation_step: (a: number, b: number) => void;
|
|
281
|
+
readonly simulation_stride: (a: number, b: number, c: number, d: number) => void;
|
|
282
|
+
readonly simulation_configureLink: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
283
|
+
readonly simulation_inletResults: (a: number, b: number, c: number, d: number) => void;
|
|
284
|
+
readonly simulation_linkConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
285
|
+
readonly simulation_linkExternalPollutantMassFlux: (a: number, b: number, c: number, d: number) => void;
|
|
286
|
+
readonly simulation_linkExternalPollutantMassFluxValue: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
287
|
+
readonly simulation_linkInlet: (a: number, b: number, c: number, d: number) => void;
|
|
288
|
+
readonly simulation_linkQuality: (a: number, b: number, c: number, d: number) => void;
|
|
289
|
+
readonly simulation_linkQualitySnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
290
|
+
readonly simulation_linkStatistics: (a: number, b: number, c: number, d: number) => void;
|
|
291
|
+
readonly simulation_linkStatisticsSnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
292
|
+
readonly simulation_overrideLinkPollutantConcentrations: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
293
|
+
readonly simulation_pumpStatistics: (a: number, b: number, c: number, d: number) => void;
|
|
294
|
+
readonly simulation_setLinkFlowLimit: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
295
|
+
readonly simulation_updateInlet: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
296
|
+
readonly simulation_updateLinkExternalPollutantMassFlux: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
297
|
+
readonly simulation_configureSubcatchment: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
298
|
+
readonly simulation_rainGage: (a: number, b: number, c: number, d: number) => void;
|
|
299
|
+
readonly simulation_rainGageExternalPrecipitationRate: (a: number, b: number, c: number, d: number) => void;
|
|
300
|
+
readonly simulation_rainGageRainfallOverride: (a: number, b: number, c: number, d: number) => void;
|
|
301
|
+
readonly simulation_setRainGagePrecipitation: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
302
|
+
readonly simulation_setRainGageRainfallOverride: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
303
|
+
readonly simulation_setSubcatchmentExternalRainfall: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
304
|
+
readonly simulation_setSubcatchmentExternalSnowfall: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
305
|
+
readonly simulation_setSubcatchmentPrecipitationScaleFactors: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
306
|
+
readonly simulation_subcatchment: (a: number, b: number, c: number, d: number) => void;
|
|
307
|
+
readonly simulation_subcatchmentConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
308
|
+
readonly simulation_subcatchmentExternalForcing: (a: number, b: number, c: number, d: number) => void;
|
|
309
|
+
readonly simulation_subcatchmentExternalPollutantBuildupIncrement: (a: number, b: number, c: number, d: number) => void;
|
|
310
|
+
readonly simulation_subcatchmentExternalPollutantBuildupIncrementValue: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
311
|
+
readonly simulation_subcatchmentNamedSetting: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
312
|
+
readonly simulation_subcatchmentNamedSettings: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
313
|
+
readonly simulation_subcatchmentPrecipitationScaleFactors: (a: number, b: number, c: number, d: number) => void;
|
|
314
|
+
readonly simulation_subcatchmentQuality: (a: number, b: number, c: number, d: number) => void;
|
|
315
|
+
readonly simulation_subcatchmentQualitySnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
316
|
+
readonly simulation_subcatchmentStatistics: (a: number, b: number, c: number, d: number) => void;
|
|
317
|
+
readonly simulation_subcatchmentStatisticsSnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
318
|
+
readonly simulation_subcatchments: (a: number, b: number, c: number, d: number) => void;
|
|
319
|
+
readonly simulation_updateSubcatchmentExternalPollutantBuildupIncrement: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
320
|
+
readonly simulation_updateSubcatchmentNamedSettings: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
321
|
+
readonly simulation_useRainGageExternalPrecipitation: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
322
|
+
readonly simulation_configureNode: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
323
|
+
readonly simulation_nodeConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
324
|
+
readonly simulation_nodeExternalInflow: (a: number, b: number, c: number, d: number) => void;
|
|
325
|
+
readonly simulation_nodeExternalPollutantMassFlux: (a: number, b: number, c: number, d: number) => void;
|
|
326
|
+
readonly simulation_nodeExternalPollutantMassFluxValue: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
327
|
+
readonly simulation_nodeQuality: (a: number, b: number, c: number, d: number) => void;
|
|
328
|
+
readonly simulation_nodeQualitySnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
329
|
+
readonly simulation_nodeStatistics: (a: number, b: number, c: number, d: number) => void;
|
|
330
|
+
readonly simulation_nodeStatisticsSnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
331
|
+
readonly simulation_nodeTotalInflowVolume: (a: number, b: number, c: number, d: number) => void;
|
|
332
|
+
readonly simulation_outfallFixedStage: (a: number, b: number, c: number, d: number) => void;
|
|
333
|
+
readonly simulation_outfallStatistics: (a: number, b: number, c: number, d: number) => void;
|
|
334
|
+
readonly simulation_overrideNodePollutantConcentrations: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
335
|
+
readonly simulation_setOutfallStage: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
336
|
+
readonly simulation_storageStatistics: (a: number, b: number, c: number, d: number) => void;
|
|
337
|
+
readonly simulation_updateNodeExternalPollutantMassFlux: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
338
|
+
readonly simulation_configureLidControl: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
339
|
+
readonly simulation_configureLidUnit: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
340
|
+
readonly simulation_lidControlConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
341
|
+
readonly simulation_lidUnitConfiguration: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
342
|
+
readonly simulation_lidUnitCount: (a: number, b: number, c: number, d: number) => void;
|
|
343
|
+
readonly simulation_lidUnitSnapshot: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
344
|
+
readonly simulation_subcatchmentLidSnapshot: (a: number, b: number, c: number, d: number) => void;
|
|
345
|
+
readonly simulation_configureOptions: (a: number, b: number, c: number) => void;
|
|
346
|
+
readonly simulation_maximumRoutingStepSeconds: (a: number, b: number) => void;
|
|
347
|
+
readonly simulation_options: (a: number, b: number) => void;
|
|
348
|
+
readonly simulation_statistics: (a: number, b: number) => void;
|
|
349
|
+
readonly simulation_status: (a: number, b: number) => void;
|
|
350
|
+
readonly simulation_updateSchedule: (a: number, b: number, c: number) => void;
|
|
351
|
+
readonly __wbg_outputreader_free: (a: number, b: number) => void;
|
|
352
|
+
readonly outputreader_new: (a: number, b: number, c: number) => void;
|
|
353
|
+
readonly outputreader_outputLinkSeries: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
354
|
+
readonly outputreader_outputMetadata: (a: number, b: number) => void;
|
|
355
|
+
readonly outputreader_outputNodeSeries: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
356
|
+
readonly outputreader_outputReadBulkSeries: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
357
|
+
readonly outputreader_outputReadBulkSeriesByPeriod: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
358
|
+
readonly outputreader_outputReadStoredDates: (a: number, b: number, c: number, d: number) => void;
|
|
359
|
+
readonly outputreader_outputSubcatchmentSeries: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
360
|
+
readonly outputreader_outputSystemSeries: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
361
|
+
readonly simulation_exportCheckpoint: (a: number, b: number) => void;
|
|
362
|
+
readonly simulation_loadCheckpointState: (a: number, b: number, c: number) => void;
|
|
363
|
+
readonly simulation_resumeCheckpoint: (a: number, b: number) => void;
|
|
364
|
+
readonly simulation_saveHotstart: (a: number, b: number) => void;
|
|
365
|
+
readonly simulation_useHotstart: (a: number, b: number, c: number) => void;
|
|
366
|
+
readonly simulation_ammAssignments: (a: number, b: number) => void;
|
|
367
|
+
readonly simulation_ammModelConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
368
|
+
readonly simulation_aquiferConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
369
|
+
readonly simulation_configureAmmModel: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
370
|
+
readonly simulation_configureAquifer: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
371
|
+
readonly simulation_configureSnowmelt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
372
|
+
readonly simulation_configureSnowmeltSurface: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
373
|
+
readonly simulation_configureUnitHydrograph: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
374
|
+
readonly simulation_rdiiAssignments: (a: number, b: number) => void;
|
|
375
|
+
readonly simulation_replaceAmmAssignments: (a: number, b: number, c: number) => void;
|
|
376
|
+
readonly simulation_replaceRdiiAssignments: (a: number, b: number, c: number) => void;
|
|
377
|
+
readonly simulation_snowmeltConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
378
|
+
readonly simulation_snowmeltSurfaceConfiguration: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
379
|
+
readonly simulation_unitHydrographConfiguration: (a: number, b: number, c: number, d: number) => void;
|
|
380
|
+
readonly initThreadPool: (a: number, b: number, c: number) => number;
|
|
381
|
+
readonly swmmrsParallelWorker: (a: number) => void;
|
|
382
|
+
readonly terminateThreadPool: (a: number) => void;
|
|
383
|
+
readonly swmmrsParallelCaller: () => void;
|
|
384
|
+
readonly swmmrsParallelWorkerFailed: (a: number) => void;
|
|
385
|
+
readonly __wasm_bindgen_func_elem_6868: (a: number, b: number, c: number, d: number) => void;
|
|
386
|
+
readonly __wasm_bindgen_func_elem_6871: (a: number, b: number, c: number, d: number) => void;
|
|
387
|
+
readonly __wasm_bindgen_func_elem_5740: (a: number, b: number, c: number) => void;
|
|
388
|
+
readonly __wasm_bindgen_func_elem_6870: (a: number, b: number, c: number) => void;
|
|
389
|
+
readonly memory: WebAssembly.Memory;
|
|
390
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
391
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
392
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
393
|
+
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
394
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
395
|
+
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
396
|
+
readonly __wbindgen_thread_destroy: (a?: number, b?: number, c?: number) => void;
|
|
397
|
+
readonly __wbindgen_start: (a: number) => void;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
404
|
+
* a precompiled `WebAssembly.Module`.
|
|
405
|
+
*
|
|
406
|
+
* @param {{ module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number }} module - Passing `SyncInitInput` directly is deprecated.
|
|
407
|
+
* @param {WebAssembly.Memory} memory - Deprecated.
|
|
408
|
+
*
|
|
409
|
+
* @returns {InitOutput}
|
|
410
|
+
*/
|
|
411
|
+
export function initSync(module: { module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number } | SyncInitInput, memory?: WebAssembly.Memory): InitOutput;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
415
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
416
|
+
*
|
|
417
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
418
|
+
* @param {WebAssembly.Memory} memory - Deprecated.
|
|
419
|
+
*
|
|
420
|
+
* @returns {Promise<InitOutput>}
|
|
421
|
+
*/
|
|
422
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number } | InitInput | Promise<InitInput>, memory?: WebAssembly.Memory): Promise<InitOutput>;
|