@fgv/ts-utils 1.2.0 → 1.3.1

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 (77) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +4 -0
  3. package/brand.d.ts +8 -0
  4. package/brand.d.ts.map +1 -0
  5. package/brand.js +24 -0
  6. package/converter.d.ts +149 -105
  7. package/converter.d.ts.map +1 -0
  8. package/converter.js +59 -72
  9. package/converters.d.ts +432 -194
  10. package/converters.d.ts.map +1 -0
  11. package/converters.js +335 -224
  12. package/csvHelpers.d.ts +7 -0
  13. package/csvHelpers.d.ts.map +1 -0
  14. package/csvHelpers.js +14 -4
  15. package/extendedArray.d.ts +46 -0
  16. package/extendedArray.d.ts.map +1 -0
  17. package/extendedArray.js +53 -8
  18. package/formatter.d.ts +53 -0
  19. package/formatter.d.ts.map +1 -0
  20. package/formatter.js +27 -4
  21. package/hash.d.ts +51 -0
  22. package/hash.d.ts.map +1 -0
  23. package/hash.js +168 -0
  24. package/index.d.ts +7 -2
  25. package/index.d.ts.map +1 -0
  26. package/index.js +16 -5
  27. package/logger.d.ts +3 -2
  28. package/logger.d.ts.map +1 -0
  29. package/logger.js +12 -12
  30. package/package.json +24 -20
  31. package/rangeOf.d.ts +96 -0
  32. package/rangeOf.d.ts.map +1 -0
  33. package/rangeOf.js +81 -2
  34. package/result.d.ts +393 -39
  35. package/result.d.ts.map +1 -0
  36. package/result.js +259 -49
  37. package/ts-utils.d.ts +2475 -0
  38. package/tsdoc-metadata.json +11 -0
  39. package/utils.d.ts +71 -27
  40. package/utils.d.ts.map +1 -0
  41. package/utils.js +82 -37
  42. package/validation/boolean.d.ts +27 -0
  43. package/validation/boolean.d.ts.map +1 -0
  44. package/validation/boolean.js +59 -0
  45. package/validation/classes.d.ts +5 -0
  46. package/validation/classes.d.ts.map +1 -0
  47. package/validation/classes.js +34 -0
  48. package/validation/field.d.ts +43 -0
  49. package/validation/field.d.ts.map +1 -0
  50. package/validation/field.js +72 -0
  51. package/validation/genericValidator.d.ts +84 -0
  52. package/validation/genericValidator.d.ts.map +1 -0
  53. package/validation/genericValidator.js +138 -0
  54. package/validation/index.d.ts +7 -0
  55. package/validation/index.d.ts.map +1 -0
  56. package/validation/index.js +59 -0
  57. package/validation/number.d.ts +27 -0
  58. package/validation/number.d.ts.map +1 -0
  59. package/validation/number.js +57 -0
  60. package/validation/object.d.ts +115 -0
  61. package/validation/object.d.ts.map +1 -0
  62. package/validation/object.js +143 -0
  63. package/validation/string.d.ts +27 -0
  64. package/validation/string.d.ts.map +1 -0
  65. package/validation/string.js +57 -0
  66. package/validation/traits.d.ts +68 -0
  67. package/validation/traits.d.ts.map +1 -0
  68. package/validation/traits.js +58 -0
  69. package/validation/validator.d.ts +82 -0
  70. package/validation/validator.d.ts.map +1 -0
  71. package/validation/validator.js +24 -0
  72. package/validation/validatorBase.d.ts +25 -0
  73. package/validation/validatorBase.d.ts.map +1 -0
  74. package/validation/validatorBase.js +44 -0
  75. package/validation/validators.d.ts +32 -0
  76. package/validation/validators.d.ts.map +1 -0
  77. package/validation/validators.js +59 -0
package/converters.d.ts CHANGED
@@ -4,7 +4,9 @@ import { Result } from './result';
4
4
  import { ExtendedArray } from './extendedArray';
5
5
  declare type OnError = 'failOnError' | 'ignoreErrors';
6
6
  /**
7
- * Options for @see StringConverter maching method
7
+ * Options for {@link Converters.StringConverter | StringConverter}
8
+ * matching method
9
+ * @public
8
10
  */
