@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,109 @@
1
+ import type { NodeSnapshot, LinkSnapshot, SubcatchmentSnapshot } from "../snapshots.js";
2
+ import { Node, type NodeQualitySnapshot, type NodeStatisticsSnapshot } from "./nodes.js";
3
+ import { Link, type LinkQualitySnapshot, type LinkStatisticsSnapshot } from "./links.js";
4
+ import { Subcatchment, RainGage, type SubcatchmentQualitySnapshot, type SubcatchmentStatisticsSnapshot } from "./subcatchments.js";
5
+ /**
6
+ * Configured-order handles with synchronous, case-insensitive ID lookup and stable identity.
7
+ * Obtain simulation collections from the owner rather than constructing a replacement view.
8
+ * All access checks the owner lifecycle; no access is valid after close.
9
+ * @typeParam T - Handle type returned by lookup and iteration.
10
+ */
11
+ export declare class ObjectCollection<T> implements Iterable<T> {
12
+ #private;
13
+ /** Construct the shared collection implementation.
14
+ * @param ids - Canonical IDs in configured order; copied on construction.
15
+ * @param create - Factory called once per looked-up canonical ID.
16
+ * @param assertOpen - Lifecycle guard called before collection access.
17
+ */
18
+ constructor(ids: readonly string[], create: (id: string) => T, assertOpen: () => void);
19
+ /** Canonical IDs in configured order; a frozen array. */
20
+ get ids(): readonly string[];
21
+ /** Number of configured objects. */
22
+ get size(): number;
23
+ /** Test membership synchronously.
24
+ * @param id - Case-insensitive object ID.
25
+ * @returns Whether the ID is configured.
26
+ */
27
+ has(id: string): boolean;
28
+ /** Look up a stable handle synchronously.
29
+ * @param id - Case-insensitive object ID.
30
+ * @returns The same handle instance for repeated lookups of one canonical ID.
31
+ * @throws ObjectNotFoundError for an unknown ID; lifecycle errors after close.
32
+ */
33
+ get(id: string): T;
34
+ /** Look up a configured-order handle synchronously.
35
+ * @param index - Zero-based integer index; negative and fractional values are invalid.
36
+ * @returns The stable handle at the index.
37
+ * @throws RangeError for an out-of-range or noninteger index.
38
+ */
39
+ at(index: number): T;
40
+ /** Iterate handles in configured order.
41
+ * @returns Synchronous iterator, checking the owner on each lookup.
42
+ */
43
+ [Symbol.iterator](): IterableIterator<T>;
44
+ }
45
+ /** Owner-bound node handles. Snapshot selections preserve requested order; omit IDs for all nodes. */
46
+ export declare class NodeCollection extends ObjectCollection<Node> {
47
+ #private;
48
+ private constructor();
49
+ /** Read node hydraulics in `running`, `complete`, or `ended`.
50
+ * @param ids - Ordered selection; omit for all, use [] for empty columns. Unknown or case-insensitive duplicate IDs reject.
51
+ * @returns Detached columns aligned with canonical `objectIds`, without a timestamp.
52
+ */
53
+ snapshot(ids?: readonly string[]): Promise<NodeSnapshot>;
54
+ /** Read node quality in `running`, `complete`, or `ended`.
55
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
56
+ * @returns Detached pollutant-major matrices; inner rows follow `objectIds`.
57
+ */
58
+ qualitySnapshot(ids?: readonly string[]): Promise<NodeQualitySnapshot>;
59
+ /** Read cumulative node statistics in `running` or `complete`, before ending the run.
60
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
61
+ * @returns Detached statistics columns aligned with canonical `objectIds`.
62
+ */
63
+ statisticsSnapshot(ids?: readonly string[]): Promise<NodeStatisticsSnapshot>;
64
+ }
65
+ /** Owner-bound link handles. Snapshot selections preserve requested order; omit IDs for all links. */
66
+ export declare class LinkCollection extends ObjectCollection<Link> {
67
+ #private;
68
+ private constructor();
69
+ /** Read link hydraulics in `running`, `complete`, or `ended`.
70
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject, including case-only duplicates.
71
+ * @returns Detached hydraulic columns aligned with canonical `objectIds`, without a timestamp.
72
+ */
73
+ snapshot(ids?: readonly string[]): Promise<LinkSnapshot>;
74
+ /** Read link quality in `running`, `complete`, or `ended`.
75
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
76
+ * @returns Detached pollutant-major matrices; inner rows follow `objectIds`.
77
+ */
78
+ qualitySnapshot(ids?: readonly string[]): Promise<LinkQualitySnapshot>;
79
+ /** Read cumulative link statistics in `running` or `complete`.
80
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
81
+ * @returns Detached scalar columns; flow-class durations have one seven-value row per link.
82
+ */
83
+ statisticsSnapshot(ids?: readonly string[]): Promise<LinkStatisticsSnapshot>;
84
+ }
85
+ /** Owner-bound subcatchment handles and aligned hydraulic, quality, and statistics reads. */
86
+ export declare class SubcatchmentCollection extends ObjectCollection<Subcatchment> {
87
+ #private;
88
+ private constructor();
89
+ /** Read runoff results in `running`, `complete`, or `ended`.
90
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject, including case-only duplicates.
91
+ * @returns Detached runoff columns aligned with canonical `objectIds`, without a timestamp.
92
+ */
93
+ snapshot(ids?: readonly string[]): Promise<SubcatchmentSnapshot>;
94
+ /** Read subcatchment quality in `running`, `complete`, or `ended`.
95
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
96
+ * @returns Detached pollutant-major matrices; inner rows follow `objectIds`.
97
+ */
98
+ qualitySnapshot(ids?: readonly string[]): Promise<SubcatchmentQualitySnapshot>;
99
+ /** Read cumulative runoff statistics in `running` or `complete`.
100
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
101
+ * @returns Detached statistics columns aligned with canonical `objectIds`.
102
+ */
103
+ statisticsSnapshot(ids?: readonly string[]): Promise<SubcatchmentStatisticsSnapshot>;
104
+ }
105
+ /** Owner-bound rain-gage handles. Rain gages provide per-object results, not collection snapshots. */
106
+ export declare class RainGageCollection extends ObjectCollection<RainGage> {
107
+ private constructor();
108
+ }
109
+ //# sourceMappingURL=collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/swmmrs/objects/collections.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,KAAK,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,KAAK,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,2BAA2B,EAAE,KAAK,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEnI;;;;;GAKG;AACH,qBAAa,gBAAgB,CAAC,CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,CAAC;;IAOrD;;;;OAIG;IACH,YAAY,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,IAAI,EAKpF;IACD,yDAAyD;IACzD,IAAI,GAAG,IAAI,SAAS,MAAM,EAAE,CAA0C;IACtE,oCAAoC;IACpC,IAAI,IAAI,IAAI,MAAM,CAAiD;IACnE;;;OAGG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAiE;IACzF;;;;OAIG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,CAOjB;IACD;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAKnB;IACD;;OAEG;IACF,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAGxC;CACF;AAED,sGAAsG;AACtG,qBAAa,cAAe,SAAQ,g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BAAa,kBAAmB,SAAQ,gBAAgB,CAAC,QAAQ,CAAC;IAChE,OAAO,eAEN;CAGF"}
@@ -0,0 +1,158 @@
1
+ import { ObjectNotFoundError } from "../exceptions.js";
2
+ import { Node } from "./nodes.js";
3
+ import { Link } from "./links.js";
4
+ import { Subcatchment, RainGage } from "./subcatchments.js";
5
+ /**
6
+ * Configured-order handles with synchronous, case-insensitive ID lookup and stable identity.
7
+ * Obtain simulation collections from the owner rather than constructing a replacement view.
8
+ * All access checks the owner lifecycle; no access is valid after close.
9
+ * @typeParam T - Handle type returned by lookup and iteration.
10
+ */
11
+ export class ObjectCollection {
12
+ #ids;
13
+ #byId;
14
+ #views = new Map();
15
+ #create;
16
+ #assertOpen;
17
+ /** Construct the shared collection implementation.
18
+ * @param ids - Canonical IDs in configured order; copied on construction.
19
+ * @param create - Factory called once per looked-up canonical ID.
20
+ * @param assertOpen - Lifecycle guard called before collection access.
21
+ */
22
+ constructor(ids, create, assertOpen) {
23
+ this.#ids = Object.freeze([...ids]);
24
+ this.#byId = new Map(ids.map((id) => [id.toLowerCase(), id]));
25
+ this.#create = create;
26
+ this.#assertOpen = assertOpen;
27
+ }
28
+ /** Canonical IDs in configured order; a frozen array. */
29
+ get ids() { this.#assertOpen(); return this.#ids; }
30
+ /** Number of configured objects. */
31
+ get size() { this.#assertOpen(); return this.#ids.length; }
32
+ /** Test membership synchronously.
33
+ * @param id - Case-insensitive object ID.
34
+ * @returns Whether the ID is configured.
35
+ */
36
+ has(id) { this.#assertOpen(); return this.#byId.has(id.toLowerCase()); }
37
+ /** Look up a stable handle synchronously.
38
+ * @param id - Case-insensitive object ID.
39
+ * @returns The same handle instance for repeated lookups of one canonical ID.
40
+ * @throws ObjectNotFoundError for an unknown ID; lifecycle errors after close.
41
+ */
42
+ get(id) {
43
+ this.#assertOpen();
44
+ const canonical = this.#byId.get(id.toLowerCase());
45
+ if (canonical === undefined)
46
+ throw new ObjectNotFoundError({ message: `Unknown object: ${id}`, code: 505, operation: "lookup" });
47
+ let view = this.#views.get(canonical);
48
+ if (view === undefined) {
49
+ view = this.#create(canonical);
50
+ this.#views.set(canonical, view);
51
+ }
52
+ return view;
53
+ }
54
+ /** Look up a configured-order handle synchronously.
55
+ * @param index - Zero-based integer index; negative and fractional values are invalid.
56
+ * @returns The stable handle at the index.
57
+ * @throws RangeError for an out-of-range or noninteger index.
58
+ */
59
+ at(index) {
60
+ this.#assertOpen();
61
+ const id = this.#ids[index];
62
+ if (!Number.isInteger(index) || id === undefined)
63
+ throw new RangeError(`Object index out of range: ${index}`);
64
+ return this.get(id);
65
+ }
66
+ /** Iterate handles in configured order.
67
+ * @returns Synchronous iterator, checking the owner on each lookup.
68
+ */
69
+ *[Symbol.iterator]() {
70
+ this.#assertOpen();
71
+ for (const id of this.#ids)
72
+ yield this.get(id);
73
+ }
74
+ }
75
+ /** Owner-bound node handles. Snapshot selections preserve requested order; omit IDs for all nodes. */
76
+ export class NodeCollection extends ObjectCollection {
77
+ #call;
78
+ constructor(ids, call, assertOpen) {
79
+ super(ids, (id) => Node.create(id, call), assertOpen);
80
+ this.#call = call;
81
+ }
82
+ /** @internal */
83
+ static create(ids, call, assertOpen) { return new NodeCollection(ids, call, assertOpen); }
84
+ /** Read node hydraulics in `running`, `complete`, or `ended`.
85
+ * @param ids - Ordered selection; omit for all, use [] for empty columns. Unknown or case-insensitive duplicate IDs reject.
86
+ * @returns Detached columns aligned with canonical `objectIds`, without a timestamp.
87
+ */
88
+ snapshot(ids) { return this.#call("nodes", ids); }
89
+ /** Read node quality in `running`, `complete`, or `ended`.
90
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
91
+ * @returns Detached pollutant-major matrices; inner rows follow `objectIds`.
92
+ */
93
+ qualitySnapshot(ids) { return this.#call("nodeQualitySnapshot", ids); }
94
+ /** Read cumulative node statistics in `running` or `complete`, before ending the run.
95
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
96
+ * @returns Detached statistics columns aligned with canonical `objectIds`.
97
+ */
98
+ statisticsSnapshot(ids) { return this.#call("nodeStatisticsSnapshot", ids); }
99
+ }
100
+ /** Owner-bound link handles. Snapshot selections preserve requested order; omit IDs for all links. */
101
+ export class LinkCollection extends ObjectCollection {
102
+ #call;
103
+ constructor(ids, call, assertOpen) {
104
+ super(ids, (id) => Link.create(id, call), assertOpen);
105
+ this.#call = call;
106
+ }
107
+ /** @internal */
108
+ static create(ids, call, assertOpen) { return new LinkCollection(ids, call, assertOpen); }
109
+ /** Read link hydraulics in `running`, `complete`, or `ended`.
110
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject, including case-only duplicates.
111
+ * @returns Detached hydraulic columns aligned with canonical `objectIds`, without a timestamp.
112
+ */
113
+ snapshot(ids) { return this.#call("links", ids); }
114
+ /** Read link quality in `running`, `complete`, or `ended`.
115
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
116
+ * @returns Detached pollutant-major matrices; inner rows follow `objectIds`.
117
+ */
118
+ qualitySnapshot(ids) { return this.#call("linkQualitySnapshot", ids); }
119
+ /** Read cumulative link statistics in `running` or `complete`.
120
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
121
+ * @returns Detached scalar columns; flow-class durations have one seven-value row per link.
122
+ */
123
+ statisticsSnapshot(ids) { return this.#call("linkStatisticsSnapshot", ids); }
124
+ }
125
+ /** Owner-bound subcatchment handles and aligned hydraulic, quality, and statistics reads. */
126
+ export class SubcatchmentCollection extends ObjectCollection {
127
+ #call;
128
+ constructor(ids, call, assertOpen) {
129
+ super(ids, (id) => Subcatchment.create(id, call), assertOpen);
130
+ this.#call = call;
131
+ }
132
+ /** @internal */
133
+ static create(ids, call, assertOpen) { return new SubcatchmentCollection(ids, call, assertOpen); }
134
+ /** Read runoff results in `running`, `complete`, or `ended`.
135
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject, including case-only duplicates.
136
+ * @returns Detached runoff columns aligned with canonical `objectIds`, without a timestamp.
137
+ */
138
+ snapshot(ids) { return this.#call("subcatchments", ids); }
139
+ /** Read subcatchment quality in `running`, `complete`, or `ended`.
140
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
141
+ * @returns Detached pollutant-major matrices; inner rows follow `objectIds`.
142
+ */
143
+ qualitySnapshot(ids) { return this.#call("subcatchmentQualitySnapshot", ids); }
144
+ /** Read cumulative runoff statistics in `running` or `complete`.
145
+ * @param ids - Ordered IDs; omit for all or use [] for none. Unknown/duplicate IDs reject.
146
+ * @returns Detached statistics columns aligned with canonical `objectIds`.
147
+ */
148
+ statisticsSnapshot(ids) { return this.#call("subcatchmentStatisticsSnapshot", ids); }
149
+ }
150
+ /** Owner-bound rain-gage handles. Rain gages provide per-object results, not collection snapshots. */
151
+ export class RainGageCollection extends ObjectCollection {
152
+ constructor(ids, call, assertOpen) {
153
+ super(ids, (id) => RainGage.create(id, call), assertOpen);
154
+ }
155
+ /** @internal */
156
+ static create(ids, call, assertOpen) { return new RainGageCollection(ids, call, assertOpen); }
157
+ }
158
+ //# sourceMappingURL=collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/swmmrs/objects/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,IAAI,EAAyD,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,IAAI,EAAyD,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAyE,MAAM,oBAAoB,CAAC;AAEnI;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAClB,IAAI,CAAoB;IACxB,KAAK,CAAsB;IAC3B,MAAM,GAAG,IAAI,GAAG,EAAa,CAAC;IAC9B,OAAO,CAAoB;IAC3B,WAAW,CAAa;IAEjC;;;;OAIG;IACH,YAAY,GAA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AAC;CACxJ"}
@@ -0,0 +1,215 @@
1
+ import type { Call } from "../protocol.js";
2
+ /** Operations used by definition handles. Main extends the worker protocol with these entries. */
3
+ export interface DefinitionOperations {
4
+ aquiferConfiguration: {
5
+ args: [string];
6
+ result: AquiferConfiguration;
7
+ };
8
+ configureAquifer: {
9
+ args: [string, AquiferPatch];
10
+ result: void;
11
+ };
12
+ snowmeltConfiguration: {
13
+ args: [string];
14
+ result: SnowmeltParameterSetConfiguration;
15
+ };
16
+ configureSnowmelt: {
17
+ args: [string, SnowmeltParameterSetPatch];
18
+ result: void;
19
+ };
20
+ snowmeltSurfaceConfiguration: {
21
+ args: [string, SnowmeltSurfaceName];
22
+ result: SnowmeltSurfaceConfiguration;
23
+ };
24
+ configureSnowmeltSurface: {
25
+ args: [string, SnowmeltSurfaceName, SnowmeltSurfacePatch];
26
+ result: void;
27
+ };
28
+ }
29
+ /** Read-only identity for a configured definition. Generic handles do not expose editable curve/time-series data. */
30
+ export declare class Definition {
31
+ /** Canonical configured definition ID. */
32
+ readonly id: string;
33
+ protected readonly call: Call;
34
+ protected constructor(id: string, call: Call);
35
+ }
36
+ /** Read-only pollutant identity handle. */
37
+ export type Pollutant = Definition;
38
+ /** Read-only land-use identity handle. */
39
+ export type LandUse = Definition;
40
+ /** Read-only time-pattern identity handle. */
41
+ export type TimePattern = Definition;
42
+ /** Read-only curve identity handle. */
43
+ export type Curve = Definition;
44
+ /** Read-only time-series identity handle. */
45
+ export type TimeSeries = Definition;
46
+ /** Read-only control-rule identity handle. */
47
+ export type ControlRule = Definition;
48
+ /** Read-only transect identity handle. */
49
+ export type Transect = Definition;
50
+ /** Read-only custom-shape identity handle. */
51
+ export type CustomShape = Definition;
52
+ /** Read-only street identity handle. */
53
+ export type Street = Definition;
54
+ /** Read-only inlet-design identity handle. */
55
+ export type InletDesign = Definition;
56
+ /** Detached aquifer declarations in configured project units. */
57
+ export interface AquiferConfiguration {
58
+ /** Soil porosity fraction. */
59
+ readonly porosity: number;
60
+ /** Wilting-point moisture fraction. */
61
+ readonly wiltingPoint: number;
62
+ /** Field-capacity moisture fraction. */
63
+ readonly fieldCapacity: number;
64
+ /** Saturated hydraulic conductivity in project rainfall-rate units. */
65
+ readonly hydraulicConductivity: number;
66
+ /** Native conductivity-response slope. */
67
+ readonly conductivitySlope: number;
68
+ /** Tension-response slope in project length units (ft or m). */
69
+ readonly tensionSlope: number;
70
+ /** Fraction of evaporation drawn from the upper zone. */
71
+ readonly upperEvaporationFraction: number;
72
+ /** Lower-zone evaporation depth in project length units. */
73
+ readonly lowerEvaporationDepth: number;
74
+ /** Lower-zone loss coefficient in in/h or mm/h. */
75
+ readonly lowerLossCoefficient: number;
76
+ /** Aquifer bottom elevation in ft or m. */
77
+ readonly bottomElevation: number;
78
+ /** Initial water-table elevation in ft or m. */
79
+ readonly waterTableElevation: number;
80
+ /** Initial upper-zone moisture fraction. */
81
+ readonly upperMoisture: number;
82
+ /** Canonical upper-evaporation time-pattern ID, or null. */
83
+ readonly upperEvaporationPattern: string | null;
84
+ }
85
+ /** Sparse aquifer update; omitted fields retain their values. */
86
+ export interface AquiferPatch {
87
+ /** {@inheritDoc AquiferConfiguration.porosity} */
88
+ porosity?: number;
89
+ /** {@inheritDoc AquiferConfiguration.wiltingPoint} */
90
+ wiltingPoint?: number;
91
+ /** {@inheritDoc AquiferConfiguration.fieldCapacity} */
92
+ fieldCapacity?: number;
93
+ /** {@inheritDoc AquiferConfiguration.hydraulicConductivity} */
94
+ hydraulicConductivity?: number;
95
+ /** {@inheritDoc AquiferConfiguration.conductivitySlope} */
96
+ conductivitySlope?: number;
97
+ /** {@inheritDoc AquiferConfiguration.tensionSlope} */
98
+ tensionSlope?: number;
99
+ /** {@inheritDoc AquiferConfiguration.upperEvaporationFraction} */
100
+ upperEvaporationFraction?: number;
101
+ /** {@inheritDoc AquiferConfiguration.lowerEvaporationDepth} */
102
+ lowerEvaporationDepth?: number;
103
+ /** {@inheritDoc AquiferConfiguration.lowerLossCoefficient} */
104
+ lowerLossCoefficient?: number;
105
+ /** {@inheritDoc AquiferConfiguration.bottomElevation} */
106
+ bottomElevation?: number;
107
+ /** {@inheritDoc AquiferConfiguration.waterTableElevation} */
108
+ waterTableElevation?: number;
109
+ /** {@inheritDoc AquiferConfiguration.upperMoisture} */
110
+ upperMoisture?: number;
111
+ /** Clear with null; omission retains the current relationship. */
112
+ upperEvaporationPattern?: string | null;
113
+ }
114
+ /** Editable aquifer handle obtained from `simulation.aquifers`. */
115
+ export declare class Aquifer extends Definition {
116
+ private constructor();
117
+ /** Read aquifer declarations in any healthy owner state.
118
+ * @returns Detached aquifer configuration in project units.
119
+ */
120
+ configuration(): Promise<AquiferConfiguration>;
121
+ /** Atomically update aquifer declarations in `open` or `ended`; accepted edits return the owner to `open`.
122
+ * @param patch - Sparse field values; null clears the optional time-pattern relationship.
123
+ * @returns Resolves after all fields are accepted.
124
+ */
125
+ configure(patch: AquiferPatch): Promise<void>;
126
+ }
127
+ /** Snowmelt surface selector within a parameter set. */
128
+ export type SnowmeltSurfaceName = "plowable" | "impervious" | "pervious";
129
+ /** Detached snowmelt-surface declarations. */
130
+ export interface SnowmeltSurfaceConfiguration {
131
+ /** Minimum melt coefficient in in/(h·°F) for US projects or mm/(h·°C) for SI projects. */
132
+ readonly minimumMeltCoefficient: number;
133
+ /** Maximum melt coefficient in in/(h·°F) for US projects or mm/(h·°C) for SI projects. */
134
+ readonly maximumMeltCoefficient: number;
135
+ /** Base melt temperature in °F for US projects or °C for SI projects. */
136
+ readonly baseTemperature: number;
137
+ /** Free-water holding-capacity fraction. */
138
+ readonly freeWaterFraction: number;
139
+ /** Initial snow water-equivalent depth in in or mm. */
140
+ readonly initialSnowDepth: number;
141
+ /** Initial free-water depth in in or mm. */
142
+ readonly initialFreeWater: number;
143
+ /** Snow water-equivalent depth for full coverage in in or mm. */
144
+ readonly snowDepthForFullCoverage: number;
145
+ }
146
+ /** Sparse snowmelt-surface update; omission retains a field. */
147
+ export interface SnowmeltSurfacePatch {
148
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.minimumMeltCoefficient} */
149
+ minimumMeltCoefficient?: number;
150
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.maximumMeltCoefficient} */
151
+ maximumMeltCoefficient?: number;
152
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.baseTemperature} */
153
+ baseTemperature?: number;
154
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.freeWaterFraction} */
155
+ freeWaterFraction?: number;
156
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.initialSnowDepth} */
157
+ initialSnowDepth?: number;
158
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.initialFreeWater} */
159
+ initialFreeWater?: number;
160
+ /** {@inheritDoc SnowmeltSurfaceConfiguration.snowDepthForFullCoverage} */
161
+ snowDepthForFullCoverage?: number;
162
+ }
163
+ /** Detached snowmelt parameter set with all three surface records. */
164
+ export interface SnowmeltParameterSetConfiguration {
165
+ /** Plowable fraction of impervious area. */
166
+ readonly plowableFraction: number;
167
+ /** Plowable-surface melt parameters. */
168
+ readonly plowable: SnowmeltSurfaceConfiguration;
169
+ /** Impervious-surface melt parameters. */
170
+ readonly impervious: SnowmeltSurfaceConfiguration;
171
+ /** Pervious-surface melt parameters. */
172
+ readonly pervious: SnowmeltSurfaceConfiguration;
173
+ /** Snow water-equivalent depth triggering plowing, in in or mm. */
174
+ readonly plowDepth: number;
175
+ /** Five removal fractions in native solver destination order. */
176
+ readonly removalFractions: readonly [number, number, number, number, number];
177
+ /** Canonical receiving subcatchment ID, or null. */
178
+ readonly removalSubcatchment: string | null;
179
+ }
180
+ /** Sparse parameter-set update; use `configureSurface` for individual surface parameters. */
181
+ export interface SnowmeltParameterSetPatch {
182
+ /** {@inheritDoc SnowmeltParameterSetConfiguration.plowableFraction} */
183
+ plowableFraction?: number;
184
+ /** {@inheritDoc SnowmeltParameterSetConfiguration.plowDepth} */
185
+ plowDepth?: number;
186
+ /** {@inheritDoc SnowmeltParameterSetConfiguration.removalFractions} */
187
+ removalFractions?: readonly [number, number, number, number, number];
188
+ /** Clear with null; omission retains the current relationship. */
189
+ removalSubcatchment?: string | null;
190
+ }
191
+ /** Editable snowmelt parameter-set identity handle. */
192
+ export declare class SnowmeltParameterSet extends Definition {
193
+ private constructor();
194
+ /** Read all parameter-set declarations in a healthy owner state.
195
+ * @returns Detached parameter set with three surface records.
196
+ */
197
+ configuration(): Promise<SnowmeltParameterSetConfiguration>;
198
+ /** Atomically update set-level declarations in `open` or `ended`; accepted edits return the owner to `open`.
199
+ * @param patch - Sparse set fields; null clears the optional receiving-subcatchment relation.
200
+ * @returns Resolves after the update is accepted.
201
+ */
202
+ configure(patch: SnowmeltParameterSetPatch): Promise<void>;
203
+ /** Read one surface in a healthy owner state.
204
+ * @param surface - Plowable, impervious, or pervious surface selector.
205
+ * @returns Detached surface parameters.
206
+ */
207
+ surfaceConfiguration(surface: SnowmeltSurfaceName): Promise<SnowmeltSurfaceConfiguration>;
208
+ /** Atomically update one surface in `open` or `ended`; accepted edits return the owner to `open`.
209
+ * @param surface - Surface to update.
210
+ * @param patch - Sparse surface values; omitted fields retain their values.
211
+ * @returns Resolves after all supplied fields are accepted.
212
+ */
213
+ configureSurface(surface: SnowmeltSurfaceName, patch: SnowmeltSurfacePatch): Promise<void>;
214
+ }
215
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/swmmrs/objects/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,kGAAkG;AAClG,MAAM,WAAW,oBAAoB;IACnC,oBAAoB,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;QAAC,MAAM,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACvE,gBAAgB,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAAC,MAAM,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;IAClE,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,uDAAuD;AACvD,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,OAAO,eAAyD;IAOhE;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,iCAAiC,CAAC,CAE1D;IAED;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzD;IAED;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAExF;IAED;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzF;CACF"}
@@ -0,0 +1,69 @@
1
+ /** Read-only identity for a configured definition. Generic handles do not expose editable curve/time-series data. */
2
+ export class Definition {
3
+ /** Canonical configured definition ID. */
4
+ id;
5
+ call;
6
+ constructor(id, call) {
7
+ this.id = id;
8
+ this.call = call;
9
+ Object.freeze(this);
10
+ }
11
+ /** @internal */
12
+ static create(id, call) { return new Definition(id, call); }
13
+ }
14
+ /** Editable aquifer handle obtained from `simulation.aquifers`. */
15
+ export class Aquifer extends Definition {
16
+ constructor(id, call) { super(id, call); }
17
+ /** @internal */
18
+ static create(id, call) { return new Aquifer(id, call); }
19
+ /** Read aquifer declarations in any healthy owner state.
20
+ * @returns Detached aquifer configuration in project units.
21
+ */
22
+ configuration() {
23
+ return this.call("aquiferConfiguration", this.id);
24
+ }
25
+ /** Atomically update aquifer declarations in `open` or `ended`; accepted edits return the owner to `open`.
26
+ * @param patch - Sparse field values; null clears the optional time-pattern relationship.
27
+ * @returns Resolves after all fields are accepted.
28
+ */
29
+ configure(patch) {
30
+ return this.call("configureAquifer", this.id, patch);
31
+ }
32
+ }
33
+ /** Editable snowmelt parameter-set identity handle. */
34
+ export class SnowmeltParameterSet extends Definition {
35
+ constructor(id, call) { super(id, call); }
36
+ /** @internal */
37
+ static create(id, call) {
38
+ return new SnowmeltParameterSet(id, call);
39
+ }
40
+ /** Read all parameter-set declarations in a healthy owner state.
41
+ * @returns Detached parameter set with three surface records.
42
+ */
43
+ configuration() {
44
+ return this.call("snowmeltConfiguration", this.id);
45
+ }
46
+ /** Atomically update set-level declarations in `open` or `ended`; accepted edits return the owner to `open`.
47
+ * @param patch - Sparse set fields; null clears the optional receiving-subcatchment relation.
48
+ * @returns Resolves after the update is accepted.
49
+ */
50
+ configure(patch) {
51
+ return this.call("configureSnowmelt", this.id, patch);
52
+ }
53
+ /** Read one surface in a healthy owner state.
54
+ * @param surface - Plowable, impervious, or pervious surface selector.
55
+ * @returns Detached surface parameters.
56
+ */
57
+ surfaceConfiguration(surface) {
58
+ return this.call("snowmeltSurfaceConfiguration", this.id, surface);
59
+ }
60
+ /** Atomically update one surface in `open` or `ended`; accepted edits return the owner to `open`.
61
+ * @param surface - Surface to update.
62
+ * @param patch - Sparse surface values; omitted fields retain their values.
63
+ * @returns Resolves after all supplied fields are accepted.
64
+ */
65
+ configureSurface(surface, patch) {
66
+ return this.call("configureSnowmeltSurface", this.id, surface, patch);
67
+ }
68
+ }
69
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../src/swmmrs/objects/definitions.ts"],"names":[],"mappings":"AAeA,qHAAqH;AACrH,MAAM,OAAO,UAAU;IACrB,0CAA0C;IACjC,EAAE,CAAS;IACD,IAAI,CAAO;IAE9B,YAAsB,EAAU,EAAE,IAAU;QAC1C,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,gBAAgB;IAChB,MAAM,CAAC,MAAM,CAAC,EAAU,EAAE,IAAU,IAAgB,OAAO,IAAI,UAAU,CAAC,EAAE,E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