@smithy/core 3.3.3 → 3.4.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.
@@ -0,0 +1,270 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * Give an input string, strictly parses a boolean value.
5
+ *
6
+ * @param value - The boolean string to parse.
7
+ * @returns true for "true", false for "false", otherwise an error is thrown.
8
+ */
9
+ export declare const parseBoolean: (value: string) => boolean;
10
+ /**
11
+ * @internal
12
+ *
13
+ * Asserts a value is a boolean and returns it.
14
+ * Casts strings and numbers with a warning if there is evidence that they were
15
+ * intended to be booleans.
16
+ *
17
+ * @param value - A value that is expected to be a boolean.
18
+ * @returns The value if it's a boolean, undefined if it's null/undefined,
19
+ * otherwise an error is thrown.
20
+ */
21
+ export declare const expectBoolean: (value: any) => boolean | undefined;
22
+ /**
23
+ * @internal
24
+ *
25
+ * Asserts a value is a number and returns it.
26
+ * Casts strings with a warning if the string is a parseable number.
27
+ * This is to unblock slight API definition/implementation inconsistencies.
28
+ *
29
+ * @param value - A value that is expected to be a number.
30
+ * @returns The value if it's a number, undefined if it's null/undefined,
31
+ * otherwise an error is thrown.
32
+ */
33
+ export declare const expectNumber: (value: any) => number | undefined;
34
+ /**
35
+ * @internal
36
+ *
37
+ * Asserts a value is a 32-bit float and returns it.
38
+ *
39
+ * @param value - A value that is expected to be a 32-bit float.
40
+ * @returns The value if it's a float, undefined if it's null/undefined,
41
+ * otherwise an error is thrown.
42
+ */
43
+ export declare const expectFloat32: (value: any) => number | undefined;
44
+ /**
45
+ * @internal
46
+ *
47
+ * Asserts a value is an integer and returns it.
48
+ *
49
+ * @param value - A value that is expected to be an integer.
50
+ * @returns The value if it's an integer, undefined if it's null/undefined,
51
+ * otherwise an error is thrown.
52
+ */
53
+ export declare const expectLong: (value: any) => number | undefined;
54
+ /**
55
+ * @internal
56
+ *
57
+ * @deprecated Use expectLong
58
+ */
59
+ export declare const expectInt: (value: any) => number | undefined;
60
+ /**
61
+ * @internal
62
+ *
63
+ * Asserts a value is a 32-bit integer and returns it.
64
+ *
65
+ * @param value - A value that is expected to be an integer.
66
+ * @returns The value if it's an integer, undefined if it's null/undefined,
67
+ * otherwise an error is thrown.
68
+ */
69
+ export declare const expectInt32: (value: any) => number | undefined;
70
+ /**
71
+ * @internal
72
+ *
73
+ * Asserts a value is a 16-bit integer and returns it.
74
+ *
75
+ * @param value - A value that is expected to be an integer.
76
+ * @returns The value if it's an integer, undefined if it's null/undefined,
77
+ * otherwise an error is thrown.
78
+ */
79
+ export declare const expectShort: (value: any) => number | undefined;
80
+ /**
81
+ * @internal
82
+ *
83
+ * Asserts a value is an 8-bit integer and returns it.
84
+ *
85
+ * @param value - A value that is expected to be an integer.
86
+ * @returns The value if it's an integer, undefined if it's null/undefined,
87
+ * otherwise an error is thrown.
88
+ */
89
+ export declare const expectByte: (value: any) => number | undefined;
90
+ /**
91
+ * @internal
92
+ *
93
+ * Asserts a value is not null or undefined and returns it, or throws an error.
94
+ *
95
+ * @param value - A value that is expected to be defined
96
+ * @param location - The location where we're expecting to find a defined object (optional)
97
+ * @returns The value if it's not undefined, otherwise throws an error
98
+ */
99
+ export declare const expectNonNull: <T>(value: T | null | undefined, location?: string) => T;
100
+ /**
101
+ * @internal
102
+ *
103
+ * Asserts a value is an JSON-like object and returns it. This is expected to be used
104
+ * with values parsed from JSON (arrays, objects, numbers, strings, booleans).
105
+ *
106
+ * @param value - A value that is expected to be an object
107
+ * @returns The value if it's an object, undefined if it's null/undefined,
108
+ * otherwise an error is thrown.
109
+ */
110
+ export declare const expectObject: (value: any) => Record<string, any> | undefined;
111
+ /**
112
+ * @internal
113
+ *
114
+ * Asserts a value is a string and returns it.
115
+ * Numbers and boolean will be cast to strings with a warning.
116
+ *
117
+ * @param value - A value that is expected to be a string.
118
+ * @returns The value if it's a string, undefined if it's null/undefined,
119
+ * otherwise an error is thrown.
120
+ */
121
+ export declare const expectString: (value: any) => string | undefined;
122
+ /**
123
+ * @internal
124
+ *
125
+ * Asserts a value is a JSON-like object with only one non-null/non-undefined key and
126
+ * returns it.
127
+ *
128
+ * @param value - A value that is expected to be an object with exactly one non-null,
129
+ * non-undefined key.
130
+ * @returns the value if it's a union, undefined if it's null/undefined, otherwise
131
+ * an error is thrown.
132
+ */
133
+ export declare const expectUnion: (value: unknown) => Record<string, any> | undefined;
134
+ /**
135
+ * @internal
136
+ *
137
+ * Parses a value into a double. If the value is null or undefined, undefined
138
+ * will be returned. If the value is a string, it will be parsed by the standard
139
+ * parseFloat with one exception: NaN may only be explicitly set as the string
140
+ * "NaN", any implicit Nan values will result in an error being thrown. If any
141
+ * other type is provided, an exception will be thrown.
142
+ *
143
+ * @param value - A number or string representation of a double.
144
+ * @returns The value as a number, or undefined if it's null/undefined.
145
+ */
146
+ export declare const strictParseDouble: (value: string | number) => number | undefined;
147
+ /**
148
+ * @internal
149
+ *
150
+ * @deprecated Use strictParseDouble
151
+ */
152
+ export declare const strictParseFloat: (value: string | number) => number | undefined;
153
+ /**
154
+ * @internal
155
+ *
156
+ * Parses a value into a float. If the value is null or undefined, undefined
157
+ * will be returned. If the value is a string, it will be parsed by the standard
158
+ * parseFloat with one exception: NaN may only be explicitly set as the string
159
+ * "NaN", any implicit Nan values will result in an error being thrown. If any
160
+ * other type is provided, an exception will be thrown.
161
+ *
162
+ * @param value - A number or string representation of a float.
163
+ * @returns The value as a number, or undefined if it's null/undefined.
164
+ */
165
+ export declare const strictParseFloat32: (value: string | number) => number | undefined;
166
+ /**
167
+ * @internal
168
+ *
169
+ * Asserts a value is a number and returns it. If the value is a string
170
+ * representation of a non-numeric number type (NaN, Infinity, -Infinity),
171
+ * the value will be parsed. Any other string value will result in an exception
172
+ * being thrown. Null or undefined will be returned as undefined. Any other
173
+ * type will result in an exception being thrown.
174
+ *
175
+ * @param value - A number or string representation of a non-numeric float.
176
+ * @returns The value as a number, or undefined if it's null/undefined.
177
+ */
178
+ export declare const limitedParseDouble: (value: string | number) => number | undefined;
179
+ /**
180
+ * @internal
181
+ *
182
+ * @deprecated Use limitedParseDouble
183
+ */
184
+ export declare const handleFloat: (value: string | number) => number | undefined;
185
+ /**
186
+ * @internal
187
+ *
188
+ * @deprecated Use limitedParseDouble
189
+ */
190
+ export declare const limitedParseFloat: (value: string | number) => number | undefined;
191
+ /**
192
+ * @internal
193
+ *
194
+ * Asserts a value is a 32-bit float and returns it. If the value is a string
195
+ * representation of a non-numeric number type (NaN, Infinity, -Infinity),
196
+ * the value will be parsed. Any other string value will result in an exception
197
+ * being thrown. Null or undefined will be returned as undefined. Any other
198
+ * type will result in an exception being thrown.
199
+ *
200
+ * @param value - A number or string representation of a non-numeric float.
201
+ * @returns The value as a number, or undefined if it's null/undefined.
202
+ */
203
+ export declare const limitedParseFloat32: (value: string | number) => number | undefined;
204
+ /**
205
+ * @internal
206
+ *
207
+ * Parses a value into an integer. If the value is null or undefined, undefined
208
+ * will be returned. If the value is a string, it will be parsed by parseFloat
209
+ * and the result will be asserted to be an integer. If the parsed value is not
210
+ * an integer, or the raw value is any type other than a string or number, an
211
+ * exception will be thrown.
212
+ *
213
+ * @param value - A number or string representation of an integer.
214
+ * @returns The value as a number, or undefined if it's null/undefined.
215
+ */
216
+ export declare const strictParseLong: (value: string | number) => number | undefined;
217
+ /**
218
+ * @internal
219
+ *
220
+ * @deprecated Use strictParseLong
221
+ */
222
+ export declare const strictParseInt: (value: string | number) => number | undefined;
223
+ /**
224
+ * @internal
225
+ *
226
+ * Parses a value into a 32-bit integer. If the value is null or undefined, undefined
227
+ * will be returned. If the value is a string, it will be parsed by parseFloat
228
+ * and the result will be asserted to be an integer. If the parsed value is not
229
+ * an integer, or the raw value is any type other than a string or number, an
230
+ * exception will be thrown.
231
+ *
232
+ * @param value - A number or string representation of a 32-bit integer.
233
+ * @returns The value as a number, or undefined if it's null/undefined.
234
+ */
235
+ export declare const strictParseInt32: (value: string | number) => number | undefined;
236
+ /**
237
+ * @internal
238
+ *
239
+ * Parses a value into a 16-bit integer. If the value is null or undefined, undefined
240
+ * will be returned. If the value is a string, it will be parsed by parseFloat
241
+ * and the result will be asserted to be an integer. If the parsed value is not
242
+ * an integer, or the raw value is any type other than a string or number, an
243
+ * exception will be thrown.
244
+ *
245
+ * @param value - A number or string representation of a 16-bit integer.
246
+ * @returns The value as a number, or undefined if it's null/undefined.
247
+ */
248
+ export declare const strictParseShort: (value: string | number) => number | undefined;
249
+ /**
250
+ * @internal
251
+ *
252
+ * Parses a value into an 8-bit integer. If the value is null or undefined, undefined
253
+ * will be returned. If the value is a string, it will be parsed by parseFloat
254
+ * and the result will be asserted to be an integer. If the parsed value is not
255
+ * an integer, or the raw value is any type other than a string or number, an
256
+ * exception will be thrown.
257
+ *
258
+ * @param value - A number or string representation of an 8-bit integer.
259
+ * @returns The value as a number, or undefined if it's null/undefined.
260
+ */
261
+ export declare const strictParseByte: (value: string | number) => number | undefined;
262
+ /**
263
+ * @internal
264
+ */
265
+ export declare const logger: {
266
+ warn: {
267
+ (...data: any[]): void;
268
+ (message?: any, ...optionalParams: any[]): void;
269
+ };
270
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @public
3
+ * @param part - header list element
4
+ * @returns quoted string if part contains delimiter.
5
+ */
6
+ export declare function quoteHeader(part: string): string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * Given an input string, splits based on the delimiter after a given
5
+ * number of delimiters has been encountered.
6
+ *
7
+ * @param value - The input string to split.
8
+ * @param delimiter - The delimiter to split on.
9
+ * @param numDelimiters - The number of delimiters to have encountered to split.
10
+ */
11
+ export declare function splitEvery(value: string, delimiter: string, numDelimiters: number): Array<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param value - header string value.
3
+ * @returns value split by commas that aren't in quotes.
4
+ */
5
+ export declare const splitHeader: (value: string) => string[];
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * Builds a proper UTC HttpDate timestamp from a Date object
5
+ * since not all environments will have this as the expected
6
+ * format.
7
+ *
8
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString}
9
+ * - Prior to ECMAScript 2018, the format of the return value
10
+ * - varied according to the platform. The most common return
11
+ * - value was an RFC-1123 formatted date stamp, which is a
12
+ * - slightly updated version of RFC-822 date stamps.
13
+ */
14
+ export declare function dateToUtcString(date: Date): string;
15
+ /**
16
+ * @internal
17
+ *
18
+ * Parses a value into a Date. Returns undefined if the input is null or
19
+ * undefined, throws an error if the input is not a string that can be parsed
20
+ * as an RFC 3339 date.
21
+ *
22
+ * Input strings must conform to RFC3339 section 5.6, and cannot have a UTC
23
+ * offset. Fractional precision is supported.
24
+ *
25
+ * @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
26
+ *
27
+ * @param value - the value to parse
28
+ * @returns a Date or undefined
29
+ */
30
+ export declare const parseRfc3339DateTime: (value: unknown) => Date | undefined;
31
+ /**
32
+ * @internal
33
+ *
34
+ * Parses a value into a Date. Returns undefined if the input is null or
35
+ * undefined, throws an error if the input is not a string that can be parsed
36
+ * as an RFC 3339 date.
37
+ *
38
+ * Input strings must conform to RFC3339 section 5.6, and can have a UTC
39
+ * offset. Fractional precision is supported.
40
+ *
41
+ * @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
42
+ *
43
+ * @param value - the value to parse
44
+ * @returns a Date or undefined
45
+ */
46
+ export declare const parseRfc3339DateTimeWithOffset: (value: unknown) => Date | undefined;
47
+ /**
48
+ * @internal
49
+ *
50
+ * Parses a value into a Date. Returns undefined if the input is null or
51
+ * undefined, throws an error if the input is not a string that can be parsed
52
+ * as an RFC 7231 IMF-fixdate or obs-date.
53
+ *
54
+ * Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.
55
+ *
56
+ * @see {@link https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}
57
+ *
58
+ * @param value - the value to parse
59
+ * @returns a Date or undefined
60
+ */
61
+ export declare const parseRfc7231DateTime: (value: unknown) => Date | undefined;
62
+ /**
63
+ * @internal
64
+ *
65
+ * Parses a value into a Date. Returns undefined if the input is null or
66
+ * undefined, throws an error if the input is not a number or a parseable string.
67
+ *
68
+ * Input strings must be an integer or floating point number. Fractional seconds are supported.
69
+ *
70
+ * @param value - the value to parse
71
+ * @returns a Date or undefined
72
+ */
73
+ export declare const parseEpochTimestamp: (value: unknown) => Date | undefined;
@@ -1 +1,7 @@
1
+ export * from "./parse-utils";
2
+ export * from "./date-utils";
3
+ export * from "./quote-header";
4
+ export * from "./split-header";
1
5
  export * from "./value/NumericValue";