9
11
  export interface StringMatchOptions {
10
12
  /**
@@ -14,275 +16,392 @@ export interface StringMatchOptions {
14
16
  message?: string;
15
17
  }
16
18
  /**
17
- * The @see StringConverter class extends @see BaseConverter to provide string-specific helper
18
- * functions.
19
+ * The {@link Converters.StringConverter | StringConverter} class extends {@link BaseConverter}
20
+ * to provide string-specific helper methods.
21
+ * @public
19
22
  */
20
23
  export declare class StringConverter<T extends string = string, TC = unknown> extends BaseConverter<T, TC> {
21
24
  /**
22
- * Construct a new @see StringConverter
23
- * @param defaultContext Optional context used by the conversion
24
- * @param traits Optional traits to be applied to the conversion
25
- * @param converter Optional converter to be used for the conversion
25
+ * Construct a new {@link Converters.StringConverter | StringConverter}.
26
+ * @param defaultContext - Optional context used by the conversion.
27
+ * @param traits - Optional traits to be applied to the conversion.
28
+ * @param converter - Optional conversion function to be used for the conversion.
26
29
  */
27
30
  constructor(defaultContext?: TC, traits?: ConverterTraits, converter?: (from: unknown, self: Converter<T, TC>, context?: TC) => Result<T>);
31
+ /**
32
+ * @internal
33
+ */
28
34
  protected static _convert<T extends string>(from: unknown): Result<T>;
35
+ /**
36
+ * @internal
37
+ */
29
38
  protected static _wrap<T extends string, TC>(wrapped: StringConverter<T, TC>, converter: (from: T) => Result<T>, traits?: ConverterTraits): StringConverter<T, TC>;
30
39
  /**
31
- * Returns a @see StringConverter which constrains the result to match a supplied
32
- * string.
33
- * @param match The string to be matched
34
- * @param options Optional @see StringMatchOptions for this conversion
35
- * @returns @see Success with a matching string or @see Failure with an informative
40
+ * Returns a {@link Converters.StringConverter | StringConverter} which constrains the result to match
41
+ * a supplied string.
42
+ * @param match - The string to be matched
43
+ * @param options - Optional {@link Converters.StringMatchOptions} for this conversion.
44
+ * @returns {@link Success} with a matching string or {@link Failure} with an informative
36
45
  * error if the string does not match.
46
+ * {@label string}
37
47
  */
38
48
  matching(match: string, options?: Partial<StringMatchOptions>): StringConverter<T, TC>;
39
49
  /**
40
- * Returns a @see StringConverter which constrains the result to match one of a supplied
41
- * array of strings.
42
- * @param match The array to be searched
43
- * @param options Optional @see StringMatchOptions for this conversion
44
- * @returns @see Success with a matching string or @see Failure with an informative
50
+ * Returns a {@link Converters.StringConverter | StringConverter} which constrains the result to match
51
+ * one of a supplied array of strings.
52
+ * @param match - The array of allowed strings.
53
+ * @param options - Optional {@link Converters.StringMatchOptions} for this conversion.
54
+ * @returns {@link Success} with a matching string or {@link Failure} with an informative
45
55
  * error if the string does not match.
56
+ * {@label array}
46
57
  */
47
58
  matching(match: string[], options?: Partial<StringMatchOptions>): StringConverter<T, TC>;
48
59
  /**
49
- * Returns a @see StringConverter which constrains the result to match one of a supplied
50
- * Set of strings.
51
- * @param match The Set to be tested
52
- * @param options Optional @see StringMatchOptions for this conversion
53
- * @returns @see Success with a matching string or @see Failure with an informative
60
+ * Returns a {@link Converters.StringConverter | StringConverter} which constrains the result to match
61
+ * one of a supplied `Set` of strings.
62
+ * @param match - The `Set` of allowed strings.
63
+ * @param options - Optional {@link Converters.StringMatchOptions} for this conversion.
64
+ * @returns {@link Success} with a matching string or {@link Failure} with an informative
54
65
  * error if the string does not match.
66
+ * {@label set}
55
67
  */
56
68
  matching(match: Set<T>, options?: Partial<StringMatchOptions>): StringConverter<T, TC>;
57
69
  /**
58
- * Returns a @see StringConverter which constrains the result to match a supplied regular
59
- * expression.
60
- * @param match The @see RegExp to be tested
61
- * @param options Optional @see StringMatchOptions for this conversion
62
- * @returns @see Success with a matching string or @see Failure with an informative
70
+ * Returns a {@link Converters.StringConverter | StringConverter} which constrains the result to match
71
+ * a supplied regular expression.
72
+ * @param match - The regular expression to be used as a constraint.
73
+ * @param options - Optional {@link Converters.StringMatchOptions} for this conversion
74
+ * @returns {@link Success} with a matching string or {@link Failure} with an informative
63
75
  * error if the string does not match.
76
+ * {@label regexp}
64
77
  */
65
78
  matching(match: RegExp, options?: Partial<StringMatchOptions>): StringConverter<T, TC>;
66
79
  }
67
80
  /**
68
81
  * A converter to convert unknown to string. Values of type
69
82
  * string succeed. Anything else fails.
83
+ * @public
70
84
  */
71
85
  export declare const string: StringConverter<string, unknown>;
72
86
  /**
73
- * Helper function to create a converter which converts unknown to string, applying
74
- * template conversions supplied at construction time or at runtime as context.
75
- * @param defaultContext optional default context to use for template values
87
+ * Helper function to create a {@link Converters.StringConverter | StringConverter} which converts
88
+ * `unknown` to `string`, applying template conversions supplied at construction time or at
89
+ * runtime as context.
90
+ * @remarks
91
+ * Template conversions are applied using `mustache` syntax.
92
+ * @param defaultContext - Optional default context to use for template values.
93
+ * @returns A new {@link Converter} returning `string`.
94
+ * @public
76
95
  */
77
96
  export declare function templateString(defaultContext?: unknown): StringConverter<string, unknown>;
78
97
  /**
79
- * A converter to convert unknown to one of a set of supplied enumerated values. Anything else fails.
98
+ * Helper function to create a {@link Converter} which converts `unknown` to one of a set of supplied
99
+ * enumerated values. Anything else fails.
100
+ *
101
+ * @remarks
80
102
  * Allowed enumerated values can also be supplied as context at conversion time.
81
- * @param values Array of allowed values
103
+ * @param values - Array of allowed values.
104
+ * @returns A new {@link Converter} returning `<T>`.
105
+ * @public
82
106
  */
83
107
  export declare function enumeratedValue<T>(values: T[]): Converter<T, T[]>;
84
108
  /**
85
- * Converts unknown to one of a set of supplied enumerated values, mapping any of multiple supplied
86
- * values to the enumeration. Enables mapping of multiple input values to a consistent internal
87
- * representation (so e.g. 'y', 'yes', 'true' and true can all map to boolean true)
88
- * @param map An array of tuples describing the mapping. The first element of each tuple is the result
109
+ * Helper function to create a {@link Converter} which converts `unknown` to one of a set of supplied enumerated
110
+ * values, mapping any of multiple supplied values to the enumeration.
111
+ * @remarks
112
+ * Enables mapping of multiple input values to a consistent internal representation (so e.g. `'y'`, `'yes'`,
113
+ * `'true'`, `1` and `true` can all map to boolean `true`)
114
+ * @param map - An array of tuples describing the mapping. The first element of each tuple is the result
89
115
  * value, the second is the set of values that map to the result. Tuples are evaluated in the order
90
116
  * supplied and are not checked for duplicates.
91
- * @param message an optional error message
92
- * @returns The mapped value
117
+ * @param message - An optional error message.
118
+ * @returns A {@link Converter} which applies the mapping and yields `<T>` on success.
119
+ * @public
93
120
  */
94
121
  export declare function mappedEnumeratedValue<T>(map: [T, unknown[]][], message?: string): Converter<T, undefined>;
95
122
  /**
96
- * A converter to convert unknown to some value. Succeeds with the supplied value if an identity
97
- * comparison succeeds, fails otherwise.
98
- * @param value The value to be compared
123
+ * Helper function to create a {@link Converter} which converts `unknown` to some supplied literal value. Succeeds with
124
+ * the supplied value if an identity comparison succeeds, fails otherwise.
125
+ * @param value - The value to be compared.
126
+ * @returns A {@link Converter} which returns the supplied value on success.
127
+ * @public
99
128
  */
100
129
  export declare function literal<T>(value: T): Converter<T, unknown>;
101
130
  /**
102
131
  * Deprecated alias for @see literal
103
- * @param value The value to be compared
104
- * @deprecated use literal instead
132
+ * @param value - The value to be compared.
133
+ * @deprecated Use {@link Converters.literal} instead.
134
+ * @internal
105
135
  */
106
136
  export declare const value: typeof literal;
107
137
  /**
108
- * A converter to convert unknown to a number. Numbers and strings
109
- * with a numeric format succeed. Anything else fails.
138
+ * A {@link Converter} which converts `unknown` to a `number`.
139
+ * @remarks
140
+ * Numbers and strings with a numeric format succeed. Anything else fails.
141
+ * @public
110
142
  */
111
143
  export declare const number: BaseConverter<number, undefined>;
112
144
  /**
113
- * A converter to convert unknown to boolean. Boolean values or the
114
- * case-insensitive strings 'true' and 'false' succeed. Anything
115
- * else fails.
145
+ * A {@link Converter} which converts `unknown` to `boolean`.
146
+ * @remarks
147
+ * Boolean values or the case-insensitive strings `'true'` and `'false'` succeed.
148
+ * Anything else fails.
149
+ * @public
116
150
  */
117
151
  export declare const boolean: BaseConverter<boolean, undefined>;
118
152
  /**
119
- * A converter to convert an optional string value. Values of type string
120
- * are returned. Anything else returns success with an undefined value.
153
+ * A {@link Converter} which converts an optional `string` value. Values of type
154
+ * `string` are returned. Anything else returns {@link Success} with value `undefined`.
155
+ * @public
121
156
  */
122
157
  export declare const optionalString: Converter<string | undefined, unknown>;
123
158
  /**
124
- * Creates a converter which converts any string into an array of strings
125
- * by separating at a supplied delimiter. Delimeter may also be supplied
126
- * as context at conversion time.
127
- * @param delimiter The delimiter at which to split.
159
+ * Helper function to create a {@link Converter} which converts any `string` into an
160
+ * array of `string`, by separating at a supplied delimiter.
161
+ * @remarks
162
+ * Delimeter may also be supplied as context at conversion time.
163
+ * @param delimiter - The delimiter at which to split.
164
+ * @returns A new {@link Converter} returning `string[]`.
165
+ * @public
128
166
  */
129
167
  export declare function delimitedString(delimiter: string, options?: 'filtered' | 'all'): Converter<string[], string>;
130
168
  /**
131
- * A converter to convert an iso formatted string, a number or a Date object to a Date object
169
+ * A {@link Converter} which converts an iso formatted string, a number or a `Date` object to
170
+ * a `Date` object.
171
+ * @public
132
172
  */
133
173
  export declare const isoDate: BaseConverter<Date, undefined>;
134
174
  /**
135
- * A converter to convert an optional number value. Values of type number
136
- * or numeric strings are converted and returned. Anything else returns
137
- * success with an undefined value.
175
+ * A {@link Converter} which converts an optional `number` value.
176
+ * @remarks
177
+ * Values of type `number` or numeric strings are converted and returned.
178
+ * Anything else returns {@link Success} with value `undefined`.
179
+ * @public
138
180
  */
139
181
  export declare const optionalNumber: Converter<number | undefined, undefined>;
140
182
  /**
141
- * A converter to convert an optional boolean value. Values of type boolean
142
- * or strings that match (case-insensitive) 'true' or 'false' are converted
143
- * and returned. Anything else returns success with an undefined value.
183
+ * A {@link Converter} to convert an optional `boolean` value.
184
+ * @remarks
185
+ * Values of type `boolean` or strings that match (case-insensitive) `'true'`
186
+ * or `'false'` are converted and returned. Anything else returns {@link Success}
187
+ * with value `undefined`.
188
+ * @public
144
189
  */
145
190
  export declare const optionalBoolean: Converter<boolean | undefined, undefined>;
146
191
  /**
147
- * A helper wrapper for polymorphic fields. Invokes the wrapped converters
148
- * in sequence, returning the first successful result. Returns an error
149
- * if none of the supplied converters can convert the value.
150
- *
151
- * If onError is 'ignoreErrors' (default), then errors from any of the
192
+ * A helper function to create a {@link Converter} for polymorphic values. Returns a
193
+ * converter which Invokes the wrapped converters in sequence, returning the first successful
194
+ * result. Returns an error if none of the supplied converters can convert the value.
195
+ * @remarks
196
+ * If `onError` is `ignoreErrors` (default), then errors from any of the
152
197
  * converters are ignored provided that some converter succeeds. If
153
- * onError is 'failOnError', then an error from any converter fails the entire
198
+ * onError is `failOnError`, then an error from any converter fails the entire
154
199
  * conversion.
155
200
  *
156
- * @param converters An ordered list of converters to be considered
157
- * @param onError Specifies treatment of unconvertable elements
201
+ * @param converters - An ordered list of {@link Converter | converters} to be considered.
202
+ * @param onError - Specifies treatment of unconvertable elements.
203
+ * @returns A new {@link Converter} which yields a value from the union of the types returned
204
+ * by the wrapped converters.
205
+ * @public
158
206
  */
159
207
  export declare function oneOf<T, TC = unknown>(converters: Array<Converter<T, TC>>, onError?: OnError): Converter<T, TC>;
160
208
  /**
161
- * A helper wrapper for converting an array of <T>. If onError is 'failOnError' (default),
162
- * then the entire conversion fails if any element cannot be converted. If onError
163
- * is 'ignoreErrors', failing elements are silently ignored.
164
- * @param converter Converter used to convert each item in the array
165
- * @param ignoreErrors Specifies treatment of unconvertable elements
209
+ * A helper function to create a {@link Converter} which converts `unknown` to an array of `<T>`.
210
+ * @remarks
211
+ * If `onError` is `'failOnError'` (default), then the entire conversion fails if any element cannot
212
+ * be converted. If `onError` is `'ignoreErrors'`, then failing elements are silently ignored.
213
+ * @param converter - {@link Converter} used to convert each item in the array.
214
+ * @param ignoreErrors - Specifies treatment of unconvertable elements.
215
+ * @returns A {@link Converter} which returns an array of `<T>`.
216
+ * @public
166
217
  */
167
218
  export declare function arrayOf<T, TC = undefined>(converter: Converter<T, TC>, onError?: OnError): Converter<T[], TC>;
168
219
  /**
169
- * A helper wrapper for converting to Itemrray<T>. If onError is 'failOnError' (default),
170
- * then the entire conversion fails if any element cannot be converted. If onError
171
- * is 'ignoreErrors', failing elements are silently ignored.
172
- * @param converter Converter used to convert each item in the array
173
- * @param ignoreErrors Specifies treatment of unconvertable elements
220
+ * A helper function to create a {@link Converter} which converts `unknown` to {@link ExtendedArray | ExtendedArray<T>}.
221
+ * @remarks
222
+ * If `onError` is `'failOnError'` (default), then the entire conversion fails if any element cannot
223
+ * be converted. If `onError` is `'ignoreErrors'`, then failing elements are silently ignored.
224
+ * @param converter - {@link Converter} used to convert each item in the array
225
+ * @param ignoreErrors - Specifies treatment of unconvertable elements
226
+ * @beta
174
227
  */
175
228
  export declare function extendedArrayOf<T, TC = undefined>(label: string, converter: Converter<T, TC>, onError?: OnError): Converter<ExtendedArray<T>, TC>;
176
229
  /**
177
- * Converter to convert an unknown to an array of strings. Conversion succeeds
178
- * and returns the supplied value if it as an array of strings, fails otherwise.
230
+ * {@link Converter} to convert an `unknown` to an array of `string`.
231
+ * @remarks
232
+ * Returns {@link Success} with the the supplied value if it as an array
233
+ * of strings, returns {@link Failure} with an error message otherwise.
234
+ * @public
179
235
  */
180
236
  export declare const stringArray: Converter<string[], unknown>;
181
237
  /**
182
- * Converter to convert an unknown to an array of numbers. Conversion succeeds
183
- * and returns the supplied value if it as an array of numbers, fails otherwise.
238
+ * {@link Converter} to convert an `unknown` to an array of `number`.
239
+ * @remarks
240
+ * Returns {@link Success} with the the supplied value if it as an array
241
+ * of numbers, returns {@link Failure} with an error message otherwise.
242
+ * @public
184
243
  */
185
244
  export declare const numberArray: Converter<number[], undefined>;
186
245
  /**
187
- * Options for 'recordOf' and 'mapOf' converters
246
+ * Options for {@link Converters.(recordOf:withOptions)} and {@link Converters.(mapOf:withOptions)}
247
+ * helper functions.
248
+ * @public
188
249
  */
189
250
  export interface KeyedConverterOptions<T extends string = string, TC = undefined> {
251
+ /**
252
+ * if `onError` is `'fail'` (default), then the entire conversion fails if any key or element
253
+ * cannot be converted. If `onError` is `'ignore'`, failing elements are silently ignored.
254
+ */
190
255
  onError?: 'fail' | 'ignore';
256
+ /**
257
+ * If present, `keyConverter` is used to convert the source object property names to
258
+ * keys in the resulting map or record.
259
+ * @remarks
260
+ * Can be used to coerce key names to supported values and/or strong types.
261
+ */
191
262
  keyConverter?: Converter<T, TC>;
192
263
  }
193
264
  /**
194
- * A helper wrapper to convert the string-keyed properties of an object to a Record of T.
195
- * Conversion fails if any element cannot be converted. If onError is 'ignore' failing
196
- * elements are silently ignored.
197
- * @param converter Converter used to convert each item in the record
265
+ * A helper function to create a {@link Converter} which converts the `string`-keyed properties
266
+ * using a supplied {@link Converter | Converter<T>} to produce a `Record<string, T>`.
267
+ * @remarks
268
+ * The resulting converter fails conversion if any element cannot be converted.
269
+ * @param converter - {@link Converter} used to convert each item in the source object.
270
+ * @returns A {@link Converter} which returns `Record<string, T>`.
271
+ * {@label default}
272
+ * @public
198
273
  */
199
274
  export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>): Converter<Record<TK, T>, TC>;
