bireader 3.0.1 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -29
- package/dist/BiReader.d.ts +339 -0
- package/dist/BiReaderStream.d.ts +340 -0
- package/dist/BiWriter.d.ts +344 -0
- package/dist/BiWriterStream.d.ts +347 -0
- package/dist/aliases/BinaryAliasReader.d.ts +4678 -0
- package/dist/aliases/BinaryAliasWriter.d.ts +4648 -0
- package/dist/common.d.ts +90 -0
- package/{build/esm/common.d.ts → dist/core/BiBase.d.ts} +132 -221
- package/{build/cjs/common.d.ts → dist/core/BiBaseStream.d.ts} +197 -261
- package/dist/index.browser.d.ts +6738 -0
- package/dist/index.browser.js +11557 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.cjs.d.ts +13439 -0
- package/dist/index.cjs.js +17364 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +13439 -0
- package/dist/index.esm.d.ts +13439 -0
- package/dist/index.esm.js +17337 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/indexBrowser.d.ts +19 -0
- package/dist/indexImport.d.ts +21 -0
- package/package.json +23 -14
- package/rollup.config.js +76 -0
- package/tsconfig.json +15 -0
- package/build/cjs/bireader.d.ts +0 -2372
- package/build/cjs/bireader.d.ts.map +0 -1
- package/build/cjs/bireader.js +0 -3060
- package/build/cjs/bireader.js.map +0 -1
- package/build/cjs/biwriter.d.ts +0 -2359
- package/build/cjs/biwriter.d.ts.map +0 -1
- package/build/cjs/biwriter.js +0 -3094
- package/build/cjs/biwriter.js.map +0 -1
- package/build/cjs/common.d.ts.map +0 -1
- package/build/cjs/common.js +0 -3615
- package/build/cjs/common.js.map +0 -1
- package/build/cjs/index.d.ts +0 -18
- package/build/cjs/index.d.ts.map +0 -1
- package/build/cjs/index.js +0 -30
- package/build/cjs/index.js.map +0 -1
- package/build/esm/bireader.d.ts +0 -2372
- package/build/esm/bireader.d.ts.map +0 -1
- package/build/esm/bireader.js +0 -3060
- package/build/esm/bireader.js.map +0 -1
- package/build/esm/biwriter.d.ts +0 -2359
- package/build/esm/biwriter.d.ts.map +0 -1
- package/build/esm/biwriter.js +0 -3094
- package/build/esm/biwriter.js.map +0 -1
- package/build/esm/common.d.ts.map +0 -1
- package/build/esm/common.js +0 -3615
- package/build/esm/common.js.map +0 -1
- package/build/esm/index.d.ts +0 -18
- package/build/esm/index.d.ts.map +0 -1
- package/build/esm/index.js +0 -30
- package/build/esm/index.js.map +0 -1
|
@@ -1,173 +1,140 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { endian, hexdumpOptions, stringOptions } from '../common.js';
|
|
3
|
+
/**
|
|
4
|
+
* For file system in Node
|
|
5
|
+
*/
|
|
6
|
+
type FileDescriptor = number;
|
|
7
|
+
/**
|
|
8
|
+
* file system read modes
|
|
9
|
+
*/
|
|
10
|
+
type fsMode = "w+" | "r";
|
|
11
|
+
export declare class BiBaseStreamer {
|
|
5
12
|
/**
|
|
6
|
-
*
|
|
13
|
+
* Endianness of default read.
|
|
14
|
+
*
|
|
15
|
+
* @type {endian}
|
|
7
16
|
*/
|
|
8
|
-
|
|
17
|
+
endian: endian;
|
|
9
18
|
/**
|
|
10
|
-
*
|
|
19
|
+
* Current read byte location.
|
|
11
20
|
*/
|
|
12
|
-
|
|
21
|
+
offset: number;
|
|
13
22
|
/**
|
|
14
|
-
*
|
|
23
|
+
* Current read byte's bit location.
|
|
15
24
|
*/
|
|
16
|
-
|
|
25
|
+
bitoffset: number;
|
|
17
26
|
/**
|
|
18
|
-
*
|
|
27
|
+
* Size in bytes of the current file.
|
|
19
28
|
*/
|
|
20
|
-
|
|
29
|
+
size: number;
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
31
|
+
* Size in bits of the current file.
|
|
23
32
|
*/
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
export declare function isBuffer(obj: Buffer | Uint8Array): boolean;
|
|
27
|
-
export declare function check_size(_this: BiReader | BiWriter | ReaderBase, write_bytes: number, write_bit?: number, offset?: number): number;
|
|
28
|
-
export declare function buffcheck(obj: Buffer | Uint8Array | ReaderBase): boolean;
|
|
29
|
-
export declare function arraybuffcheck(_this: BiReader | BiWriter | ReaderBase, obj: Buffer | Uint8Array): boolean;
|
|
30
|
-
export declare function extendarray(_this: BiReader | BiWriter | ReaderBase, to_padd: number): void;
|
|
31
|
-
export declare function checkSize(_this: BiReader | BiWriter | ReaderBase, write_bytes: number, write_bit?: number, offset?: number): number;
|
|
32
|
-
export declare function skip(_this: BiReader | BiWriter | ReaderBase, bytes: number, bits?: number): void;
|
|
33
|
-
export declare function align(_this: BiReader | BiWriter | ReaderBase, n: number): void;
|
|
34
|
-
export declare function alignRev(_this: BiReader | BiWriter | ReaderBase, n: number): void;
|
|
35
|
-
export declare function goto(_this: BiReader | BiWriter | ReaderBase, bytes: number, bits?: number): void;
|
|
36
|
-
export declare function remove(_this: BiReader | BiWriter | ReaderBase, startOffset?: number, endOffset?: number, consume?: boolean, remove?: boolean, fillValue?: number): any;
|
|
37
|
-
export declare function addData(_this: BiReader | BiWriter | ReaderBase, data: Buffer | Uint8Array, consume?: boolean, offset?: number, replace?: boolean): void;
|
|
38
|
-
type hexdumpOptions = {
|
|
33
|
+
sizeB: number;
|
|
39
34
|
/**
|
|
40
|
-
*
|
|
35
|
+
* Allows the file to extend reading or writing outside of current size
|
|
41
36
|
*/
|
|
42
|
-
|
|
37
|
+
strict: boolean;
|
|
43
38
|
/**
|
|
44
|
-
*
|
|
39
|
+
* Console log a hexdump on error.
|
|
45
40
|
*/
|
|
46
|
-
|
|
41
|
+
errorDump: boolean;
|
|
47
42
|
/**
|
|
48
|
-
*
|
|
43
|
+
* Current buffer chunk.
|
|
44
|
+
*
|
|
45
|
+
* @type {Buffer}
|
|
49
46
|
*/
|
|
50
|
-
|
|
47
|
+
data: Buffer | null;
|
|
51
48
|
/**
|
|
52
|
-
*
|
|
49
|
+
* When the data buffer needs to be extended while strict mode is ``false``, this will be the amount it extends.
|
|
50
|
+
*
|
|
51
|
+
* Otherwise it extends just the amount of the next written value.
|
|
52
|
+
*
|
|
53
|
+
* This can greatly speed up data writes when large files are being written.
|
|
54
|
+
*
|
|
55
|
+
* NOTE: Using ``BiWriter.get`` or ``BiWriter.return`` will now remove all data after the current write position. Use ``BiWriter.data`` to get the full buffer instead.
|
|
53
56
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
* @param {Uint8Array|Buffer} src - Uint8Array or Buffer
|
|
60
|
-
* @param {hexdumpOptions?} options - hex dump options
|
|
61
|
-
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
62
|
-
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
63
|
-
* @param {boolean?} options.supressUnicode - Supress unicode character preview for even columns.
|
|
64
|
-
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
65
|
-
*/
|
|
66
|
-
export declare function hexdump(src: Uint8Array | Buffer, options?: hexdumpOptions): void | string;
|
|
67
|
-
export declare function hexDump(_this: BiReader | BiWriter | ReaderBase, options?: hexdumpOptions): void | string;
|
|
68
|
-
export declare function AND(_this: BiReader | BiWriter | ReaderBase, and_key: any, start?: number, end?: number, consume?: boolean): any;
|
|
69
|
-
export declare function OR(_this: BiReader | BiWriter | ReaderBase, or_key: any, start?: number, end?: number, consume?: boolean): any;
|
|
70
|
-
export declare function XOR(_this: BiReader | BiWriter | ReaderBase, xor_key: any, start?: number, end?: number, consume?: boolean): any;
|
|
71
|
-
export declare function NOT(_this: BiReader | BiWriter | ReaderBase, start?: number, end?: number, consume?: boolean): any;
|
|
72
|
-
export declare function LSHIFT(_this: BiReader | BiWriter | ReaderBase, shift_key: any, start?: number, end?: number, consume?: boolean): any;
|
|
73
|
-
export declare function RSHIFT(_this: BiReader | BiWriter | ReaderBase, shift_key: any, start?: number, end?: number, consume?: boolean): any;
|
|
74
|
-
export declare function ADD(_this: BiReader | BiWriter | ReaderBase, add_key: any, start?: number, end?: number, consume?: boolean): any;
|
|
75
|
-
export declare function fString(_this: BiReader | BiWriter | ReaderBase, searchString: string): number;
|
|
76
|
-
export declare function fNumber(_this: BiReader | BiWriter | ReaderBase, targetNumber: number, bits: number, unsigned: boolean, endian?: string): number;
|
|
77
|
-
export declare function fHalfFloat(_this: BiReader | BiWriter | ReaderBase, targetNumber: number, endian?: string): number;
|
|
78
|
-
export declare function fFloat(_this: BiReader | BiWriter | ReaderBase, targetNumber: number, endian?: string): number;
|
|
79
|
-
export declare function fBigInt(_this: BiReader | BiWriter | ReaderBase, targetNumber: number, unsigned: boolean, endian?: string): number;
|
|
80
|
-
export declare function fDoubleFloat(_this: BiReader | BiWriter | ReaderBase, targetNumber: number, endian?: string): number;
|
|
81
|
-
export declare function wbit(_this: BiReader | BiWriter | ReaderBase, value: number, bits: number, unsigned?: boolean, endian?: string): void;
|
|
82
|
-
export declare function rbit(_this: BiReader | BiWriter | ReaderBase, bits?: number, unsigned?: boolean, endian?: string): number;
|
|
83
|
-
export declare function wbyte(_this: BiReader | BiWriter | ReaderBase, value: number, unsigned?: boolean): void;
|
|
84
|
-
export declare function rbyte(_this: BiReader | BiWriter | ReaderBase, unsigned?: boolean): number;
|
|
85
|
-
export declare function wint16(_this: BiReader | BiWriter | ReaderBase, value: number, unsigned?: boolean, endian?: string): void;
|
|
86
|
-
export declare function rint16(_this: BiReader | BiWriter | ReaderBase, unsigned?: boolean, endian?: string): number;
|
|
87
|
-
export declare function rhalffloat(_this: BiReader | BiWriter | ReaderBase, endian?: string): number;
|
|
88
|
-
export declare function whalffloat(_this: BiReader | BiWriter | ReaderBase, value: number, endian?: string): void;
|
|
89
|
-
export declare function wint32(_this: BiReader | BiWriter | ReaderBase, value: number, unsigned?: boolean, endian?: string): void;
|
|
90
|
-
export declare function rint32(_this: BiReader | BiWriter | ReaderBase, unsigned?: boolean, endian?: string): number;
|
|
91
|
-
export declare function rfloat(_this: BiReader | BiWriter | ReaderBase, endian?: string): number;
|
|
92
|
-
export declare function wfloat(_this: BiReader | BiWriter | ReaderBase, value: number, endian?: string): void;
|
|
93
|
-
export declare function rint64(_this: BiReader | BiWriter | ReaderBase, unsigned?: boolean, endian?: string): bigint;
|
|
94
|
-
export declare function wint64(_this: BiReader | BiWriter | ReaderBase, value: number, unsigned?: boolean, endian?: string): void;
|
|
95
|
-
export declare function wdfloat(_this: BiReader | BiWriter | ReaderBase, value: number, endian?: string): void;
|
|
96
|
-
export declare function rdfloat(_this: BiReader | BiWriter | ReaderBase, endian?: string): number;
|
|
97
|
-
export declare function rstring(_this: BiReader | BiWriter | ReaderBase, options?: {
|
|
98
|
-
length?: number;
|
|
99
|
-
stringType?: string;
|
|
100
|
-
terminateValue?: number;
|
|
101
|
-
lengthReadSize?: number;
|
|
102
|
-
stripNull?: boolean;
|
|
103
|
-
encoding?: string;
|
|
104
|
-
endian?: string;
|
|
105
|
-
}): string;
|
|
106
|
-
export declare function wstring(_this: BiReader | BiWriter | ReaderBase, string: string, options?: {
|
|
107
|
-
length?: number;
|
|
108
|
-
stringType?: string;
|
|
109
|
-
terminateValue?: number;
|
|
110
|
-
lengthWriteSize?: number;
|
|
111
|
-
stripNull?: boolean;
|
|
112
|
-
encoding?: string;
|
|
113
|
-
endian?: string;
|
|
114
|
-
}): void;
|
|
115
|
-
export declare class ReaderBase {
|
|
57
|
+
extendBufferSize: number;
|
|
58
|
+
fd: FileDescriptor | null;
|
|
59
|
+
filePath: string;
|
|
60
|
+
fsMode: fsMode;
|
|
116
61
|
/**
|
|
117
|
-
*
|
|
118
|
-
* @type {'little'|'big'}
|
|
62
|
+
* The settings that used when using the .str getter / setter
|
|
119
63
|
*/
|
|
120
|
-
|
|
64
|
+
private strDefaults;
|
|
65
|
+
maxFileSize: number | null;
|
|
66
|
+
constructor(filePath: string, readwrite: boolean);
|
|
121
67
|
/**
|
|
122
|
-
*
|
|
68
|
+
* Settings for when using .str
|
|
69
|
+
*
|
|
70
|
+
* @param {stringOptions} settings options to use with .str
|
|
123
71
|
*/
|
|
124
|
-
|
|
72
|
+
set strSettings(settings: stringOptions);
|
|
125
73
|
/**
|
|
126
|
-
*
|
|
74
|
+
* Enabling write mode in reader.
|
|
75
|
+
*
|
|
76
|
+
* @param {boolean} writeMode - Enabling write mode in reader.
|
|
127
77
|
*/
|
|
128
|
-
|
|
78
|
+
writeMode(writeMode: boolean): void;
|
|
129
79
|
/**
|
|
130
|
-
*
|
|
80
|
+
* Opens the file. Must be run before reading or writing.
|
|
81
|
+
*
|
|
82
|
+
* @returns {number} file size
|
|
131
83
|
*/
|
|
132
|
-
|
|
84
|
+
open(): number;
|
|
133
85
|
/**
|
|
134
|
-
*
|
|
86
|
+
* Internal update size
|
|
135
87
|
*/
|
|
136
|
-
|
|
88
|
+
updateSize(): void;
|
|
137
89
|
/**
|
|
138
|
-
*
|
|
90
|
+
* Closes the file.
|
|
91
|
+
*
|
|
92
|
+
* @returns {void}
|
|
139
93
|
*/
|
|
140
|
-
|
|
94
|
+
close(): void;
|
|
141
95
|
/**
|
|
142
|
-
*
|
|
96
|
+
* Internal reader
|
|
97
|
+
*
|
|
98
|
+
* @param start - likely this.offset
|
|
99
|
+
* @param length
|
|
100
|
+
* @param consume
|
|
101
|
+
* @returns
|
|
143
102
|
*/
|
|
144
|
-
|
|
103
|
+
read(start: number, length: number, consume?: boolean): Buffer;
|
|
145
104
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
105
|
+
* Internal writer
|
|
106
|
+
*
|
|
107
|
+
* @param start - likely this.offset
|
|
108
|
+
* @param data
|
|
109
|
+
* @param consume
|
|
110
|
+
* @returns {number}
|
|
148
111
|
*/
|
|
149
|
-
data:
|
|
112
|
+
write(start: number, data: Buffer, consume?: boolean): number;
|
|
150
113
|
/**
|
|
151
|
-
*
|
|
114
|
+
* internal write commit
|
|
152
115
|
*
|
|
153
|
-
*
|
|
116
|
+
* @param consume
|
|
117
|
+
* @returns {number}
|
|
118
|
+
*/
|
|
119
|
+
commit(consume?: boolean): number;
|
|
120
|
+
/**
|
|
121
|
+
* internal extend
|
|
154
122
|
*
|
|
155
|
-
* This can greatly speed up data writes when large files are being written.
|
|
156
123
|
*
|
|
157
|
-
*
|
|
124
|
+
* @param length amount needed
|
|
125
|
+
* @returns {void}
|
|
158
126
|
*/
|
|
159
|
-
|
|
127
|
+
extendArray(length: number): void;
|
|
160
128
|
isBufferOrUint8Array(obj: Buffer | Uint8Array): boolean;
|
|
161
|
-
extendArray(to_padd: number): void;
|
|
162
129
|
/**
|
|
163
130
|
*
|
|
164
131
|
* Change endian, defaults to little.
|
|
165
132
|
*
|
|
166
133
|
* Can be changed at any time, doesn't loose position.
|
|
167
134
|
*
|
|
168
|
-
* @param {
|
|
135
|
+
* @param {endian} endian - endianness ``big`` or ``little``
|
|
169
136
|
*/
|
|
170
|
-
endianness(endian:
|
|
137
|
+
endianness(endian: endian): void;
|
|
171
138
|
/**
|
|
172
139
|
* Sets endian to big.
|
|
173
140
|
*/
|
|
@@ -355,9 +322,9 @@ export declare class ReaderBase {
|
|
|
355
322
|
*
|
|
356
323
|
* Use ``.data`` instead if you want the full buffer data.
|
|
357
324
|
*
|
|
358
|
-
* @returns {Buffer|Uint8Array} ``Buffer``
|
|
325
|
+
* @returns {Buffer|Uint8Array} ``Buffer``
|
|
359
326
|
*/
|
|
360
|
-
get get(): Buffer
|
|
327
|
+
get get(): Buffer;
|
|
361
328
|
/**
|
|
362
329
|
* Returns current data.
|
|
363
330
|
*
|
|
@@ -365,19 +332,19 @@ export declare class ReaderBase {
|
|
|
365
332
|
*
|
|
366
333
|
* Use ``.data`` instead if you want the full buffer data.
|
|
367
334
|
*
|
|
368
|
-
* @returns {Buffer
|
|
335
|
+
* @returns {Buffer} ``Buffer``
|
|
369
336
|
*/
|
|
370
|
-
get return(): Buffer
|
|
337
|
+
get return(): Buffer;
|
|
371
338
|
/**
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
339
|
+
* Creates hex dump string. Will console log or return string if set in options.
|
|
340
|
+
*
|
|
341
|
+
* @param {object} options
|
|
342
|
+
* @param {hexdumpOptions?} options - hex dump options
|
|
343
|
+
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
344
|
+
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
345
|
+
* @param {boolean?} options.supressUnicode - Supress unicode character preview for even columns.
|
|
346
|
+
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
347
|
+
*/
|
|
381
348
|
hexdump(options?: hexdumpOptions): void | string;
|
|
382
349
|
/**
|
|
383
350
|
* Turn hexdump on error off (default on).
|
|
@@ -399,10 +366,6 @@ export declare class ReaderBase {
|
|
|
399
366
|
* removes data.
|
|
400
367
|
*/
|
|
401
368
|
end(): void;
|
|
402
|
-
/**
|
|
403
|
-
* removes data.
|
|
404
|
-
*/
|
|
405
|
-
close(): void;
|
|
406
369
|
/**
|
|
407
370
|
* removes data.
|
|
408
371
|
*/
|
|
@@ -430,9 +393,9 @@ export declare class ReaderBase {
|
|
|
430
393
|
*
|
|
431
394
|
* @param {number} value - Number to search for.
|
|
432
395
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
433
|
-
* @param {
|
|
396
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
434
397
|
*/
|
|
435
|
-
findByte(value: number, unsigned?: boolean, endian?:
|
|
398
|
+
findByte(value: number, unsigned?: boolean, endian?: endian): number;
|
|
436
399
|
/**
|
|
437
400
|
* Searches for short value (can be signed or unsigned) position from current read position.
|
|
438
401
|
*
|
|
@@ -442,9 +405,9 @@ export declare class ReaderBase {
|
|
|
442
405
|
*
|
|
443
406
|
* @param {number} value - Number to search for.
|
|
444
407
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
445
|
-
* @param {
|
|
408
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
446
409
|
*/
|
|
447
|
-
findShort(value: number, unsigned?: boolean, endian?:
|
|
410
|
+
findShort(value: number, unsigned?: boolean, endian?: endian): number;
|
|
448
411
|
/**
|
|
449
412
|
* Searches for integer value (can be signed or unsigned) position from current read position.
|
|
450
413
|
*
|
|
@@ -454,9 +417,9 @@ export declare class ReaderBase {
|
|
|
454
417
|
*
|
|
455
418
|
* @param {number} value - Number to search for.
|
|
456
419
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
457
|
-
* @param {
|
|
420
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
458
421
|
*/
|
|
459
|
-
findInt(value: number, unsigned?: boolean, endian?:
|
|
422
|
+
findInt(value: number, unsigned?: boolean, endian?: endian): number;
|
|
460
423
|
/**
|
|
461
424
|
* Searches for 64 bit value (can be signed or unsigned) position from current read position.
|
|
462
425
|
*
|
|
@@ -466,9 +429,9 @@ export declare class ReaderBase {
|
|
|
466
429
|
*
|
|
467
430
|
* @param {number} value - Number to search for.
|
|
468
431
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
469
|
-
* @param {
|
|
432
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
470
433
|
*/
|
|
471
|
-
findInt64(value: number, unsigned?: boolean, endian?:
|
|
434
|
+
findInt64(value: number, unsigned?: boolean, endian?: endian): number;
|
|
472
435
|
/**
|
|
473
436
|
* Searches for half float value position from current read position.
|
|
474
437
|
*
|
|
@@ -477,9 +440,9 @@ export declare class ReaderBase {
|
|
|
477
440
|
* Does not change current read position.
|
|
478
441
|
*
|
|
479
442
|
* @param {number} value - Number to search for.
|
|
480
|
-
* @param {
|
|
443
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
481
444
|
*/
|
|
482
|
-
findHalfFloat(value: number, endian?:
|
|
445
|
+
findHalfFloat(value: number, endian?: endian): number;
|
|
483
446
|
/**
|
|
484
447
|
* Searches for float value position from current read position.
|
|
485
448
|
*
|
|
@@ -488,9 +451,9 @@ export declare class ReaderBase {
|
|
|
488
451
|
* Does not change current read position.
|
|
489
452
|
*
|
|
490
453
|
* @param {number} value - Number to search for.
|
|
491
|
-
* @param {
|
|
454
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
492
455
|
*/
|
|
493
|
-
findFloat(value: number, endian?:
|
|
456
|
+
findFloat(value: number, endian?: endian): number;
|
|
494
457
|
/**
|
|
495
458
|
* Searches for double float value position from current read position.
|
|
496
459
|
*
|
|
@@ -499,9 +462,9 @@ export declare class ReaderBase {
|
|
|
499
462
|
* Does not change current read position.
|
|
500
463
|
*
|
|
501
464
|
* @param {number} value - Number to search for.
|
|
502
|
-
* @param {
|
|
465
|
+
* @param {endian} endian - endianness of value (default set endian).
|
|
503
466
|
*/
|
|
504
|
-
findDoubleFloat(value: number, endian?:
|
|
467
|
+
findDoubleFloat(value: number, endian?: endian): number;
|
|
505
468
|
/**
|
|
506
469
|
* Aligns current byte position.
|
|
507
470
|
*
|
|
@@ -609,25 +572,25 @@ export declare class ReaderBase {
|
|
|
609
572
|
* @param {number} startOffset - Start location (default 0)
|
|
610
573
|
* @param {number} endOffset - End location (default current position)
|
|
611
574
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
612
|
-
* @returns {Buffer
|
|
575
|
+
* @returns {Buffer} Removed data as ``Buffer``
|
|
613
576
|
*/
|
|
614
|
-
delete(startOffset?: number, endOffset?: number, consume?: boolean): Buffer
|
|
577
|
+
delete(startOffset?: number, endOffset?: number, consume?: boolean): Buffer;
|
|
615
578
|
/**
|
|
616
579
|
* Deletes part of data from current byte position to end, returns removed.
|
|
617
580
|
*
|
|
618
581
|
* Note: Errors in strict mode.
|
|
619
582
|
*
|
|
620
|
-
* @returns {Buffer
|
|
583
|
+
* @returns {Buffer} Removed data as ``Buffer``
|
|
621
584
|
*/
|
|
622
|
-
clip(): Buffer
|
|
585
|
+
clip(): Buffer;
|
|
623
586
|
/**
|
|
624
587
|
* Deletes part of data from current byte position to end, returns removed.
|
|
625
588
|
*
|
|
626
589
|
* Note: Errors in strict mode.
|
|
627
590
|
*
|
|
628
|
-
* @returns {Buffer
|
|
591
|
+
* @returns {Buffer} Removed data as ``Buffer``
|
|
629
592
|
*/
|
|
630
|
-
trim(): Buffer
|
|
593
|
+
trim(): Buffer;
|
|
631
594
|
/**
|
|
632
595
|
* Deletes part of data from current byte position to supplied length, returns removed.
|
|
633
596
|
*
|
|
@@ -635,9 +598,9 @@ export declare class ReaderBase {
|
|
|
635
598
|
*
|
|
636
599
|
* @param {number} length - Length of data in bytes to remove
|
|
637
600
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
638
|
-
* @returns {Buffer
|
|
601
|
+
* @returns {Buffer} Removed data as ``Buffer``
|
|
639
602
|
*/
|
|
640
|
-
crop(length: number, consume?: boolean): Buffer
|
|
603
|
+
crop(length: number, consume?: boolean): Buffer;
|
|
641
604
|
/**
|
|
642
605
|
* Deletes part of data from current position to supplied length, returns removed.
|
|
643
606
|
*
|
|
@@ -645,13 +608,13 @@ export declare class ReaderBase {
|
|
|
645
608
|
*
|
|
646
609
|
* @param {number} length - Length of data in bytes to remove
|
|
647
610
|
* @param {boolean} consume - Move position to end of removed data (default false)
|
|
648
|
-
* @returns {Buffer
|
|
611
|
+
* @returns {Buffer} Removed data as ``Buffer``
|
|
649
612
|
*/
|
|
650
|
-
drop(length: number, consume?: boolean): Buffer
|
|
613
|
+
drop(length: number, consume?: boolean): Buffer;
|
|
651
614
|
/**
|
|
652
615
|
* Replaces data in data.
|
|
653
616
|
*
|
|
654
|
-
* Note:
|
|
617
|
+
* Note: Errors on strict mode.
|
|
655
618
|
*
|
|
656
619
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
657
620
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
@@ -661,7 +624,7 @@ export declare class ReaderBase {
|
|
|
661
624
|
/**
|
|
662
625
|
* Replaces data in data.
|
|
663
626
|
*
|
|
664
|
-
* Note:
|
|
627
|
+
* Note: Errors on strict mode.
|
|
665
628
|
*
|
|
666
629
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
667
630
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
@@ -675,9 +638,9 @@ export declare class ReaderBase {
|
|
|
675
638
|
* @param {number} endOffset - End location (default end of data)
|
|
676
639
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
677
640
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
678
|
-
* @returns {Buffer
|
|
641
|
+
* @returns {Buffer} Selected data as ``Buffer``
|
|
679
642
|
*/
|
|
680
|
-
lift(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Buffer
|
|
643
|
+
lift(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Buffer;
|
|
681
644
|
/**
|
|
682
645
|
* Returns part of data from current byte position to end of data unless supplied.
|
|
683
646
|
*
|
|
@@ -685,9 +648,9 @@ export declare class ReaderBase {
|
|
|
685
648
|
* @param {number} endOffset - End location (default end of data)
|
|
686
649
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
687
650
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
688
|
-
* @returns {Buffer
|
|
651
|
+
* @returns {Buffer} Selected data as ``Buffer``
|
|
689
652
|
*/
|
|
690
|
-
fill(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Buffer
|
|
653
|
+
fill(startOffset?: number, endOffset?: number, consume?: boolean, fillValue?: number): Buffer;
|
|
691
654
|
/**
|
|
692
655
|
* Extract data from current position to length supplied.
|
|
693
656
|
*
|
|
@@ -695,9 +658,9 @@ export declare class ReaderBase {
|
|
|
695
658
|
*
|
|
696
659
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
697
660
|
* @param {number} consume - Moves offset to end of length
|
|
698
|
-
* @returns {Buffer
|
|
661
|
+
* @returns {Buffer} Selected data as ``Buffer``
|
|
699
662
|
*/
|
|
700
|
-
extract(length: number, consume?: boolean): Buffer
|
|
663
|
+
extract(length: number, consume?: boolean): Buffer;
|
|
701
664
|
/**
|
|
702
665
|
* Extract data from current position to length supplied.
|
|
703
666
|
*
|
|
@@ -705,9 +668,9 @@ export declare class ReaderBase {
|
|
|
705
668
|
*
|
|
706
669
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
707
670
|
* @param {number} consume - Moves offset to end of length
|
|
708
|
-
* @returns {Buffer
|
|
671
|
+
* @returns {Buffer} Selected data as ``Buffer``
|
|
709
672
|
*/
|
|
710
|
-
slice(length: number, consume?: boolean): Buffer
|
|
673
|
+
slice(length: number, consume?: boolean): Buffer;
|
|
711
674
|
/**
|
|
712
675
|
* Extract data from current position to length supplied.
|
|
713
676
|
*
|
|
@@ -715,13 +678,13 @@ export declare class ReaderBase {
|
|
|
715
678
|
*
|
|
716
679
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
717
680
|
* @param {number} consume - Moves offset to end of length
|
|
718
|
-
* @returns {Buffer|Uint8Array} Selected data
|
|
681
|
+
* @returns {Buffer|Uint8Array} Selected data or ``Buffer``
|
|
719
682
|
*/
|
|
720
|
-
wrap(length: number, consume?: boolean): Buffer
|
|
683
|
+
wrap(length: number, consume?: boolean): Buffer;
|
|
721
684
|
/**
|
|
722
685
|
* Inserts data into data.
|
|
723
686
|
*
|
|
724
|
-
* Note:
|
|
687
|
+
* Note: Errors on strict mode.
|
|
725
688
|
*
|
|
726
689
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
727
690
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
@@ -731,7 +694,7 @@ export declare class ReaderBase {
|
|
|
731
694
|
/**
|
|
732
695
|
* Inserts data into data.
|
|
733
696
|
*
|
|
734
|
-
* Note:
|
|
697
|
+
* Note: Errors on strict mode.
|
|
735
698
|
*
|
|
736
699
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
737
700
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
@@ -741,7 +704,7 @@ export declare class ReaderBase {
|
|
|
741
704
|
/**
|
|
742
705
|
* Adds data to start of supplied data.
|
|
743
706
|
*
|
|
744
|
-
* Note:
|
|
707
|
+
* Note: Errors on strict mode.
|
|
745
708
|
*
|
|
746
709
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
747
710
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
@@ -750,7 +713,7 @@ export declare class ReaderBase {
|
|
|
750
713
|
/**
|
|
751
714
|
* Adds data to start of supplied data.
|
|
752
715
|
*
|
|
753
|
-
* Note:
|
|
716
|
+
* Note: Errors on strict mode.
|
|
754
717
|
*
|
|
755
718
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
756
719
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
@@ -759,7 +722,7 @@ export declare class ReaderBase {
|
|
|
759
722
|
/**
|
|
760
723
|
* Adds data to end of supplied data.
|
|
761
724
|
*
|
|
762
|
-
* Note:
|
|
725
|
+
* Note: Errors on strict mode.
|
|
763
726
|
*
|
|
764
727
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
765
728
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
@@ -768,7 +731,7 @@ export declare class ReaderBase {
|
|
|
768
731
|
/**
|
|
769
732
|
* Adds data to end of supplied data.
|
|
770
733
|
*
|
|
771
|
-
* Note:
|
|
734
|
+
* Note: Errors on strict mode.
|
|
772
735
|
*
|
|
773
736
|
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
774
737
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
@@ -900,9 +863,9 @@ export declare class ReaderBase {
|
|
|
900
863
|
* @param {number} value - value as int
|
|
901
864
|
* @param {number} bits - number of bits to write
|
|
902
865
|
* @param {boolean} unsigned - if value is unsigned
|
|
903
|
-
* @param {
|
|
866
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
904
867
|
*/
|
|
905
|
-
writeBit(value: number, bits: number, unsigned?: boolean, endian?:
|
|
868
|
+
writeBit(value: number, bits: number, unsigned?: boolean, endian?: endian): void;
|
|
906
869
|
/**
|
|
907
870
|
* Bit field writer.
|
|
908
871
|
*
|
|
@@ -952,10 +915,10 @@ export declare class ReaderBase {
|
|
|
952
915
|
*
|
|
953
916
|
* @param {number} bits - bits to read
|
|
954
917
|
* @param {boolean} unsigned - if the value is unsigned
|
|
955
|
-
* @param {
|
|
918
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
956
919
|
* @returns {number}
|
|
957
920
|
*/
|
|
958
|
-
readBit(bits?: number, unsigned?: boolean, endian?:
|
|
921
|
+
readBit(bits?: number, unsigned?: boolean, endian?: endian): number;
|
|
959
922
|
/**
|
|
960
923
|
* Bit field reader.
|
|
961
924
|
*
|
|
@@ -1039,25 +1002,25 @@ export declare class ReaderBase {
|
|
|
1039
1002
|
* Read short.
|
|
1040
1003
|
*
|
|
1041
1004
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
1042
|
-
* @param {
|
|
1005
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1043
1006
|
* @returns {number}
|
|
1044
1007
|
*/
|
|
1045
|
-
readInt16(unsigned?: boolean, endian?:
|
|
1008
|
+
readInt16(unsigned?: boolean, endian?: endian): number;
|
|
1046
1009
|
/**
|
|
1047
1010
|
* Write int16.
|
|
1048
1011
|
*
|
|
1049
1012
|
* @param {number} value - value as int
|
|
1050
1013
|
* @param {boolean} unsigned - if the value is unsigned
|
|
1051
|
-
* @param {
|
|
1014
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1052
1015
|
*/
|
|
1053
|
-
writeInt16(value: number, unsigned?: boolean, endian?:
|
|
1016
|
+
writeInt16(value: number, unsigned?: boolean, endian?: endian): void;
|
|
1054
1017
|
/**
|
|
1055
1018
|
* Write unsigned int16.
|
|
1056
1019
|
*
|
|
1057
1020
|
* @param {number} value - value as int
|
|
1058
|
-
* @param {
|
|
1021
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1059
1022
|
*/
|
|
1060
|
-
writeUInt16(value: number, endian?:
|
|
1023
|
+
writeUInt16(value: number, endian?: endian): void;
|
|
1061
1024
|
/**
|
|
1062
1025
|
* Write unsigned int16.
|
|
1063
1026
|
*
|
|
@@ -1079,11 +1042,11 @@ export declare class ReaderBase {
|
|
|
1079
1042
|
/**
|
|
1080
1043
|
* Read unsigned short.
|
|
1081
1044
|
*
|
|
1082
|
-
* @param {
|
|
1045
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1083
1046
|
*
|
|
1084
1047
|
* @returns {number}
|
|
1085
1048
|
*/
|
|
1086
|
-
readUInt16(endian?:
|
|
1049
|
+
readUInt16(endian?: endian): number;
|
|
1087
1050
|
/**
|
|
1088
1051
|
* Read unsigned short in little endian.
|
|
1089
1052
|
*
|
|
@@ -1111,17 +1074,17 @@ export declare class ReaderBase {
|
|
|
1111
1074
|
/**
|
|
1112
1075
|
* Read half float.
|
|
1113
1076
|
*
|
|
1114
|
-
* @param {
|
|
1077
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1115
1078
|
* @returns {number}
|
|
1116
1079
|
*/
|
|
1117
|
-
readHalfFloat(endian?:
|
|
1080
|
+
readHalfFloat(endian?: endian): number;
|
|
1118
1081
|
/**
|
|
1119
1082
|
* Writes half float.
|
|
1120
1083
|
*
|
|
1121
1084
|
* @param {number} value - value as int
|
|
1122
|
-
* @param {
|
|
1085
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1123
1086
|
*/
|
|
1124
|
-
writeHalfFloat(value: number, endian?:
|
|
1087
|
+
writeHalfFloat(value: number, endian?: endian): void;
|
|
1125
1088
|
/**
|
|
1126
1089
|
* Writes half float.
|
|
1127
1090
|
*
|
|
@@ -1150,25 +1113,25 @@ export declare class ReaderBase {
|
|
|
1150
1113
|
* Read 32 bit integer.
|
|
1151
1114
|
*
|
|
1152
1115
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
1153
|
-
* @param {
|
|
1116
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1154
1117
|
* @returns {number}
|
|
1155
1118
|
*/
|
|
1156
|
-
readInt32(unsigned?: boolean, endian?:
|
|
1119
|
+
readInt32(unsigned?: boolean, endian?: endian): number;
|
|
1157
1120
|
/**
|
|
1158
1121
|
* Write int32.
|
|
1159
1122
|
*
|
|
1160
1123
|
* @param {number} value - value as int
|
|
1161
1124
|
* @param {boolean} unsigned - if the value is unsigned
|
|
1162
|
-
* @param {
|
|
1125
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1163
1126
|
*/
|
|
1164
|
-
writeInt32(value: number, unsigned?: boolean, endian?:
|
|
1127
|
+
writeInt32(value: number, unsigned?: boolean, endian?: endian): void;
|
|
1165
1128
|
/**
|
|
1166
1129
|
* Write unsigned int32.
|
|
1167
1130
|
*
|
|
1168
1131
|
* @param {number} value - value as int
|
|
1169
|
-
* @param {
|
|
1132
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1170
1133
|
*/
|
|
1171
|
-
writeUInt32(value: number, endian?:
|
|
1134
|
+
writeUInt32(value: number, endian?: endian): void;
|
|
1172
1135
|
/**
|
|
1173
1136
|
* Write signed int32.
|
|
1174
1137
|
*
|
|
@@ -1220,17 +1183,17 @@ export declare class ReaderBase {
|
|
|
1220
1183
|
/**
|
|
1221
1184
|
* Read float.
|
|
1222
1185
|
*
|
|
1223
|
-
* @param {
|
|
1186
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1224
1187
|
* @returns {number}
|
|
1225
1188
|
*/
|
|
1226
|
-
readFloat(endian?:
|
|
1189
|
+
readFloat(endian?: endian): number;
|
|
1227
1190
|
/**
|
|
1228
1191
|
* Write float.
|
|
1229
1192
|
*
|
|
1230
1193
|
* @param {number} value - value as int
|
|
1231
|
-
* @param {
|
|
1194
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1232
1195
|
*/
|
|
1233
|
-
writeFloat(value: number, endian?:
|
|
1196
|
+
writeFloat(value: number, endian?: endian): void;
|
|
1234
1197
|
/**
|
|
1235
1198
|
* Write float.
|
|
1236
1199
|
*
|
|
@@ -1259,25 +1222,25 @@ export declare class ReaderBase {
|
|
|
1259
1222
|
* Read signed 64 bit integer.
|
|
1260
1223
|
*
|
|
1261
1224
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
1262
|
-
* @param {
|
|
1225
|
+
* @param {endian?} endian - ``big`` or ``little``
|
|
1263
1226
|
* @returns {number}
|
|
1264
1227
|
*/
|
|
1265
|
-
readInt64(unsigned?: boolean, endian?:
|
|
1228
|
+
readInt64(unsigned?: boolean, endian?: endian): bigint;
|
|
1266
1229
|
/**
|
|
1267
1230
|
* Write 64 bit integer.
|
|
1268
1231
|
*
|
|
1269
1232
|
* @param {number} value - value as int
|
|
1270
1233
|
* @param {boolean} unsigned - if the value is unsigned
|
|
1271
|
-
* @param {
|
|
1234
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1272
1235
|
*/
|
|
1273
|
-
writeInt64(value: number, unsigned?: boolean, endian?:
|
|
1236
|
+
writeInt64(value: number, unsigned?: boolean, endian?: endian): void;
|
|
1274
1237
|
/**
|
|
1275
1238
|
* Write unsigned 64 bit integer.
|
|
1276
1239
|
*
|
|
1277
1240
|
* @param {number} value - value as int
|
|
1278
|
-
* @param {
|
|
1241
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1279
1242
|
*/
|
|
1280
|
-
writeUInt64(value: number, endian?:
|
|
1243
|
+
writeUInt64(value: number, endian?: endian): void;
|
|
1281
1244
|
/**
|
|
1282
1245
|
* Write signed 64 bit integer.
|
|
1283
1246
|
*
|
|
@@ -1335,17 +1298,17 @@ export declare class ReaderBase {
|
|
|
1335
1298
|
/**
|
|
1336
1299
|
* Read double float.
|
|
1337
1300
|
*
|
|
1338
|
-
* @param {
|
|
1301
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1339
1302
|
* @returns {number}
|
|
1340
1303
|
*/
|
|
1341
|
-
readDoubleFloat(endian?:
|
|
1304
|
+
readDoubleFloat(endian?: endian): number;
|
|
1342
1305
|
/**
|
|
1343
1306
|
* Writes double float.
|
|
1344
1307
|
*
|
|
1345
1308
|
* @param {number} value - value as int
|
|
1346
|
-
* @param {
|
|
1309
|
+
* @param {endian} endian - ``big`` or ``little``
|
|
1347
1310
|
*/
|
|
1348
|
-
writeDoubleFloat(value: number, endian?:
|
|
1311
|
+
writeDoubleFloat(value: number, endian?: endian): void;
|
|
1349
1312
|
/**
|
|
1350
1313
|
* Writes double float.
|
|
1351
1314
|
*
|
|
@@ -1373,55 +1336,28 @@ export declare class ReaderBase {
|
|
|
1373
1336
|
/**
|
|
1374
1337
|
* Reads string, use options object for different types.
|
|
1375
1338
|
*
|
|
1376
|
-
* @param {
|
|
1377
|
-
*
|
|
1378
|
-
* {
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
*
|
|
1383
|
-
*
|
|
1384
|
-
* encoding: "utf-8", //TextEncoder accepted types
|
|
1385
|
-
* endian: "little", //for wide-pascal and utf-16
|
|
1386
|
-
* }
|
|
1387
|
-
* ```
|
|
1388
|
-
* @return string
|
|
1339
|
+
* @param {stringOptions} options
|
|
1340
|
+
* @param {stringOptions["length"]?} options.length - for fixed length, non-terminate value utf strings
|
|
1341
|
+
* @param {stringOptions["stringType"]?} options.stringType - utf-8, utf-16, pascal or wide-pascal
|
|
1342
|
+
* @param {stringOptions["terminateValue"]?} options.terminateValue - only with stringType: "utf"
|
|
1343
|
+
* @param {stringOptions["lengthReadSize"]?} options.lengthReadSize - for pascal strings. 1, 2 or 4 byte length read size
|
|
1344
|
+
* @param {stringOptions["encoding"]?} options.encoding - TextEncoder accepted types
|
|
1345
|
+
* @param {stringOptions["endian"]?} options.endian - for wide-pascal and utf-16
|
|
1346
|
+
* @return {Promise<string>}
|
|
1389
1347
|
*/
|
|
1390
|
-
readString(options?:
|
|
1391
|
-
length?: number;
|
|
1392
|
-
stringType?: string;
|
|
1393
|
-
terminateValue?: number;
|
|
1394
|
-
lengthReadSize?: number;
|
|
1395
|
-
stripNull?: boolean;
|
|
1396
|
-
encoding?: string;
|
|
1397
|
-
endian?: string;
|
|
1398
|
-
}): string;
|
|
1348
|
+
readString(options?: stringOptions): string;
|
|
1399
1349
|
/**
|
|
1400
1350
|
* Writes string, use options object for different types.
|
|
1401
1351
|
*
|
|
1402
|
-
*
|
|
1403
1352
|
* @param {string} string - text string
|
|
1404
|
-
* @param {
|
|
1405
|
-
*
|
|
1406
|
-
* {
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1411
|
-
* encoding: "utf-8", //TextEncoder accepted types
|
|
1412
|
-
* endian: "little", //for wide-pascal and utf-16
|
|
1413
|
-
* }
|
|
1414
|
-
* ```
|
|
1353
|
+
* @param {stringOptions?} options
|
|
1354
|
+
* @param {stringOptions["length"]?} options.length - for fixed length, non-terminate value utf strings
|
|
1355
|
+
* @param {stringOptions["stringType"]?} options.stringType - utf-8, utf-16, pascal or wide-pascal
|
|
1356
|
+
* @param {stringOptions["terminateValue"]?} options.terminateValue - only with stringType: "utf"
|
|
1357
|
+
* @param {stringOptions["lengthWriteSize"]?} options.lengthWriteSize - for pascal strings. 1, 2 or 4 byte length write size
|
|
1358
|
+
* @param {stringOptions["encoding"]?} options.encoding - TextEncoder accepted types
|
|
1359
|
+
* @param {stringOptions["endian"]?} options.endian - for wide-pascal and utf-16
|
|
1415
1360
|
*/
|
|
1416
|
-
writeString(string: string, options?:
|
|
1417
|
-
length?: number;
|
|
1418
|
-
stringType?: string;
|
|
1419
|
-
terminateValue?: number;
|
|
1420
|
-
lengthWriteSize?: number;
|
|
1421
|
-
stripNull?: boolean;
|
|
1422
|
-
encoding?: string;
|
|
1423
|
-
endian?: string;
|
|
1424
|
-
}): void;
|
|
1361
|
+
writeString(string: string, options?: stringOptions): void;
|
|
1425
1362
|
}
|
|
1426
1363
|
export {};
|
|
1427
|
-
//# sourceMappingURL=common.d.ts.map
|