@itwin/core-i18n 3.6.0-dev.10 → 3.6.0-dev.14
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.
|
@@ -16990,7 +16990,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16990
16990
|
/** Allows the contents of an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
|
|
16991
16991
|
* to be consumed sequentially using methods to extract
|
|
16992
16992
|
* data of a particular type from the bytes beginning at the current read position.
|
|
16993
|
-
* Methods and properties beginning with '
|
|
16993
|
+
* Methods and properties beginning with 'read' and taking no arguments consume data at the current read position and advance it
|
|
16994
16994
|
* by the size of the data read. The read position can also be directly adjusted by the caller.
|
|
16995
16995
|
* @public
|
|
16996
16996
|
*/
|
|
@@ -17075,21 +17075,37 @@ class ByteStream {
|
|
|
17075
17075
|
/** Resets the current read position to the beginning of the stream */
|
|
17076
17076
|
reset() { this.curPos = 0; }
|
|
17077
17077
|
/** Read a unsigned 8-bit integer from the current read position and advance by 1 byte. */
|
|
17078
|
-
|
|
17078
|
+
readUint8() { return this.read(1, (view) => view.getUint8(this.curPos)); }
|
|
17079
17079
|
/** Read an unsigned 16-bit integer from the current read position and advance by 2 bytes. */
|
|
17080
|
-
|
|
17080
|
+
readUint16() { return this.read(2, (view) => view.getUint16(this.curPos, true)); }
|
|
17081
17081
|
/** Read an unsigned 32-bit integer from the current read position and advance by 4 bytes. */
|
|
17082
|
-
|
|
17082
|
+
readUint32() { return this.read(4, (view) => view.getUint32(this.curPos, true)); }
|
|
17083
17083
|
/** Read a signed 32-bit integer from the current read position and advance by 4 bytes. */
|
|
17084
|
-
|
|
17084
|
+
readInt32() { return this.read(4, (view) => view.getInt32(this.curPos, true)); }
|
|
17085
17085
|
/** Read a 32-bit floating point number from the current read position and advance by 4 bytes. */
|
|
17086
|
-
|
|
17086
|
+
readFloat32() { return this.read(4, (view) => view.getFloat32(this.curPos, true)); }
|
|
17087
17087
|
/** Read a 64-bit floating point number from the current read position and advance by 8 bytes. */
|
|
17088
|
-
|
|
17088
|
+
readFloat64() { return this.read(8, (view) => view.getFloat64(this.curPos, true)); }
|
|
17089
17089
|
/** Read an unsigned 64-bit integer from the current read position, advance by 8 bytes, and return the 64-bit value as an Id64String. */
|
|
17090
|
-
|
|
17090
|
+
readId64() { return _Id__WEBPACK_IMPORTED_MODULE_1__.Id64.fromUint32Pair(this.readUint32(), this.readUint32()); }
|
|
17091
17091
|
/** Read an unsigned 24-bit integer from the current read position and advance by 3 bytes. */
|
|
17092
|
-
|
|
17092
|
+
readUint24() { return this.readUint8() | (this.readUint8() << 8) | (this.readUint8() << 16); }
|
|
17093
|
+
/** @deprecated use [[readUint8]]. */
|
|
17094
|
+
get nextUint8() { return this.readUint8(); }
|
|
17095
|
+
/** @deprecated use [[readUint16]]. */
|
|
17096
|
+
get nextUint16() { return this.readUint16(); }
|
|
17097
|
+
/** @deprecated use [[readUint32]]. */
|
|
17098
|
+
get nextUint32() { return this.readUint32(); }
|
|
17099
|
+
/** @deprecated use [[readInt32]]. */
|
|
17100
|
+
get nextInt32() { return this.readInt32(); }
|
|
17101
|
+
/** @deprecated use [[readFloat32]]. */
|
|
17102
|
+
get nextFloat32() { return this.readFloat32(); }
|
|
17103
|
+
/** @deprecated use [[readFloat64]]. */
|
|
17104
|
+
get nextFloat64() { return this.readFloat64(); }
|
|
17105
|
+
/** @deprecated use [[readId64]]. */
|
|
17106
|
+
get nextId64() { return this.readId64(); }
|
|
17107
|
+
/** @deprecated use [[readUint32]]. */
|
|
17108
|
+
get nextUint24() { return this.readUint24(); }
|
|
17093
17109
|
/** Read the specified number of bytes beginning at the current read position into a Uint8Array and advance by the specified number of byte.
|
|
17094
17110
|
* @param numBytes The number of bytes to read.
|
|
17095
17111
|
*/
|
|
@@ -21684,7 +21700,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21684
21700
|
/* harmony export */ "TypedArrayBuilder": () => (/* binding */ TypedArrayBuilder),
|
|
21685
21701
|
/* harmony export */ "Uint16ArrayBuilder": () => (/* binding */ Uint16ArrayBuilder),
|
|
21686
21702
|
/* harmony export */ "Uint32ArrayBuilder": () => (/* binding */ Uint32ArrayBuilder),
|
|
21687
|
-
/* harmony export */ "Uint8ArrayBuilder": () => (/* binding */ Uint8ArrayBuilder)
|
|
21703
|
+
/* harmony export */ "Uint8ArrayBuilder": () => (/* binding */ Uint8ArrayBuilder),
|
|
21704
|
+
/* harmony export */ "UintArrayBuilder": () => (/* binding */ UintArrayBuilder)
|
|
21688
21705
|
/* harmony export */ });
|
|
21689
21706
|
/* harmony import */ var _Assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Assert */ "../bentley/lib/esm/Assert.js");
|
|
21690
21707
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -21695,7 +21712,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21695
21712
|
* @module Collections
|
|
21696
21713
|
*/
|
|
21697
21714
|
|
|
21698
|
-
/** Incrementally builds a [TypedArray] of unsigned 8-, 16-, or 32-bit integers.
|
|
21715
|
+
/** Incrementally builds a [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) of unsigned 8-, 16-, or 32-bit integers.
|
|
21699
21716
|
* Sometimes you wish to populate a `TypedArray`, but you don't know how many elements you will need.
|
|
21700
21717
|
* `TypedArray` requires you to specify the size upon construction, and does not permit you to change the size later.
|
|
21701
21718
|
*
|
|
@@ -21706,6 +21723,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21706
21723
|
*
|
|
21707
21724
|
* Once you've finished adding elements, you can obtain the finished `TypedArray` via [[toTypedArray]].
|
|
21708
21725
|
* @see [[Uint8ArrayBuilder]], [[Uint16ArrayBuilder]], and [[Uint32ArrayBuilder]] to build specific types of arrays.
|
|
21726
|
+
* @see [[UintArrayBuilder]] when you don't know the maximum number of bytes required for each element in the array.
|
|
21709
21727
|
* @public
|
|
21710
21728
|
*/
|
|
21711
21729
|
class TypedArrayBuilder {
|
|
@@ -21785,7 +21803,7 @@ class TypedArrayBuilder {
|
|
|
21785
21803
|
* @public
|
|
21786
21804
|
*/
|
|
21787
21805
|
class Uint8ArrayBuilder extends TypedArrayBuilder {
|
|
21788
|
-
/**
|
|
21806
|
+
/** See [[TypedArrayBuilder]] constructor. */
|
|
21789
21807
|
constructor(options) {
|
|
21790
21808
|
super(Uint8Array, options);
|
|
21791
21809
|
}
|
|
@@ -21794,7 +21812,7 @@ class Uint8ArrayBuilder extends TypedArrayBuilder {
|
|
|
21794
21812
|
* @public
|
|
21795
21813
|
*/
|
|
21796
21814
|
class Uint16ArrayBuilder extends TypedArrayBuilder {
|
|
21797
|
-
/**
|
|
21815
|
+
/** See [[TypedArrayBuilder]] constructor. */
|
|
21798
21816
|
constructor(options) {
|
|
21799
21817
|
super(Uint16Array, options);
|
|
21800
21818
|
}
|
|
@@ -21803,7 +21821,7 @@ class Uint16ArrayBuilder extends TypedArrayBuilder {
|
|
|
21803
21821
|
* @public
|
|
21804
21822
|
*/
|
|
21805
21823
|
class Uint32ArrayBuilder extends TypedArrayBuilder {
|
|
21806
|
-
/**
|
|
21824
|
+
/** See [[TypedArrayBuilder]] constructor. */
|
|
21807
21825
|
constructor(options) {
|
|
21808
21826
|
super(Uint32Array, options);
|
|
21809
21827
|
}
|
|
@@ -21814,6 +21832,78 @@ class Uint32ArrayBuilder extends TypedArrayBuilder {
|
|
|
21814
21832
|
return new Uint8Array(this._data.buffer, 0, this.length * 4);
|
|
21815
21833
|
}
|
|
21816
21834
|
}
|
|
21835
|
+
/** A [[TypedArrayBuilder]] that can populate a [[UintArray]] with the minimum
|
|
21836
|
+
* [bytes per element](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) required.
|
|
21837
|
+
*
|
|
21838
|
+
* By default, the underlying array is a `Uint8Array`, though this can be configured via [[UintArrayBuilderOptions.initialType]].
|
|
21839
|
+
* As values are added to the array, if the bytes per element supported by the underlying array is too small to hold one of the new values, the array is
|
|
21840
|
+
* reallocated to a type large enough to hold all of the new values. For example, the following produces a `Uint8Array` because all values are less than 256:
|
|
21841
|
+
*
|
|
21842
|
+
* ```ts
|
|
21843
|
+
* const builder = new UintArrayBuilder();
|
|
21844
|
+
* builder.append([1, 2, 254, 255]);
|
|
21845
|
+
* const array = builder.toTypedArray();
|
|
21846
|
+
* assert(array instanceof Uint8Array);
|
|
21847
|
+
* ```
|
|
21848
|
+
*
|
|
21849
|
+
* However, the following produces a `Uint16Array` because one of the values is larger than 255 but none are larger than 65,535:
|
|
21850
|
+
*
|
|
21851
|
+
* ```ts
|
|
21852
|
+
* const builder = new UintArrayBuilder();
|
|
21853
|
+
* builder.append([1, 255, 257, 65535]);
|
|
21854
|
+
* const array = builder.toTypedArray();
|
|
21855
|
+
* assert(array instanceof Uint16Array);
|
|
21856
|
+
* ```
|
|
21857
|
+
*
|
|
21858
|
+
* @see [[Uint8ArrayBuilder]], [[Uint16ArrayBuilder]], or [[Uint32ArrayBuilder]] if you know the number of bytes you want to allocate for each element in the array.
|
|
21859
|
+
* @public
|
|
21860
|
+
*/
|
|
21861
|
+
class UintArrayBuilder extends TypedArrayBuilder {
|
|
21862
|
+
constructor(options) {
|
|
21863
|
+
var _a;
|
|
21864
|
+
super((_a = options === null || options === void 0 ? void 0 : options.initialType) !== null && _a !== void 0 ? _a : Uint8Array, options);
|
|
21865
|
+
}
|
|
21866
|
+
/** The number of bytes (1, 2, or 4) currently allocated per element by the underlying array.
|
|
21867
|
+
* This may change as larger values are added to the array.
|
|
21868
|
+
*/
|
|
21869
|
+
get bytesPerElement() {
|
|
21870
|
+
return this._data.BYTES_PER_ELEMENT;
|
|
21871
|
+
}
|
|
21872
|
+
/** Ensures that the underlying array is of a type that can contain the largest value in `newValues`.
|
|
21873
|
+
* For example, if `_data` is a `Uint16Array` and `newValues` contains any value(s) larger than 65,535, it will be replaced with a `Uint32Array`.
|
|
21874
|
+
* This method is invoked by [[push]] and [[append]].
|
|
21875
|
+
*/
|
|
21876
|
+
ensureBytesPerElement(newValues) {
|
|
21877
|
+
const curBytesPerElem = this.bytesPerElement;
|
|
21878
|
+
(0,_Assert__WEBPACK_IMPORTED_MODULE_0__.assert)(curBytesPerElem === 1 || curBytesPerElem === 2 || curBytesPerElem === 4);
|
|
21879
|
+
if (curBytesPerElem >= 4)
|
|
21880
|
+
return;
|
|
21881
|
+
let neededBytesPerElem = curBytesPerElem;
|
|
21882
|
+
for (const value of newValues) {
|
|
21883
|
+
if (value > 0xffff) {
|
|
21884
|
+
neededBytesPerElem = 4;
|
|
21885
|
+
break;
|
|
21886
|
+
}
|
|
21887
|
+
else if (value > 0xff) {
|
|
21888
|
+
neededBytesPerElem = 2;
|
|
21889
|
+
}
|
|
21890
|
+
}
|
|
21891
|
+
if (neededBytesPerElem <= curBytesPerElem)
|
|
21892
|
+
return;
|
|
21893
|
+
this._constructor = neededBytesPerElem === 1 ? Uint8Array : (neededBytesPerElem === 2 ? Uint16Array : Uint32Array);
|
|
21894
|
+
this._data = new this._constructor(this._data);
|
|
21895
|
+
}
|
|
21896
|
+
/** See [[TypedArrayBuilder.push]]. */
|
|
21897
|
+
push(value) {
|
|
21898
|
+
this.ensureBytesPerElement([value]);
|
|
21899
|
+
super.push(value);
|
|
21900
|
+
}
|
|
21901
|
+
/** See [[TypedArrayBuilder.append]]. */
|
|
21902
|
+
append(values) {
|
|
21903
|
+
this.ensureBytesPerElement(values);
|
|
21904
|
+
super.append(values);
|
|
21905
|
+
}
|
|
21906
|
+
}
|
|
21817
21907
|
|
|
21818
21908
|
|
|
21819
21909
|
/***/ }),
|
|
@@ -22065,6 +22155,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22065
22155
|
/* harmony export */ "Uint16ArrayBuilder": () => (/* reexport safe */ _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__.Uint16ArrayBuilder),
|
|
22066
22156
|
/* harmony export */ "Uint32ArrayBuilder": () => (/* reexport safe */ _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__.Uint32ArrayBuilder),
|
|
22067
22157
|
/* harmony export */ "Uint8ArrayBuilder": () => (/* reexport safe */ _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__.Uint8ArrayBuilder),
|
|
22158
|
+
/* harmony export */ "UintArrayBuilder": () => (/* reexport safe */ _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__.UintArrayBuilder),
|
|
22068
22159
|
/* harmony export */ "UnexpectedErrors": () => (/* reexport safe */ _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_33__.UnexpectedErrors),
|
|
22069
22160
|
/* harmony export */ "YieldManager": () => (/* reexport safe */ _YieldManager__WEBPACK_IMPORTED_MODULE_35__.YieldManager),
|
|
22070
22161
|
/* harmony export */ "areEqualPossiblyUndefined": () => (/* reexport safe */ _Compare__WEBPACK_IMPORTED_MODULE_10__.areEqualPossiblyUndefined),
|