200
275
  /**
201
- * A helper wrapper to convert the string-keyed properties of an object to a Record of T.
202
- * If onError is 'fail' (default), then the entire conversion fails if any element
203
- * cannot be converted. If onError is 'ignore' failing elements are silently ignored.
204
- * @param converter Converter used to convert each item in the record
205
- * @param onError Specifies treatment of unconvertable elements
276
+ * A helper function to create a {@link Converter} which converts the `string`-keyed properties
277
+ * using a supplied {@link Converter | Converter<T>} to produce a `Record<string, T>` and optionally
278
+ * specified handling of elements that cannot be converted.
279
+ * @remarks
280
+ * if `onError` is `'fail'` (default), then the entire conversion fails if any key or element
281
+ * cannot be converted. If `onError` is `'ignore'`, failing elements are silently ignored.
282
+ * @param converter - {@link Converter} used to convert each item in the source object.
283
+ * @returns A {@link Converter} which returns `Record<string, T>`.
284
+ * {@label withOnError}
285
+ * @public
206
286
  */
207
287
  export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, onError: 'fail' | 'ignore'): Converter<Record<TK, T>, TC>;
208
288
  /**
209
- * A helper wrapper to convert the string-keyed properties of an object to a Record of T.
210
- * If options specify a key converter it will be applied to each key.
211
- * If onError is 'fail' (default), then the entire conversion fails if any key or element
212
- * cannot be converted. If onError is 'ignore' failing elements are silently ignored.
213
- * @param converter Converter used to convert each item in the record
214
- * @param options Optional @see KeyedConverterOptions
289
+ * A helper function to create a {@link Converter} which converts the `string`-keyed properties
290
+ * using a supplied {@link Converter | Converter<T>} to produce a `Record<TK, T>`.
291
+ * @remarks
292
+ * If present, the supplied {@link Converters.KeyedConverterOptions | options} can provide a strongly-typed
293
+ * converter for keys and/or control the handling of elements that fail conversion.
294
+ * @param converter - {@link Converter} used to convert each item in the source object.
295
+ * @param options - Optional {@link Converters.KeyedConverterOptions | KeyedConverterOptions<TK, TC>} which
296
+ * supplies a key converter and/or error-handling options.
297
+ * @returns A {@link Converter} which returns `Record<TK, T>`.
298
+ * {@label withOptions}
299
+ * @public
215
300
  */
