@everyonesoftware/common 3.0.0 → 4.0.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 (176) hide show
  1. package/outputs/chunk-AY3YWKOM.js +7741 -0
  2. package/outputs/chunk-AY3YWKOM.js.map +1 -0
  3. package/outputs/sources.cjs +9007 -0
  4. package/outputs/sources.cjs.map +1 -0
  5. package/outputs/sources.d.cts +4082 -0
  6. package/outputs/sources.d.ts +4082 -0
  7. package/outputs/sources.js +1370 -0
  8. package/outputs/sources.js.map +1 -0
  9. package/outputs/tests.cjs +17208 -0
  10. package/outputs/tests.cjs.map +1 -0
  11. package/outputs/tests.d.cts +3 -0
  12. package/outputs/tests.d.ts +3 -0
  13. package/outputs/tests.js +9798 -0
  14. package/outputs/tests.js.map +1 -0
  15. package/package.json +6 -1
  16. package/.c8rc.json +0 -12
  17. package/.github/workflows/publish.yml +0 -54
  18. package/.mocharc.json +0 -9
  19. package/sources/assertMessageParameters.ts +0 -22
  20. package/sources/asyncIterator.ts +0 -437
  21. package/sources/asyncIteratorToJavascriptAsyncIteratorAdapter.ts +0 -48
  22. package/sources/asyncResult.ts +0 -95
  23. package/sources/basicDisposable.ts +0 -57
  24. package/sources/byteList.ts +0 -202
  25. package/sources/byteListStream.ts +0 -121
  26. package/sources/byteReadStream.ts +0 -24
  27. package/sources/byteWriteStream.ts +0 -16
  28. package/sources/bytes.ts +0 -25
  29. package/sources/characterList.ts +0 -195
  30. package/sources/characterListStream.ts +0 -151
  31. package/sources/characterReadStream.ts +0 -81
  32. package/sources/characterReadStreamIterator.ts +0 -128
  33. package/sources/characterWriteStream.ts +0 -45
  34. package/sources/commandLineParameter.ts +0 -45
  35. package/sources/commandLineParameters.ts +0 -21
  36. package/sources/comparable.ts +0 -144
  37. package/sources/comparer.ts +0 -133
  38. package/sources/comparison.ts +0 -20
  39. package/sources/concatenateIterable.ts +0 -119
  40. package/sources/concatenateIterator.ts +0 -165
  41. package/sources/condition.ts +0 -329
  42. package/sources/currentProcess.ts +0 -158
  43. package/sources/dateTime.ts +0 -130
  44. package/sources/depthFirstSearch.ts +0 -230
  45. package/sources/disposable.ts +0 -31
  46. package/sources/emptyError.ts +0 -10
  47. package/sources/english.ts +0 -45
  48. package/sources/equalFunctions.ts +0 -123
  49. package/sources/fetchHttpClient.ts +0 -89
  50. package/sources/fetchHttpResponse.ts +0 -106
  51. package/sources/flatMapIterable.ts +0 -104
  52. package/sources/flatMapIterator.ts +0 -152
  53. package/sources/generator.ts +0 -251
  54. package/sources/httpClient.ts +0 -36
  55. package/sources/httpHeader.ts +0 -37
  56. package/sources/httpHeaders.ts +0 -216
  57. package/sources/httpIncomingRequest.ts +0 -30
  58. package/sources/httpIncomingResponse.ts +0 -19
  59. package/sources/httpMethod.ts +0 -164
  60. package/sources/httpOutgoingRequest.ts +0 -119
  61. package/sources/httpOutgoingResponse.ts +0 -113
  62. package/sources/httpServer.ts +0 -34
  63. package/sources/inMemoryCharacterWriteStream.ts +0 -78
  64. package/sources/index.ts +0 -101
  65. package/sources/iterable.ts +0 -345
  66. package/sources/iterator.ts +0 -481
  67. package/sources/iteratorToJavascriptIteratorAdapter.ts +0 -48
  68. package/sources/javascript.ts +0 -59
  69. package/sources/javascriptArrayList.ts +0 -175
  70. package/sources/javascriptAsyncIteratorToAsyncIteratorAdapter.ts +0 -124
  71. package/sources/javascriptIteratorToIteratorAdapter.ts +0 -133
  72. package/sources/javascriptMapMap.ts +0 -143
  73. package/sources/javascriptSetSet.ts +0 -134
  74. package/sources/list.ts +0 -330
  75. package/sources/listQueue.ts +0 -62
  76. package/sources/listStack.ts +0 -62
  77. package/sources/luxonDateTime.ts +0 -109
  78. package/sources/map.ts +0 -302
  79. package/sources/mapAsyncIterator.ts +0 -141
  80. package/sources/mapIterable.ts +0 -105
  81. package/sources/mapIterator.ts +0 -145
  82. package/sources/mutableCondition.ts +0 -451
  83. package/sources/mutableHttpHeaders.ts +0 -204
  84. package/sources/mutableMap.ts +0 -292
  85. package/sources/network.ts +0 -18
  86. package/sources/node.ts +0 -37
  87. package/sources/nodeJSCharacterWriteStream.ts +0 -42
  88. package/sources/nodeJSHttpIncomingRequest.ts +0 -132
  89. package/sources/nodeJSHttpServer.ts +0 -134
  90. package/sources/notFoundError.ts +0 -12
  91. package/sources/postCondition.ts +0 -284
  92. package/sources/postConditionError.ts +0 -12
  93. package/sources/preCondition.ts +0 -284
  94. package/sources/preConditionError.ts +0 -12
  95. package/sources/promiseAsyncResult.ts +0 -174
  96. package/sources/property.ts +0 -63
  97. package/sources/queue.ts +0 -49
  98. package/sources/realNetwork.ts +0 -28
  99. package/sources/recreationDotGovClient.ts +0 -259
  100. package/sources/searchControl.ts +0 -42
  101. package/sources/set.ts +0 -244
  102. package/sources/skipAsyncIterator.ts +0 -145
  103. package/sources/skipIterator.ts +0 -155
  104. package/sources/stack.ts +0 -48
  105. package/sources/stringComparer.ts +0 -33
  106. package/sources/stringIterator.ts +0 -149
  107. package/sources/strings.ts +0 -322
  108. package/sources/syncResult.ts +0 -300
  109. package/sources/takeAsyncIterator.ts +0 -141
  110. package/sources/takeIterator.ts +0 -151
  111. package/sources/toStringFunctions.ts +0 -185
  112. package/sources/types.ts +0 -371
  113. package/sources/whereAsyncIterator.ts +0 -143
  114. package/sources/whereIterable.ts +0 -108
  115. package/sources/whereIterator.ts +0 -157
  116. package/sources/wonderlandTrailClient.ts +0 -1503
  117. package/tests/assertTest.ts +0 -113
  118. package/tests/assertTestTests.ts +0 -75
  119. package/tests/basicTestSkip.ts +0 -51
  120. package/tests/byteListStreamTests.ts +0 -390
  121. package/tests/byteListTests.ts +0 -27
  122. package/tests/bytesTests.ts +0 -43
  123. package/tests/characterListStreamTests.ts +0 -391
  124. package/tests/characterListTests.ts +0 -250
  125. package/tests/characterWriteStreamTests.ts +0 -12
  126. package/tests/comparerTests.ts +0 -92
  127. package/tests/conditionTests.ts +0 -877
  128. package/tests/consoleTestRunner.ts +0 -404
  129. package/tests/consoleTestRunnerTests.ts +0 -651
  130. package/tests/dateTimeTests.ts +0 -30
  131. package/tests/depthFirstSearchTests.ts +0 -106
  132. package/tests/disposableTests.ts +0 -121
  133. package/tests/englishTests.ts +0 -103
  134. package/tests/equalFunctionsTests.ts +0 -223
  135. package/tests/failedTest.ts +0 -43
  136. package/tests/fetchHttpClientTests.ts +0 -33
  137. package/tests/generatorTests.ts +0 -86
  138. package/tests/httpClientTests.ts +0 -18
  139. package/tests/inMemoryCharacterWriteStreamTests.ts +0 -117
  140. package/tests/iterableTests.ts +0 -141
  141. package/tests/iteratorTests.ts +0 -1086
  142. package/tests/javascriptMapMapTests.ts +0 -21
  143. package/tests/listTests.ts +0 -338
  144. package/tests/mapIteratorTests.ts +0 -55
  145. package/tests/mapTests.ts +0 -104
  146. package/tests/mutableConditionTests.ts +0 -273
  147. package/tests/mutableMapTests.ts +0 -154
  148. package/tests/nodeJSHttpServerTests.ts +0 -75
  149. package/tests/notFoundErrorTests.ts +0 -24
  150. package/tests/postConditionErrorTests.ts +0 -24
  151. package/tests/preConditionErrorTests.ts +0 -24
  152. package/tests/promiseAsyncResultTests.ts +0 -688
  153. package/tests/propertyTests.ts +0 -63
  154. package/tests/queueTests.ts +0 -29
  155. package/tests/recreationDotGovClientTests.ts +0 -191
  156. package/tests/setTests.ts +0 -140
  157. package/tests/skippedTest.ts +0 -39
  158. package/tests/stackTests.ts +0 -66
  159. package/tests/stringComparerTests.ts +0 -60
  160. package/tests/stringIteratorTests.ts +0 -156
  161. package/tests/stringsTests.ts +0 -516
  162. package/tests/syncResultTests.ts +0 -1251
  163. package/tests/test.ts +0 -228
  164. package/tests/testAction.ts +0 -75
  165. package/tests/testActionTests.ts +0 -93
  166. package/tests/testFailureTests.ts +0 -12
  167. package/tests/testRunner.ts +0 -267
  168. package/tests/testRunnerTests.ts +0 -895
  169. package/tests/testSkip.ts +0 -34
  170. package/tests/tests.ts +0 -103
  171. package/tests/toStringFunctionsTests.ts +0 -55
  172. package/tests/typesTests.ts +0 -257
  173. package/tests/whereIteratorTests.ts +0 -77
  174. package/tests/wonderlandTrailClientTests.ts +0 -452
  175. package/tsconfig.json +0 -20
  176. package/tsup.config.ts +0 -13
