@rotu/structview 0.8.2 → 0.9.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/esm/fields.js ADDED
@@ -0,0 +1,393 @@
1
+ /**
2
+ * Factories for property descriptors representing fields in a binary struct
3
+ * @module
4
+ */
5
+ import { fromDataView, structBytes, structDataView } from "./core.js";
6
+ /**
7
+ * Field for a 8-bit unsigned integer
8
+ */
9
+ export function u8(fieldOffset) {
10
+ return {
11
+ enumerable: true,
12
+ get() {
13
+ return structDataView(this).getUint8(fieldOffset);
14
+ },
15
+ set(value) {
16
+ structDataView(this).setUint8(fieldOffset, value);
17
+ },
18
+ };
19
+ }
20
+ /**
21
+ * Field for a little-endian 16-bit unsigned integer
22
+ */
23
+ export function u16(fieldOffset) {
24
+ return {
25
+ enumerable: true,
26
+ get() {
27
+ return structDataView(this).getUint16(fieldOffset, true);
28
+ },
29
+ set(value) {
30
+ structDataView(this).setUint16(fieldOffset, value, true);
31
+ },
32
+ };
33
+ }
34
+ /**
35
+ * Field for a little-endian 32-bit unsigned integer
36
+ */
37
+ export function u32(fieldOffset) {
38
+ return {
39
+ enumerable: true,
40
+ get() {
41
+ return structDataView(this).getUint32(fieldOffset, true);
42
+ },
43
+ set(value) {
44
+ structDataView(this).setUint32(fieldOffset, value, true);
45
+ },
46
+ };
47
+ }
48
+ /**
49
+ * Field for a little-endian 64-bit unsigned integer
50
+ */
51
+ export function u64(fieldOffset) {
52
+ return {
53
+ enumerable: true,
54
+ get() {
55
+ return structDataView(this).getBigUint64(fieldOffset, true);
56
+ },
57
+ set(value) {
58
+ structDataView(this).setBigUint64(fieldOffset, value, true);
59
+ },
60
+ };
61
+ }
62
+ /**
63
+ * Field for a little-endian 8-bit signed integer
64
+ */
65
+ export function i8(fieldOffset) {
66
+ return {
67
+ enumerable: true,
68
+ get() {
69
+ return structDataView(this).getInt8(fieldOffset);
70
+ },
71
+ set(value) {
72
+ structDataView(this).setInt8(fieldOffset, value);
73
+ },
74
+ };
75
+ }
76
+ /**
77
+ * Field for a little-endian 16-bit signed integer
78
+ */
79
+ export function i16(fieldOffset) {
80
+ return {
81
+ enumerable: true,
82
+ get() {
83
+ return structDataView(this).getInt16(fieldOffset, true);
84
+ },
85
+ set(value) {
86
+ structDataView(this).setInt16(fieldOffset, value, true);
87
+ },
88
+ };
89
+ }
90
+ /**
91
+ * Field for a little-endian 32-bit signed integer
92
+ */
93
+ export function i32(fieldOffset) {
94
+ return {
95
+ enumerable: true,
96
+ get() {
97
+ return structDataView(this).getInt32(fieldOffset, true);
98
+ },
99
+ set(value) {
100
+ structDataView(this).setInt32(fieldOffset, value, true);
101
+ },
102
+ };
103
+ }
104
+ /**
105
+ * Field for a little-endian 64-bit signed integer
106
+ */
107
+ export function i64(fieldOffset) {
108
+ return {
109
+ enumerable: true,
110
+ get() {
111
+ return structDataView(this).getBigInt64(fieldOffset, true);
112
+ },
113
+ set(value) {
114
+ structDataView(this).setBigInt64(fieldOffset, value, true);
115
+ },
116
+ };
117
+ }
118
+ /**
119
+ * Field for a little-endian unsigned integer of arbitrary byte length
120
+ */
121
+ export function biguintle(fieldOffset, { byteLength }) {
122
+ if (!Number.isInteger(byteLength) ||
123
+ !(0 < byteLength)) {
124
+ throw new TypeError("byteLength must be a positive integer");
125
+ }
126
+ return {
127
+ get() {
128
+ let result = 0n;
129
+ const dv = structDataView(this);
130
+ for (let i = 0; i < byteLength; ++i) {
131
+ result |= BigInt(dv.getUint8(fieldOffset + i)) << BigInt(8 * i);
132
+ }
133
+ return result;
134
+ },
135
+ set(value) {
136
+ const dv = structDataView(this);
137
+ for (let i = 0; i < byteLength; ++i) {
138
+ dv.setUint8(fieldOffset + i, Number((value >> BigInt(8 * i)) & 0xffn));
139
+ }
140
+ },
141
+ };
142
+ }
143
+ /**
144
+ * Field for a little-endian signed integer of arbitrary byte length
145
+ */
146
+ export function bigintle(offset, options) {
147
+ const { byteLength } = options;
148
+ return {
149
+ get() {
150
+ let result = 0n;
151
+ const dv = structDataView(this);
152
+ for (let i = 0; i < byteLength; ++i) {
153
+ result |= BigInt(dv.getUint8(offset + i)) << BigInt(8 * i);
154
+ }
155
+ return BigInt.asIntN(byteLength * 8, result);
156
+ },
157
+ set(value) {
158
+ const dv = structDataView(this);
159
+ for (let i = 0; i < byteLength; ++i) {
160
+ dv.setUint8(offset + i, Number((value >> BigInt(8 * i)) & 0xffn));
161
+ }
162
+ },
163
+ };
164
+ }
165
+ /**
166
+ * Field for a little-endian 16-bit binary float (float16_t)
167
+ */
168
+ export function f16(fieldOffset) {
169
+ if (typeof DataView.prototype.getFloat16 !== "function" ||
170
+ typeof DataView.prototype.setFloat16 !== "function") {
171
+ throw new TypeError("float16 is not supported in this environment");
172
+ }
173
+ return {
174
+ enumerable: true,
175
+ get() {
176
+ return structDataView(this).getFloat16(fieldOffset, true);
177
+ },
178
+ set(value) {
179
+ structDataView(this).setFloat16(fieldOffset, value, true);
180
+ },
181
+ };
182
+ }
183
+ /**
184
+ * Field for a little-endian 32-bit binary float (float32_t)
185
+ */
186
+ export function f32(fieldOffset) {
187
+ return {
188
+ enumerable: true,
189
+ get() {
190
+ return structDataView(this).getFloat32(fieldOffset, true);
191
+ },
192
+ set(value) {
193
+ structDataView(this).setFloat32(fieldOffset, value, true);
194
+ },
195
+ };
196
+ }
197
+ /**
198
+ * Field for a little-endian 64-bit binary float (float64_t)
199
+ */
200
+ export function f64(fieldOffset) {
201
+ return {
202
+ enumerable: true,
203
+ get() {
204
+ return structDataView(this).getFloat64(fieldOffset, true);
205
+ },
206
+ set(value) {
207
+ structDataView(this).setFloat64(fieldOffset, value, true);
208
+ },
209
+ };
210
+ }
211
+ /**
212
+ * Field for a UTF-8 fixed-length string
213
+ */
214
+ export function string(fieldOffset, byteLength) {
215
+ const TEXT_DECODER = new TextDecoder();
216
+ const TEXT_ENCODER = new TextEncoder();
217
+ return {
218
+ enumerable: true,
219
+ get() {
220
+ const str = TEXT_DECODER.decode(structBytes(this, fieldOffset, fieldOffset + byteLength));
221
+ // trim all trailing null characters
222
+ return str.replace(/\0+$/, "");
223
+ },
224
+ set(value) {
225
+ const bytes = structBytes(this, fieldOffset, fieldOffset + byteLength);
226
+ bytes.fill(0);
227
+ TEXT_ENCODER.encodeInto(value, bytes);
228
+ },
229
+ };
230
+ }
231
+ /**
232
+ * Field for a boolean stored in a byte (0 = false, nonzero = true)
233
+ * True will be stored as 1
234
+ */
235
+ export function bool(fieldOffset) {
236
+ return {
237
+ enumerable: true,
238
+ get() {
239
+ return Boolean(structDataView(this).getUint8(fieldOffset));
240
+ },
241
+ set(value) {
242
+ structDataView(this).setUint8(fieldOffset, value ? 1 : 0);
243
+ },
244
+ };
245
+ }
246
+ /**
247
+ * Field for an embedded struct
248
+ * @param ctor constructor for the inner struct
249
+ * @param byteOffset where the inner struct starts relative to the outer struct
250
+ * @param bytelength the length in bytes of the inner struct
251
+ * @returns property descriptor for a struct
252
+ */
253
+ export function substruct(ctor, byteOffset, bytelength) {
254
+ return fromDataView(function (dv) {
255
+ const offset2 = dv.byteOffset + (byteOffset ?? 0);
256
+ const bytelength2 = bytelength ?? (dv.byteLength - (byteOffset ?? 0));
257
+ return Reflect.construct(ctor, [{
258
+ buffer: dv.buffer,
259
+ byteOffset: offset2,
260
+ byteLength: bytelength2,
261
+ }]);
262
+ });
263
+ }
264
+ /**
265
+ * Field for a big-endian 16-bit unsigned integer
266
+ */
267
+ export function u16be(fieldOffset) {
268
+ return {
269
+ enumerable: true,
270
+ get() {
271
+ return structDataView(this).getUint16(fieldOffset, false);
272
+ },
273
+ set(value) {
274
+ structDataView(this).setUint16(fieldOffset, value, false);
275
+ },
276
+ };
277
+ }
278
+ /**
279
+ * Field for a big-endian 32-bit unsigned integer
280
+ */
281
+ export function u32be(fieldOffset) {
282
+ return {
283
+ enumerable: true,
284
+ get() {
285
+ return structDataView(this).getUint32(fieldOffset, false);
286
+ },
287
+ set(value) {
288
+ structDataView(this).setUint32(fieldOffset, value, false);
289
+ },
290
+ };
291
+ }
292
+ /**
293
+ * Field for a big-endian 64-bit unsigned integer
294
+ */
295
+ export function u64be(fieldOffset) {
296
+ return {
297
+ enumerable: true,
298
+ get() {
299
+ return structDataView(this).getBigUint64(fieldOffset, false);
300
+ },
301
+ set(value) {
302
+ structDataView(this).setBigUint64(fieldOffset, value, false);
303
+ },
304
+ };
305
+ }
306
+ /**
307
+ * Field for a big-endian 16-bit signed integer
308
+ */
309
+ export function i16be(fieldOffset) {
310
+ return {
311
+ enumerable: true,
312
+ get() {
313
+ return structDataView(this).getInt16(fieldOffset, false);
314
+ },
315
+ set(value) {
316
+ structDataView(this).setInt16(fieldOffset, value, false);
317
+ },
318
+ };
319
+ }
320
+ /**
321
+ * Field for a big-endian 32-bit signed integer
322
+ */
323
+ export function i32be(fieldOffset) {
324
+ return {
325
+ enumerable: true,
326
+ get() {
327
+ return structDataView(this).getInt32(fieldOffset, false);
328
+ },
329
+ set(value) {
330
+ structDataView(this).setInt32(fieldOffset, value, false);
331
+ },
332
+ };
333
+ }
334
+ /**
335
+ * Field for a big-endian 64-bit signed integer
336
+ */
337
+ export function i64be(fieldOffset) {
338
+ return {
339
+ enumerable: true,
340
+ get() {
341
+ return structDataView(this).getBigInt64(fieldOffset, false);
342
+ },
343
+ set(value) {
344
+ structDataView(this).setBigInt64(fieldOffset, value, false);
345
+ },
346
+ };
347
+ }
348
+ /**
349
+ * Field for a big-endian 16-bit binary float (float16_t)
350
+ */
351
+ export function f16be(fieldOffset) {
352
+ if (typeof DataView.prototype.getFloat16 !== "function" ||
353
+ typeof DataView.prototype.setFloat16 !== "function") {
354
+ throw new TypeError("float16 is not supported in this environment");
355
+ }
356
+ return {
357
+ enumerable: true,
358
+ get() {
359
+ return structDataView(this).getFloat16(fieldOffset, false);
360
+ },
361
+ set(value) {
362
+ structDataView(this).setFloat16(fieldOffset, value, false);
363
+ },
364
+ };
365
+ }
366
+ /**
367
+ * Field for a big-endian 32-bit binary float (float32_t)
368
+ */
369
+ export function f32be(fieldOffset) {
370
+ return {
371
+ enumerable: true,
372
+ get() {
373
+ return structDataView(this).getFloat32(fieldOffset, false);
374
+ },
375
+ set(value) {
376
+ structDataView(this).setFloat32(fieldOffset, value, false);
377
+ },
378
+ };
379
+ }
380
+ /**
381
+ * Field for a big-endian 64-bit binary float (float64_t)
382
+ */
383
+ export function f64be(fieldOffset) {
384
+ return {
385
+ enumerable: true,
386
+ get() {
387
+ return structDataView(this).getFloat64(fieldOffset, false);
388
+ },
389
+ set(value) {
390
+ structDataView(this).setFloat64(fieldOffset, value, false);
391
+ },
392
+ };
393
+ }
package/esm/mod.d.ts CHANGED
@@ -2,160 +2,7 @@
2
2
  * Strongly typed classes for accessing binary data in a structured way
