bireader 4.0.4 → 4.0.5
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/dist/cjs/index.d.ts +41 -41
- package/dist/cjs/index.js +18 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/indexBrowser.d.ts +41 -41
- package/dist/esm/indexBrowser.js +18 -18
- package/dist/esm/indexBrowser.js.map +1 -1
- package/dist/esm/indexImport.d.ts +41 -41
- package/dist/esm/indexImport.js +18 -18
- package/dist/esm/indexImport.js.map +1 -1
- package/package.json +1 -1
|
@@ -824,25 +824,25 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
824
824
|
* @param {number} startOffset - Start location (default 0)
|
|
825
825
|
* @param {number} endOffset - End location (default current position)
|
|
826
826
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
827
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
827
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
828
828
|
*/
|
|
829
|
-
delete(startOffset?: number, endOffset?: number, consume?: boolean): DataType
|
|
829
|
+
delete(startOffset?: number, endOffset?: number, consume?: boolean): ReturnMapping<DataType>;
|
|
830
830
|
/**
|
|
831
831
|
* Deletes part of data from current byte position to end, returns removed.
|
|
832
832
|
*
|
|
833
833
|
* Note: Errors in strict mode.
|
|
834
834
|
*
|
|
835
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
835
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
836
836
|
*/
|
|
837
|
-
clip(): DataType
|
|
837
|
+
clip(): ReturnMapping<DataType>;
|
|
838
838
|
/**
|
|
839
839
|
* Deletes part of data from current byte position to end, returns removed.
|
|
840
840
|
*
|
|
841
841
|
* Note: Errors in strict mode.
|
|
842
842
|
*
|
|
843
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
843
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
844
844
|
*/
|
|
845
|
-
trim(): DataType
|
|
845
|
+
trim(): ReturnMapping<DataType>;
|
|
846
846
|
/**
|
|
847
847
|
* Deletes part of data from current byte position to supplied length, returns removed.
|
|
848
848
|
*
|
|
@@ -850,9 +850,9 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
850
850
|
*
|
|
851
851
|
* @param {number} length - Length of data in bytes to remove
|
|
852
852
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
853
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
853
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
854
854
|
*/
|
|
855
|
-
crop(length?: number, consume?: boolean): DataType
|
|
855
|
+
crop(length?: number, consume?: boolean): ReturnMapping<DataType>;
|
|
856
856
|
/**
|
|
857
857
|
* Deletes part of data from current position to supplied length, returns removed.
|
|
858
858
|
*
|
|
@@ -860,29 +860,29 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
860
860
|
*
|
|
861
861
|
* @param {number} length - Length of data in bytes to remove
|
|
862
862
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
863
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
863
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
864
864
|
*/
|
|
865
|
-
drop(length?: number, consume?: boolean): DataType
|
|
865
|
+
drop(length?: number, consume?: boolean): ReturnMapping<DataType>;
|
|
866
866
|
/**
|
|
867
867
|
* Replaces data in data.
|
|
868
868
|
*
|
|
869
869
|
* Note: Errors on strict mode if past end of data.
|
|
870
870
|
*
|
|
871
|
-
* @param {
|
|
871
|
+
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
872
872
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
873
873
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
874
874
|
*/
|
|
875
|
-
replace(data:
|
|
875
|
+
replace(data: DataType, offset?: number, consume?: boolean): void;
|
|
876
876
|
/**
|
|
877
877
|
* Replaces data in data.
|
|
878
878
|
*
|
|
879
879
|
* Note: Errors on strict mode.
|
|
880
880
|
*
|
|
881
|
-
* @param {
|
|
881
|
+
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
882
882
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
883
883
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
884
884
|
*/
|
|
885
|
-
overwrite(data:
|
|
885
|
+
overwrite(data: DataType, offset?: number, consume?: boolean): void;
|
|
886
886
|
/**
|
|
887
887
|
* Returns part of data from current byte position to end of data unless supplied.
|
|
888
888
|
*
|
|
@@ -890,9 +890,9 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
890
890
|
* @param {number} endOffset - End location (default end of data)
|
|
891
891
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
892
892
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
893
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
893
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
894
894
|
*/
|
|
895
|
-
fill(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): DataType
|
|
895
|
+
fill(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): ReturnMapping<DataType>;
|
|
896
896
|
/**
|
|
897
897
|
* Returns part of data from current byte position to end of data unless supplied.
|
|
898
898
|
*
|
|
@@ -900,9 +900,9 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
900
900
|
* @param {number} endOffset - End location (default end of data)
|
|
901
901
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
902
902
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
903
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
903
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
904
904
|
*/
|
|
905
|
-
lift(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): DataType
|
|
905
|
+
lift(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): ReturnMapping<DataType>;
|
|
906
906
|
/**
|
|
907
907
|
* Extract data from current position to length supplied.
|
|
908
908
|
*
|
|
@@ -910,9 +910,9 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
910
910
|
*
|
|
911
911
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
912
912
|
* @param {number} consume - Moves offset to end of length (default false)
|
|
913
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
913
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
914
914
|
*/
|
|
915
|
-
extract(length?: number, consume?: boolean): DataType
|
|
915
|
+
extract(length?: number, consume?: boolean): ReturnMapping<DataType>;
|
|
916
916
|
/**
|
|
917
917
|
* Extract data from current position to length supplied.
|
|
918
918
|
*
|
|
@@ -920,9 +920,9 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
920
920
|
*
|
|
921
921
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
922
922
|
* @param {number} consume - Moves offset to end of length (default false)
|
|
923
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
923
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
924
924
|
*/
|
|
925
|
-
slice(length?: number, consume?: boolean): DataType
|
|
925
|
+
slice(length?: number, consume?: boolean): ReturnMapping<DataType>;
|
|
926
926
|
/**
|
|
927
927
|
* Extract data from current position to length supplied.
|
|
928
928
|
*
|
|
@@ -930,9 +930,9 @@ declare class BiBase<DataType, alwaysBigInt> {
|
|
|
930
930
|
*
|
|
931
931
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
932
932
|
* @param {number} consume - Moves offset to end of length (default false)
|
|
933
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
933
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
934
934
|
*/
|
|
935
|
-
wrap(length?: number, consume?: boolean): DataType
|
|
935
|
+
wrap(length?: number, consume?: boolean): ReturnMapping<DataType>;
|
|
936
936
|
/**
|
|
937
937
|
* Inserts data into data.
|
|
938
938
|
*
|
|
@@ -7532,7 +7532,7 @@ declare class BiBaseAsync<DataType, alwaysBigInt> {
|
|
|
7532
7532
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
7533
7533
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
7534
7534
|
*/
|
|
7535
|
-
fill(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Promise<DataType
|
|
7535
|
+
fill(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Promise<DataType | ReturnMapping<DataType>>;
|
|
7536
7536
|
/**
|
|
7537
7537
|
* Returns part of data from current byte position to end of data unless supplied.
|
|
7538
7538
|
*
|
|
@@ -7541,7 +7541,7 @@ declare class BiBaseAsync<DataType, alwaysBigInt> {
|
|
|
7541
7541
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
7542
7542
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
7543
7543
|
*/
|
|
7544
|
-
lift(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Promise<DataType
|
|
7544
|
+
lift(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Promise<ReturnMapping<DataType>>;
|
|
7545
7545
|
/**
|
|
7546
7546
|
* Extract data from current position to length supplied.
|
|
7547
7547
|
*
|
|
@@ -7550,7 +7550,7 @@ declare class BiBaseAsync<DataType, alwaysBigInt> {
|
|
|
7550
7550
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
7551
7551
|
* @param {number} consume - Moves offset to end of length
|
|
7552
7552
|
*/
|
|
7553
|
-
extract(length?: number, consume?: boolean): Promise<DataType
|
|
7553
|
+
extract(length?: number, consume?: boolean): Promise<DataType | ReturnMapping<DataType>>;
|
|
7554
7554
|
/**
|
|
7555
7555
|
* Extract data from current position to length supplied.
|
|
7556
7556
|
*
|
|
@@ -7559,7 +7559,7 @@ declare class BiBaseAsync<DataType, alwaysBigInt> {
|
|
|
7559
7559
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
7560
7560
|
* @param {number} consume - Moves offset to end of length
|
|
7561
7561
|
*/
|
|
7562
|
-
slice(length?: number, consume?: boolean): Promise<DataType
|
|
7562
|
+
slice(length?: number, consume?: boolean): Promise<DataType | ReturnMapping<DataType>>;
|
|
7563
7563
|
/**
|
|
7564
7564
|
* Extract data from current position to length supplied.
|
|
7565
7565
|
*
|
|
@@ -7568,63 +7568,63 @@ declare class BiBaseAsync<DataType, alwaysBigInt> {
|
|
|
7568
7568
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
7569
7569
|
* @param {number} consume - Moves offset to end of length
|
|
7570
7570
|
*/
|
|
7571
|
-
wrap(length?: number, consume?: boolean): Promise<DataType
|
|
7571
|
+
wrap(length?: number, consume?: boolean): Promise<DataType | ReturnMapping<DataType>>;
|
|
7572
7572
|
/**
|
|
7573
7573
|
* Inserts data into data.
|
|
7574
7574
|
*
|
|
7575
7575
|
* Note: Errors on strict mode.
|
|
7576
7576
|
*
|
|
7577
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7577
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7578
7578
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
7579
7579
|
* @param {boolean} consume - Move current byte position to end of data (default true)
|
|
7580
7580
|
*/
|
|
7581
|
-
insert(data: DataType
|
|
7581
|
+
insert(data: ReturnMapping<DataType>, offset?: number, consume?: boolean): Promise<void>;
|
|
7582
7582
|
/**
|
|
7583
7583
|
* Inserts data into data.
|
|
7584
7584
|
*
|
|
7585
7585
|
* Note: Errors on strict mode.
|
|
7586
7586
|
*
|
|
7587
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7587
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7588
7588
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
7589
7589
|
* @param {boolean} consume - Move current byte position to end of data (default true)
|
|
7590
7590
|
*/
|
|
7591
|
-
place(data: DataType
|
|
7591
|
+
place(data: ReturnMapping<DataType>, offset?: number, consume?: boolean): Promise<void>;
|
|
7592
7592
|
/**
|
|
7593
7593
|
* Adds data to start of supplied data.
|
|
7594
7594
|
*
|
|
7595
7595
|
* Note: Errors on strict mode.
|
|
7596
7596
|
*
|
|
7597
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7597
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7598
7598
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
7599
7599
|
*/
|
|
7600
|
-
unshift(data: DataType
|
|
7600
|
+
unshift(data: ReturnMapping<DataType>, consume?: boolean): Promise<void>;
|
|
7601
7601
|
/**
|
|
7602
7602
|
* Adds data to start of supplied data.
|
|
7603
7603
|
*
|
|
7604
7604
|
* Note: Errors on strict mode.
|
|
7605
7605
|
*
|
|
7606
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7606
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7607
7607
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
7608
7608
|
*/
|
|
7609
|
-
prepend(data: DataType
|
|
7609
|
+
prepend(data: ReturnMapping<DataType>, consume?: boolean): Promise<void>;
|
|
7610
7610
|
/**
|
|
7611
7611
|
* Adds data to end of supplied data.
|
|
7612
7612
|
*
|
|
7613
7613
|
* Note: Errors on strict mode.
|
|
7614
7614
|
*
|
|
7615
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7615
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7616
7616
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
7617
7617
|
*/
|
|
7618
|
-
push(data: DataType
|
|
7618
|
+
push(data: ReturnMapping<DataType>, consume?: boolean): Promise<void>;
|
|
7619
7619
|
/**
|
|
7620
7620
|
* Adds data to end of supplied data.
|
|
7621
7621
|
*
|
|
7622
7622
|
* Note: Errors on strict mode.
|
|
7623
7623
|
*
|
|
7624
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7624
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
7625
7625
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
7626
7626
|
*/
|
|
7627
|
-
append(data: DataType
|
|
7627
|
+
append(data: ReturnMapping<DataType>, consume?: boolean): Promise<void>;
|
|
7628
7628
|
/**
|
|
7629
7629
|
* XOR data.
|
|
7630
7630
|
*
|
package/dist/esm/indexImport.js
CHANGED
|
@@ -2738,7 +2738,7 @@ class BiBase {
|
|
|
2738
2738
|
* @param {number} startOffset - Start location (default 0)
|
|
2739
2739
|
* @param {number} endOffset - End location (default current position)
|
|
2740
2740
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
2741
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2741
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2742
2742
|
*/
|
|
2743
2743
|
delete(startOffset = 0, endOffset = this.#offset, consume = false) {
|
|
2744
2744
|
if (this.readOnly || this.strict) {
|
|
@@ -2774,7 +2774,7 @@ class BiBase {
|
|
|
2774
2774
|
*
|
|
2775
2775
|
* Note: Errors in strict mode.
|
|
2776
2776
|
*
|
|
2777
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2777
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2778
2778
|
*/
|
|
2779
2779
|
clip() {
|
|
2780
2780
|
return this.delete(this.#offset, this.size, false);
|
|
@@ -2785,7 +2785,7 @@ class BiBase {
|
|
|
2785
2785
|
*
|
|
2786
2786
|
* Note: Errors in strict mode.
|
|
2787
2787
|
*
|
|
2788
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2788
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2789
2789
|
*/
|
|
2790
2790
|
trim() {
|
|
2791
2791
|
return this.delete(this.#offset, this.size, false);
|
|
@@ -2798,7 +2798,7 @@ class BiBase {
|
|
|
2798
2798
|
*
|
|
2799
2799
|
* @param {number} length - Length of data in bytes to remove
|
|
2800
2800
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
2801
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2801
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2802
2802
|
*/
|
|
2803
2803
|
crop(length = 0, consume = false) {
|
|
2804
2804
|
return this.delete(this.#offset, this.#offset + length, consume);
|
|
@@ -2811,7 +2811,7 @@ class BiBase {
|
|
|
2811
2811
|
*
|
|
2812
2812
|
* @param {number} length - Length of data in bytes to remove
|
|
2813
2813
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
2814
|
-
* @returns {DataType} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2814
|
+
* @returns {ReturnMapping<DataType>} Removed data as ``Buffer`` or ``Uint8Array``
|
|
2815
2815
|
*/
|
|
2816
2816
|
drop(length = 0, consume = false) {
|
|
2817
2817
|
return this.delete(this.#offset, this.#offset + length, consume);
|
|
@@ -2825,7 +2825,7 @@ class BiBase {
|
|
|
2825
2825
|
*
|
|
2826
2826
|
* Note: Errors on strict mode if past end of data.
|
|
2827
2827
|
*
|
|
2828
|
-
* @param {
|
|
2828
|
+
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
2829
2829
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
2830
2830
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2831
2831
|
*/
|
|
@@ -2876,7 +2876,7 @@ class BiBase {
|
|
|
2876
2876
|
*
|
|
2877
2877
|
* Note: Errors on strict mode.
|
|
2878
2878
|
*
|
|
2879
|
-
* @param {
|
|
2879
|
+
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
2880
2880
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
2881
2881
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2882
2882
|
*/
|
|
@@ -2894,7 +2894,7 @@ class BiBase {
|
|
|
2894
2894
|
* @param {number} endOffset - End location (default end of data)
|
|
2895
2895
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
2896
2896
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
2897
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2897
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2898
2898
|
*/
|
|
2899
2899
|
fill(startOffset = this.#offset, endOffset = this.size, consume = false, fillValue) {
|
|
2900
2900
|
if (this.readOnly) {
|
|
@@ -2957,7 +2957,7 @@ class BiBase {
|
|
|
2957
2957
|
* @param {number} endOffset - End location (default end of data)
|
|
2958
2958
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
2959
2959
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
2960
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2960
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2961
2961
|
*/
|
|
2962
2962
|
lift(startOffset = this.#offset, endOffset = this.size, consume = false, fillValue) {
|
|
2963
2963
|
return this.fill(startOffset, endOffset, consume, fillValue);
|
|
@@ -2970,7 +2970,7 @@ class BiBase {
|
|
|
2970
2970
|
*
|
|
2971
2971
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2972
2972
|
* @param {number} consume - Moves offset to end of length (default false)
|
|
2973
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2973
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2974
2974
|
*/
|
|
2975
2975
|
extract(length = 0, consume = false) {
|
|
2976
2976
|
return this.fill(this.#offset, this.#offset + length, consume);
|
|
@@ -2983,7 +2983,7 @@ class BiBase {
|
|
|
2983
2983
|
*
|
|
2984
2984
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2985
2985
|
* @param {number} consume - Moves offset to end of length (default false)
|
|
2986
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2986
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2987
2987
|
*/
|
|
2988
2988
|
slice(length = 0, consume = false) {
|
|
2989
2989
|
return this.fill(this.#offset, this.#offset + length, consume);
|
|
@@ -2996,7 +2996,7 @@ class BiBase {
|
|
|
2996
2996
|
*
|
|
2997
2997
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2998
2998
|
* @param {number} consume - Moves offset to end of length (default false)
|
|
2999
|
-
* @returns {DataType} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2999
|
+
* @returns {ReturnMapping<DataType>} Selected data as ``Uint8Array`` or ``Buffer``
|
|
3000
3000
|
*/
|
|
3001
3001
|
wrap(length = 0, consume = false) {
|
|
3002
3002
|
return this.fill(this.#offset, this.#offset + length, consume);
|
|
@@ -14265,7 +14265,7 @@ class BiBaseAsync {
|
|
|
14265
14265
|
*
|
|
14266
14266
|
* Note: Errors on strict mode.
|
|
14267
14267
|
*
|
|
14268
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14268
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14269
14269
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
14270
14270
|
* @param {boolean} consume - Move current byte position to end of data (default true)
|
|
14271
14271
|
*/
|
|
@@ -14330,7 +14330,7 @@ class BiBaseAsync {
|
|
|
14330
14330
|
*
|
|
14331
14331
|
* Note: Errors on strict mode.
|
|
14332
14332
|
*
|
|
14333
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14333
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14334
14334
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
14335
14335
|
* @param {boolean} consume - Move current byte position to end of data (default true)
|
|
14336
14336
|
*/
|
|
@@ -14343,7 +14343,7 @@ class BiBaseAsync {
|
|
|
14343
14343
|
*
|
|
14344
14344
|
* Note: Errors on strict mode.
|
|
14345
14345
|
*
|
|
14346
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14346
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14347
14347
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
14348
14348
|
*/
|
|
14349
14349
|
async unshift(data, consume = false) {
|
|
@@ -14355,7 +14355,7 @@ class BiBaseAsync {
|
|
|
14355
14355
|
*
|
|
14356
14356
|
* Note: Errors on strict mode.
|
|
14357
14357
|
*
|
|
14358
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14358
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14359
14359
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
14360
14360
|
*/
|
|
14361
14361
|
async prepend(data, consume = false) {
|
|
@@ -14367,7 +14367,7 @@ class BiBaseAsync {
|
|
|
14367
14367
|
*
|
|
14368
14368
|
* Note: Errors on strict mode.
|
|
14369
14369
|
*
|
|
14370
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14370
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14371
14371
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
14372
14372
|
*/
|
|
14373
14373
|
async push(data, consume = false) {
|
|
@@ -14379,7 +14379,7 @@ class BiBaseAsync {
|
|
|
14379
14379
|
*
|
|
14380
14380
|
* Note: Errors on strict mode.
|
|
14381
14381
|
*
|
|
14382
|
-
* @param {DataType} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14382
|
+
* @param {ReturnMapping<DataType>} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
14383
14383
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
14384
14384
|
*/
|
|
14385
14385
|
async append(data, consume = false) {
|