216
301
  export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, options: KeyedConverterOptions<TK, TC>): Converter<Record<TK, T>, TC>;
217
302
  /**
218
- * A helper wrapper to convert the string-keyed properties of an object to a Map of T.
219
- * Conversion fails if any element cannot be converted.
220
- * @param converter Converter used to convert each item in the map
303
+ * A helper function to create a {@link Converter} which converts the `string`-keyed properties
304
+ * using a supplied {@link Converter | Converter<T>} to produce a `Map<string, T>`.
305
+ * @remarks
306
+ * The resulting converter fails conversion if any element cannot be converted.
307
+ * @param converter - {@link Converter} used to convert each item in the source object.
308
+ * @returns A {@link Converter} which returns `Map<string, T>`.
309
+ * {@label default}
310
+ * @public
221
311
  */
222
312
  export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>): Converter<Map<TK, T>, TC>;
223
313
  /**
224
- * A helper wrapper to convert the string-keyed properties of an object to a Map of T.
225
- * If onError is 'fail' (default), then the entire conversion fails if any element
226
- * cannot be converted. If onError is 'ignore' failing elements are silently ignored.
227
- * @param converter Converter used to convert each item in the map
228
- * @param onError Specifies treatment of unconvertable elements
314
+ * A helper function to create a {@link Converter} which converts the `string`-keyed properties
315
+ * using a supplied {@link Converter | Converter<T>} to produce a `Map<string, T>` and optionally
316
+ * specified handling of elements that cannot be converted.
317
+ * @remarks
318
+ * if `onError` is `'fail'` (default), then the entire conversion fails if any key or element
319
+ * cannot be converted. If `onError` is `'ignore'`, failing elements are silently ignored.
320
+ * @param converter - {@link Converter} used to convert each item in the source object.
321
+ * @returns A {@link Converter} which returns `Map<string, T>`.
322
+ * {@label withOnError}
323
+ * @public
229
324
  */