3
3
  * @module
4
4
  */
5
- declare const dataViewSymbol: unique symbol;
6
- type AnyStruct = {
7
- readonly [dataViewSymbol]: DataView;
8
- };
9
- type Constructor<T> = {
10
- new (...args: any[]): T;
11
- };
12
- type SubclassWithProperties<Ctor extends Constructor<object>, Mixin> = {
13
- [K in keyof Ctor]: Ctor[K];
14
- } & {
15
- new (...args: ConstructorParameters<Ctor>): InstanceType<Ctor> & {
16
- [K in keyof Mixin]: Mixin[K];
17
- };
18
- };
19
- type TPropertyDescriptor<T> = {
20
- enumerable?: boolean;
21
- configurable?: boolean;
22
- get?(): T;
23
- set?(t: T): undefined;
24
- value?: T;
25
- writable?: boolean;
26
- };
27
- type MixinFromProps<Props extends object> = {
28
- -readonly [K in keyof Props]: Props[K] extends TPropertyDescriptor<infer V> ? V : unknown;
29
- };
30
- /**
31
- * Get the underlying DataView of a struct
32
- * @param struct
33
- * @returns
34
- */
35
- export declare function structDataView(struct: AnyStruct): DataView;
36
- /**
37
- * Type of a property descriptor for a struct
38
- */
39
- export type StructPropertyDescriptor<T> = ThisType<AnyStruct> & TPropertyDescriptor<T>;
40
- /**
41
- * Define a descriptor based on a dataview of the struct
42
- * @param fieldGetter function which, given a dataview, returns
43
- * @returns
44
- */
45
- export declare function fromDataView<Fn extends (dv: DataView) => unknown>(fieldGetter: Fn): StructPropertyDescriptor<ReturnType<Fn>>;
46
- /**
47
- * Field for a 8-bit unsigned integer
48
- */
49
- export declare function u8(fieldOffset: number): StructPropertyDescriptor<number>;
50
- /**
51
- * Field for a little-endian 16-bit unsigned integer
52
- */
53
- export declare function u16(fieldOffset: number): StructPropertyDescriptor<number>;
54
- /**
55
- * Field for a little-endian 32-bit unsigned integer
56
- */
57
- export declare function u32(fieldOffset: number): StructPropertyDescriptor<number>;
58
- /**
59
- * Field for a little-endian 64-bit unsigned integer
60
- */
61
- export declare function u64(fieldOffset: number): StructPropertyDescriptor<bigint>;
62
- /**
63
- * Field for a little-endian 8-bit signed integer
64
- */
65
- export declare function i8(fieldOffset: number): StructPropertyDescriptor<number>;
66
- /**
67
- * Field for a little-endian 16-bit signed integer
68
- */
69
- export declare function i16(fieldOffset: number): StructPropertyDescriptor<number>;
70
- /**
71
- * Field for a little-endian 32-bit signed integer
72
- */
73
- export declare function i32(fieldOffset: number): StructPropertyDescriptor<number>;
74
- /**
75
- * Field for a little-endian 64-bit signed integer
76
- */
77
- export declare function i64(fieldOffset: number): StructPropertyDescriptor<bigint>;
78
- /**
79
- * Field for a little-endian 16-bit binary float (float16_t)
80
- */
81
- export declare function f16(fieldOffset: number): StructPropertyDescriptor<number>;
82
- /**
83
- * Field for a little-endian 32-bit binary float (float32_t)
84
- */
85
- export declare function f32(fieldOffset: number): StructPropertyDescriptor<number>;
86
- /**
87
- * Field for a little-endian 64-bit binary float (float64_t)
88
- */
89
- export declare function f64(fieldOffset: number): StructPropertyDescriptor<number>;
90
- /**
91
- * Field for a UTF-8 fixed-length string
92
- */
93
- export declare function string(fieldOffset: number, byteLength: number): StructPropertyDescriptor<string>;
94
- /**
95
- * Field for a boolean stored in a byte (0 = false, nonzero = true)
96
- * True will be stored as 1
97
- */
98
- export declare function bool(fieldOffset: number): StructPropertyDescriptor<boolean>;
99
- type StructConstructor<T extends object> = {
100
- new (arg: {
101
- readonly buffer: ArrayBufferLike;
102
- readonly byteOffset: number;
103
- readonly byteLength: number;
104
- }): T;
105
- };
106
- /**
107
- * Field for an embedded struct
108
- * @param ctor constructor for the inner struct
109
- * @param byteOffset where the inner struct starts relative to the outer struct
110
- * @param bytelength the length in bytes of the inner struct
111
- * @returns property descriptor for a struct
112
- */
113
- export declare function substruct<T extends object>(ctor: StructConstructor<T>, byteOffset?: number, bytelength?: number): StructPropertyDescriptor<T>;
114
- /**
115
- * Base class for a structured binary object
116
- * Note there are no predeclared string-keyed properties - all property names are reserved for user-defined fields
117
- */
118
- export declare class Struct {
119
- [dataViewSymbol]: DataView;
120
- get [Symbol.toStringTag](): string;
121
- static toDataView(o: Struct): DataView;
122
- /**
123
- * Create a new Struct
124
- * @param arg options for creating the struct.
125
- * If options has a `.buffer` property, we will use that as the backing memory (e.g. any TypedArray or DataView).
126
- * If options has no `.buffer` property but has a `.byteLength`, we will allocate a new buffer for the object.
127
- */
128
- constructor(arg: {
129
- readonly buffer: ArrayBufferLike;
130
- readonly byteOffset?: number;
131
- readonly byteLength?: number;
132
- } | {
133
- readonly buffer?: undefined;
134
- readonly byteOffset?: number;
135
- readonly byteLength: number;
136
- });
137
- }
138
- /**
139
- * Subclass struct by adding the given property descriptors
140
- * @param propertyDescriptors properties to add to subclass instances
141
- * @returns A new class, inheriting from `Struct`, with the new property descriptors added
142
- */
143
- export declare function defineStruct<const Props extends PropertyDescriptorMap>(propertyDescriptors: Props): SubclassWithProperties<typeof Struct, MixinFromProps<Props>>;
144
- /**
145
- * Create a new struct subclass for an array of structs
146
- * @param arrayOptions
147
- * @returns A new class, inheriting from `Struct` whose elements are statically typed structs
148
- */
149
- export declare function defineArray<Item extends object>(arrayOptions: {
150
- /** Constructor for an object view of each item */
151
- readonly struct: StructConstructor<Item>;
152
- /** Number of bytes between the start of consecutive items */
153
- readonly byteStride: number;
154
- /** Total number of items in the array (not bytes). If omitted, the array length will depend on the size of its underlying buffer */
155
- readonly length?: number;
156
- }): StructConstructor<{
157
- readonly length: number;
158
- element(i: number): Item;
159
- } & Iterable<Item>>;
160
- export {};
5
+ export type * from "./types.js";
6
+ export * from "./core.js";
7
+ export * from "./fields.js";
161
8
  //# sourceMappingURL=mod.d.ts.map
package/esm/mod.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,QAAA,MAAM,cAAc,eAAgC,CAAA;AACpD,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAA;CACpC,CAAA;AAED,KAAK,WAAW,CAAC,CAAC,IAAI;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,CAAA;AAEjD,KAAK,sBAAsB,CACzB,IAAI,SAAS,WAAW,CAAC,MAAM,CAAC,EAChC,KAAK,IAEH;KAAG,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;CAAE,GAC9B;IACA,KACE,GAAG,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC,GACnC,YAAY,CAAC,IAAI,CAAC,GAAG;SAAG,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;KAAE,CAAA;CACzD,CAAA;AAEH,KAAK,mBAAmB,CAAC,CAAC,IAAI;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,GAAG,CAAC,IAAI,CAAC,CAAA;IACT,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAA;IACrB,KAAK,CAAC,EAAE,CAAC,CAAA;IACT,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,KAAK,cAAc,CAAC,KAAK,SAAS,MAAM,IAAI;IAC1C,CAAC,UAAU,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,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