@yume-chan/struct 0.0.13 → 0.0.16
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/CHANGELOG.json +33 -0
- package/CHANGELOG.md +21 -1
- package/LICENSE +21 -21
- package/README.md +767 -769
- package/esm/basic/definition.d.ts +3 -3
- package/esm/basic/definition.d.ts.map +1 -1
- package/esm/basic/definition.js +0 -1
- package/esm/basic/definition.js.map +1 -1
- package/esm/basic/field-value.d.ts +1 -0
- package/esm/basic/field-value.d.ts.map +1 -1
- package/esm/basic/field-value.js +4 -0
- package/esm/basic/field-value.js.map +1 -1
- package/esm/basic/stream.d.ts +2 -1
- package/esm/basic/stream.d.ts.map +1 -1
- package/esm/basic/struct-value.d.ts +7 -5
- package/esm/basic/struct-value.d.ts.map +1 -1
- package/esm/basic/struct-value.js +30 -14
- package/esm/basic/struct-value.js.map +1 -1
- package/esm/struct.d.ts +11 -11
- package/esm/struct.d.ts.map +1 -1
- package/esm/struct.js +55 -41
- package/esm/struct.js.map +1 -1
- package/esm/sync-promise.d.ts +13 -0
- package/esm/sync-promise.d.ts.map +1 -0
- package/esm/sync-promise.js +71 -0
- package/esm/sync-promise.js.map +1 -0
- package/esm/types/bigint.d.ts.map +1 -1
- package/esm/types/bigint.js +7 -5
- package/esm/types/bigint.js.map +1 -1
- package/esm/types/buffer/base.d.ts +4 -3
- package/esm/types/buffer/base.d.ts.map +1 -1
- package/esm/types/buffer/base.js +9 -7
- package/esm/types/buffer/base.js.map +1 -1
- package/esm/types/buffer/fixed-length.d.ts +1 -1
- package/esm/types/buffer/fixed-length.d.ts.map +1 -1
- package/esm/types/buffer/fixed-length.js.map +1 -1
- package/esm/types/buffer/variable-length.d.ts +2 -2
- package/esm/types/buffer/variable-length.d.ts.map +1 -1
- package/esm/types/buffer/variable-length.js.map +1 -1
- package/esm/types/number.d.ts +6 -5
- package/esm/types/number.d.ts.map +1 -1
- package/esm/types/number.js +25 -14
- package/esm/types/number.js.map +1 -1
- package/package.json +11 -11
- package/src/basic/definition.ts +68 -70
- package/src/basic/field-value.ts +72 -67
- package/src/basic/index.ts +5 -5
- package/src/basic/options.ts +19 -19
- package/src/basic/stream.ts +21 -19
- package/src/basic/struct-value.ts +61 -39
- package/src/index.ts +17 -17
- package/src/struct.ts +632 -609
- package/src/sync-promise.ts +114 -0
- package/src/types/bigint.ts +103 -102
- package/src/types/buffer/base.ts +179 -176
- package/src/types/buffer/fixed-length.ts +20 -17
- package/src/types/buffer/index.ts +3 -3
- package/src/types/buffer/variable-length.ts +158 -156
- package/src/types/index.ts +3 -3
- package/src/types/number.ts +127 -115
- package/src/utils.ts +70 -70
- package/tsconfig.build.json +3 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.test.json +8 -0
- package/esm/syncbird.d.ts +0 -65
- package/esm/syncbird.d.ts.map +0 -1
- package/esm/syncbird.js +0 -38
- package/esm/syncbird.js.map +0 -1
- package/src/syncbird.ts +0 -131
package/src/basic/definition.ts
CHANGED
|
@@ -1,70 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @template
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
public readonly
|
|
31
|
-
|
|
32
|
-
public
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
): Promise<StructFieldValue<this>>;
|
|
70
|
-
}
|
|
1
|
+
import type { StructAsyncDeserializeStream, StructDeserializeStream } from "./stream.js";
|
|
2
|
+
import type { StructFieldValue } from "./field-value.js";
|
|
3
|
+
import type { StructValue } from "./struct-value.js";
|
|
4
|
+
import type { StructOptions } from "./options.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A field definition defines how to deserialize a field.
|
|
8
|
+
*
|
|
9
|
+
* @template TOptions TypeScript type of this definition's `options`.
|
|
10
|
+
* @template TValue TypeScript type of this field.
|
|
11
|
+
* @template TOmitInitKey Optionally remove some fields from the init type. Should be a union of string literal types.
|
|
12
|
+
*/
|
|
13
|
+
export abstract class StructFieldDefinition<
|
|
14
|
+
TOptions = void,
|
|
15
|
+
TValue = unknown,
|
|
16
|
+
TOmitInitKey extends PropertyKey = never,
|
|
17
|
+
> {
|
|
18
|
+
/**
|
|
19
|
+
* When `T` is a type initiated `StructFieldDefinition`,
|
|
20
|
+
* use `T['TValue']` to retrieve its `TValue` type parameter.
|
|
21
|
+
*/
|
|
22
|
+
public readonly TValue!: TValue;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* When `T` is a type initiated `StructFieldDefinition`,
|
|
26
|
+
* use `T['TOmitInitKey']` to retrieve its `TOmitInitKey` type parameter.
|
|
27
|
+
*/
|
|
28
|
+
public readonly TOmitInitKey!: TOmitInitKey;
|
|
29
|
+
|
|
30
|
+
public readonly options: TOptions;
|
|
31
|
+
|
|
32
|
+
public constructor(options: TOptions) {
|
|
33
|
+
this.options = options;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* When implemented in derived classes, returns the size (or minimal size if it's dynamic) of this field.
|
|
38
|
+
*
|
|
39
|
+
* Actual size can be retrieved from `StructFieldValue#getSize`
|
|
40
|
+
*/
|
|
41
|
+
public abstract getSize(): number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* When implemented in derived classes, creates a `StructFieldValue` from a given `value`.
|
|
45
|
+
*/
|
|
46
|
+
public abstract create(
|
|
47
|
+
options: Readonly<StructOptions>,
|
|
48
|
+
structValue: StructValue,
|
|
49
|
+
value: TValue,
|
|
50
|
+
): StructFieldValue<this>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When implemented in derived classes,It must be synchronous (returns a value) or asynchronous (returns a `Promise`) depending
|
|
54
|
+
* on the type of `stream`. reads and creates a `StructFieldValue` from `stream`.
|
|
55
|
+
*
|
|
56
|
+
* `SyncPromise` can be used to simplify implementation.
|
|
57
|
+
*/
|
|
58
|
+
public abstract deserialize(
|
|
59
|
+
options: Readonly<StructOptions>,
|
|
60
|
+
stream: StructDeserializeStream,
|
|
61
|
+
structValue: StructValue,
|
|
62
|
+
): StructFieldValue<this>;
|
|
63
|
+
public abstract deserialize(
|
|
64
|
+
options: Readonly<StructOptions>,
|
|
65
|
+
stream: StructAsyncDeserializeStream,
|
|
66
|
+
struct: StructValue,
|
|
67
|
+
): Promise<StructFieldValue<this>>;
|
|
68
|
+
}
|
package/src/basic/field-value.ts
CHANGED
|
@@ -1,67 +1,72 @@
|
|
|
1
|
-
import type { StructFieldDefinition } from "./definition.js";
|
|
2
|
-
import type { StructOptions } from "./options.js";
|
|
3
|
-
import type { StructValue } from "./struct-value.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A field value defines how to serialize a field.
|
|
7
|
-
*
|
|
8
|
-
* It may contains extra metadata about the value which are essential or
|
|
9
|
-
* helpful for the serialization process.
|
|
10
|
-
*/
|
|
11
|
-
export abstract class StructFieldValue<
|
|
12
|
-
TDefinition extends StructFieldDefinition<any, any, any> = StructFieldDefinition<any, any, any>
|
|
13
|
-
> {
|
|
14
|
-
/** Gets the definition associated with this runtime value */
|
|
15
|
-
public readonly definition: TDefinition;
|
|
16
|
-
|
|
17
|
-
/** Gets the options of the associated `Struct` */
|
|
18
|
-
public readonly options: Readonly<StructOptions>;
|
|
19
|
-
|
|
20
|
-
/** Gets the associated `Struct` instance */
|
|
21
|
-
public readonly struct: StructValue;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
import type { StructFieldDefinition } from "./definition.js";
|
|
2
|
+
import type { StructOptions } from "./options.js";
|
|
3
|
+
import type { StructValue } from "./struct-value.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A field value defines how to serialize a field.
|
|
7
|
+
*
|
|
8
|
+
* It may contains extra metadata about the value which are essential or
|
|
9
|
+
* helpful for the serialization process.
|
|
10
|
+
*/
|
|
11
|
+
export abstract class StructFieldValue<
|
|
12
|
+
TDefinition extends StructFieldDefinition<any, any, any> = StructFieldDefinition<any, any, any>
|
|
13
|
+
> {
|
|
14
|
+
/** Gets the definition associated with this runtime value */
|
|
15
|
+
public readonly definition: TDefinition;
|
|
16
|
+
|
|
17
|
+
/** Gets the options of the associated `Struct` */
|
|
18
|
+
public readonly options: Readonly<StructOptions>;
|
|
19
|
+
|
|
20
|
+
/** Gets the associated `Struct` instance */
|
|
21
|
+
public readonly struct: StructValue;
|
|
22
|
+
|
|
23
|
+
public get hasCustomAccessors(): boolean {
|
|
24
|
+
return this.get !== StructFieldValue.prototype.get ||
|
|
25
|
+
this.set !== StructFieldValue.prototype.set;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected value: TDefinition['TValue'];
|
|
29
|
+
|
|
30
|
+
public constructor(
|
|
31
|
+
definition: TDefinition,
|
|
32
|
+
options: Readonly<StructOptions>,
|
|
33
|
+
struct: StructValue,
|
|
34
|
+
value: TDefinition['TValue'],
|
|
35
|
+
) {
|
|
36
|
+
this.definition = definition;
|
|
37
|
+
this.options = options;
|
|
38
|
+
this.struct = struct;
|
|
39
|
+
this.value = value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Gets size of this field. By default, it returns its `definition`'s size.
|
|
44
|
+
*
|
|
45
|
+
* When overridden in derived classes, can have custom logic to calculate the actual size.
|
|
46
|
+
*/
|
|
47
|
+
public getSize(): number {
|
|
48
|
+
return this.definition.getSize();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* When implemented in derived classes, reads current field's value.
|
|
53
|
+
*/
|
|
54
|
+
public get(): TDefinition['TValue'] {
|
|
55
|
+
return this.value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* When implemented in derived classes, updates current field's value.
|
|
60
|
+
*/
|
|
61
|
+
public set(value: TDefinition['TValue']): void {
|
|
62
|
+
this.value = value;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* When implemented in derived classes, serializes this field into `dataView` at `offset`
|
|
67
|
+
*/
|
|
68
|
+
public abstract serialize(
|
|
69
|
+
dataView: DataView,
|
|
70
|
+
offset: number,
|
|
71
|
+
): void;
|
|
72
|
+
}
|
package/src/basic/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './definition.js';
|
|
2
|
-
export * from './field-value.js';
|
|
3
|
-
export * from './options.js';
|
|
4
|
-
export * from './stream.js';
|
|
5
|
-
export * from './struct-value.js';
|
|
1
|
+
export * from './definition.js';
|
|
2
|
+
export * from './field-value.js';
|
|
3
|
+
export * from './options.js';
|
|
4
|
+
export * from './stream.js';
|
|
5
|
+
export * from './struct-value.js';
|
package/src/basic/options.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export interface StructOptions {
|
|
2
|
-
/**
|
|
3
|
-
* Whether all multi-byte fields in this struct are little-endian encoded.
|
|
4
|
-
*
|
|
5
|
-
* @default false
|
|
6
|
-
*/
|
|
7
|
-
littleEndian: boolean;
|
|
8
|
-
|
|
9
|
-
// TODO: StructOptions: investigate whether this is necessary
|
|
10
|
-
// I can't think about any other options which need to be struct wide.
|
|
11
|
-
// Even endianness can be set on a per-field basis (because it's not meaningful
|
|
12
|
-
// for some field types like `Uint8Array`, and very rarely, a struct may contain
|
|
13
|
-
// mixed endianness).
|
|
14
|
-
// It's just more common and a little more convenient to have it here.
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const StructDefaultOptions: Readonly<StructOptions> = {
|
|
18
|
-
littleEndian: false,
|
|
19
|
-
};
|
|
1
|
+
export interface StructOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Whether all multi-byte fields in this struct are little-endian encoded.
|
|
4
|
+
*
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
littleEndian: boolean;
|
|
8
|
+
|
|
9
|
+
// TODO: StructOptions: investigate whether this is necessary
|
|
10
|
+
// I can't think about any other options which need to be struct wide.
|
|
11
|
+
// Even endianness can be set on a per-field basis (because it's not meaningful
|
|
12
|
+
// for some field types like `Uint8Array`, and very rarely, a struct may contain
|
|
13
|
+
// mixed endianness).
|
|
14
|
+
// It's just more common and a little more convenient to have it here.
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const StructDefaultOptions: Readonly<StructOptions> = {
|
|
18
|
+
littleEndian: false,
|
|
19
|
+
};
|
package/src/basic/stream.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import type { ValueOrPromise } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface StructDeserializeStream {
|
|
4
|
+
/**
|
|
5
|
+
* Read data from the underlying data source.
|
|
6
|
+
*
|
|
7
|
+
* The stream must return exactly `length` bytes or data. If that's not possible
|
|
8
|
+
* (due to end of file or other error condition), it must throw an error.
|
|
9
|
+
*/
|
|
10
|
+
read(length: number): Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface StructAsyncDeserializeStream {
|
|
14
|
+
/**
|
|
15
|
+
* Read data from the underlying data source.
|
|
16
|
+
*
|
|
17
|
+
* The stream must return exactly `length` bytes or data. If that's not possible
|
|
18
|
+
* (due to end of file or other error condition), it must throw an error.
|
|
19
|
+
*/
|
|
20
|
+
read(length: number): ValueOrPromise<Uint8Array>;
|
|
21
|
+
}
|
|
@@ -1,39 +1,61 @@
|
|
|
1
|
-
import type { StructFieldValue } from "./field-value.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param
|
|
35
|
-
*/
|
|
36
|
-
public
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import type { StructFieldValue } from "./field-value.js";
|
|
2
|
+
|
|
3
|
+
export const STRUCT_VALUE_SYMBOL = Symbol("struct-value");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A struct value is a map between keys in a struct and their field values.
|
|
7
|
+
*/
|
|
8
|
+
export class StructValue {
|
|
9
|
+
/** @internal */ readonly fieldValues: Record<PropertyKey, StructFieldValue> = {};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gets the result struct value object
|
|
13
|
+
*/
|
|
14
|
+
public readonly value: Record<PropertyKey, unknown>;
|
|
15
|
+
|
|
16
|
+
public constructor(prototype: any) {
|
|
17
|
+
// PERF: `Object.create(extra)` is 50% faster
|
|
18
|
+
// than `Object.defineProperties(this.value, extra)`
|
|
19
|
+
this.value = Object.create(prototype);
|
|
20
|
+
|
|
21
|
+
// PERF: `Object.defineProperty` is slow
|
|
22
|
+
// but we need it to be non-enumerable
|
|
23
|
+
Object.defineProperty(
|
|
24
|
+
this.value,
|
|
25
|
+
STRUCT_VALUE_SYMBOL,
|
|
26
|
+
{ enumerable: false, value: this }
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Sets a `StructFieldValue` for `key`
|
|
32
|
+
*
|
|
33
|
+
* @param name The field name
|
|
34
|
+
* @param fieldValue The associated `StructFieldValue`
|
|
35
|
+
*/
|
|
36
|
+
public set(name: PropertyKey, fieldValue: StructFieldValue): void {
|
|
37
|
+
this.fieldValues[name] = fieldValue;
|
|
38
|
+
|
|
39
|
+
// PERF: `Object.defineProperty` is slow
|
|
40
|
+
// use normal property when possible
|
|
41
|
+
if (fieldValue.hasCustomAccessors) {
|
|
42
|
+
Object.defineProperty(this.value, name, {
|
|
43
|
+
configurable: true,
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get() { return fieldValue.get(); },
|
|
46
|
+
set(v) { fieldValue.set(v); },
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
this.value[name] = fieldValue.get();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Gets the `StructFieldValue` for `key`
|
|
55
|
+
*
|
|
56
|
+
* @param name The field name
|
|
57
|
+
*/
|
|
58
|
+
public get(name: PropertyKey): StructFieldValue {
|
|
59
|
+
return this.fieldValues[name]!;
|
|
60
|
+
}
|
|
61
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface ArrayBuffer {
|
|
3
|
-
// Disallow assigning `Uint8Array` to `Arraybuffer`
|
|
4
|
-
__brand: never;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface SharedArrayBuffer {
|
|
8
|
-
// Allow `SharedArrayBuffer` to be assigned to `ArrayBuffer`
|
|
9
|
-
__brand: never;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export * from './basic/index.js';
|
|
14
|
-
export * from './struct.js';
|
|
15
|
-
export { Struct as default } from './struct.js';
|
|
16
|
-
export * from './types/index.js';
|
|
17
|
-
export * from './utils.js';
|
|
1
|
+
declare global {
|
|
2
|
+
interface ArrayBuffer {
|
|
3
|
+
// Disallow assigning `Uint8Array` to `Arraybuffer`
|
|
4
|
+
__brand: never;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface SharedArrayBuffer {
|
|
8
|
+
// Allow `SharedArrayBuffer` to be assigned to `ArrayBuffer`
|
|
9
|
+
__brand: never;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export * from './basic/index.js';
|
|
14
|
+
export * from './struct.js';
|
|
15
|
+
export { Struct as default } from './struct.js';
|
|
16
|
+
export * from './types/index.js';
|
|
17
|
+
export * from './utils.js';
|