@@ -0,0 +1,4082 @@
1
+ import * as http from 'http';
2
+
3
+ /**
4
+ * A collection of parameters that can be passed to an assert error message function.
5
+ */
6
+ interface AssertMessageParameters {
7
+ /**
8
+ * The expected state.
9
+ */
10
+ expected: string;
11
+ /**
12
+ * The actual state.
13
+ */
14
+ actual: string;
15
+ /**
16
+ * A string representation of the expression that produced the actual state.
17
+ */
18
+ expression?: string;
19
+ /**
20
+ * A message that describes the failure.
21
+ */
22
+ message?: string;
23
+ }
24
+
25
+ /**
26
+ * The result of comparing two values.
27
+ */
28
+ declare enum Comparison {
29
+ /**
30
+ * The left value is less than the right value.
31
+ */
32
+ LessThan = 0,
33
+ /**
34
+ * The two values are equal.
35
+ */
36
+ Equal = 1,
37
+ /**
38
+ * The left value is greater than the right value.
39
+ */
40
+ GreaterThan = 2
41
+ }
42
+
43
+ /**
44
+ * An type that can be compared against another type.
45
+ */
46
+ declare abstract class Comparable<T> {
47
+ protected constructor();
48
+ /**
49
+ * Compare this value against the provided value.
50
+ * @param value The value to compare against.
51
+ */
52
+ abstract compareTo(value: T): Comparison;
53
+ /**
54
+ * Get whether this value is less than the provided value.
55
+ * @param value The value to compare against.
56
+ */
57
+ lessThan(value: T): boolean;
58
+ /**
59
+ * Get whether the left value is less than the right value.
60
+ * @param left The left value in the comparison.
61
+ * @param right The right value in the comparison.
62
+ */
63
+ static lessThan<T>(left: Comparable<T>, right: T): boolean;
64
+ /**
65
+ * Get whether this value is less than or equal to the provided value.
66
+ * @param value The value to compare against.
67
+ */
68
+ lessThanOrEqualTo(value: T): boolean;
69
+ /**
70
+ * Get whether the left value is less than or equal to the right value.
71
+ * @param left The left value in the comparison.
72
+ * @param right The right value in the comparison.
73
+ */
74
+ static lessThanOrEqualTo<T>(left: Comparable<T>, right: T): boolean;
75
+ /**
76
+ * Get whether this value equals the provided value.
77
+ * @param value The value to compare against.
78
+ */
79
+ equals(value: T): boolean;
80
+ /**
81
+ * Get whether the left value equals the right value.
82
+ * @param left The left value in the comparison.
83
+ * @param right The right value in the comparison.
84
+ */
85
+ static equals<T>(left: Comparable<T>, right: T): boolean;
86
+ /**
87
+ * Get whether this value is not equal to the provided value.
88
+ * @param value The value to compare against.
89
+ */
90
+ notEquals(value: T): boolean;
91
+ /**
92
+ * Get whether the left value is not equal to the right value.
93
+ * @param left The left value in the comparison.
94
+ * @param right The right value in the comparison.
95
+ */
96
+ static notEquals<T>(left: Comparable<T>, right: T): boolean;
97
+ /**
98
+ * Get whether this value is greater than or equal to the provided value.
99
+ * @param value The value to compare against.
100
+ */
101
+ greaterThanOrEqualTo(value: T): boolean;
102
+ /**
103
+ * Get whether the left value is greater than or equal to the right value.
104
+ * @param left The left value in the comparison.
105
+ * @param right The right value in the comparison.
106
+ */
107
+ static greaterThanOrEqualTo<T>(left: Comparable<T>, right: T): boolean;
108
+ /**
109
+ * Get whether this value is greater than the provided value.
110
+ * @param value The value to compare against.
111
+ */
112
+ greaterThan(value: T): boolean;
113
+ /**
114
+ * Get whether the left value is greater than the right value.
115
+ * @param left The left value in the comparison.
116
+ * @param right The right value in the comparison.
117
+ */
118
+ static greaterThan<T>(left: Comparable<T>, right: T): boolean;
119
+ }
120
+
121
+ declare class SyncResult<T> implements AsyncResult<T> {
122
+ private value;
123
+ private error;
124
+ private constructor();
125
+ static create<T>(action: () => T): SyncResult<T>;
126
+ static value<T>(value: T): SyncResult<T>;
127
+ static error<T>(error: unknown): SyncResult<T>;
128
+ await(): T;
129
+ then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => TResult1) | null, onrejected?: ((reason: unknown) => TResult2) | null): SyncResult<TResult1 | TResult2>;
130
+ then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => (TResult1 | PromiseLike<TResult1>)) | null, onrejected?: ((reason: unknown) => (TResult2 | PromiseLike<TResult2>)) | null): SyncResult<TResult1 | TResult2>;
131
+ onValue(onValueFunction: (value: T) => void): SyncResult<T>;
132
+ onValue(onValueFunction: (value: T) => Promise<void>): PromiseAsyncResult<T>;
133
+ catch<TResult = never>(onrejected: (reason: unknown) => TResult): SyncResult<T | TResult>;
134
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): SyncResult<T | TResult> | PromiseAsyncResult<T | TResult>;
135
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => TResult): SyncResult<T | TResult>;
136
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => PromiseLike<TResult>): PromiseAsyncResult<T | TResult>;
137
+ onError(onErrorFunction: (reason: unknown) => void): SyncResult<T>;
138
+ onError(onErrorFunction: (reason: unknown) => PromiseLike<void>): PromiseAsyncResult<T>;
139
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => void): SyncResult<T>;
140
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => PromiseLike<void>): PromiseAsyncResult<T>;
141
+ convertError(convertErrorFunction: (reason: unknown) => unknown): SyncResult<T>;
142
+ convertError(onErrorFunction: (reason: unknown) => PromiseLike<unknown>): PromiseAsyncResult<T>;
143
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => unknown): SyncResult<T>;
144
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => PromiseLike<unknown>): PromiseAsyncResult<T>;
145
+ finally(onfinally?: (() => void) | null): SyncResult<T>;
146
+ finally(onfinally?: (() => Promise<void>) | null): PromiseAsyncResult<T>;
147
+ readonly [Symbol.toStringTag]: string;
148
+ }
149
+
150
+ /**
151
+ * A collection of {@link Function}s that can be used to determine if two values are equal.
152
+ */
153
+ declare class EqualFunctions {
154
+ private readonly equalFunctions;
155
+ private constructor();
156
+ static create(): EqualFunctions;
157
+ private defaultEqualFunction;
158
+ /**
159
+ * Get whether the provided values are equal based on the registered equal {@link Function}s.
160
+ * @param left The left value in the comparison.
161
+ * @param right The right value in the comparison.
162
+ */
163
+ areEqual(left: unknown, right: unknown): SyncResult<boolean>;
164
+ add(equalFunction: (left: unknown, right: unknown) => (boolean | undefined)): this;
165
+ }
166
+
167
+ /**
168
+ * The built-in {@link Array} type.
169
+ *
170
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
171
+ */
172
+ type JavascriptArray<T> = Array<T>;
173
+ /**
174
+ * The built-in {@link Iterator} type.
175
+ *
176
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterators
177
+ */
178
+ type JavascriptIterator<T> = Iterator<T>;
179
+ /**
180
+ * The built-in {@link IteratorResult} type.
181
+ */
182
+ type JavascriptIteratorResult<T> = IteratorResult<T, T>;
183
+ /**
184
+ * The built-in {@link Iterable} type.
185
+ *
186
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterables
187
+ */
188
+ type JavascriptIterable<T> = Iterable<T>;
189
+ /**
190
+ * The built-in {@link Map} type.
191
+ *
192
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
193
+ */
194
+ type JavascriptMap<TKey, TValue> = Map<TKey, TValue>;
195
+ /**
196
+ * The built-in {@link Map} type.
197
+ *
198
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
199
+ */
200
+ declare const JavascriptMap: MapConstructor;
201
+ /**
202
+ * The built-in {@link AsyncIterator} type.
203
+ *
204
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator
205
+ */
206
+ type JavascriptAsyncIterator<T> = AsyncIterator<T>;
207
+ interface JavascriptAsyncIterable<T> {
208
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<T>;
209
+ }
210
+ /**
211
+ * The built-in {@link Set} type.
212
+ *
213
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
214
+ */
215
+ type JavascriptSet<T> = Set<T>;
216
+ declare const JavascriptSet: SetConstructor;
217
+
218
+ /**
219
+ * A type that can be used to iterate over a collection.
220
+ */
221
+ declare abstract class Iterator$1<T> implements JavascriptIterable<T> {
222
+ /**
223
+ * Create a new {@link Iterator} that contains the provided values.
224
+ * @param values The values that the new {@link Iterator} will iterate over.
225
+ */
226
+ static create<T>(values: JavascriptIterator<T> | JavascriptIterable<T>): Iterator$1<T>;
227
+ /**
228
+ * Move to the next value in the collection. Return whether this {@link Iterator} points to a
229
+ * value after the move.
230
+ */
231
+ abstract next(): SyncResult<boolean>;
232
+ /**
233
+ * Get whether this {@link Iterator} has started iterating over the values in the collection.
234
+ */
235
+ abstract hasStarted(): boolean;
236
+ /**
237
+ * Get whether this {@link Iterator} currently points at a value in the collection.
238
+ */
239
+ abstract hasCurrent(): boolean;
240
+ /**
241
+ * Get the value that this {@link Iterator} points to.
242
+ */
243
+ abstract getCurrent(): T;
244
+ /**
245
+ * Move to the first value if this {@link Iterator} hasn't started yet.
246
+ * @returns This object for method chaining.
247
+ */
248
+ start(): SyncResult<this>;
249
+ /**
250
+ * Move the provided {@link Iterator} to its first value if it hasn't started yet.
251
+ */
252
+ static start<T, TIterator extends Iterator$1<T>>(iterator: TIterator): SyncResult<TIterator>;
253
+ /**
254
+ * Get the current value from this {@link Iterator} and advance this {@link Iterator} to the
255
+ * next value.
256
+ */
257
+ takeCurrent(): SyncResult<T>;
258
+ static takeCurrent<T>(iterator: Iterator$1<T>): SyncResult<T>;
259
+ [Symbol.iterator](): JavascriptIterator<T>;
260
+ /**
261
+ * Convert the provided {@link Iterator} to a {@link IteratorToJavascriptIteratorAdapter}.
262
+ * @param iterator The {@link Iterator} to convert.
263
+ */
264
+ static [Symbol.iterator]<T>(iterator: Iterator$1<T>): JavascriptIterator<T>;
265
+ /**
266
+ * Get whether this {@link Iterator} contains any values.
267
+ * Note: This may advance the {@link Iterator} to the first value if it hasn't been
268
+ * started yet.
269
+ */
270
+ any(): SyncResult<boolean>;
271
+ /**
272
+ * Get whether this {@link Iterator} contains any values.
273
+ * Note: This may advance the {@link Iterator} to the first value if it hasn't been
274
+ * started yet.
275
+ */
276
+ static any<T>(iterator: Iterator$1<T>): SyncResult<boolean>;
277
+ /**
278
+ * Get the number of values in this {@link Iterator}.
279
+ * Note: This will consume all of the values in this {@link Iterator}.
280
+ */
281
+ getCount(): SyncResult<number>;
282
+ /**
283
+ * Get the number of values in the provided {@link Iterator}.
284
+ * Note: This will consume all of the values in the provided {@link Iterator}.
285
+ */
286
+ static getCount<T>(iterator: Iterator$1<T>): SyncResult<number>;
287
+ /**
288
+ * Get all of the remaining values in this {@link Iterator} in a {@link T} {@link Array}.
289
+ */
290
+ toArray(): SyncResult<T[]>;
291
+ /**
292
+ * Get all of the remaining values in the provided {@link Iterator} in a {@link T}
293
+ * {@link Array}.
294
+ */
295
+ static toArray<T>(iterator: Iterator$1<T>): SyncResult<T[]>;
296
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
297
+ static concatenate<T>(iterator: Iterator$1<T>, ...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
298
+ /**
299
+ * Get an {@link Iterator} that will only return values that match the provided condition.
300
+ * @param condition The condition to run against each of the values in this {@link Iterator}.
301
+ */
302
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterator$1<T>;
303
+ static where<T>(iterator: Iterator$1<T>, condition: (value: T) => (boolean | SyncResult<boolean>)): Iterator$1<T>;
304
+ /**
305
+ * Get a {@link MapIterator} that will map all {@link T} values from this {@link Iterator} to
306
+ * {@link TOutput} values.
307
+ * @param mapping The mapping that maps {@link T} values to {@link TOutput} values.
308
+ */
309
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
310
+ static map<T, TOutput>(iterator: Iterator$1<T>, mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
311
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
312
+ static flatMap<T, TOutput>(iterator: Iterator$1<T>, mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
313
+ /**
314
+ * Get an {@link Iterator} that will filter this {@link Iterator} to only the values that are
315
+ * instances of {@link U} based on the provided type check {@link Function}.
316
+ * @param typeCheck The {@link Function} that will be used to determine if values are of type
317
+ * {@link U}.
318
+ */
319
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
320
+ static whereInstanceOf<T, U extends T>(iterator: Iterator$1<T>, typeCheck: (value: T) => value is U): Iterator$1<U>;
321
+ /**
322
+ * Get an {@link Iterator} that will filter this {@link Iterator} to only the values that are
323
+ * instances of the provided {@link Type}.
324
+ * @param type The type of values to return from the new {@link Iterator}.
325
+ */
326
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
327
+ static whereInstanceOfType<T, U extends T>(iterator: Iterator$1<T>, type: Type<U>): Iterator$1<U>;
328
+ /**
329
+ * If the condition function is undefined, then this function will return the first value in
330
+ * this {@link Iterator}. If this condition function is provided, then this function will return
331
+ * the first value that matches the provided condition.
332
+ * @param condition The condition that the returned value must satisfy.
333
+ */
334
+ first(condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
335
+ /**
336
+ * If the condition function is undefined, then this function will return the first value in
337
+ * the {@link Iterator}. If this condition function is provided, then this function will return
338
+ * the first value that matches the provided condition.
339
+ * @param iterator The {@link Iterator} to get the first value from.
340
+ */
341
+ static first<T>(iterator: Iterator$1<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
342
+ /**
343
+ * If the condition function is undefined, then this function will return the last value in this
344
+ * {@link Iterator}. If this condition function is provided, then this function will return the
345
+ * last value that matches the provided condition.
346
+ * @param condition The condition that the returned value must satisfy.
347
+ */
348
+ last(condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
349
+ /**
350
+ * If the condition function is undefined, then this function will return the last value in the
351
+ * {@link Iterator}. If this condition function is provided, then this function will return the
352
+ * last value that matches the provided condition.
353
+ * @param iterator The {@link Iterator} to get the last value from.
354
+ */
355
+ static last<T>(iterator: Iterator$1<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
356
+ /**
357
+ * Find the maximum value in the provided {@link Iterator}.
358
+ * @param iterator The values to find the maximum of.
359
+ */
360
+ static findMaximum<T extends Comparable<T>>(iterator: JavascriptIterator<T> | Iterator$1<T>): SyncResult<T>;
361
+ /**
362
+ * Get a new {@link Iterator} that wraps around this {@link Iterator} and only
363
+ * returns a maximum number of values from this {@link Iterator}.
364
+ * @param maximumToTake The maximum number of values to take from this {@link Iterator}.
365
+ */
366
+ take(maximumToTake: number): Iterator$1<T>;
367
+ static take<T>(iterator: Iterator$1<T>, maximumToTake: number): Iterator$1<T>;
368
+ /**
369
+ * Get a new {@link Iterator} that wraps around this {@link Iterator} and will skip the initial
370
+ * provided number of values before beginning to return values.
371
+ * @param maximumToSkip The maximum number of values to skip from this {@link Iterator}.
372
+ */
373
+ skip(maximumToSkip: number): Iterator$1<T>;
374
+ static skip<T>(iterator: Iterator$1<T>, maximumToSkip: number): Iterator$1<T>;
375
+ }
376
+
377
+ /**
378
+ * A collection of {@link ToStringFunction}s.
379
+ */
380
+ declare class ToStringFunctions {
381
+ private readonly functions;
382
+ private constructor();
383
+ static create(): ToStringFunctions;
384
+ private defaultToString;
385
+ /**
386
+ * Get the {@link String} representation of the value with the registered
387
+ * {@link ToStringFunction}s.
388
+ * @param value The value to get the {@link String} representation of.
389
+ */
390
+ toString(value: unknown): string;
391
+ add(toStringFunction: (value: unknown) => (string | undefined)): this;
392
+ add<T>(typeCheckFunction: (value: unknown) => value is T, typedToStringFunction: (value: T) => string): this;
393
+ private iterableToString;
394
+ private mapToString;
395
+ private setToString;
396
+ }
397
+
398
+ /**
399
+ * An object that can be iterated over.
400
+ */
401
+ declare abstract class Iterable$1<T> implements JavascriptIterable<T> {
402
+ static create<T>(values?: JavascriptIterable<T>): Iterable$1<T>;
403
+ /**
404
+ * Iterate over the values in this {@link Iterable}.
405
+ */
406
+ abstract iterate(): Iterator$1<T>;
407
+ [Symbol.iterator](): JavascriptIterator<T>;
408
+ static [Symbol.iterator]<T>(iterable: Iterable$1<T>): JavascriptIterator<T>;
409
+ /**
410
+ * Get all of the values in this {@link Iterable} in an {@link Array}.
411
+ */
412
+ toArray(): SyncResult<T[]>;
413
+ /**
414
+ * Get all of the values in the provided {@link Iterable} in an {@link Array}.
415
+ */
416
+ static toArray<T>(iterable: Iterable$1<T>): SyncResult<T[]>;
417
+ /**
418
+ * Get whether this {@link Iterable} contains any values.
419
+ */
420
+ any(): SyncResult<boolean>;
421
+ /**
422
+ * Get whether the provided {@link JavascriptIterable} contains any values.
423
+ */
424
+ static any<T>(iterable: JavascriptIterable<T>): SyncResult<boolean>;
425
+ /**
426
+ * Get the number of values in this {@link Iterable}.
427
+ */
428
+ getCount(): SyncResult<number>;
429
+ /**
430
+ * Get the number of values in the provided {@link Iterable}.
431
+ */
432
+ static getCount<T>(iterable: Iterable$1<T>): SyncResult<number>;
433
+ /**
434
+ * Get whether this {@link Iterable} is equal to the provided {@link Iterable}.
435
+ * @param right The {@link Iterable} to compare against this {@link Iterable}.
436
+ * @param equalFunctions The optional {@link EqualFunctions} to use to determine if the two
437
+ * {@link Iterable}s are equal.
438
+ */
439
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
440
+ static equals<T>(left: JavascriptIterable<T>, right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
441
+ /**
442
+ * Get the {@link String} representation of this {@link Iterable}.
443
+ */
444
+ toString(toStringFunctions?: ToStringFunctions): string;
445
+ /**
446
+ * Get the {@link String} representation of the provided {@link Iterable}.
447
+ */
448
+ static toString<T>(iterable: Iterable$1<T>, toStringFunctions?: ToStringFunctions): string;
449
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
450
+ static concatenate<T>(iterable: Iterable$1<T>, ...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
451
+ /**
452
+ * Get a {@link MapIterable} that maps all of the {@link T} values in this {@link Iterable} to
453
+ * {@link TOutput} values.
454
+ * @param mapping The mapping function to use to convert values of type {@link T} to
455
+ * {@link TOutput}.
456
+ */
457
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
458
+ /**
459
+ * Get a {@link MapIterable} that maps all of the {@link T} values in the provided
460
+ * {@link Iterable} to {@link TOutput} values.
461
+ * @param mapping The mapping function to use to convert values of type {@link T} to
462
+ * {@link TOutput}.
463
+ */
464
+ static map<TInput, TOutput>(iterable: Iterable$1<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
465
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
466
+ static flatMap<T, TOutput>(iterable: Iterable$1<T>, mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
467
+ /**
468
+ * Get an {@link Iterable} that contains values from this {@link Iterable} that match the
469
+ * provided condition.
470
+ * @param condition The condition to run against each of the values in this {@link Iterable}.
471
+ */
472
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
473
+ /**
474
+ * Get an {@link Iterable} that contains values from the provided {@link Iterable} that match
475
+ * the provided condition.
476
+ * @param iterable The {@link Iterable} to get values from.
477
+ * @param condition The condition that the values must match to be contained in the new
478
+ * {@link Iterable}.
479
+ */
480
+ static where<T>(iterable: JavascriptIterable<T>, condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
481
+ /**
482
+ * Get an {@link Iterable} that contains values from this {@link Iterable} that match the
483
+ * provided {@link Type} or type check function.
484
+ * @param typeOrTypeCheck The {@link Type} or type check function that returned values must
485
+ * match.
486
+ */
487
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
488
+ /**
489
+ * Get an {@link Iterable} that contains values from the provided {@link Iterable} that match
490
+ * the provided {@link Type} or type check function.
491
+ * @param iterable The {@link Iterable} to get values from.
492
+ * @param typeOrTypeCheck The {@link Type} or type check function that returned values must
493
+ * match.
494
+ */
495
+ static instanceOf<TInput, TOutput extends TInput>(iterable: JavascriptIterable<TInput>, typeOrTypeCheck: Type<TOutput> | ((value: TInput) => value is TOutput)): Iterable$1<TOutput>;
496
+ /**
497
+ * Get the first value in this {@link Iterable}.
498
+ */
499
+ first(condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
500
+ /**
501
+ * Get the first value from the provided {@link JavascriptIterable}.
502
+ * @param iterable The {@link JavascriptIterable} to get the first value from.
503
+ */
504
+ static first<T>(iterable: JavascriptIterable<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
505
+ /**
506
+ * Get the last value in this {@link Iterable}.
507
+ */
508
+ last(condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
509
+ /**
510
+ * Get the last value from the provided {@link JavascriptIterable}.
511
+ * @param iterable The {@link JavascriptIterable} to get the last value from.
512
+ */
513
+ static last<T>(iterable: JavascriptIterable<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
514
+ /**
515
+ * Find the maximum value in the provided {@link Iterable}.
516
+ * @param iterable The values to find the maximum of.
517
+ */
518
+ static findMaximum<T extends Comparable<T>>(iterable: JavascriptIterable<T> | Iterable$1<T>): SyncResult<T>;
519
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
520
+ static contains<T>(iterable: Iterable$1<T>, value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
521
+ }
522
+
523
+ /**
524
+ * A {@link Type} that can be used to pass types as parameters.
525
+ */
526
+ type Type<T> = Function & {
527
+ prototype: T;
528
+ };
529
+ /**
530
+ * Get whether the provided value is an instance of {@link Type} {@link T}.
531
+ * @param typeOrTypeCheck The {@link Type} to look for or type check {@link Function} to determine
532
+ * if the provided value is a {@link T}.
533
+ * @param value The value to check.
534
+ */
535
+ declare function instanceOf<T>(value: unknown, typeCheck: (value: unknown) => value is T): value is T;
536
+ /**
537
+ * Get whether the provided value is an instance of {@link Type} {@link T}.
538
+ * @param typeOrTypeCheck The {@link Type} to look for or type check {@link Function} to determine
539
+ * if the provided value is a {@link T}.
540
+ * @param value The value to check.
541
+ */
542
+ declare function instanceOf<T>(value: unknown, type: Type<T>, typeCheck?: (value: unknown) => value is T): value is T;
543
+ /**
544
+ * Get whether the provided value is an instance of the provided {@link Type}. This will return
545
+ * false if value only implements the provided {@link Type} but doesn't extend it.
546
+ * @param value The value to check.
547
+ * @param type The {@link Type} to see if value is an instance of.
548
+ */
549
+ declare function instanceOfType<T>(value: unknown, type: Type<T>): value is T;
550
+ /**
551
+ * If the provided {@link value} is of type {@link T} (according to the provided {@link typeCheck}),
552
+ * then return the {@link value}. Otherwise return undefined.
553
+ * @param value The value to check.
554
+ * @param typeOrTypeCheck The {@link Type} to look for or type check {@link Function} to determine
555
+ * if the provided value is a {@link T}.
556
+ */
557
+ declare function as<T>(value: unknown, typeOrTypeCheck: Type<T> | ((value: unknown) => value is T)): T | undefined;
558
+ /**
559
+ * Get whether the provided value is undefined.
560
+ * @param value The value to check.
561
+ */
562
+ declare function isUndefined(value: unknown): value is undefined;
563
+ /**
564
+ * Get whether the provided value is null.
565
+ * @param value The value to check.
566
+ */
567
+ declare function isNull(value: unknown): value is null;
568
+ /**
569
+ * Return the provided value if it is null, otherwise return undefined.
570
+ * @param value The value to check.
571
+ */
572
+ declare function asNull(value: unknown): null | undefined;
573
+ /**
574
+ * Get whether the provided value is undefined or null.
575
+ * @param value The value to check.
576
+ */
577
+ declare function isUndefinedOrNull(value: unknown): value is undefined | null;
578
+ /**
579
+ * Get whether the provided value is a {@link boolean}.
580
+ * @param value The value to check.
581
+ */
582
+ declare function isBoolean(value: unknown): value is boolean;
583
+ /**
584
+ * Return the provided value if it is a boolean, otherwise return undefined.
585
+ * @param value The value to check.
586
+ */
587
+ declare function asBoolean(value: unknown): boolean | undefined;
588
+ /**
589
+ * Get whether the provided value is a {@link number}.
590
+ * @param value The value to check.
591
+ */
592
+ declare function isNumber(value: unknown): value is number;
593
+ /**
594
+ * Return the provided value if it is a number, otherwise return undefined.
595
+ * @param value The value to check.
596
+ */
597
+ declare function asNumber(value: unknown): number | undefined;
598
+ /**
599
+ * Get whether the provided value is a {@link string}.
600
+ * @param value The value to check.
601
+ */
602
+ declare function isString(value: unknown): value is string;
603
+ /**
604
+ * Return the provided value if it is a string, otherwise return undefined.
605
+ * @param value The value to check.
606
+ */
607
+ declare function asString(value: unknown): string | undefined;
608
+ /**
609
+ * Get whether the provided value is a {@link function}.
610
+ * @param value The value to check.
611
+ */
612
+ declare function isFunction(value: unknown): value is Function;
613
+ /**
614
+ * Return the provided value if it is a function, otherwise return undefined.
615
+ * @param value The value to check.
616
+ */
617
+ declare function asFunction(value: unknown): Function | undefined;
618
+ /**
619
+ * Get the number of parameters that the provided {@link Function} takes.
620
+ * @param value The {@link Function} to get the parameter count for.
621
+ */
622
+ declare function getParameterCount(value: Function): number;
623
+ /**
624
+ * Get whether the provided value is a function with the provided parameter count.
625
+ * @param value The value to check.
626
+ * @param parameterCount The number of parameters the function must have.
627
+ */
628
+ declare function isFunctionWithParameterCount(value: unknown, parameterCount: number): value is Function;
629
+ /**
630
+ * Return the provided value if it is a function with the provided {@link parameterCount}, otherwise
631
+ * return undefined.
632
+ * @param value The value to check.
633
+ */
634
+ declare function asFunctionWithParameterCount(value: unknown, parameterCount: number): Function | undefined;
635
+ /**
636
+ * Get whether the provided value is an {@link Array}.
637
+ * @param value The value to check.
638
+ */
639
+ declare function isArray(value: unknown): value is unknown[];
640
+ /**
641
+ * Return the provided value if it is an array, otherwise return undefined.
642
+ * @param value The value to check.
643
+ */
644
+ declare function asArray(value: unknown): unknown[] | undefined;
645
+ /**
646
+ * Get whether the provided value is an {@link Object} or is null.
647
+ * @param value The value to check.
648
+ */
649
+ declare function isObjectOrArrayOrNull(value: unknown): value is {} | unknown[] | null;
650
+ /**
651
+ * Return the provided value if it is an array, otherwise return undefined.
652
+ * @param value The value to check.
653
+ */
654
+ declare function asObjectOrArrayOrNull(value: unknown): {} | unknown[] | null | undefined;
655
+ /**
656
+ * Get whether the provided value is an {@link Object}.
657
+ * @param value The value to check.
658
+ * @returns
659
+ */
660
+ declare function isObject(value: unknown): value is {};
661
+ /**
662
+ * Return the provided value if it is an {@link Object}, otherwise return undefined.
663
+ * @param value The value to check.
664
+ */
665
+ declare function asObject(value: unknown): {} | undefined;
666
+ /**
667
+ * Get an {@link Iterator} that can be used to iterate through the properties of the provided value.
668
+ * @param value The value to iterate over.
669
+ */
670
+ declare function getPropertyNames(value: {}): Iterable$1<string>;
671
+ /**
672
+ * Get whether the provided value has a property with the provided key.
673
+ * @param value The value to check.
674
+ * @param propertyKey The key of the property to look for.
675
+ */
676
+ declare function hasProperty<TValue, TPropertyKey extends PropertyKey>(value: TValue, propertyKey: TPropertyKey): value is TValue & Record<TPropertyKey, unknown>;
677
+ /**
678
+ * Get whether the value has a function with the provided name.
679
+ * @param value The value to check.
680
+ * @param functionName The name of the function to look for.
681
+ */
682
+ declare function hasFunction<TValue, TPropertyKey extends PropertyKey>(value: TValue, functionName: TPropertyKey, parameterCount?: number): value is TValue & Record<TPropertyKey, Function>;
683
+ /**
684
+ * Get whether the provided value is a {@link JavascriptIterator}.
685
+ * @param value The value to check.
686
+ */
687
+ declare function isJavascriptIterator<T>(value: unknown): value is JavascriptIterator<T>;
688
+ /**
689
+ * Get whether the provided value is a {@link JavascriptIterable}.
690
+ * @param value The value to check.
691
+ */
692
+ declare function isJavascriptIterable<T>(value: unknown): value is JavascriptIterable<T>;
693
+ declare function isIterable<T>(value: unknown): value is Iterable$1<T>;
694
+ /**
695
+ * Get whether the provided value is a {@link JavascriptAsyncIterator}.
696
+ * @param value The value to check.
697
+ */
698
+ declare function isJavascriptAsyncIterator<T>(value: unknown): value is JavascriptAsyncIterator<T>;
699
+ /**
700
+ * Get whether the provided value is a {@link JavascriptAsyncIterable}.
701
+ * @param value The value to check.
702
+ */
703
+ declare function isJavascriptAsyncIterable<T>(value: unknown): value is JavascriptAsyncIterable<T>;
704
+ declare function isAsyncIterable<T>(value: unknown): value is AsyncIterable<T>;
705
+ /**
706
+ * Get the name of the provided {@link Type}.
707
+ * @param type The {@link Type} to get the name of.
708
+ */
709
+ declare function getName(type: Type<unknown>): string;
710
+ declare function isPromiseLike<T>(value: unknown): value is PromiseLike<T>;
711
+ declare function isPromise<T>(value: unknown): value is Promise<T>;
712
+
713
+ /**
714
+ * A result object that adds extra behavior beyond the standard {@link Promise}.
715
+ */
716
+ declare abstract class AsyncResult<T> implements Promise<T> {
717
+ static create<T>(action: () => (T | Promise<T>)): AsyncResult<T>;
718
+ static create<T>(promise: Promise<T>): AsyncResult<T>;
719
+ /**
720
+ * Create a new {@link AsyncResult} that contains the provided value.
721
+ * @param value The value to wrap in a {@link AsyncResult}.
722
+ */
723
+ static value<T>(value: T): AsyncResult<T>;
724
+ /**
725
+ * Create a new {@link AsyncResult} that contains the provided error.
726
+ * @param error The error to wrap in a {@link AsyncResult}.
727
+ */
728
+ static error<T>(error: Error): AsyncResult<T>;
729
+ static yield(): AsyncResult<void>;
730
+ /**
731
+ * Get a {@link AsyncResult} that runs the provided function if this {@link AsyncResult} is successful.
732
+ * @param thenFunction The function to run if this {@link AsyncResult} is successful.
733
+ */
734
+ abstract then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): AsyncResult<TResult1 | TResult2>;
735
+ /**
736
+ * Run the provided onValueFunction if this {@link AsyncResult} is successful. The value or error
737
+ * contained by this {@link AsyncResult} will be contained by the returned {@link AsyncResult}.
738
+ * @param onValueFunction The function to run if this {@link AsyncResult} is successful.
739
+ */
740
+ abstract onValue(onValueFunction: (value: T) => (void | Promise<void>)): AsyncResult<T>;
741
+ /**
742
+ * Run the provided catchFunction if this {@link AsyncResult} contains an error.
743
+ * @param catchFunction The function to run if an error is caught.
744
+ */
745
+ abstract catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): AsyncResult<T | TResult>;
746
+ /**
747
+ * Run the provided catchFunction if this {@link AsyncResult} contains an error of the provided type.
748
+ * @param errorType The type of error to catch.
749
+ * @param catchFunction The function to run if the error is caught.
750
+ */
751
+ abstract catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): AsyncResult<T | TResult>;
752
+ /**
753
+ * Run the provided onErrorFunction if this {@link AsyncResult} contains an error.
754
+ * @param onErrorFunction The function to run if an error is found.
755
+ */
756
+ abstract onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): AsyncResult<T>;
757
+ /**
758
+ * Run the provided onErrorFunction if this {@link AsyncResult} contains an error of the provided
759
+ * type.
760
+ * @param errorType The type of error to respond to.
761
+ * @param onErrorFunction The function to run if the error is found.
762
+ */
763
+ abstract onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): AsyncResult<T>;
764
+ /**
765
+ * Run the provided convertErrorFunction if this {@link AsyncResult} contains an error. The value
766
+ * returned from the convertErrorFunction will be the error for the returned {@link AsyncResult}.
767
+ * @param convertErrorFunction The function that will return the new error.
768
+ */
769
+ abstract convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): AsyncResult<T>;
770
+ /**
771
+ * Run the provided convertErrorFunction if this {@link AsyncResult} contains an error of the
772
+ * provided type. The value returned from the convertErrorFunction will be the error for the
773
+ * returned {@link AsyncResult}.
774
+ * @param errorType The type of error to respond to.
775
+ * @param convertErrorFunction The function that will return the new error.
776
+ */
777
+ abstract convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): AsyncResult<T>;
778
+ abstract finally(onfinally?: (() => (void | Promise<void>)) | null): AsyncResult<T>;
779
+ readonly abstract [Symbol.toStringTag]: string;
780
+ }
781
+
782
+ declare class PromiseAsyncResult<T> implements AsyncResult<T> {
783
+ private readonly promise;
784
+ private constructor();
785
+ static create<T>(action: () => (T | Promise<T>)): PromiseAsyncResult<T>;
786
+ static create<T>(promise: Promise<T>): PromiseAsyncResult<T>;
787
+ static value<T>(value: T): PromiseAsyncResult<T>;
788
+ static error<T>(error: unknown): PromiseAsyncResult<T>;
789
+ static yield(): PromiseAsyncResult<void>;
790
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
791
+ onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
792
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
793
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
794
+ onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
795
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
796
+ convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
797
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
798
+ finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
799
+ readonly [Symbol.toStringTag]: string;
800
+ }
801
+
802
+ /**
803
+ * A type that can be used to asynchronously iterate over a collection.
804
+ */
805
+ declare abstract class AsyncIterator$1<T> {
806
+ static create<T>(iterator: JavascriptAsyncIterator<T>): AsyncIterator$1<T>;
807
+ /**
808
+ * Move to the next value in the collection. Return whether this {@link AsyncIterator} points to
809
+ * a value after the move.
810
+ */
811
+ abstract next(): PromiseAsyncResult<boolean>;
812
+ /**
813
+ * Get whether this {@link AsyncIterator} has started iterating over the values in the collection.
814
+ */
815
+ abstract hasStarted(): boolean;
816
+ /**
817
+ * Get whether this {@link AsyncIterator} currently points at a value in the collection.
818
+ */
819
+ abstract hasCurrent(): boolean;
820
+ /**
821
+ * Get the value that this {@link AsyncIterator} points to.
822
+ */
823
+ abstract getCurrent(): T;
824
+ /**
825
+ * Move to the first value if this {@link AsyncIterator} hasn't started yet.
826
+ * @returns This object for method chaining.
827
+ */
828
+ start(): PromiseAsyncResult<this>;
829
+ /**
830
+ * Move the provided {@link AsyncIterator} to its first value if it hasn't started yet.
831
+ */
832
+ static start<T, TIterator extends AsyncIterator$1<T>>(iterator: TIterator): PromiseAsyncResult<TIterator>;
833
+ /**
834
+ * Get the current value from this {@link AsyncIterator} and advance this {@link AsyncIterator} to the
835
+ * next value.
836
+ */
837
+ takeCurrent(): PromiseAsyncResult<T>;
838
+ static takeCurrent<T>(iterator: AsyncIterator$1<T>): PromiseAsyncResult<T>;
839
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<T>;
840
+ /**
841
+ * Convert the provided {@link AsyncIterator} to a {@link IteratorToJavascriptIteratorAdapter}.
842
+ * @param iterator The {@link AsyncIterator} to convert.
843
+ */
844
+ static [Symbol.asyncIterator]<T>(iterator: AsyncIterator$1<T>): JavascriptAsyncIterator<T>;
845
+ /**
846
+ * Get whether this {@link AsyncIterator} contains any values.
847
+ * Note: This may advance the {@link AsyncIterator} to the first value if it hasn't been
848
+ * started yet.
849
+ */
850
+ any(): PromiseAsyncResult<boolean>;
851
+ /**
852
+ * Get whether this {@link AsyncIterator} contains any values.
853
+ * Note: This may advance the {@link AsyncIterator} to the first value if it hasn't been
854
+ * started yet.
855
+ */
856
+ static any<T>(iterator: AsyncIterator$1<T>): PromiseAsyncResult<boolean>;
857
+ /**
858
+ * Get the number of values in this {@link AsyncIterator}.
859
+ * Note: This will consume all of the values in this {@link AsyncIterator}.
860
+ */
861
+ getCount(): PromiseAsyncResult<number>;
862
+ /**
863
+ * Get the number of values in the provided {@link AsyncIterator}.
864
+ * Note: This will consume all of the values in the provided {@link AsyncIterator}.
865
+ */
866
+ static getCount<T>(iterator: AsyncIterator$1<T>): PromiseAsyncResult<number>;
867
+ /**
868
+ * Get all of the remaining values in this {@link AsyncIterator} in a {@link T} {@link Array}.
869
+ */
870
+ toArray(): PromiseAsyncResult<T[]>;
871
+ /**
872
+ * Get all of the remaining values in the provided {@link AsyncIterator} in a {@link T}
873
+ * {@link Array}.
874
+ */
875
+ static toArray<T>(iterator: AsyncIterator$1<T>): PromiseAsyncResult<T[]>;
876
+ /**
877
+ * Get an {@link AsyncIterator} that will only return values that match the provided condition.
878
+ * @param condition The condition to run against each of the values in this {@link AsyncIterator}.
879
+ */
880
+ where(condition: (value: T) => (boolean | PromiseLike<boolean>)): AsyncIterator$1<T>;
881
+ static where<T>(iterator: AsyncIterator$1<T>, condition: (value: T) => (boolean | PromiseLike<boolean>)): AsyncIterator$1<T>;
882
+ /**
883
+ * Get a {@link MapIterator} that will map all {@link T} values from this {@link AsyncIterator} to
884
+ * {@link TOutput} values.
885
+ * @param mapping The mapping that maps {@link T} values to {@link TOutput} values.
886
+ */
887
+ map<TOutput>(mapping: (value: T) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
888
+ static map<T, TOutput>(iterator: AsyncIterator$1<T>, mapping: (value: T) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
889
+ /**
890
+ * Get an {@link AsyncIterator} that will filter this {@link AsyncIterator} to only the values that are
891
+ * instances of {@link U} based on the provided type check {@link Function}.
892
+ * @param typeCheck The {@link Function} that will be used to determine if values are of type
893
+ * {@link U}.
894
+ */
895
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): AsyncIterator$1<U>;
896
+ static whereInstanceOf<T, U extends T>(iterator: AsyncIterator$1<T>, typeCheck: (value: T) => value is U): AsyncIterator$1<U>;
897
+ /**
898
+ * Get an {@link AsyncIterator} that will filter this {@link AsyncIterator} to only the values that are
899
+ * instances of the provided {@link Type}.
900
+ * @param type The type of values to return from the new {@link AsyncIterator}.
901
+ */
902
+ whereInstanceOfType<U extends T>(type: Type<U>): AsyncIterator$1<U>;
903
+ static whereInstanceOfType<T, U extends T>(iterator: AsyncIterator$1<T>, type: Type<U>): AsyncIterator$1<U>;
904
+ /**
905
+ * If the condition function is undefined, then this function will return the first value in
906
+ * this {@link AsyncIterator}. If this condition function is provided, then this function will return
907
+ * the first value that matches the provided condition.
908
+ * @param condition The condition that the returned value must satisfy.
909
+ */
910
+ first(condition?: (value: T) => boolean): PromiseAsyncResult<T>;
911
+ /**
912
+ * If the condition function is undefined, then this function will return the first value in
913
+ * the {@link AsyncIterator}. If this condition function is provided, then this function will return
914
+ * the first value that matches the provided condition.
915
+ * @param iterator The {@link AsyncIterator} to get the first value from.
916
+ */
917
+ static first<T>(iterator: AsyncIterator$1<T>, condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
918
+ /**
919
+ * If the condition function is undefined, then this function will return the last value in this
920
+ * {@link AsyncIterator}. If this condition function is provided, then this function will return the
921
+ * last value that matches the provided condition.
922
+ * @param condition The condition that the returned value must satisfy.
923
+ */
924
+ last(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
925
+ /**
926
+ * If the condition function is undefined, then this function will return the last value in the
927
+ * {@link AsyncIterator}. If this condition function is provided, then this function will return the
928
+ * last value that matches the provided condition.
929
+ * @param iterator The {@link AsyncIterator} to get the last value from.
930
+ */
931
+ static last<T>(iterator: AsyncIterator$1<T>, condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
932
+ /**
933
+ * Find the maximum value in the provided {@link AsyncIterator}.
934
+ * @param iterator The values to find the maximum of.
935
+ */
936
+ static findMaximum<T extends Comparable<T>>(iterator: JavascriptAsyncIterator<T> | AsyncIterator$1<T>): PromiseAsyncResult<T>;
937
+ /**
938
+ * Get a new {@link AsyncIterator} that wraps around this {@link AsyncIterator} and only
939
+ * returns a maximum number of values from this {@link AsyncIterator}.
940
+ * @param maximumToTake The maximum number of values to take from this {@link AsyncIterator}.
941
+ */
942
+ take(maximumToTake: number): AsyncIterator$1<T>;
943
+ static take<T>(iterator: AsyncIterator$1<T>, maximumToTake: number): AsyncIterator$1<T>;
944
+ /**
945
+ * Get a new {@link AsyncIterator} that wraps around this {@link AsyncIterator} and will skip the initial
946
+ * provided number of values before beginning to return values.
947
+ * @param maximumToSkip The maximum number of values to skip from this {@link AsyncIterator}.
948
+ */
949
+ skip(maximumToSkip: number): AsyncIterator$1<T>;
950
+ static skip<T>(iterator: AsyncIterator$1<T>, maximumToSkip: number): AsyncIterator$1<T>;
951
+ }
952
+
953
+ /**
954
+ * A type that adapts an {@link AsyncIterator} to match a {@link JavascriptAsyncIterator}.
955
+ */
956
+ declare class AsyncIteratorToJavascriptAsyncIteratorAdapter<T> implements JavascriptAsyncIterator<T> {
957
+ private readonly iterator;
958
+ private hasStarted;
959
+ private constructor();
960
+ static create<T>(iterator: AsyncIterator$1<T>): AsyncIteratorToJavascriptAsyncIteratorAdapter<T>;
961
+ next(): Promise<JavascriptIteratorResult<T>>;
962
+ }
963
+
964
+ /**
965
+ * An object that can be disposed.
966
+ */
967
+ declare abstract class Disposable {
968
+ /**
969
+ * Create a new {@link Disposable} that will invoke the provided {@link Function} when it is
970
+ * disposed.
971
+ * @param disposedFunction The function to invoke when the returned {@link Disposable} is
972
+ * disposed.
973
+ */
974
+ static create(disposedFunction: () => void): SyncDisposable;
975
+ /**
976
+ * Synchronously clean up any resources that this object is using. This function will return
977
+ * true if this invocation disposed of the object. Subsequent calls to dispose() will return
978
+ * false.
979
+ */
980
+ abstract dispose(): AsyncResult<boolean>;
981
+ /**
982
+ * Get whether this {@link Disposable} has been disposed yet.
983
+ */
984
+ abstract isDisposed(): boolean;
985
+ }
986
+
987
+ /**
988
+ * A {@link Disposable} type that can be configured with a function that will be invoked when the
989
+ * object is disposed.
990
+ */
991
+ declare class SyncDisposable implements Disposable {
992
+ private readonly disposedFunction;
993
+ private disposed;
994
+ protected constructor(disposedFunction: () => void);
995
+ /**
996
+ * Create a new {@link Disposable} that will invoke the provided {@link Function} when it is
997
+ * disposed.
998
+ * @param disposedFunction The function to invoke when the returned {@link Disposable} is
999
+ * disposed.
1000
+ */
1001
+ static create(disposedFunction: () => void): SyncDisposable;
1002
+ dispose(): SyncResult<boolean>;
1003
+ isDisposed(): boolean;
1004
+ }
1005
+
1006
+ declare abstract class List<T> implements Iterable$1<T> {
1007
+ static create<T>(values?: JavascriptIterable<T>): List<T>;
1008
+ /**
1009
+ * Add the provided value to the end of this {@link List}.
1010
+ * @param value The value to add.
1011
+ */
1012
+ add(value: T): this;
1013
+ /**
1014
+ * Add the provided value to the provided {@link List}.
1015
+ * @param list The {@link List} to add the value to.
1016
+ * @param value The value to add.
1017
+ */
1018
+ static add<T, TList extends List<T>>(list: TList, value: T): TList;
1019
+ /**
1020
+ * Add the provided values to the end of this {@link List}.
1021
+ * @param values The values to add.
1022
+ */
1023
+ addAll(values: JavascriptIterable<T>): this;
1024
+ /**
1025
+ * Add the provided values to the end of the provided {@link List}.
1026
+ * @param list The {@link List} to add the values to.
1027
+ * @param values The values to add.
1028
+ */
1029
+ static addAll<T, TList extends List<T>>(list: TList, values: JavascriptIterable<T>): TList;
1030
+ /**
1031
+ * Insert the value at the index in this {@link List}.
1032
+ * @param index The index to insert the value at.
1033
+ * @param value The value to insert.
1034
+ */
1035
+ abstract insert(index: number, value: T): this;
1036
+ /**
1037
+ * Insert the values at the index in this {@link List}.
1038
+ * @param index The index to insert the values at.
1039
+ * @param values The values to insert.
1040
+ */
1041
+ insertAll(index: number, values: JavascriptIterable<T>): this;
1042
+ /**
1043
+ * Insert the values at the index in this {@link List}.
1044
+ * @param list The list to insert the values into.
1045
+ * @param index The index to insert the values at.
1046
+ * @param values The values to insert.
1047
+ */
1048
+ static insertAll<T, TList extends List<T>>(list: TList, index: number, values: JavascriptIterable<T>): TList;
1049
+ /**
1050
+ * Attempt to remove the first instance of the provided value from this {@link List}. Return
1051
+ * whether the removed value.
1052
+ * @param value The value to remove.
1053
+ */
1054
+ remove(value: T, equalFunctions?: EqualFunctions): SyncResult<T>;
1055
+ static remove<T>(list: List<T>, value: T, equalFunctions?: EqualFunctions): SyncResult<T>;
1056
+ /**
1057
+ * Remove and return the value in this {@link List} at the provided index.
1058
+ * @param index The index to remove a value from.
1059
+ */
1060
+ abstract removeAt(index: number): SyncResult<T>;
1061
+ /**
1062
+ * Remove the first value in this {@link List}.
1063
+ */
1064
+ removeFirst(): SyncResult<T>;
1065
+ static removeFirst<T, TList extends List<T>>(list: TList): SyncResult<T>;
1066
+ /**
1067
+ * Remove the last value in this {@link List}.
1068
+ */
1069
+ removeLast(): SyncResult<T>;
1070
+ static removeLast<T, TList extends List<T>>(list: TList): SyncResult<T>;
1071
+ abstract set(index: number, value: T): this;
1072
+ abstract iterate(): Iterator$1<T>;
1073
+ abstract get(index: number): SyncResult<T>;
1074
+ toArray(): SyncResult<T[]>;
1075
+ static toArray<T>(list: List<T>): SyncResult<T[]>;
1076
+ any(): SyncResult<boolean>;
1077
+ static any<T>(list: List<T>): SyncResult<boolean>;
1078
+ getCount(): SyncResult<number>;
1079
+ static getCount<T>(list: List<T>): SyncResult<number>;
1080
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1081
+ static equals<T>(left: List<T>, right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1082
+ toString(toStringFunctions?: ToStringFunctions): string;
1083
+ static toString<T>(list: List<T>, toStringFunctions?: ToStringFunctions): string;
1084
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
1085
+ static concatenate<T>(list: List<T>, ...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
1086
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
1087
+ static map<TInput, TOutput>(list: List<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
1088
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1089
+ static flatMap<TInput, TOutput>(list: List<TInput>, mapping: (value: TInput) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1090
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
1091
+ static where<T>(list: List<T>, condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
1092
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
1093
+ static instanceOf<TInput, TOutput extends TInput>(list: List<TInput>, typeOrTypeCheck: Type<TOutput> | ((value: TInput) => value is TOutput)): Iterable$1<TOutput>;
1094
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
1095
+ static first<T>(list: List<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
1096
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
1097
+ static last<T>(list: List<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
1098
+ [Symbol.iterator](): JavascriptIterator<T>;
1099
+ static [Symbol.iterator]<T>(list: List<T>): JavascriptIterator<T>;
1100
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1101
+ static contains<T>(list: List<T>, value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1102
+ }
1103
+
1104
+ /**
1105
+ * A {@link List} of bytes.
1106
+ */
1107
+ declare class ByteList implements List<number> {
1108
+ private bytes;
1109
+ private count;
1110
+ private constructor();
1111
+ static create(initialValues?: JavascriptIterable<number>): ByteList;
1112
+ add(value: number): this;
1113
+ addAll(values: JavascriptIterable<number>): this;
1114
+ insert(index: number, value: number): this;
1115
+ insertAll(index: number, values: JavascriptIterable<number>): this;
1116
+ remove(value: number, equalFunctions?: EqualFunctions): SyncResult<number>;
1117
+ removeAt(index: number): SyncResult<number>;
1118
+ removeFirst(): SyncResult<number>;
1119
+ removeLast(): SyncResult<number>;
1120
+ set(index: number, value: number): this;
1121
+ iterate(): Iterator$1<number>;
1122
+ get(index: number): SyncResult<number>;
1123
+ toArray(): SyncResult<number[]>;
1124
+ any(): SyncResult<boolean>;
1125
+ getCount(): SyncResult<number>;
1126
+ equals(right: JavascriptIterable<number>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1127
+ toString(toStringFunctions?: ToStringFunctions): string;
1128
+ concatenate(...toConcatenate: JavascriptIterable<number>[]): Iterable$1<number>;
1129
+ map<TOutput>(mapping: (value: number) => TOutput | SyncResult<TOutput>): Iterable$1<TOutput>;
1130
+ flatMap<TOutput>(mapping: (value: number) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1131
+ where(condition: (value: number) => (boolean | SyncResult<boolean>)): Iterable$1<number>;
1132
+ instanceOf<TOutput extends number>(typeOrTypeCheck: Type<TOutput> | ((value: number) => value is TOutput)): Iterable$1<TOutput>;
1133
+ first(condition?: ((value: number) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<number>;
1134
+ last(condition?: ((value: number) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<number>;
1135
+ contains(value: number, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1136
+ [Symbol.iterator](): JavascriptIterator<number>;
1137
+ }
1138
+
1139
+ /**
1140
+ * A stream that reads bytes.
1141
+ */
1142
+ declare abstract class ByteReadStream {
1143
+ /**
1144
+ * Attempt to read the provided {@link count} number of bytes. Returns the bytes that were read.
1145
+ * The number of bytes returned may be less than the number requested.
1146
+ * @param count The number of bytes to attempt to read.
1147
+ */
1148
+ abstract readBytes(count: number): AsyncResult<Uint8Array>;
1149
+ /**
1150
+ * Attempt to read bytes into the provided output array. Returns the number of bytes that were
1151
+ * read.
1152
+ * @param output The array that the read bytes will be written to.
1153
+ * @param startIndex The index in the {@link output} array to start writting the read bytes to.
1154
+ * Defaults to 0.
1155
+ * @param count The maximum number of bytes to read. Defaults to the length of the output array
1156
+ * minus the startIndex.
1157
+ */
1158
+ abstract readBytes(output: Uint8Array, startIndex?: number, count?: number): AsyncResult<number>;
1159
+ }
1160
+
1161
+ /**
1162
+ * A stream that writes bytes.
1163
+ */
1164
+ declare abstract class ByteWriteStream {
1165
+ /**
1166
+ * Write the provided bytes to this {@link ByteWriteStream}.
1167
+ * @param bytes The bytes to write.
1168
+ * @param startIndex The index to start writing from.
1169
+ * @param length The number of bytes to write.
1170
+ * @returns The number of bytes that were written.
1171
+ */
1172
+ abstract writeBytes(bytes: Uint8Array | number[], startIndex?: number, length?: number): AsyncResult<number>;
1173
+ }
1174
+
1175
+ /**
1176
+ * A {@link ByteReadStream} and {@link ByteWriteStream} implementation that is implemented using a
1177
+ * {@link ByteList}.
1178
+ */
1179
+ declare class ByteListStream implements ByteReadStream, ByteWriteStream {
1180
+ private readonly list;
1181
+ private constructor();
1182
+ static create(initialValues?: Uint8Array | number[]): ByteListStream;
1183
+ /**
1184
+ * Get the number of bytes that are available to be read.
1185
+ */
1186
+ getAvailableByteCount(): number;
1187
+ writeBytes(bytes: Uint8Array | number[], startIndex?: number, length?: number): SyncResult<number>;
1188
+ readBytes(count: number): SyncResult<Uint8Array>;
1189
+ readBytes(output: Uint8Array, startIndex?: number, count?: number): SyncResult<number>;
1190
+ }
1191
+
1192
+ /**
1193
+ * A collection of values and functions for interacting with bytes.
1194
+ */
1195
+ declare abstract class Bytes {
1196
+ /**
1197
+ * The minimum value that a byte can have.
1198
+ */
1199
+ static readonly minimumValue: number;
1200
+ /**
1201
+ * The maximum value (inclusive) that a byte can have.
1202
+ */
1203
+ static readonly maximumValue: number;
1204
+ /**
1205
+ * Get whether the provided value is within the range of a valid byte (between 0 and
1206
+ * 255).
1207
+ * @param value The value to check.
1208
+ */
1209
+ static isByte(value: number): boolean;
1210
+ }
1211
+
1212
+ declare class CharacterList implements List<string> {
1213
+ private characters;
1214
+ private constructor();
1215
+ static create(values?: JavascriptIterable<string>): CharacterList;
1216
+ getCount(): SyncResult<number>;
1217
+ insert(index: number, value: string): this;
1218
+ removeAt(index: number): SyncResult<string>;
1219
+ set(index: number, value: string): this;
1220
+ iterate(): Iterator$1<string>;
1221
+ get(index: number): SyncResult<string>;
1222
+ add(value: string): this;
1223
+ addAll(values: JavascriptIterable<string>): this;
1224
+ insertAll(index: number, values: JavascriptIterable<string>): this;
1225
+ remove(value: string, equalFunctions?: EqualFunctions): SyncResult<string>;
1226
+ removeFirst(): SyncResult<string>;
1227
+ removeLast(): SyncResult<string>;
1228
+ toArray(): SyncResult<string[]>;
1229
+ any(): SyncResult<boolean>;
1230
+ equals(right: JavascriptIterable<string>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1231
+ toString(toStringFunctions?: ToStringFunctions): string;
1232
+ concatenate(...toConcatenate: JavascriptIterable<string>[]): Iterable$1<string>;
1233
+ map<TOutput>(mapping: (value: string) => TOutput | SyncResult<TOutput>): Iterable$1<TOutput>;
1234
+ flatMap<TOutput>(mapping: (value: string) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1235
+ where(condition: (value: string) => (boolean | SyncResult<boolean>)): Iterable$1<string>;
1236
+ instanceOf<TOutput extends string>(typeOrTypeCheck: Type<TOutput> | ((value: string) => value is TOutput)): Iterable$1<TOutput>;
1237
+ first(condition?: (value: string) => (boolean | SyncResult<boolean>)): SyncResult<string>;
1238
+ last(condition?: (value: string) => (boolean | SyncResult<boolean>)): SyncResult<string>;
1239
+ contains(value: string, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1240
+ [Symbol.iterator](): JavascriptIterator<string>;
1241
+ }
1242
+
1243
+ declare abstract class CharacterReadStream {
1244
+ /**
1245
+ * Read a single character from this stream.
1246
+ */
1247
+ abstract readCharacter(): AsyncResult<string>;
1248
+ readCharacters(count: number): AsyncResult<string>;
1249
+ static readCharacters(readStream: CharacterReadStream, count: number): AsyncResult<string>;
1250
+ /**
1251
+ * Read characters from this stream until the provided {@link searchString} is found or the end
1252
+ * of the stream is reached. The {@link searchString} will be included in the returned string if
1253
+ * it is found..
1254
+ * @param searchString The string to search for.
1255
+ */
1256
+ readUntil(searchString: string): AsyncResult<string>;
1257
+ static readUntil(readStream: CharacterReadStream, searchString: string): AsyncResult<string>;
1258
+ /**
1259
+ * Read a sequence of characters from this stream until either a newline character ('\\n') or
1260
+ * the end of the stream is reached. Terminating newline characters will be included in the
1261
+ * returned string.
1262
+ */
1263
+ readLine(): AsyncResult<string>;
1264
+ static readLine(readStream: CharacterReadStream): AsyncResult<string>;
1265
+ }
1266
+
1267
+ declare abstract class CharacterWriteStream {
1268
+ /**
1269
+ * Write the provided text to this {@link CharacterWriteStream}.
1270
+ * @param text The text to write.
1271
+ * @returns The number of characters that were written.
1272
+ */
1273
+ abstract writeString(text: string): AsyncResult<number>;
1274
+ /**
1275
+ * Write the provided text (if provided) and then write a newline character sequence to this
1276
+ * {@link CharacterWriteStream}.
1277
+ * @param text The optional text to write before the newline character sequence.
1278
+ * @returns The number of characters that were written.
1279
+ */
1280
+ writeLine(text?: string): AsyncResult<number>;
1281
+ static writeLine(writeStream: CharacterWriteStream, text?: string): AsyncResult<number>;
1282
+ }
1283
+
1284
+ /**
1285
+ * A {@link CharacterReadStream} and {@link CharacterWriteStream} implementation that is implemented using a
1286
+ * {@link CharacterList}.
1287
+ */
1288
+ declare class CharacterListStream implements CharacterReadStream, CharacterWriteStream {
1289
+ private readonly list;
1290
+ private constructor();
1291
+ static create(initialValues?: JavascriptIterable<string>): CharacterListStream;
1292
+ writeCharacters(characters: JavascriptIterable<string>, startIndex?: number, length?: number): SyncResult<number>;
1293
+ writeString(text: string): AsyncResult<number>;
1294
+ writeLine(text?: string): AsyncResult<number>;
1295
+ /**
1296
+ * Get the number of characters that are available to be read.
1297
+ */
1298
+ getAvailableCharacterCount(): number;
1299
+ readCharacter(): AsyncResult<string>;
1300
+ readCharacters(count: number): SyncResult<string>;
1301
+ readCharacters(output: string[], startIndex?: number, count?: number): SyncResult<number>;
1302
+ readUntil(searchString: string): AsyncResult<string>;
1303
+ readLine(): AsyncResult<string>;
1304
+ }
1305
+
1306
+ declare class CharacterReadStreamAsyncIterator implements AsyncIterator$1<string> {
1307
+ private readonly readStream;
1308
+ private current;
1309
+ private started;
1310
+ private constructor();
1311
+ static create(readStream: CharacterReadStream): CharacterReadStreamAsyncIterator;
1312
+ next(): PromiseAsyncResult<boolean>;
1313
+ hasStarted(): boolean;
1314
+ hasCurrent(): boolean;
1315
+ getCurrent(): string;
1316
+ start(): PromiseAsyncResult<this>;
1317
+ takeCurrent(): PromiseAsyncResult<string>;
1318
+ any(): PromiseAsyncResult<boolean>;
1319
+ getCount(): PromiseAsyncResult<number>;
1320
+ toArray(): PromiseAsyncResult<string[]>;
1321
+ where(condition: (value: string) => boolean | PromiseLike<boolean>): AsyncIterator$1<string>;
1322
+ map<TOutput>(mapping: (value: string) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
1323
+ whereInstanceOf<U extends string>(typeCheck: (value: string) => value is U): AsyncIterator$1<U>;
1324
+ whereInstanceOfType<U extends string>(type: Type<U>): AsyncIterator$1<U>;
1325
+ first(condition?: (value: string) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<string>;
1326
+ last(condition?: (value: string) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<string>;
1327
+ take(maximumToTake: number): AsyncIterator$1<string>;
1328
+ skip(maximumToSkip: number): AsyncIterator$1<string>;
1329
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<string>;
1330
+ }
1331
+
1332
+ /**
1333
+ * An individual parameter from a {@link CommandLineParameters} object.
1334
+ */
1335
+ declare class CommandLineParameter<T> {
1336
+ /**
1337
+ * The full name of this {@link CommandLineParameter}.
1338
+ */
1339
+ private readonly name;
1340
+ /**
1341
+ * The description for this {@link CommandLineParameter}.
1342
+ */
1343
+ private readonly description;
1344
+ /**
1345
+ * The function that can be invoked to get this {@link CommandLineParameter}'s value.
1346
+ */
1347
+ private readonly valueGetter;
1348
+ private constructor();
1349
+ /**
1350
+ * Create a new {@link CommandLineParameter}.
1351
+ * @param name The full name of the {@link CommandLineParameter}.
1352
+ * @param description The description for the {@link CommandLineParameter}.
1353
+ * @param valueGetter The function that will be used to get the returned
1354
+ * {@link CommandLineParameter}'s value.
1355
+ */
1356
+ static create<T>(name: string, description: string, valueGetter: () => T): CommandLineParameter<T>;
1357
+ /**
1358
+ * Get the value for this {@link CommandLineParameter}.
1359
+ */
1360
+ getValue(): T;
1361
+ }
1362
+
1363
+ /**
1364
+ * A class that can be used to define and interact with an application's command line interface.
1365
+ */
1366
+ declare class CommandLineParameters {
1367
+ private readonly args;
1368
+ private constructor();
1369
+ static create(args: JavascriptIterable<string>): CommandLineParameters;
1370
+ }
1371
+
1372
+ /**
1373
+ * A type that can be used to compare values.
1374
+ */
1375
+ declare abstract class Comparer<TLeft, TRight = TLeft> {
1376
+ /**
1377
+ * Compare the two provided values.
1378
+ * @param left The left value to compare.
1379
+ * @param right The right value to compare.
1380
+ */
1381
+ abstract compare(left: TLeft, right: TRight): Comparison;
1382
+ /**
1383
+ * Get whether the left value is less than the right value.
1384
+ * @param left The left value to compare.
1385
+ * @param right The right value to compare.
1386
+ */
1387
+ lessThan(left: TLeft, right: TRight): boolean;
1388
+ /**
1389
+ * Get whether the left value is less than or equal to the right value.
1390
+ * @param left The left value to compare.
1391
+ * @param right The right value to compare.
1392
+ */
1393
+ lessThanOrEqual(left: TLeft, right: TRight): boolean;
1394
+ /**
1395
+ * Get whether the left value equals the right value.
1396
+ * @param left The left value to compare.
1397
+ * @param right The right value to compare.
1398
+ */
1399
+ equal(left: TLeft, right: TRight): boolean;
1400
+ /**
1401
+ * Get whether the left value is greater than or equal to the right value.
1402
+ * @param left The left value to compare.
1403
+ * @param right The right value to compare.
1404
+ */
1405
+ greaterThanOrEqualTo(left: TLeft, right: TRight): boolean;
1406
+ /**
1407
+ * Get whether the left value is greater than the right value.
1408
+ * @param left The left value to compare.
1409
+ * @param right The right value to compare.
1410
+ */
1411
+ greaterThan(left: TLeft, right: TRight): boolean;
1412
+ /**
1413
+ * Attempt to compare the left and right values. The comparison will be done on whether they are
1414
+ * the same value (left === right) or whether one is undefined or null. If they aren't the same
1415
+ * value and neither is undefined or null, then this function can't compare them and will return
1416
+ * undefined.
1417
+ * @param left The left value of the comparison.
1418
+ * @param right The right value of the comparison.
1419
+ */
1420
+ static compareSameUndefinedNull(left: unknown, right: unknown): Comparison | undefined;
1421
+ /**
1422
+ * Get whether the left and right values are equal. The comparison will be done on whether they
1423
+ * are the same value (left === right) or whether one is undefined or null. If they aren't the
1424
+ * same value and neither is undefined or null, then this function can't determine whether they
1425
+ * are equal and will return undefined.
1426
+ * @param left The left value of the comparison.
1427
+ * @param right The right value of the comparison.
1428
+ */
1429
+ static equalSameUndefinedNull(left: unknown, right: unknown): boolean | undefined;
1430
+ static compareNumbers(left: number | undefined | null, right: number | undefined | null): Comparison;
1431
+ }
1432
+
1433
+ declare class ConcatenateIterable<T> implements Iterable$1<T> {
1434
+ private readonly innerIterables;
1435
+ private constructor();
1436
+ static create<T>(innerIterable: Iterable$1<T>, ...toConcatenate: JavascriptIterable<T>[]): ConcatenateIterable<T>;
1437
+ iterate(): Iterator$1<T>;
1438
+ toArray(): SyncResult<T[]>;
1439
+ any(): SyncResult<boolean>;
1440
+ getCount(): SyncResult<number>;
1441
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1442
+ toString(toStringFunctions?: ToStringFunctions): string;
1443
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
1444
+ map<TOutput>(mapping: (value: T) => TOutput | SyncResult<TOutput>): Iterable$1<TOutput>;
1445
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1446
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
1447
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
1448
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
1449
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
1450
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1451
+ [Symbol.iterator](): JavascriptIterator<T>;
1452
+ }
1453
+
1454
+ declare class ConcatenateIterator<T> implements Iterator$1<T> {
1455
+ private readonly innerIterators;
1456
+ private constructor();
1457
+ static create<T>(...toConcatenate: JavascriptIterable<T>[]): ConcatenateIterator<T>;
1458
+ next(): SyncResult<boolean>;
1459
+ hasStarted(): boolean;
1460
+ hasCurrent(): boolean;
1461
+ getCurrent(): T;
1462
+ start(): SyncResult<this>;
1463
+ takeCurrent(): SyncResult<T>;
1464
+ any(): SyncResult<boolean>;
1465
+ getCount(): SyncResult<number>;
1466
+ toArray(): SyncResult<T[]>;
1467
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
1468
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterator$1<T>;
1469
+ map<TOutput>(mapping: (value: T) => TOutput | SyncResult<TOutput>): Iterator$1<TOutput>;
1470
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
1471
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
1472
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
1473
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
1474
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
1475
+ take(maximumToTake: number): Iterator$1<T>;
1476
+ skip(maximumToSkip: number): Iterator$1<T>;
1477
+ [Symbol.iterator](): JavascriptIterator<T>;
1478
+ }
1479
+
1480
+ /**
1481
+ * A collection of condition methods that can be used to assert the state of an application.
1482
+ */
1483
+ declare class MutableCondition implements Condition {
1484
+ private toStringFunctions;
1485
+ private equalFunctions;
1486
+ private createErrorFunction;
1487
+ protected constructor();
1488
+ private static defaultCreateErrorFunction;
1489
+ /**
1490
+ * Create a new {@link MutableCondition} object.
1491
+ */
1492
+ static create(): MutableCondition;
1493
+ /**
1494
+ * Set the {@link ToStringFunctions} that will be used to convert values to their {@link String}
1495
+ * representations.
1496
+ * @param toStringFunctions The {@link ToStringFunctions} that will be used to convert values to
1497
+ * their {@link String} representations.
1498
+ * @returns This object for method chaining.
1499
+ */
1500
+ setToStringFunctions(toStringFunctions: ToStringFunctions): this;
1501
+ /**
1502
+ * Set the {@link EqualFunctions} that will be used to determine if values are equal.
1503
+ * @param equalFunctions The {@link EqualFunctions} that will be used to determine if values are
1504
+ * equal.
1505
+ * @returns This object for method chaining.
1506
+ */
1507
+ setEqualFunctions(equalFunctions: EqualFunctions): this;
1508
+ /**
1509
+ * Set the {@link Function} that will be used to create {@link Error}s.
1510
+ * @param createErrorFunction The {@link Function} to use to create {@link Error}.
1511
+ * @returns This object for method chaining.
1512
+ */
1513
+ setCreateErrorFunction(createErrorFunction: (message: string) => Error): this;
1514
+ assertUndefined(value: unknown, expression?: string, message?: string): asserts value is undefined;
1515
+ assertNotUndefined<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1516
+ /**
1517
+ * Get whether the provided values are equal.
1518
+ * @param left The left part of the comparison.
1519
+ * @param right The right part of the comparison.
1520
+ */
1521
+ areEqual(left: unknown, right: unknown): boolean;
1522
+ /**
1523
+ * Get the {@link String} representation of the provided value.
1524
+ * @param value The value to get the {@link String} representation of.
1525
+ */
1526
+ toValueString(value: unknown): string;
1527
+ /**
1528
+ * Create an {@link Error} based on the provided {@link AssertMessageParameters}.
1529
+ * @param parameters The {@link AssertMessageParameters} that define how the should be made.
1530
+ */
1531
+ createError(parameters: AssertMessageParameters): Error;
1532
+ /**
1533
+ * Create an error message based on the provided parameters.
1534
+ * @param parameters The parameters to use to create the error message.
1535
+ */
1536
+ static createErrorMessage(parameters: AssertMessageParameters): string;
1537
+ assertNotUndefinedAndNotNull<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1538
+ assertTrue(value: boolean, expression?: string, message?: string): asserts value is true;
1539
+ assertFalse(value: boolean, expression?: string, message?: string): asserts value is false;
1540
+ assertSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
1541
+ assertNotSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
1542
+ assertEqual<T>(expected: T, actual: T, expression?: string, message?: string): void;
1543
+ assertNotEqual<T>(notExpected: T, actual: T, expression?: string, message?: string): void;
1544
+ assertNotEmpty<T extends JavascriptIterable<unknown> | string | null | undefined>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1545
+ assertLessThan(value: number, upperBound: number, expression?: string, message?: string): void;
1546
+ assertLessThanOrEqualTo(value: number, upperBound: number, expression?: string, message?: string): void;
1547
+ assertGreaterThanOrEqualTo(value: number, lowerBound: number, expression?: string, message?: string): void;
1548
+ assertGreaterThan(value: number, lowerBound: number, expression?: string, message?: string): void;
1549
+ assertBetween(lowerBound: number, value: number, upperBound: number, expression?: string, message?: string): void;
1550
+ assertAccessIndex(index: number, count: number, expression?: string, message?: string): void;
1551
+ assertInsertIndex(index: number, count: number, expression?: string, message?: string): void;
1552
+ assertOneOf<T>(possibilities: JavascriptIterable<T>, value: T, expression?: string, message?: string): void;
1553
+ assertByte(value: number, expression?: string, message?: string): void;
1554
+ assertInteger(value: number, expression?: string, message?: string): void;
1555
+ assertCharacter(value: string, expression?: string, message?: string): void;
1556
+ assertInstanceOf<T>(value: unknown, type: Type<T>, typeCheck?: (value: unknown) => value is T, expression?: string, message?: string): asserts value is T;
1557
+ assertInstanceOf<T>(parameters: {
1558
+ value: unknown;
1559
+ type: Type<T>;
1560
+ typeCheck?: (value: unknown) => value is T;
1561
+ expression?: string;
1562
+ message?: string;
1563
+ }): void;
1564
+ assertInstanceOf<T>(parametersOrValue: unknown | {
1565
+ value: unknown;
1566
+ type: Type<T>;
1567
+ typeCheck?: (value: unknown) => value is T;
1568
+ expression?: string;
1569
+ message?: string;
1570
+ }, type?: Type<T>, typeCheck?: (value: unknown) => value is T, expression?: string, message?: string): void;
1571
+ }
1572
+
1573
+ /**
1574
+ * A collection of condition methods that can be used to assert the state of an application.
1575
+ */
1576
+ declare abstract class Condition {
1577
+ protected constructor();
1578
+ /**
1579
+ * Create a new {@link MutableCondition} object.
1580
+ */
1581
+ static create(): MutableCondition;
1582
+ /**
1583
+ * Assert that the provided value is undefined.
1584
+ * @param value The value to check.
1585
+ * @param expression The name of the expression that produced the value.
1586
+ * @param message An additional message that will be included with the error.
1587
+ */
1588
+ assertUndefined(value: unknown, expression?: string, message?: string): asserts value is undefined;
1589
+ /**
1590
+ * Assert that the provided value is undefined.
1591
+ * @param value The value to check.
1592
+ * @param expression The name of the expression that produced the value.
1593
+ * @param message An additional message that will be included with the error.
1594
+ */
1595
+ static assertUndefined(condition: Condition, value: unknown, expression?: string, message?: string): asserts value is undefined;
1596
+ /**
1597
+ * Assert that the provided value is not undefined and not null.
1598
+ * @param value The value to check.
1599
+ * @param expression The name of the expression that produced the value.
1600
+ * @param message An additional message that will be included with the error.
1601
+ */
1602
+ assertNotUndefined<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1603
+ /**
1604
+ * Assert that the provided value is not undefined and not null.
1605
+ * @param value The value to check.
1606
+ * @param expression The name of the expression that produced the value.
1607
+ * @param message An additional message that will be included with the error.
1608
+ */
1609
+ static assertNotUndefined<T>(condition: Condition, value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1610
+ /**
1611
+ * Assert that the provided value is not undefined and not null.
1612
+ * @param value The value to check.
1613
+ * @param expression The name of the expression that produced the value.
1614
+ * @param message An additional message that will be included with the error.
1615
+ */
1616
+ assertNotUndefinedAndNotNull<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1617
+ /**
1618
+ * Assert that the provided value is not undefined and not null.
1619
+ * @param value The value to check.
1620
+ * @param expression The name of the expression that produced the value.
1621
+ * @param message An additional message that will be included with the error.
1622
+ */
1623
+ static assertNotUndefinedAndNotNull<T>(condition: Condition, value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
1624
+ /**
1625
+ * Assert that the provided value is true.
1626
+ * @param value The value to check.
1627
+ * @param expression The name of the expression that produced the value.
1628
+ * @param message An additional message that will be included with the error.
1629
+ */
1630
+ assertTrue(value: boolean, expression?: string, message?: string): asserts value is true;
1631
+ /**
1632
+ * Assert that the provided value is true.
1633
+ * @param value The value to check.
1634
+ * @param expression The name of the expression that produced the value.
1635
+ * @param message An additional message that will be included with the error.
1636
+ */
1637
+ static assertTrue(condition: Condition, value: boolean, expression?: string, message?: string): asserts value is true;
1638
+ /**
1639
+ * Assert that the provided value is false.
1640
+ * @param value The value to check.
1641
+ * @param expression The name of the expression that produced the value.
1642
+ * @param message An additional message that will be included with the error.
1643
+ */
1644
+ assertFalse(value: boolean, expression?: string, message?: string): asserts value is false;
1645
+ /**
1646
+ * Assert that the provided value is false.
1647
+ * @param value The value to check.
1648
+ * @param expression The name of the expression that produced the value.
1649
+ * @param message An additional message that will be included with the error.
1650
+ */
1651
+ static assertFalse(condition: Condition, value: boolean, expression?: string, message?: string): asserts value is false;
1652
+ /**
1653
+ * Assert that the provided actual value is the same as the provided expected value.
1654
+ * @param expected The expected value.
1655
+ * @param actual The actual value.
1656
+ * @param expression The expression that produced the actual value.
1657
+ * @param message An optional message that describes the scenario.
1658
+ */
1659
+ abstract assertSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
1660
+ /**
1661
+ * Assert that the provided actual value is not the same as the provided expected value.
1662
+ * @param expected The expected value.
1663
+ * @param actual The actual value.
1664
+ * @param expression The expression that produced the actual value.
1665
+ * @param message An optional message that describes the scenario.
1666
+ */
1667
+ abstract assertNotSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
1668
+ /**
1669
+ * Assert that the provided actual value is equal to the provided expected value.
1670
+ * @param expected The expected value.
1671
+ * @param actual The actual value.
1672
+ * @param expression The expression that produced the actual value.
1673
+ * @param message An optional message that describes the scenario.
1674
+ */
1675
+ abstract assertEqual<T>(expected: T, actual: T, expression?: string, message?: string): void;
1676
+ /**
1677
+ * Assert that the provided actual value is not equal to the provided expected value.
1678
+ * @param notExpected The not expected value.
1679
+ * @param actual The actual value.
1680
+ * @param expression The expression that produced the actual value.
1681
+ * @param message An optional message that describes the scenario.
1682
+ */
1683
+ abstract assertNotEqual<T>(notExpected: T, actual: T, expression?: string, message?: string): void;
1684
+ /**
1685
+ * Assert that the provided value is not empty.
1686
+ * @param value The value to check.
1687
+ * @param expression The expression that produced the actual value.
1688
+ * @param message An optional message that describes the scenario.
1689
+ */
1690
+ abstract assertNotEmpty(value: JavascriptIterable<unknown> | string | undefined | null, expression?: string, message?: string): void;
1691
+ /**
1692
+ * Assert that the provided value is less than the provided upperBound.
1693
+ * @param value The value to check.
1694
+ * @param upperBound The upperBound that the value must be less than.
1695
+ * @param expression The expression that produced the actual value.
1696
+ * @param message An optional message that describes the scenario.
1697
+ */
1698
+ abstract assertLessThan(value: number, upperBound: number, expression?: string, message?: string): void;
1699
+ /**
1700
+ * Assert that the provided value is less than or equal to the provided upperBound.
1701
+ * @param value The value to check.
1702
+ * @param upperBound The upperBound that the value must be less than.
1703
+ * @param expression The expression that produced the actual value.
1704
+ * @param message An optional message that describes the scenario.
1705
+ */
1706
+ abstract assertLessThanOrEqualTo(value: number, upperBound: number, expression?: string, message?: string): void;
1707
+ /**
1708
+ * Assert that the provided value is greater than or equal to the provided lowerBound.
1709
+ * @param value The value to check.
1710
+ * @param lowerBound The lowerBound that the value must be greater than or equal to.
1711
+ * @param expression The expression that produced the actual value.
1712
+ * @param message An optional message that describes the scenario.
1713
+ */
1714
+ abstract assertGreaterThanOrEqualTo(value: number, lowerBound: number, expression?: string, message?: string): void;
1715
+ /**
1716
+ * Assert that the provided value is greater than the provided lowerBound.
1717
+ * @param value The value to check.
1718
+ * @param lowerBound The lowerBound that the value must be greater than.
1719
+ * @param expression The expression that produced the actual value.
1720
+ * @param message An optional message that describes the scenario.
1721
+ */
1722
+ abstract assertGreaterThan(value: number, lowerBound: number, expression?: string, message?: string): void;
1723
+ /**
1724
+ * Assert that the value is greater than or equal to the lowerBound and less than or equal to
1725
+ * the upperBound.
1726
+ * @param lowerBound The lowerBound that the value must be greater than or equal to.
1727
+ * @param value The value to check.
1728
+ * @param upperBound The upperBound that the value must be less than or equal to.
1729
+ * @param expression The expression that produced the actual value.
1730
+ * @param message An optional message that describes the scenario.
1731
+ */
1732
+ abstract assertBetween(lowerBound: number, value: number, upperBound: number, expression?: string, message?: string): void;
1733
+ /**
1734
+ * Assert that the index is within the access bounds of an indexable with the provided count.
1735
+ * @param index The index to check.
1736
+ * @param count The number of elements in the indexable.
1737
+ * @param expression The expression that produced the actual value.
1738
+ * @param message An optional message that describes the scenario.
1739
+ */
1740
+ assertAccessIndex(index: number, count: number, expression?: string, message?: string): void;
1741
+ /**
1742
+ * Assert that the index is within the access bounds of an indexable with the provided count.
1743
+ * @param index The index to check.
1744
+ * @param count The number of elements in the indexable.
1745
+ * @param expression The expression that produced the actual value.
1746
+ * @param message An optional message that describes the scenario.
1747
+ */
1748
+ static assertAccessIndex(condition: Condition, index: number, count: number, expression?: string, message?: string): void;
1749
+ /**
1750
+ * Assert that the index is within the insertion bounds of a {@link List} with the provided count.
1751
+ * @param index The index to check.
1752
+ * @param count The number of elements in the indexable.
1753
+ * @param expression The expression that produced the actual value.
1754
+ * @param message An optional message that describes the scenario.
1755
+ */
1756
+ assertInsertIndex(index: number, count: number, expression?: string, message?: string): void;
1757
+ /**
1758
+ * Assert that the index is within the insertion bounds of a {@link List} with the provided count.
1759
+ * @param index The index to check.
1760
+ * @param count The number of elements in the indexable.
1761
+ * @param expression The expression that produced the actual value.
1762
+ * @param message An optional message that describes the scenario.
1763
+ */
1764
+ static assertInsertIndex(condition: Condition, index: number, count: number, expression?: string, message?: string): void;
1765
+ /**
1766
+ * Assert that the value is one of the possibilities.
1767
+ * @param possibilities The possible values that the value can be.
1768
+ * @param value The value to check.
1769
+ * @param expression The expression that produced the value.
1770
+ * @param message An optional error message.
1771
+ */
1772
+ abstract assertOneOf<T>(possibilities: JavascriptIterable<T>, value: T, expression?: string, message?: string): void;
1773
+ /**
1774
+ * Assert that the value is within the bounds of a byte.
1775
+ * @param value The value to check.
1776
+ * @param expression The expression that produced the value.
1777
+ * @param message An optional error message.
1778
+ */
1779
+ assertByte(value: number, expression?: string, message?: string): void;
1780
+ /**
1781
+ * Assert that the value is within the bounds of a byte.
1782
+ * @param value The value to check.
1783
+ * @param expression The expression that produced the value.
1784
+ * @param message An optional error message.
1785
+ */
1786
+ static assertByte(condition: Condition, value: number, expression?: string, message?: string): void;
1787
+ /**
1788
+ * Assert that the value is an integer.
1789
+ * @param value The value to check.
1790
+ * @param expression The expression that produced the value.
1791
+ * @param message An optional error message.
1792
+ */
1793
+ abstract assertInteger(value: number, expression?: string, message?: string): void;
1794
+ /**
1795
+ * Assert that the provided value is an instance of the provided {@link Type}.
1796
+ * @param value The value to check.
1797
+ * @param type The {@link Type} to check.
1798
+ * @param expression The expression that produced the value.
1799
+ * @param message An optional error message.
1800
+ */
1801
+ abstract assertInstanceOf<T>(value: unknown, type: Type<T>, typeCheck?: (value: unknown) => value is T, expression?: string, message?: string): asserts value is T;
1802
+ /**
1803
+ * Assert that the provided value is an instance of the provided {@link Type}.
1804
+ * @param value The value to check.
1805
+ * @param type The {@link Type} to check.
1806
+ * @param expression The expression that produced the value.
1807
+ * @param message An optional error message.
1808
+ */
1809
+ abstract assertInstanceOf<T>(parameters: {
1810
+ value: unknown;
1811
+ type: Type<T>;
1812
+ typeCheck?: (value: unknown) => value is T;
1813
+ expression?: string;
1814
+ message?: string;
1815
+ }): void;
1816
+ }
1817
+
1818
+ declare class HttpHeader {
1819
+ private readonly name;
1820
+ private readonly value;
1821
+ private constructor();
1822
+ static create(name: string, value: string): HttpHeader;
1823
+ getName(): string;
1824
+ getValue(): string;
1825
+ toString(): string;
1826
+ }
1827
+
1828
+ declare class MutableHttpHeaders implements HttpHeaders {
1829
+ private readonly headers;
1830
+ private constructor();
1831
+ static create(headers?: JavascriptIterable<HttpHeader>): MutableHttpHeaders;
1832
+ iterate(): Iterator$1<HttpHeader>;
1833
+ get(headerName: string): SyncResult<HttpHeader>;
1834
+ getValue(headerName: string): SyncResult<string>;
1835
+ /**
1836
+ * Set a {@link HttpHeader} value in this collection. This will overwrite any existing
1837
+ * {@link HttpHeader} with the same name.
1838
+ * @param headerName The name of the header to set.
1839
+ * @param headerValue The value of the header to set.
1840
+ */
1841
+ set(headerName: string, headerValue: string): this;
1842
+ set(header: HttpHeader): this;
1843
+ setAll(headers: JavascriptIterable<HttpHeader>): this;
1844
+ setContentType(contentType: string): this;
1845
+ getContentType(): SyncResult<HttpHeader>;
1846
+ getContentTypeValue(): SyncResult<string>;
1847
+ getCount(): SyncResult<number>;
1848
+ toArray(): SyncResult<HttpHeader[]>;
1849
+ any(): SyncResult<boolean>;
1850
+ equals(right: JavascriptIterable<HttpHeader>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1851
+ toString(toStringFunctions?: ToStringFunctions): string;
1852
+ concatenate(...toConcatenate: JavascriptIterable<HttpHeader>[]): Iterable$1<HttpHeader>;
1853
+ map<TOutput>(mapping: (value: HttpHeader) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
1854
+ flatMap<TOutput>(mapping: (value: HttpHeader) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1855
+ where(condition: (value: HttpHeader) => (boolean | SyncResult<boolean>)): Iterable$1<HttpHeader>;
1856
+ instanceOf<TOutput extends HttpHeader>(typeOrTypeCheck: Type<TOutput> | ((value: HttpHeader) => value is TOutput)): Iterable$1<TOutput>;
1857
+ first(condition?: (value: HttpHeader) => (boolean | SyncResult<boolean>)): SyncResult<HttpHeader>;
1858
+ last(condition?: (value: HttpHeader) => (boolean | SyncResult<boolean>)): SyncResult<HttpHeader>;
1859
+ [Symbol.iterator](): JavascriptIterator<HttpHeader>;
1860
+ contains(value: HttpHeader, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1861
+ }
1862
+
1863
+ /**
1864
+ * A collection of {@link HttpHeader}s.
1865
+ */
1866
+ declare abstract class HttpHeaders implements Iterable$1<HttpHeader> {
1867
+ static readonly contentTypeHeaderName: string;
1868
+ static create(headers?: JavascriptIterable<HttpHeader>): MutableHttpHeaders;
1869
+ /**
1870
+ * Get the header with the provided name.
1871
+ * @param headerName The name of the header.
1872
+ */
1873
+ abstract get(headerName: string): SyncResult<HttpHeader>;
1874
+ /**
1875
+ * Get the value of the header with the provided name.
1876
+ * @param headerName The name of the header.
1877
+ */
1878
+ abstract getValue(headerName: string): SyncResult<string>;
1879
+ getContentType(): AsyncResult<HttpHeader>;
1880
+ static getContentType(headers: HttpHeaders): AsyncResult<HttpHeader>;
1881
+ getContentTypeValue(): AsyncResult<string>;
1882
+ static getContentTypeValue(headers: HttpHeaders): AsyncResult<string>;
1883
+ /**
1884
+ * Get an {@link Iterator} that can be used to iterate through the {@link HttpHeader}s in this
1885
+ * collection.
1886
+ */
1887
+ abstract iterate(): Iterator$1<HttpHeader>;
1888
+ /**
1889
+ * Get the {@link HttpHeader}s in this {@link HttpHeaders} object as an array.
1890
+ */
1891
+ toArray(): SyncResult<HttpHeader[]>;
1892
+ static toArray(headers: HttpHeaders): SyncResult<HttpHeader[]>;
1893
+ any(): SyncResult<boolean>;
1894
+ static any(headers: HttpHeaders): SyncResult<boolean>;
1895
+ getCount(): SyncResult<number>;
1896
+ static getCount(headers: HttpHeaders): SyncResult<number>;
1897
+ equals(right: JavascriptIterable<HttpHeader>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1898
+ static equals(headers: HttpHeaders, right: JavascriptIterable<HttpHeader>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1899
+ toString(toStringFunctions?: ToStringFunctions): string;
1900
+ static toString(headers: HttpHeaders, toStringFunctions?: ToStringFunctions): string;
1901
+ concatenate(...toConcatenate: JavascriptIterable<HttpHeader>[]): Iterable$1<HttpHeader>;
1902
+ static concatenate(headers: HttpHeaders, ...toConcatenate: JavascriptIterable<HttpHeader>[]): Iterable$1<HttpHeader>;
1903
+ map<TOutput>(mapping: (value: HttpHeader) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
1904
+ static map<TOutput>(headers: HttpHeaders, mapping: (value: HttpHeader) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
1905
+ flatMap<TOutput>(mapping: (value: HttpHeader) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1906
+ static flatMap<TOutput>(headers: HttpHeaders, mapping: (value: HttpHeader) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
1907
+ where(condition: (value: HttpHeader) => boolean): Iterable$1<HttpHeader>;
1908
+ static where(headers: HttpHeaders, condition: (value: HttpHeader) => (boolean | SyncResult<boolean>)): Iterable$1<HttpHeader>;
1909
+ instanceOf<TOutput extends HttpHeader>(typeOrTypeCheck: Type<TOutput> | ((value: HttpHeader) => value is TOutput)): Iterable$1<TOutput>;
1910
+ static instanceOf<TOutput extends HttpHeader>(headers: HttpHeaders, typeOrTypeCheck: Type<TOutput> | ((value: HttpHeader) => value is TOutput)): Iterable$1<TOutput>;
1911
+ first(condition?: (value: HttpHeader) => (boolean | SyncResult<boolean>)): SyncResult<HttpHeader>;
1912
+ static first(headers: HttpHeaders, condition?: (value: HttpHeader) => (boolean | SyncResult<boolean>)): SyncResult<HttpHeader>;
1913
+ last(condition?: (value: HttpHeader) => (boolean | SyncResult<boolean>)): SyncResult<HttpHeader>;
1914
+ static last(headers: HttpHeaders, condition?: (value: HttpHeader) => (boolean | SyncResult<boolean>)): SyncResult<HttpHeader>;
1915
+ [Symbol.iterator](): JavascriptIterator<HttpHeader>;
1916
+ static [Symbol.iterator](headers: HttpHeaders): JavascriptIterator<HttpHeader>;
1917
+ contains(value: HttpHeader, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1918
+ static contains(headers: HttpHeaders, value: HttpHeader, equalFunctions?: EqualFunctions): SyncResult<boolean>;
1919
+ }
1920
+
1921
+ declare enum HttpMethod {
1922
+ /**
1923
+ * The GET method requests a representation of the specified resource. Requests using GET should
1924
+ * only retrieve data and should not contain a request content.
1925
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET
1926
+ */
1927
+ GET = 0,
1928
+ /**
1929
+ * The HEAD method asks for a response identical to a GET request, but without a response body.
1930
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD
1931
+ */
1932
+ HEAD = 1,
1933
+ /**
1934
+ * The POST method submits an entity to the specified resource, often causing a change in state
1935
+ * or side effects on the server.
1936
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST
1937
+ */
1938
+ POST = 2,
1939
+ /**
1940
+ * The PUT method replaces all current representations of the target resource with the request
1941
+ * content.
1942
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT
1943
+ */
1944
+ PUT = 3,
1945
+ /**
1946
+ * The DELETE method deletes the specified resource.
1947
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE
1948
+ */
1949
+ DELETE = 4,
1950
+ /**
1951
+ * The CONNECT method establishes a tunnel to the server identified by the target resource.
1952
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/CONNECT
1953
+ */
1954
+ CONNECT = 5,
1955
+ /**
1956
+ * The OPTIONS method describes the communication options for the target resource.
1957
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/OPTIONS
1958
+ */
1959
+ OPTIONS = 6,
1960
+ /**
1961
+ * The TRACE method performs a message loop-back test along the path to the target resource.
1962
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/TRACE
1963
+ */
1964
+ TRACE = 7,
1965
+ /**
1966
+ * The PATCH method applies partial modifications to a resource.
1967
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PATCH
1968
+ */
1969
+ PATCH = 8
1970
+ }
1971
+ /**
1972
+ * Parse a {@link HttpMethod} from the provided text.
1973
+ * @param text The text to parse.
1974
+ */
1975
+ declare function parseHttpMethod(text: string): SyncResult<HttpMethod>;
1976
+ /**
1977
+ * Get the string representation of the provided {@link HttpMethod}.
1978
+ * @param httpMethod The {@link HttpMethod} to get the string representation of.
1979
+ */
1980
+ declare function httpMethodToString(httpMethod: HttpMethod): string;
1981
+
1982
+ /**
1983
+ * A HTTP request that is sent out by a {@link HttpClient}.
1984
+ */
1985
+ declare class HttpOutgoingRequest {
1986
+ private method;
1987
+ private url;
1988
+ private readonly headers;
1989
+ private body;
1990
+ private constructor();
1991
+ static create(method: HttpMethod, url: string): HttpOutgoingRequest;
1992
+ /**
1993
+ * Create a new {@link HttpOutgoingRequest} with a GET {@link HttpMethod}.
1994
+ * @param url The target URL for the {@link HttpOutgoingRequest}.
1995
+ */
1996
+ static get(url: string): HttpOutgoingRequest;
1997
+ /**
1998
+ * Get the {@link HttpMethod} for this {@link HttpOutgoingRequest}.
1999
+ */
2000
+ getMethod(): HttpMethod;
2001
+ /**
2002
+ * Set the {@link HttpMethod} for this {@link HttpOutgoingRequest}.
2003
+ * @param method The {@link HttpMethod} for this {@link HttpOutgoingRequest}.
2004
+ */
2005
+ setMethod(method: HttpMethod): this;
2006
+ /**
2007
+ * Get this {@link HttpOutgoingRequest}'s target URL.
2008
+ */
2009
+ getURL(): string;
2010
+ /**
2011
+ * Set the URL that this request will be sent to.
2012
+ * @param url The URL to send this request to.
2013
+ */
2014
+ setURL(url: string): this;
2015
+ /**
2016
+ * Get the {@link HttpHeaders} that will be sent.
2017
+ */
2018
+ getHeaders(): HttpHeaders;
2019
+ getHeader(headerName: string): SyncResult<HttpHeader>;
2020
+ getHeaderValue(headerName: string): SyncResult<string>;
2021
+ /**
2022
+ * Get the body that will be sent.
2023
+ */
2024
+ getBody(): string;
2025
+ setBody(body: string): this;
2026
+ }
2027
+
2028
+ /**
2029
+ * The response from a {@link HttpClient}'s sendRequest() method.
2030
+ */
2031
+ declare abstract class HttpIncomingResponse {
2032
+ abstract getStatusCode(): number;
2033
+ abstract getHeaders(): AsyncResult<HttpHeaders>;
2034
+ abstract getHeader(headerName: string): AsyncResult<HttpHeader>;
2035
+ abstract getHeaderValue(headerName: string): AsyncResult<string>;
2036
+ abstract getBody(): AsyncResult<string>;
2037
+ }
2038
+
2039
+ /**
2040
+ * An object that can make HTTP network requests.
2041
+ */
2042
+ declare abstract class HttpClient {
2043
+ static create(): HttpClient;
2044
+ /**
2045
+ * Send the provided {@link HttpOutgoingRequest}.
2046
+ * @param request The {@link HttpOutgoingRequest} to send.
2047
+ */
2048
+ abstract sendRequest(request: HttpOutgoingRequest): AsyncResult<HttpIncomingResponse>;
2049
+ /**
2050
+ * Send a GET {@link HttpOutgoingRequest} to the provided URL.
2051
+ * @param url The URL to send the GET {@link HttpOutgoingRequest} to.
2052
+ */
2053
+ sendGetRequest(url: string): AsyncResult<HttpIncomingResponse>;
2054
+ static sendGetRequest(httpClient: HttpClient, url: string): AsyncResult<HttpIncomingResponse>;
2055
+ }
2056
+
2057
+ /**
2058
+ * A HTTP request that is received by a {@link HttpServer}.
2059
+ */
2060
+ declare abstract class HttpIncomingRequest {
2061
+ /**
2062
+ * Get the {@link HttpMethod} of the request.
2063
+ */
2064
+ abstract getMethod(): HttpMethod;
2065
+ abstract getHost(): AsyncResult<string>;
2066
+ /**
2067
+ * Get the path component of the requested URL.
2068
+ */
2069
+ abstract getURLPath(): string;
2070
+ abstract getHeaders(): AsyncResult<HttpHeaders>;
2071
+ abstract getHeader(headerName: string): AsyncResult<HttpHeader>;
2072
+ abstract getHeaderValue(headerName: string): AsyncResult<string>;
2073
+ abstract getBody(): AsyncResult<string>;
2074
+ }
2075
+
2076
+ /**
2077
+ * A HTTP response that is sent out by an {@link HttpServer}.
2078
+ */
2079
+ declare class HttpOutgoingResponse {
2080
+ private statusCode;
2081
+ private readonly headers;
2082
+ private body;
2083
+ private constructor();
2084
+ static create(): HttpOutgoingResponse;
2085
+ /**
2086
+ * Get the status code of this {@link HttpOutgoingResponse}.
2087
+ */
2088
+ getStatusCode(): number;
2089
+ /**
2090
+ * Set the status code of this {@link HttpOutgoingResponse}.
2091
+ * @param statusCode The status code of this {@link HttpOutgoingResponse}.
2092
+ */
2093
+ setStatusCode(statusCode: number): this;
2094
+ getHeaders(): HttpHeaders;
2095
+ /**
2096
+ * Get the HTTP header with the provided name or return a {@link NotFoundError} if the header
2097
+ * doesn't exist.
2098
+ * @param headerName The name of the header to get.
2099
+ */
2100
+ getHeader(headerName: string): SyncResult<HttpHeader>;
2101
+ /**
2102
+ * Get the value of the header with the provided name or return a {@link NotFoundError} if the
2103
+ * header doesn't exist.
2104
+ * @param headerName The name of the header value to get.
2105
+ */
2106
+ getHeaderValue(headerName: string): SyncResult<string>;
2107
+ /**
2108
+ * Set the HTTP header in this {@link HttpOutgoingResponse}.
2109
+ * @param headerName The name of the HTTP header.
2110
+ * @param headerValue The value of the HTTP header.
2111
+ */
2112
+ setHeader(headerName: string, headerValue: string): this;
2113
+ setContentTypeHeader(contentType: string): this;
2114
+ /**
2115
+ * Get the body of this {@link HttpOutgoingResponse}.
2116
+ */
2117
+ getBody(): string;
2118
+ /**
2119
+ * Set the body of this {@link HttpOutgoingResponse}.
2120
+ * @param body The body for this {@link HttpOutgoingResponse}.
2121
+ */
2122
+ setBody(body: string): this;
2123
+ }
2124
+
2125
+ declare abstract class HttpServer implements Disposable {
2126
+ abstract dispose(): AsyncResult<boolean>;
2127
+ abstract isDisposed(): boolean;
2128
+ /**
2129
+ * Add the provided request handler so it will be invoked when a request is received for the
2130
+ * provided path.
2131
+ * @param requestPath The path that will cause the provided handler to be invoked.
2132
+ * @param handler The function that will be invoked when the
2133
+ */
2134
+ abstract addRequestHandler(requestPath: string, handler: (request: HttpIncomingRequest, response: HttpOutgoingResponse) => AsyncResult<void>): void;
2135
+ /**
2136
+ * Set the default request handler that will be invoked when no other request handlers match an
2137
+ * {@link HttpIncomingRequest}.
2138
+ * @param handler The handler that will be invoked when no other request handlers match an
2139
+ * {@link HttpIncomingRequest}.
2140
+ */
2141
+ abstract setDefaultRequestHandler(handler: (request: HttpIncomingRequest, response: HttpOutgoingResponse) => AsyncResult<void>): void;
2142
+ /**
2143
+ * Start listening for incoming connections on the provided port number. The returned
2144
+ * {@link AsyncResult} will complete when the server is disposed.
2145
+ * @param portNumber The port number to start listening on.
2146
+ */
2147
+ abstract start(portNumber: number): AsyncResult<void>;
2148
+ }
2149
+
2150
+ /**
2151
+ * An object that provides access to the network.
2152
+ */
2153
+ declare abstract class Network {
2154
+ /**
2155
+ * Create a new {@link HttpServer} that is connected to this {@link Network}.
2156
+ */
2157
+ abstract createHttpServer(): HttpServer;
2158
+ /**
2159
+ * Create a new {@link HttpClient} that is connected to this {@link Network}.
2160
+ */
2161
+ abstract createHttpClient(): HttpClient;
2162
+ }
2163
+
2164
+ declare class Property<T> {
2165
+ private readonly getter;
2166
+ private readonly setter;
2167
+ private constructor();
2168
+ static create<T>(getter: () => T, setter: (value: T) => void): Property<T>;
2169
+ static create<T>(options: {
2170
+ getter: () => T;
2171
+ setter: (value: T) => void;
2172
+ }): Property<T>;
2173
+ static create<T>(initialValue: T): Property<T>;
2174
+ getValue(): T;
2175
+ setValue(value: T): this;
2176
+ toString(): string;
2177
+ }
2178
+
2179
+ /**
2180
+ * An object that provides all of the resources that are available to the current process.
2181
+ */
2182
+ declare class CurrentProcess {
2183
+ private args;
2184
+ private parameters;
2185
+ private outputWriteStream;
2186
+ private exitCodeProperty;
2187
+ private network;
2188
+ private constructor();
2189
+ static create(): CurrentProcess;
2190
+ static run(action: (currentProcess: CurrentProcess) => void | number | Promise<void | number>): Promise<void>;
2191
+ getArguments(): JavascriptIterable<string>;
2192
+ setArguments(args: JavascriptIterable<string>): this;
2193
+ getParameters(): CommandLineParameters;
2194
+ getOutputWriteStream(): CharacterWriteStream;
2195
+ setOutputWriteStream(outputWriteStream: CharacterWriteStream): this;
2196
+ getExitCode(): number;
2197
+ setExitCode(exitCode: number): this;
2198
+ getExitCodeProperty(): Property<number>;
2199
+ setExitCodeProperty(exitCodeProperty: Property<number>): this;
2200
+ getNetwork(): Network;
2201
+ setNetwork(network: Network): this;
2202
+ }
2203
+
2204
+ declare abstract class DateTime {
2205
+ static parse(text: string): DateTime;
2206
+ static now(): DateTime;
2207
+ abstract getYear(): number;
2208
+ abstract getMonth(): number;
2209
+ abstract getDay(): number;
2210
+ abstract getHour(): number;
2211
+ abstract getMinute(): number;
2212
+ abstract getSecond(): number;
2213
+ abstract addDays(days: number): DateTime;
2214
+ /**
2215
+ * Compare this {@link DateTime} to the provided {@link DateTime}. If this {@link DateTime} is
2216
+ * less than the provided {@link DateTime}, then a negative number will be returned, 0 if
2217
+ * they're equal, or a positive number if this {@link DateTime} is greater than the provided
2218
+ * {@link DateTime}.
2219
+ * @param dateTime The {@link DateTime} to compare to this {@link DateTime}.
2220
+ */
2221
+ compareTo(dateTime: DateTime, compareTimes: boolean): number;
2222
+ static compareTo(left: DateTime, right: DateTime, compareTimes: boolean): number;
2223
+ lessThan(dateTime: DateTime, compareTimes: boolean): boolean;
2224
+ static lessThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
2225
+ lessThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
2226
+ static lessThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
2227
+ equals(dateTime: DateTime, compareTimes: boolean): boolean;
2228
+ static equals(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
2229
+ greaterThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
2230
+ static greaterThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
2231
+ greaterThan(dateTime: DateTime, compareTimes: boolean): boolean;
2232
+ static greaterThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
2233
+ get debug(): string;
2234
+ static debug(dateTime: DateTime): string;
2235
+ abstract toString(): string;
2236
+ abstract toDateString(): string;
2237
+ }
2238
+
2239
+ /**
2240
+ * An object that can be used to implement a search algorithm.
2241
+ */
2242
+ declare abstract class SearchControl<TVisit, TResult> {
2243
+ /**
2244
+ * Add the provided value to the to-visit list.
2245
+ * @param value The value to add to the to-visit list.
2246
+ */
2247
+ abstract addToVisit(value: TVisit): void;
2248
+ /**
2249
+ * Add the provided values to the to-visit list.
2250
+ * @param values The values to add to the to-visit list.
2251
+ */
2252
+ abstract addAllToVisit(values: JavascriptIterable<TVisit>): void;
2253
+ /**
2254
+ * Get whether the provided value has already been visited.
2255
+ * @param value The value to check.
2256
+ */
2257
+ abstract hasVisited(value: TVisit): boolean;
2258
+ /**
2259
+ * Add the provided value to the list of values to be returned.
2260
+ * @param value The value to add.
2261
+ */
2262
+ abstract addResult(value: TResult): void;
2263
+ /**
2264
+ * Add the provided values to the list of values to be returned.
2265
+ * @param values The values to add.
2266
+ */
2267
+ abstract addResults(values: JavascriptIterable<TResult>): void;
2268
+ /**
2269
+ * Immediately stop the search.
2270
+ */
2271
+ abstract break(): never;
2272
+ }
2273
+
2274
+ declare function depthFirstSearch<TVisit, TResult>(initialToVisit: JavascriptIterable<TVisit>, searchAction: (searchControl: SearchControl<TVisit, TResult>, current: TVisit) => void): Iterator$1<TResult>;
2275
+ declare function depthFirstSearch<TVisit, TResult>(parameters: {
2276
+ initialToVisit: JavascriptIterable<TVisit>;
2277
+ searchAction: (searchControl: SearchControl<TVisit, TResult>, current: TVisit) => void;
2278
+ }): Iterator$1<TResult>;
2279
+
2280
+ /**
2281
+ * An {@link Error} that is created when something is empty.
2282
+ */
2283
+ declare class EmptyError extends Error {
2284
+ constructor(message?: string);
2285
+ }
2286
+
2287
+ declare function andList(values: JavascriptIterable<string>): string;
2288
+ declare function orList(values: JavascriptIterable<string>): string;
2289
+
2290
+ /**
2291
+ * An {@link HttpIncomingResponse} that comes from a {@link FetchHttpClient}.
2292
+ */
2293
+ declare class FetchHttpIncomingResponse extends HttpIncomingResponse {
2294
+ private readonly response;
2295
+ private constructor();
2296
+ static create(response: Response): FetchHttpIncomingResponse;
2297
+ getStatusCode(): number;
2298
+ getHeaders(): SyncResult<HttpHeaders>;
2299
+ getHeader(headerName: string): SyncResult<HttpHeader>;
2300
+ getHeaderValue(headerName: string): SyncResult<string>;
2301
+ getBody(): PromiseAsyncResult<string>;
2302
+ }
2303
+
2304
+ /**
2305
+ * A {@link HttpClient} that uses {@link fetch}() to make network requests.
2306
+ */
2307
+ declare class FetchHttpClient implements HttpClient {
2308
+ protected constructor();
2309
+ static create(): FetchHttpClient;
2310
+ sendRequest(request: HttpOutgoingRequest): PromiseAsyncResult<FetchHttpIncomingResponse>;
2311
+ sendGetRequest(url: string): PromiseAsyncResult<FetchHttpIncomingResponse>;
2312
+ static convertMethod(method: HttpMethod): string;
2313
+ }
2314
+
2315
+ declare class FlatMapIterable<TInput, TOutput> implements Iterable$1<TOutput> {
2316
+ private readonly innerIterable;
2317
+ private readonly mapping;
2318
+ private constructor();
2319
+ static create<TInput, TOutput>(innerIterable: Iterable$1<TInput>, mapping: (value: TInput) => JavascriptIterable<TOutput>): FlatMapIterable<TInput, TOutput>;
2320
+ iterate(): Iterator$1<TOutput>;
2321
+ toArray(): SyncResult<TOutput[]>;
2322
+ any(): SyncResult<boolean>;
2323
+ getCount(): SyncResult<number>;
2324
+ equals(right: JavascriptIterable<TOutput>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2325
+ toString(toStringFunctions?: ToStringFunctions): string;
2326
+ concatenate(...toConcatenate: JavascriptIterable<TOutput>[]): Iterable$1<TOutput>;
2327
+ map<TOutput2>(mapping: (value: TOutput) => TOutput2 | SyncResult<TOutput2>): Iterable$1<TOutput2>;
2328
+ flatMap<TOutput2>(mapping: (value: TOutput) => JavascriptIterable<TOutput2>): Iterable$1<TOutput2>;
2329
+ where(condition: (value: TOutput) => (boolean | SyncResult<boolean>)): Iterable$1<TOutput>;
2330
+ instanceOf<TOutput2 extends TOutput>(typeOrTypeCheck: Type<TOutput2> | ((value: TOutput2) => value is TOutput2)): Iterable$1<TOutput2>;
2331
+ first(condition?: ((value: TOutput) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<TOutput>;
2332
+ last(condition?: ((value: TOutput) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<TOutput>;
2333
+ contains(value: TOutput, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2334
+ [Symbol.iterator](): JavascriptIterator<TOutput>;
2335
+ }
2336
+
2337
+ declare class FlatMapIterator<TInput, TOutput> implements Iterator$1<TOutput> {
2338
+ private readonly innerIterator;
2339
+ private readonly mapping;
2340
+ private mappingIterator;
2341
+ private started;
2342
+ private constructor();
2343
+ static create<TInput, TOutput>(innerIterator: Iterator$1<TInput>, mapping: (value: TInput) => JavascriptIterable<TOutput>): FlatMapIterator<TInput, TOutput>;
2344
+ next(): SyncResult<boolean>;
2345
+ hasStarted(): boolean;
2346
+ hasCurrent(): boolean;
2347
+ getCurrent(): TOutput;
2348
+ start(): SyncResult<this>;
2349
+ takeCurrent(): SyncResult<TOutput>;
2350
+ any(): SyncResult<boolean>;
2351
+ getCount(): SyncResult<number>;
2352
+ toArray(): SyncResult<TOutput[]>;
2353
+ concatenate(...toConcatenate: JavascriptIterable<TOutput>[]): Iterator$1<TOutput>;
2354
+ where(condition: (value: TOutput) => (boolean | SyncResult<boolean>)): Iterator$1<TOutput>;
2355
+ map<TOutput2>(mapping: (value: TOutput) => (TOutput2 | SyncResult<TOutput2>)): Iterator$1<TOutput2>;
2356
+ flatMap<TOutput2>(mapping: (value: TOutput) => JavascriptIterable<TOutput2>): Iterator$1<TOutput2>;
2357
+ whereInstanceOf<U extends TOutput>(typeCheck: (value: TOutput) => value is U): Iterator$1<U>;
2358
+ whereInstanceOfType<U extends TOutput>(type: Type<U>): Iterator$1<U>;
2359
+ first(condition?: ((value: TOutput) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<TOutput>;
2360
+ last(condition?: ((value: TOutput) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<TOutput>;
2361
+ take(maximumToTake: number): Iterator$1<TOutput>;
2362
+ skip(maximumToSkip: number): Iterator$1<TOutput>;
2363
+ [Symbol.iterator](): JavascriptIterator<TOutput>;
2364
+ }
2365
+
2366
+ /**
2367
+ * A control that can be used to interact with a {@link Generator} while it is generating values.
2368
+ */
2369
+ interface GeneratorControl<T> {
2370
+ /**
2371
+ * Add the provided value to the list of values that the {@link Generator} will return.
2372
+ * @param value The value to add to the {@link Generator}'s list of values.
2373
+ */
2374
+ addValue(value: T): void;
2375
+ /**
2376
+ * Add the provided values to the list of values that the {@link Generator} will return.
2377
+ * @param returnValues The values to add to the {@link Generator}'s list of values.
2378
+ */
2379
+ addValues(returnValues: JavascriptIterable<T>): void;
2380
+ /**
2381
+ * Get whether the {@link Generator} currently has a value.
2382
+ */
2383
+ hasCurrent(): boolean;
2384
+ /**
2385
+ * Get the current value of the {@link Generator}.
2386
+ */
2387
+ getCurrent(): T;
2388
+ }
2389
+ declare class Generator<T> implements Iterator$1<T> {
2390
+ private readonly control;
2391
+ private readonly generatorAction;
2392
+ private started;
2393
+ private constructor();
2394
+ static create<T>(generatorAction: (control: GeneratorControl<T>) => (void | T)): Generator<T>;
2395
+ next(): SyncResult<boolean>;
2396
+ hasStarted(): boolean;
2397
+ hasCurrent(): boolean;
2398
+ getCurrent(): T;
2399
+ start(): SyncResult<this>;
2400
+ takeCurrent(): SyncResult<T>;
2401
+ any(): SyncResult<boolean>;
2402
+ getCount(): SyncResult<number>;
2403
+ toArray(): SyncResult<T[]>;
2404
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
2405
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterator$1<T>;
2406
+ map<TOutput>(mapping: (value: T) => TOutput | SyncResult<TOutput>): Iterator$1<TOutput>;
2407
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
2408
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
2409
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
2410
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2411
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2412
+ take(maximumToTake: number): Iterator$1<T>;
2413
+ skip(maximumToSkip: number): Iterator$1<T>;
2414
+ [Symbol.iterator](): JavascriptIterator<T>;
2415
+ }
2416
+
2417
+ declare class InMemoryCharacterWriteStream extends CharacterWriteStream {
2418
+ private writtenText;
2419
+ private newlineSequence;
2420
+ private constructor();
2421
+ static create(): InMemoryCharacterWriteStream;
2422
+ getNewlineSequence(): string;
2423
+ setNewlineSequence(newlineSequence: string): this;
2424
+ getWrittenText(): string;
2425
+ clearWrittenText(): this;
2426
+ writeString(text: string): SyncResult<number>;
2427
+ writeLine(text?: string): SyncResult<number>;
2428
+ }
2429
+
2430
+ /**
2431
+ * A JavaScript/TypeScript object that is used to iterate over a collection of values.
2432
+ */
2433
+ declare class IteratorToJavascriptIteratorAdapter<T> implements JavascriptIterator<T> {
2434
+ private readonly iterator;
2435
+ private hasStarted;
2436
+ private constructor();
2437
+ static create<T>(iterator: Iterator$1<T>): IteratorToJavascriptIteratorAdapter<T>;
2438
+ next(): JavascriptIteratorResult<T>;
2439
+ }
2440
+
2441
+ declare class JavascriptArrayList<T> implements List<T> {
2442
+ private readonly array;
2443
+ private constructor();
2444
+ static create<T>(values?: JavascriptIterable<T>): JavascriptArrayList<T>;
2445
+ set(index: number, value: T): this;
2446
+ iterate(): Iterator$1<T>;
2447
+ getCount(): SyncResult<number>;
2448
+ get(index: number): SyncResult<T>;
2449
+ insert(index: number, value: T): this;
2450
+ insertAll(index: number, values: JavascriptIterable<T>): this;
2451
+ removeAt(index: number): SyncResult<T>;
2452
+ removeFirst(): SyncResult<T>;
2453
+ removeLast(): SyncResult<T>;
2454
+ add(value: T): this;
2455
+ addAll(values: JavascriptIterable<T>): this;
2456
+ remove(value: T, equalFunctions?: EqualFunctions): SyncResult<T>;
2457
+ toArray(): SyncResult<T[]>;
2458
+ any(): SyncResult<boolean>;
2459
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2460
+ toString(toStringFunctions?: ToStringFunctions): string;
2461
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
2462
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2463
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2464
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
2465
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
2466
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2467
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2468
+ [Symbol.iterator](): JavascriptIterator<T>;
2469
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2470
+ }
2471
+
2472
+ declare class JavascriptAsyncIteratorToAsyncIteratorAdapter<T> implements AsyncIterator$1<T> {
2473
+ private readonly javascriptIterator;
2474
+ private javascriptIteratorResult?;
2475
+ private constructor();
2476
+ static create<T>(javascriptIterator: JavascriptAsyncIterator<T> | JavascriptAsyncIterable<T>): JavascriptAsyncIteratorToAsyncIteratorAdapter<T>;
2477
+ next(): PromiseAsyncResult<boolean>;
2478
+ hasStarted(): boolean;
2479
+ hasCurrent(): boolean;
2480
+ getCurrent(): T;
2481
+ start(): PromiseAsyncResult<this>;
2482
+ takeCurrent(): PromiseAsyncResult<T>;
2483
+ any(): PromiseAsyncResult<boolean>;
2484
+ getCount(): PromiseAsyncResult<number>;
2485
+ toArray(): PromiseAsyncResult<T[]>;
2486
+ map<TOutput>(mapping: (value: T) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
2487
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<T>;
2488
+ first(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
2489
+ last(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
2490
+ where(condition: (value: T) => (boolean | PromiseLike<boolean>)): AsyncIterator$1<T>;
2491
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): AsyncIterator$1<U>;
2492
+ whereInstanceOfType<U extends T>(type: Type<U>): AsyncIterator$1<U>;
2493
+ take(maximumToTake: number): AsyncIterator$1<T>;
2494
+ skip(maximumToSkip: number): AsyncIterator$1<T>;
2495
+ }
2496
+
2497
+ declare class JavascriptIteratorToIteratorAdapter<T> implements Iterator$1<T> {
2498
+ private readonly javascriptIterator;
2499
+ private javascriptIteratorResult?;
2500
+ private constructor();
2501
+ static create<T>(javascriptIterator: JavascriptIterator<T> | JavascriptIterable<T>): JavascriptIteratorToIteratorAdapter<T>;
2502
+ next(): SyncResult<boolean>;
2503
+ hasStarted(): boolean;
2504
+ hasCurrent(): boolean;
2505
+ getCurrent(): T;
2506
+ start(): SyncResult<this>;
2507
+ takeCurrent(): SyncResult<T>;
2508
+ any(): SyncResult<boolean>;
2509
+ getCount(): SyncResult<number>;
2510
+ toArray(): SyncResult<T[]>;
2511
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
2512
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
2513
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
2514
+ [Symbol.iterator](): JavascriptIterator<T>;
2515
+ first(condition?: (value: T) => boolean): SyncResult<T>;
2516
+ last(): SyncResult<T>;
2517
+ where(condition: (value: T) => boolean): Iterator$1<T>;
2518
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
2519
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
2520
+ take(maximumToTake: number): Iterator$1<T>;
2521
+ skip(maximumToSkip: number): Iterator$1<T>;
2522
+ }
2523
+
2524
+ /**
2525
+ * Get whether the provided value is {@link Map}.
2526
+ * @param value The value to check.
2527
+ */
2528
+ declare function isMutableMap(value: unknown): value is MutableMap<unknown, unknown>;
2529
+ /**
2530
+ * A type that maps {@link TKey} values to {@link TValue} values.
2531
+ */
2532
+ declare abstract class MutableMap<TKey, TValue> implements Map$1<TKey, TValue> {
2533
+ /**
2534
+ * Create a new instance of the default {@link Map} implementation.
2535
+ */
2536
+ static create<TKey, TValue>(): MutableMap<TKey, TValue>;
2537
+ /**
2538
+ * Iterate over the entries in this {@link MutableMap}.
2539
+ */
2540
+ abstract iterate(): Iterator$1<MapEntry<TKey, TValue>>;
2541
+ any(): SyncResult<boolean>;
2542
+ static any<TKey, TValue>(map: MutableMap<TKey, TValue>): SyncResult<boolean>;
2543
+ toArray(): SyncResult<MapEntry<TKey, TValue>[]>;
2544
+ static toArray<TKey, TValue>(map: MutableMap<TKey, TValue>): SyncResult<MapEntry<TKey, TValue>[]>;
2545
+ equals(right: Iterable$1<MapEntry<TKey, TValue>>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2546
+ static equals<TKey, TValue>(left: MutableMap<TKey, TValue>, right: Iterable$1<MapEntry<TKey, TValue>>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2547
+ /**
2548
+ * Get the {@link String} representation of this {@link MutableMap}.
2549
+ */
2550
+ toString(toStringFunctions?: ToStringFunctions): string;
2551
+ /**
2552
+ * Get the {@link String} representation of the provided {@link MutableMap}.
2553
+ */
2554
+ static toString<TKey, TValue>(map: MutableMap<TKey, TValue>, toStringFunctions?: ToStringFunctions): string;
2555
+ concatenate(...toConcatenate: JavascriptIterable<MapEntry<TKey, TValue>>[]): Iterable$1<MapEntry<TKey, TValue>>;
2556
+ static concatenate<TKey, TValue>(map: MutableMap<TKey, TValue>, ...toConcatenate: JavascriptIterable<MapEntry<TKey, TValue>>[]): Iterable$1<MapEntry<TKey, TValue>>;
2557
+ map<TOutput>(mapping: (value: MapEntry<TKey, TValue>) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2558
+ static map<TKey, TValue, TOutput>(map: MutableMap<TKey, TValue>, mapping: (value: MapEntry<TKey, TValue>) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2559
+ flatMap<TOutput>(mapping: (value: MapEntry<TKey, TValue>) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2560
+ static flatMap<TKey, TValue, TOutput>(map: MutableMap<TKey, TValue>, mapping: (value: MapEntry<TKey, TValue>) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2561
+ where(condition: (value: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): Iterable$1<MapEntry<TKey, TValue>>;
2562
+ static where<TKey, TValue>(map: MutableMap<TKey, TValue>, condition: (value: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): Iterable$1<MapEntry<TKey, TValue>>;
2563
+ instanceOf<T extends MapEntry<TKey, TValue>>(typeOrTypeCheck: Type<T> | ((value: MapEntry<TKey, TValue>) => value is T)): Iterable$1<T>;
2564
+ static instanceOf<TKey, TValue, T extends MapEntry<TKey, TValue>>(map: MutableMap<TKey, TValue>, typeOrTypeCheck: Type<T> | ((value: MapEntry<TKey, TValue>) => value is T)): Iterable$1<T>;
2565
+ [Symbol.iterator](): JavascriptIterator<MapEntry<TKey, TValue>>;
2566
+ static [Symbol.iterator]<TKey, TValue>(map: MutableMap<TKey, TValue>): JavascriptIterator<MapEntry<TKey, TValue>>;
2567
+ /**
2568
+ * Get the number of entries in this {@link MutableMap}.
2569
+ */
2570
+ getCount(): SyncResult<number>;
2571
+ static getCount<TKey, TValue>(map: MutableMap<TKey, TValue>): SyncResult<number>;
2572
+ first(condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2573
+ static first<TKey, TValue>(map: MutableMap<TKey, TValue>, condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2574
+ last(condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2575
+ static last<TKey, TValue>(map: MutableMap<TKey, TValue>, condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2576
+ /**
2577
+ * Get whether this {@link MutableMap} contains the provided key.
2578
+ * @param key The key to look for.
2579
+ */
2580
+ abstract containsKey(key: TKey): SyncResult<boolean>;
2581
+ /**
2582
+ * Get the value associated with the provided key.
2583
+ * @param key The key of the value to get.
2584
+ */
2585
+ abstract get(key: TKey): SyncResult<TValue>;
2586
+ /**
2587
+ * Set the key/value association in this {@link MutableMap}.
2588
+ * @param key The key associated with the value.
2589
+ * @param value The value associated with the key.
2590
+ */
2591
+ abstract set(key: TKey, value: TValue): this;
2592
+ /**
2593
+ * Get the {@link TValue} associated with the provided {@link TKey}. If the provided
2594
+ * {@link TKey} doesn't exist in this {@link MutableMap}, then invoke the provided {@link valueCreator}
2595
+ * and associate the returned {@link TValue} with the provided {@link TKey}. Then return the new
2596
+ * {@link TValue}.
2597
+ * @param key The {@link TKey} of the {@link TValue} to get.
2598
+ * @param valueCreator The {@link Function} that will be invoked if the {@link TKey} doesn't
2599
+ * exist in this {@link MutableMap}.
2600
+ */
2601
+ getOrSet(key: TKey, valueCreator: () => (TValue | SyncResult<TValue>)): SyncResult<TValue>;
2602
+ /**
2603
+ * Get the {@link TValue} associated with the provided {@link TKey}. If the provided
2604
+ * {@link TKey} doesn't exist in the {@link MutableMap}, then invoke the provided {@link valueCreator}
2605
+ * and associate the returned {@link TValue} with the provided {@link TKey}. Then return the new
2606
+ * {@link TValue}.
2607
+ * @param key The {@link TKey} of the {@link TValue} to get.
2608
+ * @param valueCreator The {@link Function} that will be invoked if the {@link TKey} doesn't
2609
+ * exist in this {@link MutableMap}.
2610
+ */
2611
+ static getOrSet<TKey, TValue>(map: MutableMap<TKey, TValue>, key: TKey, valueCreator: () => (TValue | SyncResult<TValue>)): SyncResult<TValue>;
2612
+ /**
2613
+ * Remove the provided {@link TKey} from this {@link MutableMap}. If the {@link TKey} doesn't exist in
2614
+ * this {@link MutableMap}, then return a {@link NotFoundError}. If the {@link TKey} does exist, then
2615
+ * return the {@link TValue} that was associated with it.
2616
+ * @param key The {@link TKey} to remove from this {@link MutableMap}.
2617
+ */
2618
+ abstract remove(key: TKey): SyncResult<TValue>;
2619
+ /**
2620
+ * Iterate over the keys in this {@link MutableMap}.
2621
+ */
2622
+ iterateKeys(): Iterator$1<TKey>;
2623
+ /**
2624
+ * Iterate over the keys in the {@link MutableMap}.
2625
+ * @param map The map to iterate over.
2626
+ */
2627
+ static iterateKeys<TKey, TValue>(map: MutableMap<TKey, TValue>): Iterator$1<TKey>;
2628
+ /**
2629
+ * Iterate over the values in this {@link MutableMap}.
2630
+ */
2631
+ iterateValues(): Iterator$1<TValue>;
2632
+ /**
2633
+ * Iterate over the keys in the {@link MutableMap}.
2634
+ * @param map The map to iterate over.
2635
+ */
2636
+ static iterateValues<TKey, TValue>(map: MutableMap<TKey, TValue>): Iterator$1<TValue>;
2637
+ contains(value: MapEntry<TKey, TValue>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2638
+ static contains<TKey, TValue>(map: MutableMap<TKey, TValue>, value: MapEntry<TKey, TValue>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2639
+ }
2640
+
2641
+ /**
2642
+ * Get whether the provided value is {@link Map}.
2643
+ * @param value The value to check.
2644
+ */
2645
+ declare function isMap(value: unknown): value is Map$1<unknown, unknown>;
2646
+ /**
2647
+ * An entry within a {@link Map}.
2648
+ */
2649
+ interface MapEntry<TKey, TValue> {
2650
+ /**
2651
+ * The key of the {@link MapEntry}.
2652
+ */
2653
+ readonly key: TKey;
2654
+ /**
2655
+ * The value of the {@link MapEntry}.
2656
+ */
2657
+ readonly value: TValue;
2658
+ }
2659
+ /**
2660
+ * A type that maps {@link TKey} values to {@link TValue} values.
2661
+ */
2662
+ declare abstract class Map$1<TKey, TValue> implements Iterable$1<MapEntry<TKey, TValue>> {
2663
+ /**
2664
+ * Create a new instance of the default {@link MutableMap} implementation.
2665
+ */
2666
+ static create<TKey, TValue>(): MutableMap<TKey, TValue>;
2667
+ /**
2668
+ * Iterate over the entries in this {@link Map}.
2669
+ */
2670
+ abstract iterate(): Iterator$1<MapEntry<TKey, TValue>>;
2671
+ any(): SyncResult<boolean>;
2672
+ static any<TKey, TValue>(map: Map$1<TKey, TValue>): SyncResult<boolean>;
2673
+ toArray(): SyncResult<MapEntry<TKey, TValue>[]>;
2674
+ static toArray<TKey, TValue>(map: Map$1<TKey, TValue>): SyncResult<MapEntry<TKey, TValue>[]>;
2675
+ equals(right: Iterable$1<MapEntry<TKey, TValue>>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2676
+ static equals<TKey, TValue>(left: Map$1<TKey, TValue>, right: Iterable$1<MapEntry<TKey, TValue>>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2677
+ /**
2678
+ * Get the {@link String} representation of this {@link Map}.
2679
+ */
2680
+ toString(toStringFunctions?: ToStringFunctions): string;
2681
+ /**
2682
+ * Get the {@link String} representation of the provided {@link Map}.
2683
+ */
2684
+ static toString<TKey, TValue>(map: Map$1<TKey, TValue>, toStringFunctions?: ToStringFunctions): string;
2685
+ concatenate(...toConcatenate: JavascriptIterable<MapEntry<TKey, TValue>>[]): Iterable$1<MapEntry<TKey, TValue>>;
2686
+ static concatenate<TKey, TValue>(map: Map$1<TKey, TValue>, ...toConcatenate: JavascriptIterable<MapEntry<TKey, TValue>>[]): Iterable$1<MapEntry<TKey, TValue>>;
2687
+ map<TOutput>(mapping: (value: MapEntry<TKey, TValue>) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2688
+ static map<TKey, TValue, TOutput>(map: Map$1<TKey, TValue>, mapping: (value: MapEntry<TKey, TValue>) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2689
+ flatMap<TOutput>(mapping: (value: MapEntry<TKey, TValue>) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2690
+ static flatMap<TKey, TValue, TOutput>(map: Map$1<TKey, TValue>, mapping: (value: MapEntry<TKey, TValue>) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2691
+ where(condition: (value: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): Iterable$1<MapEntry<TKey, TValue>>;
2692
+ static where<TKey, TValue>(map: Map$1<TKey, TValue>, condition: (value: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): Iterable$1<MapEntry<TKey, TValue>>;
2693
+ instanceOf<T extends MapEntry<TKey, TValue>>(typeOrTypeCheck: Type<T> | ((value: MapEntry<TKey, TValue>) => value is T)): Iterable$1<T>;
2694
+ static instanceOf<TKey, TValue, T extends MapEntry<TKey, TValue>>(map: Map$1<TKey, TValue>, typeOrTypeCheck: Type<T> | ((value: MapEntry<TKey, TValue>) => value is T)): Iterable$1<T>;
2695
+ [Symbol.iterator](): JavascriptIterator<MapEntry<TKey, TValue>>;
2696
+ static [Symbol.iterator]<TKey, TValue>(map: Map$1<TKey, TValue>): JavascriptIterator<MapEntry<TKey, TValue>>;
2697
+ /**
2698
+ * Get the number of entries in this {@link Map}.
2699
+ */
2700
+ getCount(): SyncResult<number>;
2701
+ static getCount<TKey, TValue>(map: Map$1<TKey, TValue>): SyncResult<number>;
2702
+ first(condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2703
+ static first<TKey, TValue>(map: Map$1<TKey, TValue>, condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2704
+ last(condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2705
+ static last<TKey, TValue>(map: Map$1<TKey, TValue>, condition?: (entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): SyncResult<MapEntry<TKey, TValue>>;
2706
+ /**
2707
+ * Get whether this {@link Map} contains the provided key.
2708
+ * @param key The key to look for.
2709
+ */
2710
+ abstract containsKey(key: TKey): SyncResult<boolean>;
2711
+ /**
2712
+ * Get the value associated with the provided key.
2713
+ * @param key The key of the value to get.
2714
+ */
2715
+ abstract get(key: TKey): SyncResult<TValue>;
2716
+ /**
2717
+ * Iterate over the keys in this {@link Map}.
2718
+ */
2719
+ iterateKeys(): Iterator$1<TKey>;
2720
+ /**
2721
+ * Iterate over the keys in the {@link Map}.
2722
+ * @param map The map to iterate over.
2723
+ */
2724
+ static iterateKeys<TKey, TValue>(map: Map$1<TKey, TValue>): Iterator$1<TKey>;
2725
+ /**
2726
+ * Iterate over the values in this {@link Map}.
2727
+ */
2728
+ iterateValues(): Iterator$1<TValue>;
2729
+ /**
2730
+ * Iterate over the keys in the {@link Map}.
2731
+ * @param map The map to iterate over.
2732
+ */
2733
+ static iterateValues<TKey, TValue>(map: Map$1<TKey, TValue>): Iterator$1<TValue>;
2734
+ contains(value: MapEntry<TKey, TValue>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2735
+ static contains<TKey, TValue>(map: Map$1<TKey, TValue>, value: MapEntry<TKey, TValue>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2736
+ }
2737
+
2738
+ declare class JavascriptMapMap<TKey, TValue> implements MutableMap<TKey, TValue> {
2739
+ private readonly javascriptMap;
2740
+ private constructor();
2741
+ static create<TKey, TValue>(): JavascriptMapMap<TKey, TValue>;
2742
+ any(): SyncResult<boolean>;
2743
+ getCount(): SyncResult<number>;
2744
+ containsKey(key: TKey): SyncResult<boolean>;
2745
+ get(key: TKey): SyncResult<TValue>;
2746
+ set(key: TKey, value: TValue): this;
2747
+ remove(key: TKey): SyncResult<TValue>;
2748
+ iterate(): Iterator$1<MapEntry<TKey, TValue>>;
2749
+ iterateKeys(): Iterator$1<TKey>;
2750
+ iterateValues(): Iterator$1<TValue>;
2751
+ toArray(): SyncResult<MapEntry<TKey, TValue>[]>;
2752
+ equals(right: Iterable$1<MapEntry<TKey, TValue>>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2753
+ toString(toStringFunctions?: ToStringFunctions): string;
2754
+ concatenate(...toConcatenate: JavascriptIterable<MapEntry<TKey, TValue>>[]): Iterable$1<MapEntry<TKey, TValue>>;
2755
+ map<TOutput>(mapping: (value: MapEntry<TKey, TValue>) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2756
+ flatMap<TOutput>(mapping: (value: MapEntry<TKey, TValue>) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2757
+ where(condition: (value: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)): Iterable$1<MapEntry<TKey, TValue>>;
2758
+ instanceOf<T extends MapEntry<TKey, TValue>>(typeOrTypeCheck: Type<T> | ((value: MapEntry<TKey, TValue>) => value is T)): Iterable$1<T>;
2759
+ first(condition?: ((entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<MapEntry<TKey, TValue>>;
2760
+ last(condition?: ((entry: MapEntry<TKey, TValue>) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<MapEntry<TKey, TValue>>;
2761
+ getOrSet(key: TKey, valueCreator: () => TValue | SyncResult<TValue>): SyncResult<TValue>;
2762
+ [Symbol.iterator](): JavascriptIterator<MapEntry<TKey, TValue>>;
2763
+ contains(value: MapEntry<TKey, TValue>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2764
+ }
2765
+
2766
+ /**
2767
+ * Get whether the provided value is a {@link Set}.
2768
+ * @param value The value to check.
2769
+ */
2770
+ declare function isSet(value: unknown): value is Set$1<unknown>;
2771
+ declare abstract class Set$1<T> implements Iterable$1<T> {
2772
+ static create<T>(initialValues?: JavascriptIterable<T>): JavascriptSetSet<T>;
2773
+ /**
2774
+ * Add the provided value to this {@link Set}.
2775
+ * @param value The value to add to this {@link Set}.
2776
+ */
2777
+ abstract add(value: T): this;
2778
+ addAll(values: JavascriptIterable<T>): this;
2779
+ static addAll<T, TSet extends Set$1<T>>(set: TSet, values: JavascriptIterable<T>): TSet;
2780
+ /**
2781
+ * Remove the provided value from this {@link Set}. Return a {@link NotFoundError} if the value
2782
+ * is not found.
2783
+ * @param value The value to remove.
2784
+ */
2785
+ abstract remove(value: T): SyncResult<void>;
2786
+ abstract iterate(): Iterator$1<T>;
2787
+ union(values: JavascriptIterable<T>): Set$1<T>;
2788
+ static union<T>(set: Set$1<T>, values: JavascriptIterable<T>): Set$1<T>;
2789
+ toArray(): SyncResult<T[]>;
2790
+ static toArray<T>(set: Set$1<T>): SyncResult<T[]>;
2791
+ any(): SyncResult<boolean>;
2792
+ static any<T>(set: Set$1<T>): SyncResult<boolean>;
2793
+ getCount(): SyncResult<number>;
2794
+ static getCount<T>(set: Set$1<T>): SyncResult<number>;
2795
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2796
+ static equals<T>(left: Set$1<T>, right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2797
+ static equalSet<T>(left: Set$1<T>, right: Set$1<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2798
+ toString(toStringFunctions?: ToStringFunctions): string;
2799
+ static toString<T>(set: Set$1<T>, toStringFunctions?: ToStringFunctions): string;
2800
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
2801
+ static concatenate<T>(set: Set$1<T>, ...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
2802
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2803
+ static map<TInput, TOutput>(set: Set$1<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
2804
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2805
+ static flatMap<TInput, TOutput>(set: Set$1<TInput>, mapping: (value: TInput) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2806
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
2807
+ static where<T>(set: Set$1<T>, condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
2808
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
2809
+ static instanceOf<TInput, TOutput extends TInput>(set: Set$1<TInput>, typeOrTypeCheck: Type<TOutput> | ((value: TInput) => value is TOutput)): Iterable$1<TOutput>;
2810
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2811
+ static first<T>(set: Set$1<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
2812
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2813
+ static last<T>(set: Set$1<T>, condition?: (value: T) => (boolean | SyncResult<boolean>)): SyncResult<T>;
2814
+ [Symbol.iterator](): JavascriptIterator<T>;
2815
+ static [Symbol.iterator]<T>(set: Set$1<T>): JavascriptIterator<T>;
2816
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2817
+ static contains<T>(set: Set$1<T>, value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2818
+ }
2819
+
2820
+ declare class JavascriptSetSet<T> implements Set$1<T> {
2821
+ private readonly set;
2822
+ private constructor();
2823
+ static create<T>(initialValues?: JavascriptIterable<T>): JavascriptSetSet<T>;
2824
+ add(value: T): this;
2825
+ addAll(values: JavascriptIterable<T>): this;
2826
+ remove(value: T): SyncResult<void>;
2827
+ union(values: JavascriptIterable<T>): Set$1<T>;
2828
+ iterate(): Iterator$1<T>;
2829
+ toArray(): SyncResult<T[]>;
2830
+ any(): SyncResult<boolean>;
2831
+ getCount(): SyncResult<number>;
2832
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2833
+ toString(toStringFunctions?: ToStringFunctions): string;
2834
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
2835
+ map<TOutput>(mapping: (value: T) => TOutput | SyncResult<TOutput>): Iterable$1<TOutput>;
2836
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
2837
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
2838
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
2839
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2840
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
2841
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2842
+ [Symbol.iterator](): JavascriptIterator<T>;
2843
+ }
2844
+
2845
+ /**
2846
+ * A data structure that stores values in a first-in-first-out order.
2847
+ */
2848
+ declare abstract class Queue<T> {
2849
+ /**
2850
+ * Create an instance of the default {@link Queue} implementation.
2851
+ * @returns A new {@link Queue} object.
2852
+ */
2853
+ static create<T>(): ListQueue<T>;
2854
+ /**
2855
+ * Get whether there are any values in this {@link Stack}.
2856
+ */
2857
+ abstract any(): AsyncResult<boolean>;
2858
+ /**
2859
+ * Add the provided value onto the end of this {@link Queue}.
2860
+ * @param value The value to add to the end of this {@link Queue}.
2861
+ */
2862
+ abstract add(value: T): AsyncResult<void>;
2863
+ /**
2864
+ * Add the provided values to the end of this {@link Queue}.
2865
+ * @param values The values to add to the end of this {@link Queue}.
2866
+ */
2867
+ abstract addAll(values: JavascriptIterable<T>): AsyncResult<void>;
2868
+ /**
2869
+ * Remove the next value off of this {@link Queue}.
2870
+ */
2871
+ abstract remove(): AsyncResult<T>;
2872
+ /**
2873
+ * Get whether this {@link Stack} contains the provided value.
2874
+ * @param value The value to look for.
2875
+ * @param equalFunctions The functions to use to compare values.
2876
+ */
2877
+ abstract contains(value: T, equalFunctions?: EqualFunctions): AsyncResult<boolean>;
2878
+ }
2879
+
2880
+ declare class ListQueue<T> implements Queue<T> {
2881
+ private readonly list;
2882
+ private constructor();
2883
+ static create<T>(list?: List<T>): ListQueue<T>;
2884
+ any(): SyncResult<boolean>;
2885
+ add(value: T): SyncResult<void>;
2886
+ addAll(values: JavascriptIterable<T>): SyncResult<void>;
2887
+ remove(): SyncResult<T>;
2888
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2889
+ }
2890
+
2891
+ /**
2892
+ * A data structure that stores values in a first-in-last-out order.
2893
+ */
2894
+ declare abstract class Stack<T> {
2895
+ /**
2896
+ * Create an instance of the default {@link Stack} implementation.
2897
+ * @returns A new {@link Stack} object.
2898
+ */
2899
+ static create<T>(): ListStack<T>;
2900
+ /**
2901
+ * Get whether there are any values in this {@link Stack}.
2902
+ */
2903
+ abstract any(): AsyncResult<boolean>;
2904
+ /**
2905
+ * Push the provided value onto the top of this {@link Stack}.
2906
+ * @param value The value to push on the top of this {@link Stack}.
2907
+ */
2908
+ abstract add(value: T): AsyncResult<void>;
2909
+ /**
2910
+ * Push the provided values onto the top of this {@link Stack}.
2911
+ * @param values The values to push onto this {@link Stack}.
2912
+ */
2913
+ abstract addAll(values: JavascriptIterable<T>): AsyncResult<void>;
2914
+ /**
2915
+ * Remove the top value off of this {@link Stack}.
2916
+ */
2917
+ abstract remove(): AsyncResult<T>;
2918
+ /**
2919
+ * Get whether this {@link Stack} contains the provided value.
2920
+ * @param value The value to look for.
2921
+ * @param equalFunctions The functions to use to compare values.
2922
+ */
2923
+ abstract contains(value: T, equalFunctions?: EqualFunctions): AsyncResult<boolean>;
2924
+ }
2925
+
2926
+ declare class ListStack<T> implements Stack<T> {
2927
+ private readonly list;
2928
+ private constructor();
2929
+ static create<T>(list?: List<T>): ListStack<T>;
2930
+ any(): SyncResult<boolean>;
2931
+ add(value: T): SyncResult<void>;
2932
+ addAll(values: JavascriptIterable<T>): SyncResult<void>;
2933
+ remove(): SyncResult<T>;
2934
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
2935
+ }
2936
+
2937
+ declare class LuxonDateTime implements DateTime {
2938
+ private readonly dateTime;
2939
+ private constructor();
2940
+ private static create;
2941
+ static parse(text: string): LuxonDateTime;
2942
+ static now(): LuxonDateTime;
2943
+ getYear(): number;
2944
+ getMonth(): number;
2945
+ getDay(): number;
2946
+ getHour(): number;
2947
+ getMinute(): number;
2948
+ getSecond(): number;
2949
+ addDays(days: number): LuxonDateTime;
2950
+ toString(): string;
2951
+ toDateString(): string;
2952
+ compareTo(dateTime: DateTime, compareTimes: boolean): number;
2953
+ lessThan(dateTime: DateTime, compareTimes: boolean): boolean;
2954
+ lessThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
2955
+ equals(dateTime: DateTime, compareTimes: boolean): boolean;
2956
+ greaterThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
2957
+ greaterThan(dateTime: DateTime, compareTimes: boolean): boolean;
2958
+ get debug(): string;
2959
+ }
2960
+
2961
+ /**
2962
+ * An {@link AsyncIterator} that maps {@link TInput} values to {@link TOutput} values.
2963
+ */
2964
+ declare class MapAsyncIterator<TInput, TOutput> implements AsyncIterator$1<TOutput> {
2965
+ private readonly inputIterator;
2966
+ private readonly mapping;
2967
+ private current;
2968
+ private started;
2969
+ protected constructor(inputIterator: AsyncIterator$1<TInput>, mapping: (value: TInput) => (TOutput | PromiseLike<TOutput>));
2970
+ static create<TInput, TOutput>(inputIterator: AsyncIterator$1<TInput>, mapping: (value: TInput) => (TOutput | PromiseLike<TOutput>)): MapAsyncIterator<TInput, TOutput>;
2971
+ next(): PromiseAsyncResult<boolean>;
2972
+ hasStarted(): boolean;
2973
+ hasCurrent(): boolean;
2974
+ getCurrent(): TOutput;
2975
+ start(): PromiseAsyncResult<this>;
2976
+ takeCurrent(): PromiseAsyncResult<TOutput>;
2977
+ any(): PromiseAsyncResult<boolean>;
2978
+ getCount(): PromiseAsyncResult<number>;
2979
+ toArray(): PromiseAsyncResult<TOutput[]>;
2980
+ map<TOutput2>(mapping: (value: TOutput) => (TOutput2 | PromiseLike<TOutput2>)): AsyncIterator$1<TOutput2>;
2981
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<TOutput>;
2982
+ first(condition?: (value: TOutput) => boolean): PromiseAsyncResult<TOutput>;
2983
+ last(): PromiseAsyncResult<TOutput>;
2984
+ where(condition: (value: TOutput) => (boolean | PromiseLike<boolean>)): AsyncIterator$1<TOutput>;
2985
+ whereInstanceOf<U extends TOutput>(typeCheck: (value: TOutput) => value is U): AsyncIterator$1<U>;
2986
+ whereInstanceOfType<U extends TOutput>(type: Type<U>): AsyncIterator$1<U>;
2987
+ take(maximumToTake: number): AsyncIterator$1<TOutput>;
2988
+ skip(maximumToSkip: number): AsyncIterator$1<TOutput>;
2989
+ }
2990
+
2991
+ /**
2992
+ * An {@link Iterable} that converts {@link TInput} values to {@link TOutput} values.
2993
+ */
2994
+ declare class MapIterable<TInput, TOutput> implements Iterable$1<TOutput> {
2995
+ private readonly innerIterable;
2996
+ private readonly mapping;
2997
+ protected constructor(innerIterable: Iterable$1<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>));
2998
+ static create<TInput, TOutput>(innerIterable: Iterable$1<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>)): MapIterable<TInput, TOutput>;
2999
+ iterate(): Iterator$1<TOutput>;
3000
+ toArray(): SyncResult<TOutput[]>;
3001
+ equals(right: Iterable$1<TOutput>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
3002
+ toString(): string;
3003
+ concatenate(...toConcatenate: JavascriptIterable<TOutput>[]): Iterable$1<TOutput>;
3004
+ map<TOutput2>(mapping: (value: TOutput) => (TOutput2 | SyncResult<TOutput2>)): Iterable$1<TOutput2>;
3005
+ flatMap<TOutput2>(mapping: (value: TOutput) => JavascriptIterable<TOutput2>): Iterable$1<TOutput2>;
3006
+ where(condition: (value: TOutput) => boolean): Iterable$1<TOutput>;
3007
+ instanceOf<TOutput2 extends TOutput>(typeOrTypeCheck: Type<TOutput2> | ((value: TOutput) => value is TOutput2)): Iterable$1<TOutput2>;
3008
+ [Symbol.iterator](): JavascriptIterator<TOutput>;
3009
+ any(): SyncResult<boolean>;
3010
+ getCount(): SyncResult<number>;
3011
+ first(): SyncResult<TOutput>;
3012
+ last(): SyncResult<TOutput>;
3013
+ contains(value: TOutput, equalFunctions?: EqualFunctions): SyncResult<boolean>;
3014
+ }
3015
+
3016
+ /**
3017
+ * An {@link Iterator} that maps {@link TInput} values to {@link TOutput} values.
3018
+ */
3019
+ declare class MapIterator<TInput, TOutput> implements Iterator$1<TOutput> {
3020
+ private readonly inputIterator;
3021
+ private readonly mapping;
3022
+ private started;
3023
+ protected constructor(inputIterator: Iterator$1<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>));
3024
+ static create<TInput, TOutput>(inputIterator: Iterator$1<TInput>, mapping: (value: TInput) => (TOutput | SyncResult<TOutput>)): MapIterator<TInput, TOutput>;
3025
+ next(): SyncResult<boolean>;
3026
+ hasStarted(): boolean;
3027
+ hasCurrent(): boolean;
3028
+ getCurrent(): TOutput;
3029
+ start(): SyncResult<this>;
3030
+ takeCurrent(): SyncResult<TOutput>;
3031
+ any(): SyncResult<boolean>;
3032
+ getCount(): SyncResult<number>;
3033
+ toArray(): SyncResult<TOutput[]>;
3034
+ concatenate(toConcatenate: JavascriptIterable<TOutput>): Iterator$1<TOutput>;
3035
+ map<TOutput2>(mapping: (value: TOutput) => (TOutput2 | SyncResult<TOutput2>)): Iterator$1<TOutput2>;
3036
+ flatMap<TOutput2>(mapping: (value: TOutput) => JavascriptIterable<TOutput2>): Iterator$1<TOutput2>;
3037
+ [Symbol.iterator](): JavascriptIterator<TOutput>;
3038
+ first(condition?: (value: TOutput) => boolean): SyncResult<TOutput>;
3039
+ last(): SyncResult<TOutput>;
3040
+ where(condition: (value: TOutput) => boolean): Iterator$1<TOutput>;
3041
+ whereInstanceOf<U extends TOutput>(typeCheck: (value: TOutput) => value is U): Iterator$1<U>;
3042
+ whereInstanceOfType<U extends TOutput>(type: Type<U>): Iterator$1<U>;
3043
+ take(maximumToTake: number): Iterator$1<TOutput>;
3044
+ skip(maximumToSkip: number): Iterator$1<TOutput>;
3045
+ }
3046
+
3047
+ declare class Node<T> {
3048
+ private readonly value;
3049
+ private connectedNodes;
3050
+ private constructor();
3051
+ static create<T>(value: T): Node<T>;
3052
+ getValue(): T;
3053
+ iterateConnectedNodes(): Iterator$1<Node<T>>;
3054
+ addConnectedNode(node: Node<T>): void;
3055
+ }
3056
+
3057
+ declare class NodeJSCharacterWriteStream extends CharacterWriteStream {
3058
+ private readonly nodeJSWriteStream;
3059
+ private constructor();
3060
+ static create(nodeJSWriteStream: NodeJS.WriteStream): NodeJSCharacterWriteStream;
3061
+ writeString(text: string): PromiseAsyncResult<number>;
3062
+ }
3063
+
3064
+ declare class NodeJSHttpIncomingRequest extends HttpIncomingRequest {
3065
+ private readonly request;
3066
+ private constructor();
3067
+ static create(request: http.IncomingMessage): NodeJSHttpIncomingRequest;
3068
+ getMethod(): HttpMethod;
3069
+ getHost(): SyncResult<string>;
3070
+ getURLPath(): string;
3071
+ private static toHttpHeader;
3072
+ private static toHttpHeaderValue;
3073
+ getHeaders(): SyncResult<HttpHeaders>;
3074
+ getHeader(headerName: string): SyncResult<HttpHeader>;
3075
+ getHeaderValue(headerName: string): SyncResult<string>;
3076
+ getBody(): SyncResult<string>;
3077
+ }
3078
+
3079
+ /**
3080
+ * A {@link HttpServer} implementation that uses the Node.js HTTP module.
3081
+ */
3082
+ declare class NodeJSHttpServer extends HttpServer {
3083
+ private httpServer;
3084
+ private disposed;
3085
+ private constructor();
3086
+ static create(): NodeJSHttpServer;
3087
+ dispose(): PromiseAsyncResult<boolean>;
3088
+ isDisposed(): boolean;
3089
+ isStarted(): boolean;
3090
+ addRequestHandler(requestPath: string, handler: (request: HttpIncomingRequest, response: HttpOutgoingResponse) => AsyncResult<void>): void;
3091
+ setDefaultRequestHandler(handler: (request: HttpIncomingRequest, response: HttpOutgoingResponse) => AsyncResult<void>): void;
3092
+ start(portNumber: number): PromiseAsyncResult<void>;
3093
+ }
3094
+
3095
+ /**
3096
+ * An {@link Error} that is thrown when a value is not found.
3097
+ */
3098
+ declare class NotFoundError extends Error {
3099
+ constructor(...message: string[]);
3100
+ }
3101
+
3102
+ /**
3103
+ * A type that encapsulates conditions that should exist before an operation takes place.
3104
+ */
3105
+ declare abstract class PostCondition {
3106
+ private static condition;
3107
+ private static getCondition;
3108
+ /**
3109
+ * Assert that the provided value is undefined.
3110
+ * @param value The value to check.
3111
+ * @param expression The name of the expression that produced the value.
3112
+ * @param message An additional message that will be included with the error.
3113
+ */
3114
+ static assertUndefined(value: unknown, expression?: string, message?: string): asserts value is undefined;
3115
+ /**
3116
+ * Assert that the provided value is not undefined and not null.
3117
+ * @param value The value to check.
3118
+ * @param expression The name of the expression that produced the value.
3119
+ * @param message An additional message that will be included with the error.
3120
+ */
3121
+ static assertNotUndefined<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
3122
+ /**
3123
+ * Assert that the provided value is not undefined and not null.
3124
+ * @param value The value to check.
3125
+ * @param expression The name of the expression that produced the value.
3126
+ * @param message An additional message that will be included with the error.
3127
+ */
3128
+ static assertNotUndefinedAndNotNull<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
3129
+ /**
3130
+ * Assert that the provided value is true.
3131
+ * @param value The value to check.
3132
+ * @param expression The name of the expression that produced the value.
3133
+ * @param message An additional message that will be included with the error.
3134
+ */
3135
+ static assertTrue(value: boolean, expression?: string, message?: string): asserts value is true;
3136
+ /**
3137
+ * Assert that the provided value is false.
3138
+ * @param value The value to check.
3139
+ * @param expression The name of the expression that produced the value.
3140
+ * @param message An additional message that will be included with the error.
3141
+ */
3142
+ static assertFalse(value: boolean, expression?: string, message?: string): asserts value is false;
3143
+ /**
3144
+ * Assert that the provided actual value is the same as the provided expected value.
3145
+ * @param expected The expected value.
3146
+ * @param actual The actual value.
3147
+ * @param expression The expression that produced the actual value.
3148
+ * @param message An optional message that describes the scenario.
3149
+ */
3150
+ static assertSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
3151
+ /**
3152
+ * Assert that the provided actual value is not the same as the provided expected value.
3153
+ * @param expected The expected value.
3154
+ * @param actual The actual value.
3155
+ * @param expression The expression that produced the actual value.
3156
+ * @param message An optional message that describes the scenario.
3157
+ */
3158
+ static assertNotSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
3159
+ /**
3160
+ * Assert that the provided actual value is equal to the provided expected value.
3161
+ * @param expected The expected value.
3162
+ * @param actual The actual value.
3163
+ * @param expression The expression that produced the actual value.
3164
+ * @param message An optional message that describes the scenario.
3165
+ */
3166
+ static assertEqual<T>(expected: T, actual: T, expression?: string, message?: string): void;
3167
+ /**
3168
+ * Assert that the provided actual value is not equal to the provided expected value.
3169
+ * @param notExpected The not expected value.
3170
+ * @param actual The actual value.
3171
+ * @param expression The expression that produced the actual value.
3172
+ * @param message An optional message that describes the scenario.
3173
+ */
3174
+ static assertNotEqual<T>(notExpected: T, actual: T, expression?: string, message?: string): void;
3175
+ /**
3176
+ * Assert that the provided value is not empty.
3177
+ * @param value The value to check.
3178
+ * @param expression The expression that produced the actual value.
3179
+ * @param message An optional message that describes the scenario.
3180
+ */
3181
+ static assertNotEmpty(value: JavascriptIterable<unknown> | string | undefined | null, expression?: string, message?: string): void;
3182
+ /**
3183
+ * Assert that the provided value is less than the provided upperBound.
3184
+ * @param value The value to check.
3185
+ * @param upperBound The upperBound that the value must be less than.
3186
+ * @param expression The expression that produced the actual value.
3187
+ * @param message An optional message that describes the scenario.
3188
+ */
3189
+ static assertLessThan(value: number, upperBound: number, expression?: string, message?: string): void;
3190
+ /**
3191
+ * Assert that the provided value is less than or equal to the provided upperBound.
3192
+ * @param value The value to check.
3193
+ * @param upperBound The upperBound that the value must be less than.
3194
+ * @param expression The expression that produced the actual value.
3195
+ * @param message An optional message that describes the scenario.
3196
+ */
3197
+ static assertLessThanOrEqualTo(value: number, upperBound: number, expression?: string, message?: string): void;
3198
+ /**
3199
+ * Assert that the provided value is greater than or equal to the provided lowerBound.
3200
+ * @param value The value to check.
3201
+ * @param lowerBound The lowerBound that the value must be greater than or equal to.
3202
+ * @param expression The expression that produced the actual value.
3203
+ * @param message An optional message that describes the scenario.
3204
+ */
3205
+ static assertGreaterThanOrEqualTo(value: number, lowerBound: number, expression?: string, message?: string): void;
3206
+ /**
3207
+ * Assert that the provided value is greater than the provided lowerBound.
3208
+ * @param value The value to check.
3209
+ * @param lowerBound The lowerBound that the value must be greater than.
3210
+ * @param expression The expression that produced the actual value.
3211
+ * @param message An optional message that describes the scenario.
3212
+ */
3213
+ static assertGreaterThan(value: number, lowerBound: number, expression?: string, message?: string): void;
3214
+ /**
3215
+ * Assert that the value is greater than or equal to the lowerBound and less than or equal to
3216
+ * the upperBound.
3217
+ * @param lowerBound The lowerBound that the value must be greater than or equal to.
3218
+ * @param value The value to check.
3219
+ * @param upperBound The upperBound that the value must be less than or equal to.
3220
+ * @param expression The expression that produced the actual value.
3221
+ * @param message An optional message that describes the scenario.
3222
+ */
3223
+ static assertBetween(lowerBound: number, value: number, upperBound: number, expression?: string, message?: string): void;
3224
+ /**
3225
+ * Assert that the index is within the access bounds of an indexable with the provided count.
3226
+ * @param index The index to check.
3227
+ * @param count The number of elements in the indexable.
3228
+ * @param expression The expression that produced the actual value.
3229
+ * @param message An optional message that describes the scenario.
3230
+ */
3231
+ static assertAccessIndex(index: number, count: number, expression?: string, message?: string): void;
3232
+ /**
3233
+ * Assert that the index is within the insertion bounds of a {@link List} with the provided count.
3234
+ * @param index The index to check.
3235
+ * @param count The number of elements in the indexable.
3236
+ * @param expression The expression that produced the actual value.
3237
+ * @param message An optional message that describes the scenario.
3238
+ */
3239
+ static assertInsertIndex(index: number, count: number, expression?: string, message?: string): void;
3240
+ /**
3241
+ * Assert that the value is one of the possibilities.
3242
+ * @param possibilities The possible values that the value can be.
3243
+ * @param value The value to check.
3244
+ * @param expression The expression that produced the value.
3245
+ * @param message An optional error message.
3246
+ */
3247
+ static assertOneOf<T>(possibilities: JavascriptIterable<T>, value: T, expression?: string, message?: string): void;
3248
+ /**
3249
+ * Assert that the value is within the bounds of a byte.
3250
+ * @param value The value to check.
3251
+ * @param expression The expression that produced the value.
3252
+ * @param message An optional error message.
3253
+ */
3254
+ static assertByte(value: number, expression?: string, message?: string): void;
3255
+ /**
3256
+ * Assert that the value is an integer.
3257
+ * @param value The value to check.
3258
+ * @param expression The expression that produced the value.
3259
+ * @param message An optional error message.
3260
+ */
3261
+ static assertInteger(value: number, expression?: string, message?: string): void;
3262
+ /**
3263
+ * Assert that the value is a characer (single character string).
3264
+ * @param value The value to check.
3265
+ * @param expression The expression that produced the value.
3266
+ * @param message An optional error message.
3267
+ */
3268
+ static assertCharacter(value: string, expression?: string, message?: string): void;
3269
+ /**
3270
+ * Assert that the provided value is an instance of the provided {@link Type}.
3271
+ * @param value The value to check.
3272
+ * @param type The {@link Type} to check.
3273
+ * @param expression The expression that produced the value.
3274
+ * @param message An optional error message.
3275
+ */
3276
+ assertInstanceOf<T>(value: unknown, type: Type<T>, typeCheck?: (value: unknown) => value is T, expression?: string, message?: string): asserts value is T;
3277
+ assertInstanceOf<T>(parameters: {
3278
+ value: unknown;
3279
+ type: Type<T>;
3280
+ typeCheck?: (value: unknown) => value is T;
3281
+ expression?: string;
3282
+ message?: string;
3283
+ }): void;
3284
+ }
3285
+
3286
+ /**
3287
+ * An {@link Error} that is thrown when a post-condition fails.
3288
+ */
3289
+ declare class PostConditionError extends Error {
3290
+ constructor(...message: string[]);
3291
+ }
3292
+
3293
+ /**
3294
+ * A type that encapsulates conditions that should exist before an operation takes place.
3295
+ */
3296
+ declare abstract class PreCondition {
3297
+ private static condition;
3298
+ private static getCondition;
3299
+ /**
3300
+ * Assert that the provided value is undefined.
3301
+ * @param value The value to check.
3302
+ * @param expression The name of the expression that produced the value.
3303
+ * @param message An additional message that will be included with the error.
3304
+ */
3305
+ static assertUndefined(value: unknown, expression?: string, message?: string): asserts value is undefined;
3306
+ /**
3307
+ * Assert that the provided value is not undefined and not null.
3308
+ * @param value The value to check.
3309
+ * @param expression The name of the expression that produced the value.
3310
+ * @param message An additional message that will be included with the error.
3311
+ */
3312
+ static assertNotUndefined<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
3313
+ /**
3314
+ * Assert that the provided value is not undefined and not null.
3315
+ * @param value The value to check.
3316
+ * @param expression The name of the expression that produced the value.
3317
+ * @param message An additional message that will be included with the error.
3318
+ */
3319
+ static assertNotUndefinedAndNotNull<T>(value: T, expression?: string, message?: string): asserts value is NonNullable<T>;
3320
+ /**
3321
+ * Assert that the provided value is true.
3322
+ * @param value The value to check.
3323
+ * @param expression The name of the expression that produced the value.
3324
+ * @param message An additional message that will be included with the error.
3325
+ */
3326
+ static assertTrue(value: boolean, expression?: string, message?: string): asserts value is true;
3327
+ /**
3328
+ * Assert that the provided value is false.
3329
+ * @param value The value to check.
3330
+ * @param expression The name of the expression that produced the value.
3331
+ * @param message An additional message that will be included with the error.
3332
+ */
3333
+ static assertFalse(value: boolean, expression?: string, message?: string): asserts value is false;
3334
+ /**
3335
+ * Assert that the provided actual value is the same as the provided expected value.
3336
+ * @param expected The expected value.
3337
+ * @param actual The actual value.
3338
+ * @param expression The expression that produced the actual value.
3339
+ * @param message An optional message that describes the scenario.
3340
+ */
3341
+ static assertSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
3342
+ /**
3343
+ * Assert that the provided actual value is not the same as the provided expected value.
3344
+ * @param expected The expected value.
3345
+ * @param actual The actual value.
3346
+ * @param expression The expression that produced the actual value.
3347
+ * @param message An optional message that describes the scenario.
3348
+ */
3349
+ static assertNotSame<T>(expected: T, actual: T, expression?: string, message?: string): void;
3350
+ /**
3351
+ * Assert that the provided actual value is equal to the provided expected value.
3352
+ * @param expected The expected value.
3353
+ * @param actual The actual value.
3354
+ * @param expression The expression that produced the actual value.
3355
+ * @param message An optional message that describes the scenario.
3356
+ */
3357
+ static assertEqual<T>(expected: T, actual: T, expression?: string, message?: string): void;
3358
+ /**
3359
+ * Assert that the provided actual value is not equal to the provided expected value.
3360
+ * @param notExpected The not expected value.
3361
+ * @param actual The actual value.
3362
+ * @param expression The expression that produced the actual value.
3363
+ * @param message An optional message that describes the scenario.
3364
+ */
3365
+ static assertNotEqual<T>(notExpected: T, actual: T, expression?: string, message?: string): void;
3366
+ /**
3367
+ * Assert that the provided value is not empty.
3368
+ * @param value The value to check.
3369
+ * @param expression The expression that produced the actual value.
3370
+ * @param message An optional message that describes the scenario.
3371
+ */
3372
+ static assertNotEmpty(value: JavascriptIterable<unknown> | string | undefined | null, expression?: string, message?: string): void;
3373
+ /**
3374
+ * Assert that the provided value is less than the provided upperBound.
3375
+ * @param value The value to check.
3376
+ * @param upperBound The upperBound that the value must be less than.
3377
+ * @param expression The expression that produced the actual value.
3378
+ * @param message An optional message that describes the scenario.
3379
+ */
3380
+ static assertLessThan(value: number, upperBound: number, expression?: string, message?: string): void;
3381
+ /**
3382
+ * Assert that the provided value is less than or equal to the provided upperBound.
3383
+ * @param value The value to check.
3384
+ * @param upperBound The upperBound that the value must be less than.
3385
+ * @param expression The expression that produced the actual value.
3386
+ * @param message An optional message that describes the scenario.
3387
+ */
3388
+ static assertLessThanOrEqualTo(value: number, upperBound: number, expression?: string, message?: string): void;
3389
+ /**
3390
+ * Assert that the provided value is greater than or equal to the provided lowerBound.
3391
+ * @param value The value to check.
3392
+ * @param lowerBound The lowerBound that the value must be greater than or equal to.
3393
+ * @param expression The expression that produced the actual value.
3394
+ * @param message An optional message that describes the scenario.
3395
+ */
3396
+ static assertGreaterThanOrEqualTo(value: number, lowerBound: number, expression?: string, message?: string): void;
3397
+ /**
3398
+ * Assert that the provided value is greater than the provided lowerBound.
3399
+ * @param value The value to check.
3400
+ * @param lowerBound The lowerBound that the value must be greater than.
3401
+ * @param expression The expression that produced the actual value.
3402
+ * @param message An optional message that describes the scenario.
3403
+ */
3404
+ static assertGreaterThan(value: number, lowerBound: number, expression?: string, message?: string): void;
3405
+ /**
3406
+ * Assert that the value is greater than or equal to the lowerBound and less than or equal to
3407
+ * the upperBound.
3408
+ * @param lowerBound The lowerBound that the value must be greater than or equal to.
3409
+ * @param value The value to check.
3410
+ * @param upperBound The upperBound that the value must be less than or equal to.
3411
+ * @param expression The expression that produced the actual value.
3412
+ * @param message An optional message that describes the scenario.
3413
+ */
3414
+ static assertBetween(lowerBound: number, value: number, upperBound: number, expression?: string, message?: string): void;
3415
+ /**
3416
+ * Assert that the index is within the access bounds of an indexable with the provided count.
3417
+ * @param index The index to check.
3418
+ * @param count The number of elements in the indexable.
3419
+ * @param expression The expression that produced the actual value.
3420
+ * @param message An optional message that describes the scenario.
3421
+ */
3422
+ static assertAccessIndex(index: number, count: number, expression?: string, message?: string): void;
3423
+ /**
3424
+ * Assert that the index is within the insertion bounds of a {@link List} with the provided count.
3425
+ * @param index The index to check.
3426
+ * @param count The number of elements in the indexable.
3427
+ * @param expression The expression that produced the actual value.
3428
+ * @param message An optional message that describes the scenario.
3429
+ */
3430
+ static assertInsertIndex(index: number, count: number, expression?: string, message?: string): void;
3431
+ /**
3432
+ * Assert that the value is one of the possibilities.
3433
+ * @param possibilities The possible values that the value can be.
3434
+ * @param value The value to check.
3435
+ * @param expression The expression that produced the value.
3436
+ * @param message An optional error message.
3437
+ */
3438
+ static assertOneOf<T>(possibilities: JavascriptIterable<T>, value: T, expression?: string, message?: string): void;
3439
+ /**
3440
+ * Assert that the value is within the bounds of a byte.
3441
+ * @param value The value to check.
3442
+ * @param expression The expression that produced the value.
3443
+ * @param message An optional error message.
3444
+ */
3445
+ static assertByte(value: number, expression?: string, message?: string): void;
3446
+ /**
3447
+ * Assert that the value is an integer.
3448
+ * @param value The value to check.
3449
+ * @param expression The expression that produced the value.
3450
+ * @param message An optional error message.
3451
+ */
3452
+ static assertInteger(value: number, expression?: string, message?: string): void;
3453
+ /**
3454
+ * Assert that the value is a characer (single character string).
3455
+ * @param value The value to check.
3456
+ * @param expression The expression that produced the value.
3457
+ * @param message An optional error message.
3458
+ */
3459
+ static assertCharacter(value: string, expression?: string, message?: string): void;
3460
+ /**
3461
+ * Assert that the provided value is an instance of the provided {@link Type}.
3462
+ * @param value The value to check.
3463
+ * @param type The {@link Type} to check.
3464
+ * @param expression The expression that produced the value.
3465
+ * @param message An optional error message.
3466
+ */
3467
+ assertInstanceOf<T>(value: unknown, type: Type<T>, typeCheck?: (value: unknown) => value is T, expression?: string, message?: string): asserts value is T;
3468
+ assertInstanceOf<T>(parameters: {
3469
+ value: unknown;
3470
+ type: Type<T>;
3471
+ typeCheck?: (value: unknown) => value is T;
3472
+ expression?: string;
3473
+ message?: string;
3474
+ }): void;
3475
+ }
3476
+
3477
+ /**
3478
+ * An {@link Error} that is thrown when a pre-condition fails.
3479
+ */
3480
+ declare class PreConditionError extends Error {
3481
+ constructor(...message: string[]);
3482
+ }
3483
+
3484
+ declare class RealNetwork extends Network {
3485
+ private constructor();
3486
+ static create(): RealNetwork;
3487
+ createHttpServer(): HttpServer;
3488
+ createHttpClient(): HttpClient;
3489
+ }
3490
+
3491
+ interface RecreationDotGovDivisionDayAvailability {
3492
+ readonly date: DateTime;
3493
+ readonly walkup: boolean;
3494
+ readonly reservationsRemaining: number;
3495
+ readonly totalSpots: number;
3496
+ }
3497
+ interface RecreationDotGovDivisionAvailabilityJson {
3498
+ readonly bools: {
3499
+ [date: string]: boolean;
3500
+ };
3501
+ readonly rules: {
3502
+ readonly name: string;
3503
+ readonly value: number;
3504
+ }[];
3505
+ readonly quota_type_maps: {
3506
+ readonly ConstantQuotaUsageDaily?: {
3507
+ [date: string]: {
3508
+ readonly is_hidden: boolean;
3509
+ readonly remaining: number;
3510
+ readonly season_type: string;
3511
+ readonly show_walkup: boolean;
3512
+ readonly total: number;
3513
+ };
3514
+ };
3515
+ readonly QuotaUsageByMemberDaily?: {
3516
+ [date: string]: {
3517
+ readonly is_hidden: boolean;
3518
+ readonly remaining: number;
3519
+ readonly season_type: string;
3520
+ readonly show_walkup: boolean;
3521
+ readonly total: number;
3522
+ };
3523
+ };
3524
+ };
3525
+ }
3526
+ declare class RecreationDotGovDivisionAvailability {
3527
+ readonly json: RecreationDotGovDivisionAvailabilityJson;
3528
+ readonly minimumGroupSize?: number;
3529
+ readonly maximumGroupSize?: number;
3530
+ readonly dayAvailabilities: Iterable$1<RecreationDotGovDivisionDayAvailability>;
3531
+ private constructor();
3532
+ static create(json: RecreationDotGovDivisionAvailabilityJson): RecreationDotGovDivisionAvailability;
3533
+ }
3534
+ interface RecreationDotGovDivisionJson {
3535
+ readonly id: string;
3536
+ readonly name: string;
3537
+ readonly type: string;
3538
+ readonly district: string;
3539
+ }
3540
+ interface RecreationDotGovPermitItineraryJson {
3541
+ readonly id: string;
3542
+ readonly name: string;
3543
+ readonly divisions: {
3544
+ [divisionId: number]: RecreationDotGovDivisionJson;
3545
+ };
3546
+ }
3547
+ declare class RecreationDotGovError extends Error {
3548
+ constructor(message: string);
3549
+ }
3550
+ interface RecreationDotGovErrorResponse {
3551
+ readonly error: string;
3552
+ }
3553
+ declare class RecreationDotGovClient implements HttpClient {
3554
+ private readonly httpClient;
3555
+ private constructor();
3556
+ static create(httpClient: HttpClient): RecreationDotGovClient;
3557
+ sendRequest(request: HttpOutgoingRequest): AsyncResult<HttpIncomingResponse>;
3558
+ sendGetRequest(url: string): AsyncResult<HttpIncomingResponse>;
3559
+ getPermitItinerary(permitItineraryId: string): PromiseAsyncResult<RecreationDotGovPermitItineraryJson>;
3560
+ getDivisionAvailability(permitItineraryId: string, divisionId: string, month: number, year: number, earlyAccessPermitLotteryId?: string): PromiseAsyncResult<RecreationDotGovDivisionAvailability>;
3561
+ }
3562
+
3563
+ /**
3564
+ * An {@link AsyncIterator} that skips the first maximum number of values from an inner
3565
+ * {@link AsyncIterator} before beginning to return values.
3566
+ */
3567
+ declare class SkipAsyncIterator<T> implements AsyncIterator$1<T> {
3568
+ private readonly innerIterator;
3569
+ private started;
3570
+ private readonly maximumToSkip;
3571
+ private constructor();
3572
+ static create<T>(innerIterator: AsyncIterator$1<T>, maximumToSkip: number): SkipAsyncIterator<T>;
3573
+ next(): PromiseAsyncResult<boolean>;
3574
+ hasStarted(): boolean;
3575
+ hasCurrent(): boolean;
3576
+ getCurrent(): T;
3577
+ start(): PromiseAsyncResult<this>;
3578
+ takeCurrent(): PromiseAsyncResult<T>;
3579
+ any(): PromiseAsyncResult<boolean>;
3580
+ getCount(): PromiseAsyncResult<number>;
3581
+ toArray(): PromiseAsyncResult<T[]>;
3582
+ where(condition: (value: T) => (boolean | PromiseLike<boolean>)): AsyncIterator$1<T>;
3583
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): AsyncIterator$1<U>;
3584
+ whereInstanceOfType<U extends T>(type: Type<U>): AsyncIterator$1<U>;
3585
+ map<TOutput>(mapping: (value: T) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
3586
+ first(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
3587
+ last(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
3588
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<T>;
3589
+ take(maximumToTake: number): AsyncIterator$1<T>;
3590
+ skip(maximumToSkip: number): AsyncIterator$1<T>;
3591
+ }
3592
+
3593
+ /**
3594
+ * An {@link Iterator} that skips the first maximum number of values from an inner {@link Iterator}
3595
+ * before beginning to return values.
3596
+ */
3597
+ declare class SkipIterator<T> implements Iterator$1<T> {
3598
+ private readonly innerIterator;
3599
+ private started;
3600
+ private readonly maximumToSkip;
3601
+ private constructor();
3602
+ static create<T>(innerIterator: Iterator$1<T>, maximumToSkip: number): SkipIterator<T>;
3603
+ next(): SyncResult<boolean>;
3604
+ hasStarted(): boolean;
3605
+ hasCurrent(): boolean;
3606
+ getCurrent(): T;
3607
+ start(): SyncResult<this>;
3608
+ takeCurrent(): SyncResult<T>;
3609
+ any(): SyncResult<boolean>;
3610
+ getCount(): SyncResult<number>;
3611
+ toArray(): SyncResult<T[]>;
3612
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
3613
+ where(condition: (value: T) => boolean): Iterator$1<T>;
3614
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
3615
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
3616
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
3617
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
3618
+ first(condition?: (value: T) => boolean): SyncResult<T>;
3619
+ last(condition?: (value: T) => boolean): SyncResult<T>;
3620
+ [Symbol.iterator](): JavascriptIterator<T>;
3621
+ take(maximumToTake: number): Iterator$1<T>;
3622
+ skip(maximumToSkip: number): Iterator$1<T>;
3623
+ }
3624
+
3625
+ /**
3626
+ * A {@link Comparer} that performs {@link string} comparisons.
3627
+ */
3628
+ declare class StringComparer extends Comparer<string> {
3629
+ protected constructor();
3630
+ static create(): StringComparer;
3631
+ compare(left: string, right: string): Comparison;
3632
+ static compare(left: string, right: string): Comparison;
3633
+ }
3634
+
3635
+ /**
3636
+ * An {@link Iterator} that iterates over the characters in a {@link string}.
3637
+ */
3638
+ declare class StringIterator implements Iterator$1<string> {
3639
+ private readonly value;
3640
+ private currentIndex;
3641
+ private started;
3642
+ private constructor();
3643
+ static create(value: string): StringIterator;
3644
+ getCurrentIndex(): number;
3645
+ next(): SyncResult<boolean>;
3646
+ hasStarted(): boolean;
3647
+ hasCurrent(): boolean;
3648
+ getCurrent(): string;
3649
+ start(): SyncResult<this>;
3650
+ takeCurrent(): SyncResult<string>;
3651
+ any(): SyncResult<boolean>;
3652
+ getCount(): SyncResult<number>;
3653
+ toArray(): SyncResult<string[]>;
3654
+ concatenate(...toConcatenate: JavascriptIterable<string>[]): Iterator$1<string>;
3655
+ map<TOutput>(mapping: (value: string) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
3656
+ flatMap<TOutput>(mapping: (value: string) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
3657
+ first(): SyncResult<string>;
3658
+ last(): SyncResult<string>;
3659
+ where(condition: (value: string) => boolean): Iterator$1<string>;
3660
+ whereInstanceOf<U extends string>(typeCheck: (value: string) => value is U): Iterator$1<U>;
3661
+ whereInstanceOfType<U extends string>(type: Type<U>): Iterator$1<U>;
3662
+ take(maximumToTake: number): Iterator$1<string>;
3663
+ skip(maximumToSkip: number): Iterator$1<string>;
3664
+ [Symbol.iterator](): JavascriptIterator<string>;
3665
+ }
3666
+
3667
+ declare function getLength(value: string | undefined | null): number;
3668
+ declare function toString(value: undefined | null | {
3669
+ toString(): string;
3670
+ }): string;
3671
+ /**
3672
+ * Join the provided values with the provided separator in between each value.
3673
+ * @param separator The value to use to separate the individual values.
3674
+ * @param values The values to join.
3675
+ * @returns The joined {@link string}.
3676
+ */
3677
+ declare function join(separator: string, values: JavascriptIterable<string>): string;
3678
+ declare function join(parameters: {
3679
+ separator: string;
3680
+ values: JavascriptIterable<string>;
3681
+ }): string;
3682
+ declare function escape(value: string | undefined | null, dontEscape?: string[]): string;
3683
+ declare function escape(parameters: {
3684
+ value: string | undefined | null;
3685
+ dontEscape?: string[];
3686
+ }): string;
3687
+ /**
3688
+ * Get a version of the provided value that is quoted with the provided quote.
3689
+ * @param value The value to quote.
3690
+ * @param quote The quotes to surround the provided value with.
3691
+ */
3692
+ declare function quote(value: string | undefined | null, quote?: string): string;
3693
+ /**
3694
+ * Get a version of the provided value that is quoted with the provided quote.
3695
+ * @param parameters The parameters to use to invoke this function.
3696
+ */
3697
+ declare function quote(parameters: {
3698
+ value: string | undefined | null;
3699
+ quote?: string;
3700
+ }): string;
3701
+ /**
3702
+ * Get a version of the provided value where the characters are escaped and quoted.
3703
+ * @param value The value to escape and quote.
3704
+ * @param quoteString The quote to surround the value with.
3705
+ * @param dontEscape The characters to not escape.
3706
+ */
3707
+ declare function escapeAndQuote(value: string | undefined | null, quoteString?: string, dontEscape?: string[]): string;
3708
+ declare function escapeAndQuote(parameters: {
3709
+ value: string | undefined | null;
3710
+ quoteString?: string;
3711
+ dontEscape?: string[];
3712
+ }): string;
3713
+ /**
3714
+ * Get whether the provided value only contains whitespace characters.
3715
+ * @param value The value to check.
3716
+ */
3717
+ declare function isWhitespace(value: string): boolean;
3718
+ /**
3719
+ * Get whether the provided value only contains letters.
3720
+ * @param value The value to check.
3721
+ */
3722
+ declare function isLetter(value: string): boolean;
3723
+ /**
3724
+ * Get whether the provided value only contains letters.
3725
+ * @param value The value to check.
3726
+ */
3727
+ declare function isLowercasedLetter(value: string): boolean;
3728
+ /**
3729
+ * Get whether the provided value only contains letters.
3730
+ * @param value The value to check.
3731
+ */
3732
+ declare function isUppercasedLetter(value: string): boolean;
3733
+ /**
3734
+ * Get whether the provided value only contains digits.
3735
+ * @param value The value to check.
3736
+ */
3737
+ declare function isDigit(value: string): boolean;
3738
+ /**
3739
+ * Get whether the provided value only contains letters and digits.
3740
+ * @param value The value to check.
3741
+ */
3742
+ declare function isLetterOrDigit(value: string): boolean;
3743
+
3744
+ /**
3745
+ * An {@link AsyncIterator} that iterates over a maximum number of values.
3746
+ */
3747
+ declare class TakeAsyncIterator<T> implements AsyncIterator$1<T> {
3748
+ private readonly innerIterator;
3749
+ private started;
3750
+ private readonly maximumToTake;
3751
+ private taken;
3752
+ private constructor();
3753
+ static create<T>(innerIterator: AsyncIterator$1<T>, maximumToTake: number): TakeAsyncIterator<T>;
3754
+ hasCurrent(): boolean;
3755
+ next(): PromiseAsyncResult<boolean>;
3756
+ hasStarted(): boolean;
3757
+ getCurrent(): T;
3758
+ start(): PromiseAsyncResult<this>;
3759
+ takeCurrent(): PromiseAsyncResult<T>;
3760
+ any(): PromiseAsyncResult<boolean>;
3761
+ getCount(): PromiseAsyncResult<number>;
3762
+ toArray(): PromiseAsyncResult<T[]>;
3763
+ where(condition: (value: T) => boolean): AsyncIterator$1<T>;
3764
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): AsyncIterator$1<U>;
3765
+ whereInstanceOfType<U extends T>(type: Type<U>): AsyncIterator$1<U>;
3766
+ map<TOutput>(mapping: (value: T) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
3767
+ first(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
3768
+ last(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
3769
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<T>;
3770
+ take(maximumToTake: number): AsyncIterator$1<T>;
3771
+ skip(maximumToSkip: number): AsyncIterator$1<T>;
3772
+ }
3773
+
3774
+ /**
3775
+ * An {@link Iterator} that iterates over a maximum number of values.
3776
+ */
3777
+ declare class TakeIterator<T> implements Iterator$1<T> {
3778
+ private readonly innerIterator;
3779
+ private started;
3780
+ private readonly maximumToTake;
3781
+ private taken;
3782
+ private constructor();
3783
+ static create<T>(innerIterator: Iterator$1<T>, maximumToTake: number): TakeIterator<T>;
3784
+ hasCurrent(): boolean;
3785
+ next(): SyncResult<boolean>;
3786
+ hasStarted(): boolean;
3787
+ getCurrent(): T;
3788
+ start(): SyncResult<this>;
3789
+ takeCurrent(): SyncResult<T>;
3790
+ any(): SyncResult<boolean>;
3791
+ getCount(): SyncResult<number>;
3792
+ toArray(): SyncResult<T[]>;
3793
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
3794
+ where(condition: (value: T) => boolean): Iterator$1<T>;
3795
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
3796
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
3797
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
3798
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
3799
+ first(condition?: (value: T) => boolean): SyncResult<T>;
3800
+ last(condition?: (value: T) => boolean): SyncResult<T>;
3801
+ [Symbol.iterator](): JavascriptIterator<T>;
3802
+ take(maximumToTake: number): Iterator$1<T>;
3803
+ skip(maximumToSkip: number): Iterator$1<T>;
3804
+ }
3805
+
3806
+ /**
3807
+ * An {@link Iterator} that only returns values that match a condition.
3808
+ */
3809
+ declare class WhereAsyncIterator<T> implements AsyncIterator$1<T> {
3810
+ private readonly innerIterator;
3811
+ private started;
3812
+ private readonly condition;
3813
+ private constructor();
3814
+ hasStarted(): boolean;
3815
+ hasCurrent(): boolean;
3816
+ getCurrent(): T;
3817
+ static create<T>(innerIterator: AsyncIterator$1<T>, condition: (value: T) => (boolean | PromiseLike<boolean>)): WhereAsyncIterator<T>;
3818
+ next(): PromiseAsyncResult<boolean>;
3819
+ start(): PromiseAsyncResult<this>;
3820
+ takeCurrent(): PromiseAsyncResult<T>;
3821
+ any(): PromiseAsyncResult<boolean>;
3822
+ getCount(): PromiseAsyncResult<number>;
3823
+ toArray(): PromiseAsyncResult<T[]>;
3824
+ where(condition: (value: T) => (boolean | PromiseLike<boolean>)): AsyncIterator$1<T>;
3825
+ map<TOutput>(mapping: (value: T) => (TOutput | PromiseLike<TOutput>)): AsyncIterator$1<TOutput>;
3826
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): AsyncIterator$1<U>;
3827
+ whereInstanceOfType<U extends T>(type: Type<U>): AsyncIterator$1<U>;
3828
+ first(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
3829
+ last(condition?: (value: T) => (boolean | PromiseLike<boolean>)): PromiseAsyncResult<T>;
3830
+ take(maximumToTake: number): AsyncIterator$1<T>;
3831
+ skip(maximumToSkip: number): AsyncIterator$1<T>;
3832
+ [Symbol.asyncIterator](): JavascriptAsyncIterator<T>;
3833
+ }
3834
+
3835
+ /**
3836
+ * An {@link Iterable} that only returns values that match a condition.
3837
+ */
3838
+ declare class WhereIterable<T> implements Iterable$1<T> {
3839
+ private readonly innerIterable;
3840
+ private readonly condition;
3841
+ private constructor();
3842
+ static create<T>(innerIterable: Iterable$1<T>, condition: (value: T) => (boolean | SyncResult<boolean>)): WhereIterable<T>;
3843
+ iterate(): Iterator$1<T>;
3844
+ toArray(): SyncResult<T[]>;
3845
+ any(): SyncResult<boolean>;
3846
+ getCount(): SyncResult<number>;
3847
+ equals(right: JavascriptIterable<T>, equalFunctions?: EqualFunctions): SyncResult<boolean>;
3848
+ toString(toStringFunctions?: ToStringFunctions): string;
3849
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterable$1<T>;
3850
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterable$1<TOutput>;
3851
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterable$1<TOutput>;
3852
+ where(condition: (value: T) => (boolean | SyncResult<boolean>)): Iterable$1<T>;
3853
+ instanceOf<TOutput extends T>(typeOrTypeCheck: Type<TOutput> | ((value: T) => value is TOutput)): Iterable$1<TOutput>;
3854
+ first(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
3855
+ last(condition?: ((value: T) => (boolean | SyncResult<boolean>)) | undefined): SyncResult<T>;
3856
+ [Symbol.iterator](): JavascriptIterator<T>;
3857
+ contains(value: T, equalFunctions?: EqualFunctions): SyncResult<boolean>;
3858
+ }
3859
+
3860
+ /**
3861
+ * An {@link Iterator} that only returns values that match a condition.
3862
+ */
3863
+ declare class WhereIterator<T> implements Iterator$1<T> {
3864
+ private readonly innerIterator;
3865
+ private started;
3866
+ private readonly condition;
3867
+ private constructor();
3868
+ static create<T>(innerIterator: Iterator$1<T>, condition: (value: T) => (boolean | SyncResult<boolean>)): WhereIterator<T>;
3869
+ hasStarted(): boolean;
3870
+ hasCurrent(): boolean;
3871
+ getCurrent(): T;
3872
+ next(): SyncResult<boolean>;
3873
+ start(): SyncResult<this>;
3874
+ takeCurrent(): SyncResult<T>;
3875
+ any(): SyncResult<boolean>;
3876
+ getCount(): SyncResult<number>;
3877
+ toArray(): SyncResult<T[]>;
3878
+ concatenate(...toConcatenate: JavascriptIterable<T>[]): Iterator$1<T>;
3879
+ where(condition: (value: T) => boolean): Iterator$1<T>;
3880
+ map<TOutput>(mapping: (value: T) => (TOutput | SyncResult<TOutput>)): Iterator$1<TOutput>;
3881
+ flatMap<TOutput>(mapping: (value: T) => JavascriptIterable<TOutput>): Iterator$1<TOutput>;
3882
+ whereInstanceOf<U extends T>(typeCheck: (value: T) => value is U): Iterator$1<U>;
3883
+ whereInstanceOfType<U extends T>(type: Type<U>): Iterator$1<U>;
3884
+ first(condition?: (value: T) => boolean): SyncResult<T>;
3885
+ last(condition?: (value: T) => boolean): SyncResult<T>;
3886
+ take(maximumToTake: number): Iterator$1<T>;
3887
+ skip(maximumToSkip: number): Iterator$1<T>;
3888
+ [Symbol.iterator](): JavascriptIterator<T>;
3889
+ }
3890
+
3891
+ interface WonderlandTrailLocation {
3892
+ readonly name: string;
3893
+ readonly trailhead: boolean;
3894
+ readonly foodCacheStorage: boolean;
3895
+ readonly divisionId: string;
3896
+ readonly groupSiteDivisionId: string;
3897
+ readonly latitude: number;
3898
+ readonly longitude: number;
3899
+ readonly elevationFeet: number;
3900
+ }
3901
+ declare function isWonderlandTrailLocation(value: unknown): value is WonderlandTrailLocation;
3902
+ declare abstract class WonderlandTrailLocations {
3903
+ static readonly graniteCreek: WonderlandTrailLocation;
3904
+ static readonly sunriseCamp: WonderlandTrailLocation;
3905
+ static readonly sunriseVisitorCenter: WonderlandTrailLocation;
3906
+ static readonly whiteRiver: WonderlandTrailLocation;
3907
+ static readonly fryingPanCreek: WonderlandTrailLocation;
3908
+ static readonly summerland: WonderlandTrailLocation;
3909
+ static readonly indianBar: WonderlandTrailLocation;
3910
+ static readonly nickelCreek: WonderlandTrailLocation;
3911
+ static readonly boxCanyon: WonderlandTrailLocation;
3912
+ static readonly mapleCreek: WonderlandTrailLocation;
3913
+ static readonly reflectionLakes: WonderlandTrailLocation;
3914
+ static readonly paradiseRiver: WonderlandTrailLocation;
3915
+ static readonly longmire: WonderlandTrailLocation;
3916
+ static readonly pyramidCreek: WonderlandTrailLocation;
3917
+ static readonly devilsDream: WonderlandTrailLocation;
3918
+ static readonly southPuyallupRiver: WonderlandTrailLocation;
3919
+ static readonly klapatchePark: WonderlandTrailLocation;
3920
+ static readonly northPuyallupRiver: WonderlandTrailLocation;
3921
+ static readonly goldenLakes: WonderlandTrailLocation;
3922
+ static readonly southMowichRiver: WonderlandTrailLocation;
3923
+ static readonly mowichLake: WonderlandTrailLocation;
3924
+ static readonly eaglesRoost: WonderlandTrailLocation;
3925
+ static readonly cataractValley: WonderlandTrailLocation;
3926
+ static readonly ipsutCreek: WonderlandTrailLocation;
3927
+ static readonly carbonRiver: WonderlandTrailLocation;
3928
+ static readonly dickCreek: WonderlandTrailLocation;
3929
+ static readonly mysticLake: WonderlandTrailLocation;
3930
+ static getLocations(): Iterable$1<WonderlandTrailLocation>;
3931
+ static getTrailheads(): Iterable$1<WonderlandTrailLocation>;
3932
+ }
3933
+ declare enum WonderlandTrailReservationType {
3934
+ Reserved = 0,
3935
+ Walkup = 1
3936
+ }
3937
+ interface WonderlandTrailAvailabilityType {
3938
+ readonly individualSite?: WonderlandTrailReservationType;
3939
+ readonly groupSite?: WonderlandTrailReservationType;
3940
+ }
3941
+ declare class WonderlandTrailAvailability {
3942
+ private readonly availabilityMap;
3943
+ private constructor();
3944
+ static create(): WonderlandTrailAvailability;
3945
+ any(): boolean;
3946
+ addAvailability(location: WonderlandTrailLocation, date: DateTime, individualSite?: WonderlandTrailReservationType, groupSite?: WonderlandTrailReservationType): void;
3947
+ getAvailability(location: WonderlandTrailLocation): MutableMap<string, WonderlandTrailAvailabilityType>;
3948
+ getDayAvailability(location: WonderlandTrailLocation, date: DateTime): SyncResult<WonderlandTrailAvailabilityType>;
3949
+ }
3950
+ declare class WonderlandTrailDirection {
3951
+ private readonly value;
3952
+ private constructor();
3953
+ static readonly clockwise: WonderlandTrailDirection;
3954
+ static readonly counterClockwise: WonderlandTrailDirection;
3955
+ toString(): string;
3956
+ reverse(): WonderlandTrailDirection;
3957
+ }
3958
+ declare class WonderlandTrailConnection {
3959
+ readonly startLocation: WonderlandTrailLocation;
3960
+ readonly endLocation: WonderlandTrailLocation;
3961
+ readonly distanceMiles: number;
3962
+ readonly ascentFeet: number;
3963
+ readonly descentFeet: number;
3964
+ readonly direction: WonderlandTrailDirection;
3965
+ readonly intermediateLocations: Iterable$1<WonderlandTrailLocation>;
3966
+ private constructor();
3967
+ static create(startLocation: WonderlandTrailLocation, endLocation: WonderlandTrailLocation, distanceMiles: number, ascentFeet: number, descentFeet: number, direction: WonderlandTrailDirection, intermediateLocations: Iterable$1<WonderlandTrailLocation>): WonderlandTrailConnection;
3968
+ getLocations(): Iterable$1<WonderlandTrailLocation>;
3969
+ private static ensureExists;
3970
+ private static ensureAllExist;
3971
+ reverseDirection(): WonderlandTrailConnection;
3972
+ join(connection: WonderlandTrailConnection): WonderlandTrailConnection;
3973
+ containsLocation(location: WonderlandTrailLocation): boolean;
3974
+ isLoop(): boolean;
3975
+ }
3976
+ declare class WonderlandTrailConnections {
3977
+ private connections;
3978
+ readonly addReverseConnectionDefault: boolean;
3979
+ private constructor();
3980
+ static create(addReverseConnectionDefault?: boolean): WonderlandTrailConnections;
3981
+ static createDefault(): WonderlandTrailConnections;
3982
+ iterateConnections(startLocation?: WonderlandTrailLocation, endLocation?: WonderlandTrailLocation, direction?: WonderlandTrailDirection): Iterator$1<WonderlandTrailConnection>;
3983
+ iterateConnections(properties: {
3984
+ startLocation?: WonderlandTrailLocation;
3985
+ endLocation?: WonderlandTrailLocation;
3986
+ direction?: WonderlandTrailDirection;
3987
+ }): Iterator$1<WonderlandTrailConnection>;
3988
+ private addConnectionInner;
3989
+ addConnection(connection: WonderlandTrailConnection, addReverseConnection?: boolean): this;
3990
+ addConnection(startLocation: WonderlandTrailLocation, endLocation: WonderlandTrailLocation, distanceMiles: number, ascentFeet: number, descentFeet: number, direction?: WonderlandTrailDirection, intermediateLocations?: Iterable$1<WonderlandTrailLocation>, addReverseConnection?: boolean): this;
3991
+ addConnection(properties: {
3992
+ startLocation: WonderlandTrailLocation;
3993
+ endLocation: WonderlandTrailLocation;
3994
+ distanceMiles: number;
3995
+ ascentFeet: number;
3996
+ descentFeet: number;
3997
+ direction?: WonderlandTrailDirection;
3998
+ intermediateLocations?: Iterable$1<WonderlandTrailLocation>;
3999
+ addReverseConnection?: boolean;
4000
+ }): this;
4001
+ containsConnection(connection: WonderlandTrailConnection): boolean;
4002
+ reverseDirection(): WonderlandTrailConnections;
4003
+ expandConnections(startLocation?: WonderlandTrailLocation, endLocation?: WonderlandTrailLocation, direction?: WonderlandTrailDirection): WonderlandTrailConnections;
4004
+ }
4005
+ declare class WonderlandTrailItinerary {
4006
+ readonly startDay: DateTime;
4007
+ private readonly connections;
4008
+ private readonly availabilityTypes;
4009
+ private constructor();
4010
+ static create(startDay: DateTime): WonderlandTrailItinerary;
4011
+ clone(): WonderlandTrailItinerary;
4012
+ getConnections(): Iterable$1<WonderlandTrailConnection>;
4013
+ getEndDay(): DateTime;
4014
+ getDayCount(): number;
4015
+ getStartLocation(): SyncResult<WonderlandTrailLocation>;
4016
+ getIntermediateLocations(): Iterable$1<WonderlandTrailLocation>;
4017
+ getEndLocation(): SyncResult<WonderlandTrailLocation>;
4018
+ getPath(): Iterable$1<WonderlandTrailLocation>;
4019
+ getPathStrings(includeAvailabilityTypes?: boolean): Iterable$1<string>;
4020
+ contains(parameters: {
4021
+ location: WonderlandTrailLocation;
4022
+ checkItineraryStartLocation?: boolean;
4023
+ checkItineraryIntermediateLocations?: boolean;
4024
+ checkItineraryEndLocation?: boolean;
4025
+ }): boolean;
4026
+ containsAny(parameters: {
4027
+ connection: WonderlandTrailConnection;
4028
+ checkConnectionStartLocation?: boolean;
4029
+ checkConnectionIntermediateLocations?: boolean;
4030
+ checkConnectionEndLocation?: boolean;
4031
+ checkItineraryStartLocation?: boolean;
4032
+ checkItineraryIntermediateLocations?: boolean;
4033
+ checkItineraryEndLocation?: boolean;
4034
+ }): boolean;
4035
+ addConnection(connection: WonderlandTrailConnection): this;
4036
+ addConnections(connections: JavascriptIterable<WonderlandTrailConnection>): this;
4037
+ addAvailabilityType(availabilityType: WonderlandTrailAvailabilityType): this;
4038
+ addAvailabilityTypes(availabilityTypes: JavascriptIterable<WonderlandTrailAvailabilityType>): this;
4039
+ toString(includeAvailabilityTypes?: boolean): string;
4040
+ }
4041
+ declare class WonderlandTrailClient implements HttpClient {
4042
+ static readonly permitItineraryId: string;
4043
+ private readonly httpClient;
4044
+ private readonly recreationDotGovClient;
4045
+ private constructor();
4046
+ static create(httpClient: HttpClient): WonderlandTrailClient;
4047
+ sendRequest(request: HttpOutgoingRequest): AsyncResult<HttpIncomingResponse>;
4048
+ sendGetRequest(url: string): AsyncResult<HttpIncomingResponse>;
4049
+ getAvailability(month: number, year: number, allowWalkupPermits: boolean, allowIndividualSites: boolean, allowGroupSites: boolean, earlyAccessPermitLotteryId?: string): PromiseAsyncResult<WonderlandTrailAvailability>;
4050
+ getAvailability(options: {
4051
+ month: number;
4052
+ year: number;
4053
+ allowWalkupPermits: boolean;
4054
+ allowIndividualSites: boolean;
4055
+ allowGroupSites: boolean;
4056
+ earlyAccessPermitLotteryId?: string;
4057
+ }): PromiseAsyncResult<WonderlandTrailAvailability>;
4058
+ findItineraries(parameters: {
4059
+ availability: WonderlandTrailAvailability;
4060
+ startDate: DateTime;
4061
+ startLocation: WonderlandTrailLocation;
4062
+ endLocation: WonderlandTrailLocation;
4063
+ direction: WonderlandTrailDirection;
4064
+ maximumDayDistanceMiles?: number;
4065
+ maximumItineraryDays?: number;
4066
+ campsitesToAvoid?: JavascriptIterable<WonderlandTrailLocation>;
4067
+ }): Iterable$1<WonderlandTrailItinerary>;
4068
+ findItinerariesAsync(parameters: {
4069
+ startDay: DateTime;
4070
+ startLocation?: WonderlandTrailLocation;
4071
+ endLocation?: WonderlandTrailLocation;
4072
+ direction?: WonderlandTrailDirection;
4073
+ maximumDayDistanceMiles?: number;
4074
+ maximumItineraryDays?: number;
4075
+ allowWalkupPermits?: boolean;
4076
+ allowIndividualSites?: boolean;
4077
+ allowGroupSites?: boolean;
4078
+ campsitesToAvoid?: JavascriptIterable<WonderlandTrailLocation>;
4079
+ }): PromiseAsyncResult<Iterable$1<WonderlandTrailItinerary>>;
4080
+ }
4081
+
4082
+ export { type AssertMessageParameters, AsyncIterator$1 as AsyncIterator, AsyncIteratorToJavascriptAsyncIteratorAdapter, AsyncResult, ByteList, ByteListStream, ByteReadStream, ByteWriteStream, Bytes, CharacterList, CharacterListStream, CharacterReadStream, CharacterReadStreamAsyncIterator, CharacterWriteStream, CommandLineParameter, CommandLineParameters, Comparable, Comparer, Comparison, ConcatenateIterable, ConcatenateIterator, Condition, CurrentProcess, DateTime, Disposable, EmptyError, EqualFunctions, FetchHttpClient, FetchHttpIncomingResponse, FlatMapIterable, FlatMapIterator, Generator, type GeneratorControl, HttpClient, HttpHeader, HttpHeaders, HttpIncomingRequest, HttpIncomingResponse, HttpMethod, HttpOutgoingRequest, HttpOutgoingResponse, HttpServer, InMemoryCharacterWriteStream, Iterable$1 as Iterable, Iterator$1 as Iterator, IteratorToJavascriptIteratorAdapter, type JavascriptArray, JavascriptArrayList, type JavascriptAsyncIterable, type JavascriptAsyncIterator, JavascriptAsyncIteratorToAsyncIteratorAdapter, type JavascriptIterable, type JavascriptIterator, type JavascriptIteratorResult, JavascriptIteratorToIteratorAdapter, JavascriptMap, JavascriptMapMap, JavascriptSet, JavascriptSetSet, List, ListQueue, ListStack, LuxonDateTime, Map$1 as Map, MapAsyncIterator, type MapEntry, MapIterable, MapIterator, MutableCondition, MutableHttpHeaders, MutableMap, Network, Node, NodeJSCharacterWriteStream, NodeJSHttpIncomingRequest, NodeJSHttpServer, NotFoundError, PostCondition, PostConditionError, PreCondition, PreConditionError, PromiseAsyncResult, Property, Queue, RealNetwork, RecreationDotGovClient, RecreationDotGovDivisionAvailability, type RecreationDotGovDivisionAvailabilityJson, type RecreationDotGovDivisionDayAvailability, type RecreationDotGovDivisionJson, RecreationDotGovError, type RecreationDotGovErrorResponse, type RecreationDotGovPermitItineraryJson, SearchControl, Set$1 as Set, SkipAsyncIterator, SkipIterator, Stack, StringComparer, StringIterator, SyncDisposable, SyncResult, TakeAsyncIterator, TakeIterator, ToStringFunctions, type Type, WhereAsyncIterator, WhereIterable, WhereIterator, WonderlandTrailAvailability, type WonderlandTrailAvailabilityType, WonderlandTrailClient, WonderlandTrailConnection, WonderlandTrailConnections, WonderlandTrailDirection, WonderlandTrailItinerary, type WonderlandTrailLocation, WonderlandTrailLocations, WonderlandTrailReservationType, andList, as, asArray, asBoolean, asFunction, asFunctionWithParameterCount, asNull, asNumber, asObject, asObjectOrArrayOrNull, asString, depthFirstSearch, escape, escapeAndQuote, getLength, getName, getParameterCount, getPropertyNames, hasFunction, hasProperty, httpMethodToString, instanceOf, instanceOfType, isArray, isAsyncIterable, isBoolean, isDigit, isFunction, isFunctionWithParameterCount, isIterable, isJavascriptAsyncIterable, isJavascriptAsyncIterator, isJavascriptIterable, isJavascriptIterator, isLetter, isLetterOrDigit, isLowercasedLetter, isMap, isMutableMap, isNull, isNumber, isObject, isObjectOrArrayOrNull, isPromise, isPromiseLike, isSet, isString, isUndefined, isUndefinedOrNull, isUppercasedLetter, isWhitespace, isWonderlandTrailLocation, join, orList, parseHttpMethod, quote, toString };