6
+ export * from "./lazy-json";
7
+ export * from "./split-every";
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @public
3
+ *
4
+ * A model field with this type means that you may provide a JavaScript
5
+ * object in lieu of a JSON string, and it will be serialized to JSON
6
+ * automatically before being sent in a request.
7
+ *
8
+ * For responses, you will receive a "LazyJsonString", which is a boxed String object
9
+ * with additional mixin methods.
10
+ * To get the string value, call `.toString()`, or to get the JSON object value,
11
+ * call `.deserializeJSON()` or parse it yourself.
12
+ */
13
+ export type AutomaticJsonStringConversion = Parameters<typeof JSON.stringify>[0] | LazyJsonString;
14
+ /**
15
+ * @internal
16
+ */
17
+ export interface LazyJsonString extends String {
18
+ /**
19
+ * @returns the JSON parsing of the string value.
20
+ */
21
+ deserializeJSON(): any;
22
+ /**
23
+ * @returns the original string value rather than a JSON.stringified value.
24
+ */
25
+ toJSON(): string;
26
+ }
27
+ /**
28
+ * @internal
29
+ *
30
+ * Extension of the native String class in the previous implementation
31
+ * has negative global performance impact on method dispatch for strings,
32
+ * and is generally discouraged.
33
+ *
34
+ * This current implementation may look strange, but is necessary to preserve the interface and
35
+ * behavior of extending the String class.
36
+ */
37
+ export declare const LazyJsonString: {
38
+ new (s: string): LazyJsonString;
39
+ (s: string): LazyJsonString;
40
+ from(s: any): LazyJsonString;
41
+ /**
42
+ * @deprecated use #from.
43
+ */
44
+ fromObject(s: any): LazyJsonString;
45
+ };
@@ -0,0 +1,270 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * Give an input string, strictly parses a boolean value.
5
+ *
6
+ * @param value - The boolean string to parse.
7
+ * @returns true for "true", false for "false", otherwise an error is thrown.
8
+ */
9
+ export declare const parseBoolean: (value: string) => boolean;
10
+ /**
11
+ * @internal
12
+ *
13
+ * Asserts a value is a boolean and returns it.
14
+ * Casts strings and numbers with a warning if there is evidence that they were
15
+ * intended to be booleans.
16
+ *
17
+ * @param value - A value that is expected to be a boolean.
18
+ * @returns The value if it's a boolean, undefined if it's null/undefined,
19
+ * otherwise an error is thrown.
20
+ */
21
+ export declare const expectBoolean: (value: any) => boolean | undefined;
22
+ /**
23
+ * @internal
24
+ *
25
+ * Asserts a value is a number and returns it.
26
+ * Casts strings with a warning if the string is a parseable number.
27
+ * This is to unblock slight API definition/implementation inconsistencies.
28
+ *
29
+ * @param value - A value that is expected to be a number.
30
+ * @returns The value if it's a number, undefined if it's null/undefined,
31
+ * otherwise an error is thrown.
32
+ */
33
+ export declare const expectNumber: (value: any) => number | undefined;
34
+ /**
35
+ * @internal
36
+ *
37
+ * Asserts a value is a 32-bit float and returns it.
38
+ *
39
+ * @param value - A value that is expected to be a 32-bit float.
40
+ * @returns The value if it's a float, undefined if it's null/undefined,
41
+ * otherwise an error is thrown.
42
+ */
43
+ export declare const expectFloat32: (value: any) => number | undefined;
44
+ /**
45
+ * @internal
46
+ *
47
+ * Asserts a value is an integer and returns it.
48
+ *
49
+ * @param value - A value that is expected to be an integer.
50
+ * @returns The value if it's an integer, undefined if it's null/undefined,
51
+ * otherwise an error is thrown.
52
+ */
53
+ export declare const expectLong: (value: any) => number | undefined;
54
+ /**
55
+ * @internal
56
+ *
57
+ * @deprecated Use expectLong
58
+ */
59
+ export declare const expectInt: (value: any) => number | undefined;
60
+ /**
61
+ * @internal
62
+ *
63
+ * Asserts a value is a 32-bit integer and returns it.
64
+ *
65
+ * @param value - A value that is expected to be an integer.
66
+ * @returns The value if it's an integer, undefined if it's null/undefined,
67
+ * otherwise an error is thrown.
68
+ */
69
+ export declare const expectInt32: (value: any) => number | undefined;
70
+ /**
71
+ * @internal
72
+ *
73
+ * Asserts a value is a 16-bit integer and returns it.
74
+ *
75
+ * @param value - A value that is expected to be an integer.
76
+ * @returns The value if it's an integer, undefined if it's null/undefined,
77
+ * otherwise an error is thrown.
78
+ */
79
+ export declare const expectShort: (value: any) => number | undefined;
80
+ /**
81
+ * @internal
82
+ *
83
+ * Asserts a value is an 8-bit integer and returns it.
84
+ *
85
+ * @param value - A value that is expected to be an integer.
86
+ * @returns The value if it's an integer, undefined if it's null/undefined,
87
+ * otherwise an error is thrown.
88
+ */
89
+ export declare const expectByte: (value: any) => number | undefined;
90
+ /**
91
+ * @internal
92
+ *
93
+ * Asserts a value is not null or undefined and returns it, or throws an error.
94
+ *
95
+ * @param value - A value that is expected to be defined
96
+ * @param location - The location where we're expecting to find a defined object (optional)
97
+ * @returns The value if it's not undefined, otherwise throws an error
98
+ */
99
+ export declare const expectNonNull: <T>(value: T | null | undefined, location?: string) => T;
100
+ /**
101
+ * @internal
102
+ *
103
+ * Asserts a value is an JSON-like object and returns it. This is expected to be used
104
+ * with values parsed from JSON (arrays, objects, numbers, strings, booleans).
105
+ *
106
+ * @param value - A value that is expected to be an object
107
+ * @returns The value if it's an object, undefined if it's null/undefined,
108
+ * otherwise an error is thrown.
109
+ */
110
+ export declare const expectObject: (value: any) => Record<string, any> | undefined;
111
+ /**
112
+ * @internal
113
+ *
114
+ * Asserts a value is a string and returns it.
115
+ * Numbers and boolean will be cast to strings with a warning.
116
+ *
117
+ * @param value - A value that is expected to be a string.
118
+ * @returns The value if it's a string, undefined if it's null/undefined,
119
+ * otherwise an error is thrown.
120
+ */
121
+ export declare const expectString: (value: any) => string | undefined;
122
+ /**
123
+ * @internal
124
+ *
125
+ * Asserts a value is a JSON-like object with only one non-null/non-undefined key and
126
+ * returns it.
127
+ *
128
+ * @param value - A value that is expected to be an object with exactly one non-null,
129
+ * non-undefined key.
130
+ * @returns the value if it's a union, undefined if it's null/undefined, otherwise
131
+ * an error is thrown.
132
+ */
133
+ export declare const expectUnion: (value: unknown) => Record<string, any> | undefined;
134
+ /**
135
+ * @internal
136
+ *
137
+ * Parses a value into a double. If the value is null or undefined, undefined
138
+ * will be returned. If the value is a string, it will be parsed by the standard
139
+ * parseFloat with one exception: NaN may only be explicitly set as the string
140
+ * "NaN", any implicit Nan values will result in an error being thrown. If any
141
+ * other type is provided, an exception will be thrown.
142
+ *
143
+ * @param value - A number or string representation of a double.
144
+ * @returns The value as a number, or undefined if it's null/undefined.
145
+ */
146
+ export declare const strictParseDouble: (value: string | number) => number | undefined;
147
+ /**
148
+ * @internal
149
+ *
150
+ * @deprecated Use strictParseDouble
151
+ */
152
+ export declare const strictParseFloat: (value: string | number) => number | undefined;
153
+ /**
154
+ * @internal
155
+ *
156
+ * Parses a value into a float. If the value is null or undefined, undefined
157
+ * will be returned. If the value is a string, it will be parsed by the standard
158
+ * parseFloat with one exception: NaN may only be explicitly set as the string
159
+ * "NaN", any implicit Nan values will result in an error being thrown. If any
160
+ * other type is provided, an exception will be thrown.
161
+ *
162
+ * @param value - A number or string representation of a float.
163
+ * @returns The value as a number, or undefined if it's null/undefined.
164
+ */
165
+ export declare const strictParseFloat32: (value: string | number) => number | undefined;
166
+ /**
167
+ * @internal
168
+ *
169
+ * Asserts a value is a number and returns it. If the value is a string
170
+ * representation of a non-numeric number type (NaN, Infinity, -Infinity),
171
+ * the value will be parsed. Any other string value will result in an exception
172
+ * being thrown. Null or undefined will be returned as undefined. Any other
173
+ * type will result in an exception being thrown.
174
+ *
175
+ * @param value - A number or string representation of a non-numeric float.
176
+ * @returns The value as a number, or undefined if it's null/undefined.
177
+ */
178
+ export declare const limitedParseDouble: (value: string | number) => number | undefined;
179
+ /**
180
+ * @internal
181
+ *
182
+ * @deprecated Use limitedParseDouble
183
+ */
184
+ export declare const handleFloat: (value: string | number) => number | undefined;
185
+ /**
186
+ * @internal
187
+ *
188
+ * @deprecated Use limitedParseDouble
189
+ */
190
+ export declare const limitedParseFloat: (value: string | number) => number | undefined;
191
+ /**
192
+ * @internal
193
+ *
194
+ * Asserts a value is a 32-bit float and returns it. If the value is a string
195
+ * representation of a non-numeric number type (NaN, Infinity, -Infinity),
196
+ * the value will be parsed. Any other string value will result in an exception
197
+ * being thrown. Null or undefined will be returned as undefined. Any other
198
+ * type will result in an exception being thrown.
199
+ *
200
+ * @param value - A number or string representation of a non-numeric float.
201
+ * @returns The value as a number, or undefined if it's null/undefined.
202
+ */
203
+ export declare const limitedParseFloat32: (value: string | number) => number | undefined;
204
+ /**
205
+ * @internal
206
+ *
207
+ * Parses a value into an integer. If the value is null or undefined, undefined
208
+ * will be returned. If the value is a string, it will be parsed by parseFloat
209
+ * and the result will be asserted to be an integer. If the parsed value is not
210
+ * an integer, or the raw value is any type other than a string or number, an
211
+ * exception will be thrown.
212
+ *
213
+ * @param value - A number or string representation of an integer.
214
+ * @returns The value as a number, or undefined if it's null/undefined.
215
+ */
216
+ export declare const strictParseLong: (value: string | number) => number | undefined;
217
+ /**
218
+ * @internal
219
+ *
220
+ * @deprecated Use strictParseLong
221
+ */
222
+ export declare const strictParseInt: (value: string | number) => number | undefined;
223
+ /**
224
+ * @internal
225
+ *
226
+ * Parses a value into a 32-bit integer. If the value is null or undefined, undefined
227
+ * will be returned. If the value is a string, it will be parsed by parseFloat
228
+ * and the result will be asserted to be an integer. If the parsed value is not
229
+ * an integer, or the raw value is any type other than a string or number, an
230
+ * exception will be thrown.
231
+ *
232
+ * @param value - A number or string representation of a 32-bit integer.
233
+ * @returns The value as a number, or undefined if it's null/undefined.
234
+ */
235
+ export declare const strictParseInt32: (value: string | number) => number | undefined;
236
+ /**
237
+ * @internal
238
+ *
239
+ * Parses a value into a 16-bit integer. If the value is null or undefined, undefined
240
+ * will be returned. If the value is a string, it will be parsed by parseFloat
241
+ * and the result will be asserted to be an integer. If the parsed value is not
242
+ * an integer, or the raw value is any type other than a string or number, an
243
+ * exception will be thrown.
244
+ *
245
+ * @param value - A number or string representation of a 16-bit integer.
246
+ * @returns The value as a number, or undefined if it's null/undefined.
247
+ */
248
+ export declare const strictParseShort: (value: string | number) => number | undefined;
249
+ /**
250
+ * @internal
251
+ *
252
+ * Parses a value into an 8-bit integer. If the value is null or undefined, undefined
253
+ * will be returned. If the value is a string, it will be parsed by parseFloat
254
+ * and the result will be asserted to be an integer. If the parsed value is not
255
+ * an integer, or the raw value is any type other than a string or number, an
256
+ * exception will be thrown.
257
+ *
258
+ * @param value - A number or string representation of an 8-bit integer.
259
+ * @returns The value as a number, or undefined if it's null/undefined.
260
+ */
261
+ export declare const strictParseByte: (value: string | number) => number | undefined;
262
+ /**
263
+ * @internal
264
+ */
265
+ export declare const logger: {
266
+ warn: {
267
+ (...data: any[]): void;
268
+ (message?: any, ...optionalParams: any[]): void;
269
+ };
270
+ };