230
325
  export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, onError: 'fail' | 'ignore'): Converter<Map<TK, T>, TC>;
231
326
  /**
232
- * A helper wrapper to convert the string-keyed properties of an object to a Map of T.
233
- * If options specify a key converter it will be applied to each key.
234
- * If onError is 'fail' (default), then the entire conversion fails if any key or element
235
- * cannot be converted. If onError is 'ignore' failing elements are silently ignored.
236
- * @param converter Converter used to convert each item in the map
237
- * @param options Optional @see KeyedConverterOptions
327
+ * A helper function to create a {@link Converter} which converts the `string`-keyed properties
328
+ * using a supplied {@link Converter | Converter<T>} to produce a `Map<TK, T>`.
329
+ * @remarks
330
+ * If present, the supplied {@link Converters.KeyedConverterOptions | options} can provide a strongly-typed
331
+ * converter for keys and/or control the handling of elements that fail conversion.
332
+ * @param converter - {@link Converter} used to convert each item in the source object.
333
+ * @param options - Optional {@link Converters.KeyedConverterOptions | KeyedConverterOptions<TK, TC>} which
334
+ * supplies a key converter and/or error-handling options.
335
+ * @returns A {@link Converter} which returns `Map<TK, T>`.
336
+ * {@label withOptions}
337
+ * @public
238
338
  */
239
339
  export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, options: KeyedConverterOptions<TK, TC>): Converter<Map<TK, T>, TC>;
240
340
  /**
241
- * Gets a converter which validates that a supplied value is of a type validated by
242
- * a supplied validator and returns it.
243
- * @param validator A validator function to determine if the converted value is valid
244
- * @param description A description of the validate type for use in error messages
245
- * @returns If validator returns true, suceeds with from coerced to T. Fails with an error
246
- * message otherwise.
341
+ * Helper function to create a {@link Converter} which validates that a supplied value is
342
+ * of a type validated by a supplied validator function and returns it.
343
+ * @remarks
344
+ * If `validator` succeeds, this {@link Converter} returns {@link Success} with the supplied
345
+ * value of `from` coerced to type `<T>`. Returns a {@link Failure} with additional
346
+ * information otherwise.
347
+ * @param validator - A validator function to determine if the converted value is valid.
348
+ * @param description - A description of the validated type for use in error messages.
349
+ * @returns A new {@link Converter | Converter<T>} which applies the supplied validation.
350
+ * @public
247
351
  */
248
352
  export declare function validateWith<T, TC = undefined>(validator: (from: unknown) => from is T, description?: string): Converter<T, TC>;
249
353
  /**
250
- * A helper function to extract and convert an element from an array. Succeeds and returns
251
- * the converted value if the element exists in the supplied parameter and can be converted.
252
- * Fails otherwise.
253
- * @param index The index of the field to be extracted.
254
- * @param converter Converter used to convert the extracted element.
354
+ * A helper function to create a {@link Converter} which extracts and converts an element from an array.
355
+ * @remarks
356
+ * The returned {@link Converter} returns {@link Success} with the converted value if the element exists
357
+ * in the supplied array and can be converted. Returns {@link Failure} with an error message otherwise.
358
+ * @param index - The index of the element to be extracted.
359
+ * @param converter - A {@link Converter} used to convert the extracted element.
360
+ * @returns A {@link Converter | Converter<T>} which extracts the specified element from an array.
361
+ * @public
255
362
  */
256
363
  export declare function element<T, TC = undefined>(index: number, converter: Converter<T, TC>): Converter<T, TC>;
257
364
  /**
258
- * A helper function to extract and convert an optional element from an array. Succeeds
259
- * and returns the converted value if the element exists in the supplied parameter and can
260
- * be converted. Succeeds with undefined if the parameter is an array but the index is too
261
- * large. Fails if the supplied parameter is not an array, if the requested index is negative,
262
- * or if the element cannot be converted.
263
- * @param name The name of the field to be extracted.
264
- * @param converter Converter used to convert the extracted field.
365
+ * A helper function to create a {@link Converter} which extracts and converts an optional element from an array.
366
+ * @remarks
367
+ * The resulting {@link Converter} returns {@link Success} with the converted value if the element exsist
368
+ * in the supplied array and can be converted. Returns {@link Success} with value `undefined` if the parameter
369
+ * is an array but the index is out of range. Returns {@link Failure} with a message if the supplied parameter
370
+ * is not an array, if the requested index is negative, or if the element cannot be converted.
371
+ * @param index - The index of the element to be extracted.
372
+ * @param converter - A {@link Converter} used to convert the extracted element.
373
+ * @returns A {@link Converter | Converter<T>} which extracts the specified element from an array.
374
+ * @public
265
375
  */
