bson 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -126
- package/bson.d.ts +71 -22
- package/lib/binary.d.ts +182 -0
- package/lib/binary.d.ts.map +1 -0
- package/lib/bson.bundle.js +68 -86
- package/lib/bson.bundle.js.map +1 -1
- package/lib/bson.cjs +68 -86
- package/lib/bson.cjs.map +1 -1
- package/lib/bson.d.ts +97 -0
- package/lib/bson.d.ts.map +1 -0
- package/lib/bson.mjs +68 -86
- package/lib/bson.mjs.map +1 -1
- package/lib/bson_value.d.ts +10 -0
- package/lib/bson_value.d.ts.map +1 -0
- package/lib/code.d.ts +32 -0
- package/lib/code.d.ts.map +1 -0
- package/lib/constants.d.ts +107 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/db_ref.d.ts +40 -0
- package/lib/db_ref.d.ts.map +1 -0
- package/lib/decimal128.d.ts +34 -0
- package/lib/decimal128.d.ts.map +1 -0
- package/lib/double.d.ts +35 -0
- package/lib/double.d.ts.map +1 -0
- package/lib/error.d.ts +50 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/extended_json.d.ts +82 -0
- package/lib/extended_json.d.ts.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/int_32.d.ts +35 -0
- package/lib/int_32.d.ts.map +1 -0
- package/lib/long.d.ts +323 -0
- package/lib/long.d.ts.map +1 -0
- package/lib/max_key.d.ts +19 -0
- package/lib/max_key.d.ts.map +1 -0
- package/lib/min_key.d.ts +19 -0
- package/lib/min_key.d.ts.map +1 -0
- package/lib/objectid.d.ts +96 -0
- package/lib/objectid.d.ts.map +1 -0
- package/lib/regexp.d.ts +36 -0
- package/lib/regexp.d.ts.map +1 -0
- package/lib/symbol.d.ts +28 -0
- package/lib/symbol.d.ts.map +1 -0
- package/lib/timestamp.d.ts +66 -0
- package/lib/timestamp.d.ts.map +1 -0
- package/lib/validate_utf8.d.ts +10 -0
- package/lib/validate_utf8.d.ts.map +1 -0
- package/package.json +20 -20
- package/src/binary.ts +49 -41
- package/src/bson.ts +1 -1
- package/src/constants.ts +1 -1
- package/src/extended_json.ts +11 -3
- package/src/parser/deserializer.ts +37 -12
- package/src/parser/serializer.ts +17 -4
- package/src/timestamp.ts +1 -1
- package/src/uuid_utils.ts +0 -33
package/lib/long.d.ts
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { BSONValue } from './bson_value';
|
|
2
|
+
import type { EJSONOptions } from './extended_json';
|
|
3
|
+
import type { Timestamp } from './timestamp';
|
|
4
|
+
/** @public */
|
|
5
|
+
export interface LongExtended {
|
|
6
|
+
$numberLong: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A class representing a 64-bit integer
|
|
10
|
+
* @public
|
|
11
|
+
* @category BSONType
|
|
12
|
+
* @remarks
|
|
13
|
+
* The internal representation of a long is the two given signed, 32-bit values.
|
|
14
|
+
* We use 32-bit pieces because these are the size of integers on which
|
|
15
|
+
* Javascript performs bit-operations. For operations like addition and
|
|
16
|
+
* multiplication, we split each number into 16 bit pieces, which can easily be
|
|
17
|
+
* multiplied within Javascript's floating-point representation without overflow
|
|
18
|
+
* or change in sign.
|
|
19
|
+
* In the algorithms below, we frequently reduce the negative case to the
|
|
20
|
+
* positive case by negating the input(s) and then post-processing the result.
|
|
21
|
+
* Note that we must ALWAYS check specially whether those values are MIN_VALUE
|
|
22
|
+
* (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
|
|
23
|
+
* a positive number, it overflows back into a negative). Not handling this
|
|
24
|
+
* case would often result in infinite recursion.
|
|
25
|
+
* Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class.
|
|
26
|
+
*/
|
|
27
|
+
export declare class Long extends BSONValue {
|
|
28
|
+
get _bsontype(): 'Long';
|
|
29
|
+
/** An indicator used to reliably determine if an object is a Long or not. */
|
|
30
|
+
get __isLong__(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The high 32 bits as a signed value.
|
|
33
|
+
*/
|
|
34
|
+
high: number;
|
|
35
|
+
/**
|
|
36
|
+
* The low 32 bits as a signed value.
|
|
37
|
+
*/
|
|
38
|
+
low: number;
|
|
39
|
+
/**
|
|
40
|
+
* Whether unsigned or not.
|
|
41
|
+
*/
|
|
42
|
+
unsigned: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
|
|
45
|
+
* See the from* functions below for more convenient ways of constructing Longs.
|
|
46
|
+
*
|
|
47
|
+
* Acceptable signatures are:
|
|
48
|
+
* - Long(low, high, unsigned?)
|
|
49
|
+
* - Long(bigint, unsigned?)
|
|
50
|
+
* - Long(string, unsigned?)
|
|
51
|
+
*
|
|
52
|
+
* @param low - The low (signed) 32 bits of the long
|
|
53
|
+
* @param high - The high (signed) 32 bits of the long
|
|
54
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
55
|
+
*/
|
|
56
|
+
constructor(low?: number | bigint | string, high?: number | boolean, unsigned?: boolean);
|
|
57
|
+
static TWO_PWR_24: Long;
|
|
58
|
+
/** Maximum unsigned value. */
|
|
59
|
+
static MAX_UNSIGNED_VALUE: Long;
|
|
60
|
+
/** Signed zero */
|
|
61
|
+
static ZERO: Long;
|
|
62
|
+
/** Unsigned zero. */
|
|
63
|
+
static UZERO: Long;
|
|
64
|
+
/** Signed one. */
|
|
65
|
+
static ONE: Long;
|
|
66
|
+
/** Unsigned one. */
|
|
67
|
+
static UONE: Long;
|
|
68
|
+
/** Signed negative one. */
|
|
69
|
+
static NEG_ONE: Long;
|
|
70
|
+
/** Maximum signed value. */
|
|
71
|
+
static MAX_VALUE: Long;
|
|
72
|
+
/** Minimum signed value. */
|
|
73
|
+
static MIN_VALUE: Long;
|
|
74
|
+
/**
|
|
75
|
+
* Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits.
|
|
76
|
+
* Each is assumed to use 32 bits.
|
|
77
|
+
* @param lowBits - The low 32 bits
|
|
78
|
+
* @param highBits - The high 32 bits
|
|
79
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
80
|
+
* @returns The corresponding Long value
|
|
81
|
+
*/
|
|
82
|
+
static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long;
|
|
83
|
+
/**
|
|
84
|
+
* Returns a Long representing the given 32 bit integer value.
|
|
85
|
+
* @param value - The 32 bit integer in question
|
|
86
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
87
|
+
* @returns The corresponding Long value
|
|
88
|
+
*/
|
|
89
|
+
static fromInt(value: number, unsigned?: boolean): Long;
|
|
90
|
+
/**
|
|
91
|
+
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
|
|
92
|
+
* @param value - The number in question
|
|
93
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
94
|
+
* @returns The corresponding Long value
|
|
95
|
+
*/
|
|
96
|
+
static fromNumber(value: number, unsigned?: boolean): Long;
|
|
97
|
+
/**
|
|
98
|
+
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
|
|
99
|
+
* @param value - The number in question
|
|
100
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
101
|
+
* @returns The corresponding Long value
|
|
102
|
+
*/
|
|
103
|
+
static fromBigInt(value: bigint, unsigned?: boolean): Long;
|
|
104
|
+
/**
|
|
105
|
+
* Returns a Long representation of the given string, written using the specified radix.
|
|
106
|
+
* @param str - The textual representation of the Long
|
|
107
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
108
|
+
* @param radix - The radix in which the text is written (2-36), defaults to 10
|
|
109
|
+
* @returns The corresponding Long value
|
|
110
|
+
*/
|
|
111
|
+
static fromString(str: string, unsigned?: boolean, radix?: number): Long;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a Long from its byte representation.
|
|
114
|
+
* @param bytes - Byte representation
|
|
115
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
116
|
+
* @param le - Whether little or big endian, defaults to big endian
|
|
117
|
+
* @returns The corresponding Long value
|
|
118
|
+
*/
|
|
119
|
+
static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a Long from its little endian byte representation.
|
|
122
|
+
* @param bytes - Little endian byte representation
|
|
123
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
124
|
+
* @returns The corresponding Long value
|
|
125
|
+
*/
|
|
126
|
+
static fromBytesLE(bytes: number[], unsigned?: boolean): Long;
|
|
127
|
+
/**
|
|
128
|
+
* Creates a Long from its big endian byte representation.
|
|
129
|
+
* @param bytes - Big endian byte representation
|
|
130
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
131
|
+
* @returns The corresponding Long value
|
|
132
|
+
*/
|
|
133
|
+
static fromBytesBE(bytes: number[], unsigned?: boolean): Long;
|
|
134
|
+
/**
|
|
135
|
+
* Tests if the specified object is a Long.
|
|
136
|
+
*/
|
|
137
|
+
static isLong(value: unknown): value is Long;
|
|
138
|
+
/**
|
|
139
|
+
* Converts the specified value to a Long.
|
|
140
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
141
|
+
*/
|
|
142
|
+
static fromValue(val: number | string | {
|
|
143
|
+
low: number;
|
|
144
|
+
high: number;
|
|
145
|
+
unsigned?: boolean;
|
|
146
|
+
}, unsigned?: boolean): Long;
|
|
147
|
+
/** Returns the sum of this and the specified Long. */
|
|
148
|
+
add(addend: string | number | Long | Timestamp): Long;
|
|
149
|
+
/**
|
|
150
|
+
* Returns the sum of this and the specified Long.
|
|
151
|
+
* @returns Sum
|
|
152
|
+
*/
|
|
153
|
+
and(other: string | number | Long | Timestamp): Long;
|
|
154
|
+
/**
|
|
155
|
+
* Compares this Long's value with the specified's.
|
|
156
|
+
* @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater
|
|
157
|
+
*/
|
|
158
|
+
compare(other: string | number | Long | Timestamp): 0 | 1 | -1;
|
|
159
|
+
/** This is an alias of {@link Long.compare} */
|
|
160
|
+
comp(other: string | number | Long | Timestamp): 0 | 1 | -1;
|
|
161
|
+
/**
|
|
162
|
+
* Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned.
|
|
163
|
+
* @returns Quotient
|
|
164
|
+
*/
|
|
165
|
+
divide(divisor: string | number | Long | Timestamp): Long;
|
|
166
|
+
/**This is an alias of {@link Long.divide} */
|
|
167
|
+
div(divisor: string | number | Long | Timestamp): Long;
|
|
168
|
+
/**
|
|
169
|
+
* Tests if this Long's value equals the specified's.
|
|
170
|
+
* @param other - Other value
|
|
171
|
+
*/
|
|
172
|
+
equals(other: string | number | Long | Timestamp): boolean;
|
|
173
|
+
/** This is an alias of {@link Long.equals} */
|
|
174
|
+
eq(other: string | number | Long | Timestamp): boolean;
|
|
175
|
+
/** Gets the high 32 bits as a signed integer. */
|
|
176
|
+
getHighBits(): number;
|
|
177
|
+
/** Gets the high 32 bits as an unsigned integer. */
|
|
178
|
+
getHighBitsUnsigned(): number;
|
|
179
|
+
/** Gets the low 32 bits as a signed integer. */
|
|
180
|
+
getLowBits(): number;
|
|
181
|
+
/** Gets the low 32 bits as an unsigned integer. */
|
|
182
|
+
getLowBitsUnsigned(): number;
|
|
183
|
+
/** Gets the number of bits needed to represent the absolute value of this Long. */
|
|
184
|
+
getNumBitsAbs(): number;
|
|
185
|
+
/** Tests if this Long's value is greater than the specified's. */
|
|
186
|
+
greaterThan(other: string | number | Long | Timestamp): boolean;
|
|
187
|
+
/** This is an alias of {@link Long.greaterThan} */
|
|
188
|
+
gt(other: string | number | Long | Timestamp): boolean;
|
|
189
|
+
/** Tests if this Long's value is greater than or equal the specified's. */
|
|
190
|
+
greaterThanOrEqual(other: string | number | Long | Timestamp): boolean;
|
|
191
|
+
/** This is an alias of {@link Long.greaterThanOrEqual} */
|
|
192
|
+
gte(other: string | number | Long | Timestamp): boolean;
|
|
193
|
+
/** This is an alias of {@link Long.greaterThanOrEqual} */
|
|
194
|
+
ge(other: string | number | Long | Timestamp): boolean;
|
|
195
|
+
/** Tests if this Long's value is even. */
|
|
196
|
+
isEven(): boolean;
|
|
197
|
+
/** Tests if this Long's value is negative. */
|
|
198
|
+
isNegative(): boolean;
|
|
199
|
+
/** Tests if this Long's value is odd. */
|
|
200
|
+
isOdd(): boolean;
|
|
201
|
+
/** Tests if this Long's value is positive. */
|
|
202
|
+
isPositive(): boolean;
|
|
203
|
+
/** Tests if this Long's value equals zero. */
|
|
204
|
+
isZero(): boolean;
|
|
205
|
+
/** Tests if this Long's value is less than the specified's. */
|
|
206
|
+
lessThan(other: string | number | Long | Timestamp): boolean;
|
|
207
|
+
/** This is an alias of {@link Long#lessThan}. */
|
|
208
|
+
lt(other: string | number | Long | Timestamp): boolean;
|
|
209
|
+
/** Tests if this Long's value is less than or equal the specified's. */
|
|
210
|
+
lessThanOrEqual(other: string | number | Long | Timestamp): boolean;
|
|
211
|
+
/** This is an alias of {@link Long.lessThanOrEqual} */
|
|
212
|
+
lte(other: string | number | Long | Timestamp): boolean;
|
|
213
|
+
/** Returns this Long modulo the specified. */
|
|
214
|
+
modulo(divisor: string | number | Long | Timestamp): Long;
|
|
215
|
+
/** This is an alias of {@link Long.modulo} */
|
|
216
|
+
mod(divisor: string | number | Long | Timestamp): Long;
|
|
217
|
+
/** This is an alias of {@link Long.modulo} */
|
|
218
|
+
rem(divisor: string | number | Long | Timestamp): Long;
|
|
219
|
+
/**
|
|
220
|
+
* Returns the product of this and the specified Long.
|
|
221
|
+
* @param multiplier - Multiplier
|
|
222
|
+
* @returns Product
|
|
223
|
+
*/
|
|
224
|
+
multiply(multiplier: string | number | Long | Timestamp): Long;
|
|
225
|
+
/** This is an alias of {@link Long.multiply} */
|
|
226
|
+
mul(multiplier: string | number | Long | Timestamp): Long;
|
|
227
|
+
/** Returns the Negation of this Long's value. */
|
|
228
|
+
negate(): Long;
|
|
229
|
+
/** This is an alias of {@link Long.negate} */
|
|
230
|
+
neg(): Long;
|
|
231
|
+
/** Returns the bitwise NOT of this Long. */
|
|
232
|
+
not(): Long;
|
|
233
|
+
/** Tests if this Long's value differs from the specified's. */
|
|
234
|
+
notEquals(other: string | number | Long | Timestamp): boolean;
|
|
235
|
+
/** This is an alias of {@link Long.notEquals} */
|
|
236
|
+
neq(other: string | number | Long | Timestamp): boolean;
|
|
237
|
+
/** This is an alias of {@link Long.notEquals} */
|
|
238
|
+
ne(other: string | number | Long | Timestamp): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Returns the bitwise OR of this Long and the specified.
|
|
241
|
+
*/
|
|
242
|
+
or(other: number | string | Long): Long;
|
|
243
|
+
/**
|
|
244
|
+
* Returns this Long with bits shifted to the left by the given amount.
|
|
245
|
+
* @param numBits - Number of bits
|
|
246
|
+
* @returns Shifted Long
|
|
247
|
+
*/
|
|
248
|
+
shiftLeft(numBits: number | Long): Long;
|
|
249
|
+
/** This is an alias of {@link Long.shiftLeft} */
|
|
250
|
+
shl(numBits: number | Long): Long;
|
|
251
|
+
/**
|
|
252
|
+
* Returns this Long with bits arithmetically shifted to the right by the given amount.
|
|
253
|
+
* @param numBits - Number of bits
|
|
254
|
+
* @returns Shifted Long
|
|
255
|
+
*/
|
|
256
|
+
shiftRight(numBits: number | Long): Long;
|
|
257
|
+
/** This is an alias of {@link Long.shiftRight} */
|
|
258
|
+
shr(numBits: number | Long): Long;
|
|
259
|
+
/**
|
|
260
|
+
* Returns this Long with bits logically shifted to the right by the given amount.
|
|
261
|
+
* @param numBits - Number of bits
|
|
262
|
+
* @returns Shifted Long
|
|
263
|
+
*/
|
|
264
|
+
shiftRightUnsigned(numBits: Long | number): Long;
|
|
265
|
+
/** This is an alias of {@link Long.shiftRightUnsigned} */
|
|
266
|
+
shr_u(numBits: number | Long): Long;
|
|
267
|
+
/** This is an alias of {@link Long.shiftRightUnsigned} */
|
|
268
|
+
shru(numBits: number | Long): Long;
|
|
269
|
+
/**
|
|
270
|
+
* Returns the difference of this and the specified Long.
|
|
271
|
+
* @param subtrahend - Subtrahend
|
|
272
|
+
* @returns Difference
|
|
273
|
+
*/
|
|
274
|
+
subtract(subtrahend: string | number | Long | Timestamp): Long;
|
|
275
|
+
/** This is an alias of {@link Long.subtract} */
|
|
276
|
+
sub(subtrahend: string | number | Long | Timestamp): Long;
|
|
277
|
+
/** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */
|
|
278
|
+
toInt(): number;
|
|
279
|
+
/** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */
|
|
280
|
+
toNumber(): number;
|
|
281
|
+
/** Converts the Long to a BigInt (arbitrary precision). */
|
|
282
|
+
toBigInt(): bigint;
|
|
283
|
+
/**
|
|
284
|
+
* Converts this Long to its byte representation.
|
|
285
|
+
* @param le - Whether little or big endian, defaults to big endian
|
|
286
|
+
* @returns Byte representation
|
|
287
|
+
*/
|
|
288
|
+
toBytes(le?: boolean): number[];
|
|
289
|
+
/**
|
|
290
|
+
* Converts this Long to its little endian byte representation.
|
|
291
|
+
* @returns Little endian byte representation
|
|
292
|
+
*/
|
|
293
|
+
toBytesLE(): number[];
|
|
294
|
+
/**
|
|
295
|
+
* Converts this Long to its big endian byte representation.
|
|
296
|
+
* @returns Big endian byte representation
|
|
297
|
+
*/
|
|
298
|
+
toBytesBE(): number[];
|
|
299
|
+
/**
|
|
300
|
+
* Converts this Long to signed.
|
|
301
|
+
*/
|
|
302
|
+
toSigned(): Long;
|
|
303
|
+
/**
|
|
304
|
+
* Converts the Long to a string written in the specified radix.
|
|
305
|
+
* @param radix - Radix (2-36), defaults to 10
|
|
306
|
+
* @throws RangeError If `radix` is out of range
|
|
307
|
+
*/
|
|
308
|
+
toString(radix?: number): string;
|
|
309
|
+
/** Converts this Long to unsigned. */
|
|
310
|
+
toUnsigned(): Long;
|
|
311
|
+
/** Returns the bitwise XOR of this Long and the given one. */
|
|
312
|
+
xor(other: Long | number | string): Long;
|
|
313
|
+
/** This is an alias of {@link Long.isZero} */
|
|
314
|
+
eqz(): boolean;
|
|
315
|
+
/** This is an alias of {@link Long.lessThanOrEqual} */
|
|
316
|
+
le(other: string | number | Long | Timestamp): boolean;
|
|
317
|
+
toExtendedJSON(options?: EJSONOptions): number | LongExtended;
|
|
318
|
+
static fromExtendedJSON(doc: {
|
|
319
|
+
$numberLong: string;
|
|
320
|
+
}, options?: EJSONOptions): number | Long | bigint;
|
|
321
|
+
inspect(): string;
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=long.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"long.d.ts","sourceRoot":"","sources":["../src/long.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA+E7C,cAAc;AACd,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,IAAK,SAAQ,SAAS;IACjC,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,6EAA6E;IAC7E,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;OAEG;IACH,IAAI,EAAG,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAG,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAG,OAAO,CAAC;IAEnB;;;;;;;;;;;;OAYG;gBACS,GAAG,GAAE,MAAM,GAAG,MAAM,GAAG,MAAU,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO;IAa1F,MAAM,CAAC,UAAU,OAAgC;IAEjD,8BAA8B;IAC9B,MAAM,CAAC,kBAAkB,OAAuD;IAChF,kBAAkB;IAClB,MAAM,CAAC,IAAI,OAAmB;IAC9B,qBAAqB;IACrB,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YAAY,GAAG,MAAM,GAAG,YAAY;IAI7D,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,EAC5B,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,GAAG,IAAI,GAAG,MAAM;IA8BzB,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/max_key.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BSONValue } from './bson_value';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface MaxKeyExtended {
|
|
4
|
+
$maxKey: 1;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A class representation of the BSON MaxKey type.
|
|
8
|
+
* @public
|
|
9
|
+
* @category BSONType
|
|
10
|
+
*/
|
|
11
|
+
export declare class MaxKey extends BSONValue {
|
|
12
|
+
get _bsontype(): 'MaxKey';
|
|
13
|
+
/** @internal */
|
|
14
|
+
toExtendedJSON(): MaxKeyExtended;
|
|
15
|
+
/** @internal */
|
|
16
|
+
static fromExtendedJSON(): MaxKey;
|
|
17
|
+
inspect(): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=max_key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max_key.d.ts","sourceRoot":"","sources":["../src/max_key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,cAAc;AACd,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACnC,IAAI,SAAS,IAAI,QAAQ,CAExB;IAED,gBAAgB;IAChB,cAAc,IAAI,cAAc;IAIhC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,IAAI,MAAM;IASjC,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/min_key.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BSONValue } from './bson_value';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface MinKeyExtended {
|
|
4
|
+
$minKey: 1;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A class representation of the BSON MinKey type.
|
|
8
|
+
* @public
|
|
9
|
+
* @category BSONType
|
|
10
|
+
*/
|
|
11
|
+
export declare class MinKey extends BSONValue {
|
|
12
|
+
get _bsontype(): 'MinKey';
|
|
13
|
+
/** @internal */
|
|
14
|
+
toExtendedJSON(): MinKeyExtended;
|
|
15
|
+
/** @internal */
|
|
16
|
+
static fromExtendedJSON(): MinKey;
|
|
17
|
+
inspect(): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=min_key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min_key.d.ts","sourceRoot":"","sources":["../src/min_key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,cAAc;AACd,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACnC,IAAI,SAAS,IAAI,QAAQ,CAExB;IAED,gBAAgB;IAChB,cAAc,IAAI,cAAc;IAIhC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,IAAI,MAAM;IASjC,OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { BSONValue } from './bson_value';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface ObjectIdLike {
|
|
4
|
+
id: string | Uint8Array;
|
|
5
|
+
__id?: string;
|
|
6
|
+
toHexString(): string;
|
|
7
|
+
}
|
|
8
|
+
/** @public */
|
|
9
|
+
export interface ObjectIdExtended {
|
|
10
|
+
$oid: string;
|
|
11
|
+
}
|
|
12
|
+
declare const kId: unique symbol;
|
|
13
|
+
/**
|
|
14
|
+
* A class representation of the BSON ObjectId type.
|
|
15
|
+
* @public
|
|
16
|
+
* @category BSONType
|
|
17
|
+
*/
|
|
18
|
+
export declare class ObjectId extends BSONValue {
|
|
19
|
+
get _bsontype(): 'ObjectId';
|
|
20
|
+
/** @internal */
|
|
21
|
+
private static index;
|
|
22
|
+
static cacheHexString: boolean;
|
|
23
|
+
/** ObjectId Bytes @internal */
|
|
24
|
+
private [kId];
|
|
25
|
+
/** ObjectId hexString cache @internal */
|
|
26
|
+
private __id?;
|
|
27
|
+
/**
|
|
28
|
+
* Create an ObjectId type
|
|
29
|
+
*
|
|
30
|
+
* @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number.
|
|
31
|
+
*/
|
|
32
|
+
constructor(inputId?: string | number | ObjectId | ObjectIdLike | Uint8Array);
|
|
33
|
+
/**
|
|
34
|
+
* The ObjectId bytes
|
|
35
|
+
* @readonly
|
|
36
|
+
*/
|
|
37
|
+
get id(): Uint8Array;
|
|
38
|
+
set id(value: Uint8Array);
|
|
39
|
+
/** Returns the ObjectId id as a 24 character hex string representation */
|
|
40
|
+
toHexString(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Update the ObjectId index
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
private static getInc;
|
|
46
|
+
/**
|
|
47
|
+
* Generate a 12 byte id buffer used in ObjectId's
|
|
48
|
+
*
|
|
49
|
+
* @param time - pass in a second based timestamp.
|
|
50
|
+
*/
|
|
51
|
+
static generate(time?: number): Uint8Array;
|
|
52
|
+
/**
|
|
53
|
+
* Converts the id into a 24 character hex string for printing, unless encoding is provided.
|
|
54
|
+
* @param encoding - hex or base64
|
|
55
|
+
*/
|
|
56
|
+
toString(encoding?: 'hex' | 'base64'): string;
|
|
57
|
+
/** Converts to its JSON the 24 character hex string representation. */
|
|
58
|
+
toJSON(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Compares the equality of this ObjectId with `otherID`.
|
|
61
|
+
*
|
|
62
|
+
* @param otherId - ObjectId instance to compare against.
|
|
63
|
+
*/
|
|
64
|
+
equals(otherId: string | ObjectId | ObjectIdLike): boolean;
|
|
65
|
+
/** Returns the generation date (accurate up to the second) that this ID was generated. */
|
|
66
|
+
getTimestamp(): Date;
|
|
67
|
+
/** @internal */
|
|
68
|
+
static createPk(): ObjectId;
|
|
69
|
+
/**
|
|
70
|
+
* Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId.
|
|
71
|
+
*
|
|
72
|
+
* @param time - an integer number representing a number of seconds.
|
|
73
|
+
*/
|
|
74
|
+
static createFromTime(time: number): ObjectId;
|
|
75
|
+
/**
|
|
76
|
+
* Creates an ObjectId from a hex string representation of an ObjectId.
|
|
77
|
+
*
|
|
78
|
+
* @param hexString - create a ObjectId from a passed in 24 character hexstring.
|
|
79
|
+
*/
|
|
80
|
+
static createFromHexString(hexString: string): ObjectId;
|
|
81
|
+
/** Creates an ObjectId instance from a base64 string */
|
|
82
|
+
static createFromBase64(base64: string): ObjectId;
|
|
83
|
+
/**
|
|
84
|
+
* Checks if a value is a valid bson ObjectId
|
|
85
|
+
*
|
|
86
|
+
* @param id - ObjectId instance to validate.
|
|
87
|
+
*/
|
|
88
|
+
static isValid(id: string | number | ObjectId | ObjectIdLike | Uint8Array): boolean;
|
|
89
|
+
/** @internal */
|
|
90
|
+
toExtendedJSON(): ObjectIdExtended;
|
|
91
|
+
/** @internal */
|
|
92
|
+
static fromExtendedJSON(doc: ObjectIdExtended): ObjectId;
|
|
93
|
+
inspect(): string;
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=objectid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectid.d.ts","sourceRoot":"","sources":["../src/objectid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,cAAc;AACd,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC;I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Q7C;;;;OAIG;IACH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ;IAQvD,wDAAwD;IACxD,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAQjD;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO;IAWnF,gBAAgB;IAChB,cAAc,IAAI,gBAAgB;IAKlC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,QAAQ;IAcxD,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/regexp.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BSONValue } from './bson_value';
|
|
2
|
+
import type { EJSONOptions } from './extended_json';
|
|
3
|
+
/** @public */
|
|
4
|
+
export interface BSONRegExpExtendedLegacy {
|
|
5
|
+
$regex: string | BSONRegExp;
|
|
6
|
+
$options: string;
|
|
7
|
+
}
|
|
8
|
+
/** @public */
|
|
9
|
+
export interface BSONRegExpExtended {
|
|
10
|
+
$regularExpression: {
|
|
11
|
+
pattern: string;
|
|
12
|
+
options: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A class representation of the BSON RegExp type.
|
|
17
|
+
* @public
|
|
18
|
+
* @category BSONType
|
|
19
|
+
*/
|
|
20
|
+
export declare class BSONRegExp extends BSONValue {
|
|
21
|
+
get _bsontype(): 'BSONRegExp';
|
|
22
|
+
pattern: string;
|
|
23
|
+
options: string;
|
|
24
|
+
/**
|
|
25
|
+
* @param pattern - The regular expression pattern to match
|
|
26
|
+
* @param options - The regular expression options
|
|
27
|
+
*/
|
|
28
|
+
constructor(pattern: string, options?: string);
|
|
29
|
+
static parseOptions(options?: string): string;
|
|
30
|
+
/** @internal */
|
|
31
|
+
toExtendedJSON(options?: EJSONOptions): BSONRegExpExtendedLegacy | BSONRegExpExtended;
|
|
32
|
+
/** @internal */
|
|
33
|
+
static fromExtendedJSON(doc: BSONRegExpExtendedLegacy | BSONRegExpExtended): BSONRegExp;
|
|
34
|
+
inspect(): string;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=regexp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexp.d.ts","sourceRoot":"","sources":["../src/regexp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,cAAc;AACd,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,cAAc;AACd,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,IAAI,SAAS,IAAI,YAAY,CAE5B;IAED,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,EAAG,MAAM,CAAC;IACjB;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAiC7C,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAI7C,gBAAgB;IAChB,cAAc,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,wBAAwB,GAAG,kBAAkB;IAQrF,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,wBAAwB,GAAG,kBAAkB,GAAG,UAAU;IAyBvF,OAAO,IAAI,MAAM;CAGlB"}
|
package/lib/symbol.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BSONValue } from './bson_value';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface BSONSymbolExtended {
|
|
4
|
+
$symbol: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A class representation of the BSON Symbol type.
|
|
8
|
+
* @public
|
|
9
|
+
* @category BSONType
|
|
10
|
+
*/
|
|
11
|
+
export declare class BSONSymbol extends BSONValue {
|
|
12
|
+
get _bsontype(): 'BSONSymbol';
|
|
13
|
+
value: string;
|
|
14
|
+
/**
|
|
15
|
+
* @param value - the string representing the symbol.
|
|
16
|
+
*/
|
|
17
|
+
constructor(value: string);
|
|
18
|
+
/** Access the wrapped string value. */
|
|
19
|
+
valueOf(): string;
|
|
20
|
+
toString(): string;
|
|
21
|
+
inspect(): string;
|
|
22
|
+
toJSON(): string;
|
|
23
|
+
/** @internal */
|
|
24
|
+
toExtendedJSON(): BSONSymbolExtended;
|
|
25
|
+
/** @internal */
|
|
26
|
+
static fromExtendedJSON(doc: BSONSymbolExtended): BSONSymbol;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,cAAc;AACd,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,IAAI,SAAS,IAAI,YAAY,CAE5B;IAED,KAAK,EAAG,MAAM,CAAC;IACf;;OAEG;gBACS,KAAK,EAAE,MAAM;IAKzB,uCAAuC;IACvC,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,MAAM,IAAI,MAAM;IAIhB,gBAAgB;IAChB,cAAc,IAAI,kBAAkB;IAIpC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,GAAG,UAAU;CAQ7D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Long } from './long';
|
|
2
|
+
/** @public */
|
|
3
|
+
export type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect';
|
|
4
|
+
/** @public */
|
|
5
|
+
export type LongWithoutOverrides = new (low: unknown, high?: number | boolean, unsigned?: boolean) => {
|
|
6
|
+
[P in Exclude<keyof Long, TimestampOverrides>]: Long[P];
|
|
7
|
+
};
|
|
8
|
+
/** @public */
|
|
9
|
+
export declare const LongWithoutOverridesClass: LongWithoutOverrides;
|
|
10
|
+
/** @public */
|
|
11
|
+
export interface TimestampExtended {
|
|
12
|
+
$timestamp: {
|
|
13
|
+
t: number;
|
|
14
|
+
i: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
* @category BSONType
|
|
20
|
+
*/
|
|
21
|
+
export declare class Timestamp extends LongWithoutOverridesClass {
|
|
22
|
+
get _bsontype(): 'Timestamp';
|
|
23
|
+
static readonly MAX_VALUE: Long;
|
|
24
|
+
/**
|
|
25
|
+
* @param int - A 64-bit bigint representing the Timestamp.
|
|
26
|
+
*/
|
|
27
|
+
constructor(int: bigint);
|
|
28
|
+
/**
|
|
29
|
+
* @param long - A 64-bit Long representing the Timestamp.
|
|
30
|
+
*/
|
|
31
|
+
constructor(long: Long);
|
|
32
|
+
/**
|
|
33
|
+
* @param value - A pair of two values indicating timestamp and increment.
|
|
34
|
+
*/
|
|
35
|
+
constructor(value: {
|
|
36
|
+
t: number;
|
|
37
|
+
i: number;
|
|
38
|
+
});
|
|
39
|
+
toJSON(): {
|
|
40
|
+
$timestamp: string;
|
|
41
|
+
};
|
|
42
|
+
/** Returns a Timestamp represented by the given (32-bit) integer value. */
|
|
43
|
+
static fromInt(value: number): Timestamp;
|
|
44
|
+
/** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */
|
|
45
|
+
static fromNumber(value: number): Timestamp;
|
|
46
|
+
/**
|
|
47
|
+
* Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits.
|
|
48
|
+
*
|
|
49
|
+
* @param lowBits - the low 32-bits.
|
|
50
|
+
* @param highBits - the high 32-bits.
|
|
51
|
+
*/
|
|
52
|
+
static fromBits(lowBits: number, highBits: number): Timestamp;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a Timestamp from the given string, optionally using the given radix.
|
|
55
|
+
*
|
|
56
|
+
* @param str - the textual representation of the Timestamp.
|
|
57
|
+
* @param optRadix - the radix in which the text is written.
|
|
58
|
+
*/
|
|
59
|
+
static fromString(str: string, optRadix: number): Timestamp;
|
|
60
|
+
/** @internal */
|
|
61
|
+
toExtendedJSON(): TimestampExtended;
|
|
62
|
+
/** @internal */
|
|
63
|
+
static fromExtendedJSON(doc: TimestampExtended): Timestamp;
|
|
64
|
+
inspect(): string;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=timestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../src/timestamp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,cAAc;AACd,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,SAAS,CAAC;AACjG,cAAc;AACd,MAAM,MAAM,oBAAoB,GAAG,KACjC,GAAG,EAAE,OAAO,EACZ,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,EACvB,QAAQ,CAAC,EAAE,OAAO,KACf;KACF,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,kBAAkB,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;CACxD,CAAC;AACF,cAAc;AACd,eAAO,MAAM,yBAAyB,EAAE,oBACC,CAAC;AAE1C,cAAc;AACd,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,yBAAyB;IACtD,IAAI,SAAS,IAAI,WAAW,CAE3B;IAED,MAAM,CAAC,QAAQ,CAAC,SAAS,OAA2B;IAEpD;;OAEG;gBACS,GAAG,EAAE,MAAM;IACvB;;OAEG;gBACS,IAAI,EAAE,IAAI;IACtB;;OAEG;gBACS,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAwC3C,MAAM,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE;IAMhC,2EAA2E;IAC3E,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIxC,iIAAiI;IACjI,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAI3C;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;IAI7D;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;IAI3D,gBAAgB;IAChB,cAAc,IAAI,iBAAiB;IAInC,gBAAgB;IAChB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS;IAgB1D,OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines if the passed in bytes are valid utf8
|
|
3
|
+
* @param bytes - An array of 8-bit bytes. Must be indexable and have length property
|
|
4
|
+
* @param start - The index to start validating
|
|
5
|
+
* @param end - The index to end validating
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateUtf8(bytes: {
|
|
8
|
+
[index: number]: number;
|
|
9
|
+
}, start: number, end: number): boolean;
|
|
10
|
+
//# sourceMappingURL=validate_utf8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate_utf8.d.ts","sourceRoot":"","sources":["../src/validate_utf8.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAClC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,OAAO,CAyBT"}
|