266
376
  export declare function optionalElement<T, TC = undefined>(index: number, converter: Converter<T, TC>): Converter<T | undefined, TC>;
267
377
  /**
268
- * A helper function to extract and convert a field from an object. Succeeds and returns
269
- * the converted value if the field exists in the supplied parameter and can be converted.
270
- * Fails otherwise.
271
- * @param name The name of the field to be extracted.
272
- * @param converter Converter used to convert the extracted field.
378
+ * A helper function to create a {@link Converter} which extracts and convert a property specified
379
+ * by name from an object.
380
+ * @remarks
381
+ * The resulting {@link Converter} returns {@link Success} with the converted value of the correpsonding
382
+ * object property if the field exists and can be converted. Returns {@link Failure} with an error message
383
+ * otherwise.
384
+ * @param name - The name of the field to be extracted.
385
+ * @param converter - {@link Converter} used to convert the extracted field.
386
+ * @public
273
387
  */
274
388
  export declare function field<T, TC = undefined>(name: string, converter: Converter<T, TC>): Converter<T, TC>;
275
389
  /**
276
- * A helper function to extract and convert an optional field from an object. Succeeds
277
- * and returns the converted value if the field exists in the supplied parameter and can
278
- * be converted. Succeeds with undefined if the parameter is an object but the named field
279
- * is not present. Fails if the supplied parameter is not an object.
280
- * @param name The name of the field to be extracted.
281
- * @param converter Converter used to convert the extracted field.
390
+ * A helper function to create a {@link Converter} which extracts and convert a property specified
391
+ * by name from an object.
392
+ * @remarks
393
+ * The resulting {@link Converter} returns {@link Success} with the converted value of the correpsonding
394
+ * object property if the field exists and can be converted. Returns {@link Success} with value `undefined`
395
+ * if the supplied parametr is an object but the named field is not present. Returns {@link Failure} with
396
+ * an error message otherwise.
397
+ * @param name - The name of the field to be extracted.
398
+ * @param converter - {@link Converter} used to convert the extracted field.
399
+ * @public
282
400
  */
283
401
  export declare function optionalField<T, TC = undefined>(name: string, converter: Converter<T, TC>): Converter<T | undefined, TC>;
284
402
  /**
285
- * Options for an @see ObjectConverter.
403
+ * Options for an {@link Converters.ObjectConverter | ObjectConverter}.
404
+ * @public
286
405
  */
287
406
  export interface ObjectConverterOptions<T> {
288
407
  /**
@@ -297,101 +416,220 @@ export interface ObjectConverterOptions<T> {
297
416
  }
298
417
  /**
299
418
  * Per-property converters for each of the properties in type T.
419
+ * @remarks
420
+ * Used to construct a {@link Converters.ObjectConverter | ObjectConverter}
421
+ * @public
300
422
  */
301
423
  export declare type FieldConverters<T, TC = unknown> = {
302
424
  [key in keyof T]: Converter<T[key], TC>;
303
425
  };
304
426
  /**
305
- * Converter to convert an object of type T without changing shape, given a @see FieldConverters<T>.
306
- * If all of the required fields exist and can be converted, returns a new object with the converted
307
- * values under the original key names. If any required fields do not exist or cannot be converted,
308
- * the entire conversion fails. See @see ObjectConverterOptions for other conversion options.
427
+ * A {@link Converter} which converts an object of type `<T>` without changing shape, given
428
+ * a {@link Converters.FieldConverters | FieldConverters<T>} for the fields in the object.
429
+ * @remarks
430
+ * By default, if all of the required fields exist and can be converted, returns a new object with
431
+ * the converted values under the original key names. If any required fields do not exist or cannot
432
+ * be converted, the entire conversion fails. See {@link Converters.ObjectConverterOptions | ObjectConverterOptions}
433
+ * for other conversion options.
434
+ * @public
309
435
  */
310
436
  export declare class ObjectConverter<T, TC = unknown> extends BaseConverter<T, TC> {
437
+ /**
438
+ * Fields converted by this {@link Converters.ObjectConverter | ObjectConverter}.
439
+ */
311
440
  readonly fields: FieldConverters<T>;
441
+ /**
442
+ * Options used to initialize this {@link Converters.ObjectConverter | ObjectConverter}.
443
+ */
312
444
  readonly options: ObjectConverterOptions<T>;
313
445
  /**
314
- * Constructs a new @see ObjectConverter<T> using options supplied in an
315
- * optional @see ObjectConverterOptions<T>.
316
- * @param fields A @see FieldConverters<T> containing converters for each field
317
- * @param options An optional @see ObjectConverterOptions to configure the conversion
446
+ * Constructs a new {@link Converters.ObjectConverter | ObjectConverter<T>} using options
447
+ * supplied in a {@link Converters.ObjectConverterOptions | ObjectConverterOptions<T>}.
448
+ * @param fields - A {@link Converters.FieldConverters | FieldConverters<T>} containing
449
+ * a {@link Converter} for each field
450
+ * @param options - An optional @see ObjectConverterOptions to configure the conversion
451
+ * {@label withOptions}
318
452
  */
319
453
  constructor(fields: FieldConverters<T, TC>, options?: ObjectConverterOptions<T>);
320
454
  /**
321
- * Constructs a new @see ObjectConverter<T> using optional fields supplied in an
322
- * optional array of keyof T.
323
- * @param fields A @see FieldConverters<T> containing converters for each field
324
- * @param optional An optional array of keyof T listing fields that are not required.
455
+ * Constructs a new {@link Converters.ObjectConverter | ObjectConverter<T>} with optional
456
+ * properties specified as an array of `keyof T`.
457
+ * @param fields - A {@link Converters.FieldConverters | FieldConverters<T>} containing
458
+ * a {@link Converter} for each field.
459
+ * @param optional - An array of `keyof T` listing fields that are not required.
460
+ * {@label withKeys}
325
461
  */
326
462
  constructor(fields: FieldConverters<T, TC>, optional?: (keyof T)[]);
463
+ /**
464
+ * Creates a new {@link Converters.ObjectConverter | ObjectConverter} derived from this one but with
465
+ * new optional properties as specified by a supplied {@link Converters.ObjectConverterOptions | ObjectConverterOptions<T>}.
466
+ * @param options - The {@link Converters.ObjectConverterOptions | options} to be applied to the new
467
+ * converter.
468
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} with the additional optional source properties.
469
+ * {@label withOptions}
470
+ */
327
471
  partial(options: ObjectConverterOptions<T>): ObjectConverter<Partial<T>, TC>;
472
+ /**
473
+ * Creates a new {@link Converters.ObjectConverter | ObjectConverter} derived from this one but with
474
+ * new optional properties as specified by a supplied array of `keyof T`.
475
+ * @param optional - The keys of the source object properties to be made optional.
476
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} with the additional optional source
477
+ * properties.
478
+ * {@label withKeys}
479
+ */
328
480
  partial(optional?: (keyof T)[]): ObjectConverter<Partial<T>, TC>;
329
- addPartial(addOptionalFields: (keyof T)[]): ObjectConverter<Partial<T>, TC>;
481
+ /**
482
+ * Creates a new {@link Converters.ObjectConverter | ObjectConverter} derived from this one but with
483
+ * new optional properties as specified by a supplied array of `keyof T`.
484
+ * @param addOptionalProperties - The keys to be made optional.
485
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} with the additional optional source
486
+ * properties.
487
+ */
488
+ addPartial(addOptionalProperties: (keyof T)[]): ObjectConverter<Partial<T>, TC>;
330
489
  }
331
490
  /**
332
- * Helper to convert an object without changing shape. The source parameter is an object with
333
- * key names that correspond to the target object and the appropriate corresponding converter
334
- * as the property value. If all of the requested fields exist and can be converted, returns a
335
- * new object with the converted values under the original key names. If any fields do not exist
336
- * or cannot be converted, the entire conversion fails.
491
+ * Helper function to create a {@link Converters.ObjectConverter | ObjectConverter<T>} which converts an object
492
+ * without changing shape, given a {@link Converters.FieldConverters | FieldConverters<T>} and an optional
493
+ * {@link Converters.ObjectConverterOptions | ObjectConverterOptions<T>} to further refine conversion beavior.
494
+ * @remarks
495
+ * By default, if all of the requested fields exist and can be converted, returns {@link Success}
496
+ * with a new object that contains the converted values under the original key names. If any requried properties
497
+ * do not exist or cannot be converted, the entire conversion fails, returning {@link Failure} with additional
498
+ * error information.
499
+ *
500
+ * Fields that succeed but convert to undefined are omitted from the result object but do not
501
+ * fail the conversion.
502
+ * @param properties - An {@link Converters.FieldConverters | FieldConverters<T>} defining the shape of the
503
+ * source object and {@link Converter | converters} to be applied to each properties.
504
+ * @param options - An {@link Converters.ObjectConverterOptions | ObjectConverterOptions<T>} containing options
505
+ * for the object converter.
506
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} which applies the specified conversions.
507
+ * {@label withOptions}
508
+ * @public
509
+ */
510
+ export declare function object<T>(properties: FieldConverters<T>, options?: ObjectConverterOptions<T>): ObjectConverter<T>;
511
+ /**
512
+ * Helper function to create a {@link Converters.ObjectConverter | ObjectConverter<T>} which converts an object
513
+ * without changing shape, given a {@link Converters.FieldConverters | FieldConverters<T>} and a set of
514
+ * optional properties.
515
+ * @remarks
516
+ * By default, if all of the requested fields exist and can be converted, returns {@link Success}
517
+ * with a new object that contains the converted values under the original key names. If any requried properties
518
+ * do not exist or cannot be converted, the entire conversion fails, returning {@link Failure} with additional
519
+ * error information.
337
520
  *
338
521
  * Fields that succeed but convert to undefined are omitted from the result object but do not
339
522
  * fail the conversion.
340
- * @param fields An object containing defining the shape and converters to be applied.
341
- * @param opt An @see ObjectConverterOptions<T> containing options for the object converter, or
342
- * an array of (keyof T) containing optional keys.
523
+ * @param properties - An {@link Converters.FieldConverters | FieldConverters<T>} defining the shape of the
524
+ * source object and {@link Converter | converters} to be applied to each properties.
525
+ * @param optional - An array of `(keyof T)` listing the keys to be considered optional.
526
+ * {@label withKeys}
527
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} which applies the specified conversions.
528
+ * @public
529
+ * @deprecated Use {@link Converters.(object:withOptions) | Converters.object(fields, options)} instead.
343
530
  */
344
- export declare function object<T>(fields: FieldConverters<T>, opt?: (keyof T)[] | ObjectConverterOptions<T>): ObjectConverter<T>;
531
+ export declare function object<T>(properties: FieldConverters<T>, optional: (keyof T)[]): ObjectConverter<T>;
345
532
  /**
346
- * Helper to convert an object without changing shape. The source parameter is an object with
347
- * key names that correspond to the target object and the appropriate corresponding converter
348
- * as the property value. If all of the requested fields exist and can be converted, returns a
349
- * new object with the converted values under the original key names. If any fields do not exist
350
- * or cannot be converted, the entire conversion fails.
533
+ * Options for the {@link Converters.(strictObject:withOptions)} helper function.
534
+ * @public
535
+ */
536
+ export declare type StrictObjectConverterOptions<T> = Omit<ObjectConverterOptions<T>, 'strict'>;
537
+ /**
538
+ * Helper function to create a {@link Converters.ObjectConverter | ObjectConverter} which converts an object
539
+ * without changing shape, a {@link Converters.FieldConverters | FieldConverters<T>} and an optional
540
+ * {@link Converters.StrictObjectConverterOptions | StrictObjectConverterOptions<T>} to further refine
541
+ * conversion behavior.
542
+ *
543
+ * @remarks
544
+ * Fields that succeed but convert to undefined are omitted from the result object but do not
545
+ * fail the conversion.
546
+ *
547
+ * The conversion fails if any unexpected fields are encountered.
351
548
  *
549
+ * @param properties - An object containing defining the shape and converters to be applied.
550
+ * @param options - An optional @see StrictObjectConverterOptions<T> containing options for the object converter.
551
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} which applies the specified conversions.
552
+ * {@label withOptions}
553
+ * @public
554
+ */
555
+ export declare function strictObject<T>(properties: FieldConverters<T>, options?: StrictObjectConverterOptions<T>): ObjectConverter<T>;
556
+ /**
557
+ * Helper function to create a {@link Converters.ObjectConverter | ObjectConverter} which converts an object
558
+ * without changing shape, a {@link Converters.FieldConverters | FieldConverters<T>} and an optional
559
+ * {@link Converters.StrictObjectConverterOptions | StrictObjectConverterOptions<T>} to further refine
560
+ * conversion behavior.
561
+ *
562
+ * @remarks
352
563
  * Fields that succeed but convert to undefined are omitted from the result object but do not
353
564
  * fail the conversion.
354
565
  *
355
566
  * The conversion fails if any unexpected fields are encountered.
356
567
  *
357
- * @param fields An object containing defining the shape and converters to be applied.
358
- * @param opt - An @see ObjectConverterOptions<T> containing options for the object converter, or
359
- * an array of (keyof T) containing optional keys.
568
+ * @param properties - An object containing defining the shape and converters to be applied.
569
+ * @param optional - An array of `keyof T` containing keys to be considered optional.
570
+ * @returns A new {@link Converters.ObjectConverter | ObjectConverter} which applies the specified conversions.
571
+ * {@label withKeys}
572
+ * @deprecated Use {@link Converters.(strictObject:withOptions) | Converters.strictObject(options)} instead.
573
+ * @public
574
+ */
575
+ export declare function strictObject<T>(properties: FieldConverters<T>, optional: (keyof T)[]): ObjectConverter<T>;
576
+ /**
577
+ * A string-keyed `Record<string, Converter>` which maps specific {@link Converter | converters} to the
578
+ * value of a discriminator property.
579
+ * @public
360
580
  */
361
- export declare function strictObject<T>(fields: FieldConverters<T>, opt?: (keyof T)[] | Omit<ObjectConverterOptions<T>, 'strict'>): ObjectConverter<T>;
362
581
  export declare type DiscriminatedObjectConverters<T, TD extends string = string, TC = unknown> = Record<TD, Converter<T, TC>>;
363
582
  /**
364
- * Helper to convert a discriminated property without changing shape. Takes the name of the
365
- * discriminator property and a string-keyed record of object converters, and invokes the
366
- * converter that corresponds to the value of the discriminator property in the source object.
367
- * Fails if the source is not an object or if the discriminator property is missing or has
368
- * a value not present in the converters.
369
- * @param discriminatorProp Name of the property used to discriminate types
370
- * @param converters String-keyed record of converters to invoke, where key corresponds to a value of the
371
- * discriminator property.
583
+ * Helper to create a {@link Converter} whhich converts a discriminated object without changing shape.
584
+ * @remarks
585
+ * Takes the name of the discriminator property and a
586
+ * {@link Converters.DiscriminatedObjectConverters | string-keyed Record of converters}. During conversion,
587
+ * the resulting {@link Converter} invokes the converter from `converters` that corresponds to the value of
588
+ * the discriminator property in the source object.
589
+ *
590
+ * If the source is not an object, the discriminator property is missing, or the discriminator has
591
+ * a value not present in the converters, conversion fails and returns {@link Failure} with more information.
592
+ * @param discriminatorProp - Name of the property used to discriminate types.
593
+ * @param converters - {@link Converters.DiscriminatedObjectConverters | String-keyed record of converters} to
594
+ * invoke, where each key corresponds to a value of the discriminator property.
595
+ * @returns A {@link Converter} which converts the corresponding discriminated object.
596
+ * @public
372
597
  */
373
598
  export declare function discriminatedObject<T, TD extends string = string, TC = unknown>(discriminatorProp: string, converters: DiscriminatedObjectConverters<T, TD>): Converter<T, TC>;
374
599
  /**
375
- * Helper to convert an object to a new object with a different shape. The source parameter is
376
- * an object with key names that correspond to the target object, and an approriate _field_
377
- * converter that will extract and convert a single field from the source object.
600
+ * Helper to create a {@link Converter} which converts a source object to a new object with a
601
+ * different shape.
378
602
  *
379
- * If all of the extracted fields exist and can be converted, returns a new object with the
380
- * converted values under the original key names. If any fields to be extracted do not exist
381
- * or cannot be converted, the entire conversion fails.
603
+ * @remarks
604
+ * On successful conversion, the resulting {@link Converter} returns {@link Success} with a new
605
+ * object, which contains the converted values under the key names specified at initialization time.
606
+ * It returns {@link Failure} with an error message if any fields to be extracted do not exist
607
+ * or cannot be converted.
382
608
  *
383
609
  * Fields that succeed but convert to undefined are omitted from the result object but do not
384
610
  * fail the conversion.
385
611
  *
386
- * @param fields An object defining the shape of the target object and the field converters
387
- * to be used to construct it.
612
+ * @param properties - An object with key names that correspond to the target object and an
613
+ * appropriate {@link Converters.FieldConverters | FieldConverter} which extracts and converts
614
+ * a single filed from the source object.
615
+ * @returns A {@link Converter} with the specified conversion behavior.
616
+ * @public
388
617
  */
389
- export declare function transform<T, TC = unknown>(fields: FieldConverters<T, TC>): Converter<T, TC>;
618
+ export declare function transform<T, TC = unknown>(properties: FieldConverters<T, TC>): Converter<T, TC>;
390
619
  /**
391
- * A helper wrapper to convert a range of some other comparable type
392
- * @param converter Converter used to convert min and max extent of the raid
393
- * @param constructor Optional static constructor to instantiate the object
620
+ * A helper wrapper to construct a {@link Converter} which converts to an arbitrary strongly-typed
621
+ * range of some comparable type.
622
+ * @param converter - {@link Converter} used to convert `min` and `max` extent of the range.
623
+ * @param constructor - Static constructor to instantiate the object.
624
+ * @public
394
625
  */
395
626
  export declare function rangeTypeOf<T, RT extends RangeOf<T>, TC = unknown>(converter: Converter<T, TC>, constructor: (init: RangeOfProperties<T>) => Result<RT>): Converter<RT, TC>;
627
+ /**
628
+ * A helper wrapper to construct a {@link Converter} which converts to {@link RangeOf | RangeOf<T>}
629
+ * where `<T>` is some comparable type.
630
+ * @param converter - {@link Converter} used to convert `min` and `max` extent of the range.
631
+ * @public
632
+ */
396
633
  export declare function rangeOf<T, TC = unknown>(converter: Converter<T, TC>): Converter<RangeOf<T>, TC>;
397
634
  export {};
635
+ //# sourceMappingURL=converters.d.ts.map