@exornea/zeno-runtime 1.7.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/dist/abi.d.ts +7 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +7 -0
- package/dist/abi.js.map +1 -0
- package/dist/byte-vectors.d.ts +28 -0
- package/dist/byte-vectors.d.ts.map +1 -0
- package/dist/byte-vectors.js +64 -0
- package/dist/byte-vectors.js.map +1 -0
- package/dist/descriptor32.d.ts +15 -0
- package/dist/descriptor32.d.ts.map +1 -0
- package/dist/descriptor32.js +32 -0
- package/dist/descriptor32.js.map +1 -0
- package/dist/fixed-arrays.d.ts +39 -0
- package/dist/fixed-arrays.d.ts.map +1 -0
- package/dist/fixed-arrays.js +93 -0
- package/dist/fixed-arrays.js.map +1 -0
- package/dist/fixed.d.ts +12 -0
- package/dist/fixed.d.ts.map +1 -0
- package/dist/fixed.js +56 -0
- package/dist/fixed.js.map +1 -0
- package/dist/frame.d.ts +36 -0
- package/dist/frame.d.ts.map +1 -0
- package/dist/frame.js +151 -0
- package/dist/frame.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/pointer-vector.d.ts +13 -0
- package/dist/pointer-vector.d.ts.map +1 -0
- package/dist/pointer-vector.js +53 -0
- package/dist/pointer-vector.js.map +1 -0
- package/dist/pointer32.d.ts +4 -0
- package/dist/pointer32.d.ts.map +1 -0
- package/dist/pointer32.js +16 -0
- package/dist/pointer32.js.map +1 -0
- package/dist/range.d.ts +6 -0
- package/dist/range.d.ts.map +1 -0
- package/dist/range.js +33 -0
- package/dist/range.js.map +1 -0
- package/dist/scalar-vector.d.ts +8 -0
- package/dist/scalar-vector.d.ts.map +1 -0
- package/dist/scalar-vector.js +17 -0
- package/dist/scalar-vector.js.map +1 -0
- package/dist/scalar.d.ts +6 -0
- package/dist/scalar.d.ts.map +1 -0
- package/dist/scalar.js +99 -0
- package/dist/scalar.js.map +1 -0
- package/dist/spans.d.ts +15 -0
- package/dist/spans.d.ts.map +1 -0
- package/dist/spans.js +30 -0
- package/dist/spans.js.map +1 -0
- package/dist/struct-vectors.d.ts +14 -0
- package/dist/struct-vectors.d.ts.map +1 -0
- package/dist/struct-vectors.js +33 -0
- package/dist/struct-vectors.js.map +1 -0
- package/dist/traversal.d.ts +9 -0
- package/dist/traversal.d.ts.map +1 -0
- package/dist/traversal.js +22 -0
- package/dist/traversal.js.map +1 -0
- package/dist/vector-base.d.ts +13 -0
- package/dist/vector-base.d.ts.map +1 -0
- package/dist/vector-base.js +32 -0
- package/dist/vector-base.js.map +1 -0
- package/dist/vectors.d.ts +6 -0
- package/dist/vectors.d.ts.map +1 -0
- package/dist/vectors.js +6 -0
- package/dist/vectors.js.map +1 -0
- package/dist/view-base.d.ts +15 -0
- package/dist/view-base.d.ts.map +1 -0
- package/dist/view-base.js +47 -0
- package/dist/view-base.js.map +1 -0
- package/dist/views.d.ts +6 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +6 -0
- package/dist/views.js.map +1 -0
- package/dist/writer-arena.d.ts +16 -0
- package/dist/writer-arena.d.ts.map +1 -0
- package/dist/writer-arena.js +46 -0
- package/dist/writer-arena.js.map +1 -0
- package/dist/writer-byte-vectors.d.ts +12 -0
- package/dist/writer-byte-vectors.d.ts.map +1 -0
- package/dist/writer-byte-vectors.js +61 -0
- package/dist/writer-byte-vectors.js.map +1 -0
- package/dist/writer-pointer-vectors.d.ts +6 -0
- package/dist/writer-pointer-vectors.d.ts.map +1 -0
- package/dist/writer-pointer-vectors.js +33 -0
- package/dist/writer-pointer-vectors.js.map +1 -0
- package/dist/writer-scalar-vectors.d.ts +7 -0
- package/dist/writer-scalar-vectors.d.ts.map +1 -0
- package/dist/writer-scalar-vectors.js +19 -0
- package/dist/writer-scalar-vectors.js.map +1 -0
- package/dist/writer-spans.d.ts +9 -0
- package/dist/writer-spans.d.ts.map +1 -0
- package/dist/writer-spans.js +21 -0
- package/dist/writer-spans.js.map +1 -0
- package/dist/writer-struct-vectors.d.ts +6 -0
- package/dist/writer-struct-vectors.d.ts.map +1 -0
- package/dist/writer-struct-vectors.js +17 -0
- package/dist/writer-struct-vectors.js.map +1 -0
- package/dist/writer-vectors.d.ts +4 -0
- package/dist/writer-vectors.d.ts.map +1 -0
- package/dist/writer-vectors.js +4 -0
- package/dist/writer-vectors.js.map +1 -0
- package/dist/writer.d.ts +4 -0
- package/dist/writer.d.ts.map +1 -0
- package/dist/writer.js +4 -0
- package/dist/writer.js.map +1 -0
- package/package.json +39 -0
package/dist/abi.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { alignOffset, assertBufferRange, assertDataViewRange, assertNonNegativeInteger, assertUint32, } from "./range.js";
|
|
2
|
+
export { readScalar, SCALAR_KINDS, scalarByteLength, writeScalar, type ScalarKind, } from "./scalar.js";
|
|
3
|
+
export { SPAN32_BYTE_LENGTH, VECTOR32_BYTE_LENGTH, readSpan32Descriptor, readVector32Descriptor, writeSpan32Descriptor, writeVector32Descriptor, type Span32Descriptor, type Vector32Descriptor, } from "./descriptor32.js";
|
|
4
|
+
export { UTF8_DECODER, UTF8_ENCODER, decodeFixedText, decodeFixedUtf8, decodeText, encodeText, fixedBytesView, writeFixedText, writeFixedBytes, writeFixedUtf8, type TextEncoding, } from "./fixed.js";
|
|
5
|
+
export { POINTER32_BYTE_LENGTH, POINTER32_NULL, pointer32RelativeOffset, } from "./pointer32.js";
|
|
6
|
+
export { ZENO_FRAME_HEADER_BYTE_LENGTH, ZENO_FRAME_LAYOUT_HASH_NONE, ZENO_FRAME_VERSION_MAJOR, assertZenoFramePayload, assertZenoFrameHeader, checkedZenoFramePayloadView, readZenoFrameHeader, writeZenoFrameHeader, zenoFramePayloadView, type WriteZenoFrameHeaderOptions, type ZenoFrameEndianness, type ZenoFrameExpectation, type ZenoFrameHeader, type ZenoFramePayloadExpectation, } from "./frame.js";
|
|
7
|
+
//# sourceMappingURL=abi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,2BAA2B,GACjC,MAAM,YAAY,CAAC"}
|
package/dist/abi.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { alignOffset, assertBufferRange, assertDataViewRange, assertNonNegativeInteger, assertUint32, } from "./range.js";
|
|
2
|
+
export { readScalar, SCALAR_KINDS, scalarByteLength, writeScalar, } from "./scalar.js";
|
|
3
|
+
export { SPAN32_BYTE_LENGTH, VECTOR32_BYTE_LENGTH, readSpan32Descriptor, readVector32Descriptor, writeSpan32Descriptor, writeVector32Descriptor, } from "./descriptor32.js";
|
|
4
|
+
export { UTF8_DECODER, UTF8_ENCODER, decodeFixedText, decodeFixedUtf8, decodeText, encodeText, fixedBytesView, writeFixedText, writeFixedBytes, writeFixedUtf8, } from "./fixed.js";
|
|
5
|
+
export { POINTER32_BYTE_LENGTH, POINTER32_NULL, pointer32RelativeOffset, } from "./pointer32.js";
|
|
6
|
+
export { ZENO_FRAME_HEADER_BYTE_LENGTH, ZENO_FRAME_LAYOUT_HASH_NONE, ZENO_FRAME_VERSION_MAJOR, assertZenoFramePayload, assertZenoFrameHeader, checkedZenoFramePayloadView, readZenoFrameHeader, writeZenoFrameHeader, zenoFramePayloadView, } from "./frame.js";
|
|
7
|
+
//# sourceMappingURL=abi.js.map
|
package/dist/abi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi.js","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,GAEZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,GAGxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,GAEf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GAMrB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type TextEncoding } from "./fixed.js";
|
|
2
|
+
import { VectorView } from "./vector-base.js";
|
|
3
|
+
export declare class BytesVectorView extends VectorView<Uint8Array> {
|
|
4
|
+
constructor(view: DataView, descriptorOffset: number, baseOffset?: number, littleEndian?: boolean);
|
|
5
|
+
bytesAt(index: number): Uint8Array;
|
|
6
|
+
at(index: number): Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export declare class FixedBytesVectorView extends VectorView<Uint8Array> {
|
|
9
|
+
private readonly elementByteLength;
|
|
10
|
+
constructor(view: DataView, descriptorOffset: number, elementByteLength: number, baseOffset?: number, littleEndian?: boolean);
|
|
11
|
+
bytesAt(index: number): Uint8Array;
|
|
12
|
+
at(index: number): Uint8Array;
|
|
13
|
+
}
|
|
14
|
+
export declare class FixedStringVectorView extends VectorView<string> {
|
|
15
|
+
private readonly elementByteLength;
|
|
16
|
+
private readonly encoding;
|
|
17
|
+
constructor(view: DataView, descriptorOffset: number, elementByteLength: number, baseOffset?: number, littleEndian?: boolean, encoding?: TextEncoding);
|
|
18
|
+
bytesAt(index: number): Uint8Array;
|
|
19
|
+
textAt(index: number): string;
|
|
20
|
+
at(index: number): string;
|
|
21
|
+
}
|
|
22
|
+
export declare class Utf8VectorView extends VectorView<string> {
|
|
23
|
+
private readonly encoding;
|
|
24
|
+
constructor(view: DataView, descriptorOffset: number, baseOffset?: number, littleEndian?: boolean, encoding?: TextEncoding);
|
|
25
|
+
bytesAt(index: number): Uint8Array;
|
|
26
|
+
at(index: number): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=byte-vectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte-vectors.d.ts","sourceRoot":"","sources":["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AAQ,EACd,gBAAgB,EAAE,MAAM,EACxB,UAAU,SAAI,EACd,YAAY,UAAO,EACF,QAAQ,GAAE,YAAqB;IAKlD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAIlC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAG1B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { decodeText } from "./fixed.js";
|
|
2
|
+
import { VectorView } from "./vector-base.js";
|
|
3
|
+
export class BytesVectorView extends VectorView {
|
|
4
|
+
constructor(view, descriptorOffset, baseOffset = 0, littleEndian = true) {
|
|
5
|
+
super(view, descriptorOffset, baseOffset, littleEndian);
|
|
6
|
+
}
|
|
7
|
+
bytesAt(index) {
|
|
8
|
+
return this.spanBytesAt(index);
|
|
9
|
+
}
|
|
10
|
+
at(index) {
|
|
11
|
+
return this.bytesAt(index);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class FixedBytesVectorView extends VectorView {
|
|
15
|
+
elementByteLength;
|
|
16
|
+
constructor(view, descriptorOffset, elementByteLength, baseOffset = 0, littleEndian = true) {
|
|
17
|
+
super(view, descriptorOffset, baseOffset, littleEndian);
|
|
18
|
+
this.elementByteLength = elementByteLength;
|
|
19
|
+
}
|
|
20
|
+
bytesAt(index) {
|
|
21
|
+
this.assertIndex(index);
|
|
22
|
+
const localOffset = this.payloadOffset() + index * this.elementByteLength;
|
|
23
|
+
this.assertRange(localOffset, this.elementByteLength);
|
|
24
|
+
return new Uint8Array(this.backingBuffer(), this.backingOffset(localOffset), this.elementByteLength);
|
|
25
|
+
}
|
|
26
|
+
at(index) {
|
|
27
|
+
return this.bytesAt(index);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class FixedStringVectorView extends VectorView {
|
|
31
|
+
elementByteLength;
|
|
32
|
+
encoding;
|
|
33
|
+
constructor(view, descriptorOffset, elementByteLength, baseOffset = 0, littleEndian = true, encoding = "utf8") {
|
|
34
|
+
super(view, descriptorOffset, baseOffset, littleEndian);
|
|
35
|
+
this.elementByteLength = elementByteLength;
|
|
36
|
+
this.encoding = encoding;
|
|
37
|
+
}
|
|
38
|
+
bytesAt(index) {
|
|
39
|
+
this.assertIndex(index);
|
|
40
|
+
const localOffset = this.payloadOffset() + index * this.elementByteLength;
|
|
41
|
+
this.assertRange(localOffset, this.elementByteLength);
|
|
42
|
+
return new Uint8Array(this.backingBuffer(), this.backingOffset(localOffset), this.elementByteLength);
|
|
43
|
+
}
|
|
44
|
+
textAt(index) {
|
|
45
|
+
return decodeText(this.bytesAt(index), this.encoding);
|
|
46
|
+
}
|
|
47
|
+
at(index) {
|
|
48
|
+
return this.textAt(index);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export class Utf8VectorView extends VectorView {
|
|
52
|
+
encoding;
|
|
53
|
+
constructor(view, descriptorOffset, baseOffset = 0, littleEndian = true, encoding = "utf8") {
|
|
54
|
+
super(view, descriptorOffset, baseOffset, littleEndian);
|
|
55
|
+
this.encoding = encoding;
|
|
56
|
+
}
|
|
57
|
+
bytesAt(index) {
|
|
58
|
+
return this.spanBytesAt(index);
|
|
59
|
+
}
|
|
60
|
+
at(index) {
|
|
61
|
+
return decodeText(this.bytesAt(index), this.encoding);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=byte-vectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte-vectors.js","sourceRoot":"","sources":["../src/byte-vectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,eAAgB,SAAQ,UAAsB;IACzD,YACE,IAAc,EACd,gBAAwB,EACxB,UAAU,GAAG,CAAC,EACd,YAAY,GAAG,IAAI;QAEnB,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,C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export declare const VECTOR32_BYTE_LENGTH = 8;
|
|
3
|
+
export interface Span32Descriptor {
|
|
4
|
+
readonly relOffset: number;
|
|
5
|
+
readonly byteLength: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Vector32Descriptor {
|
|
8
|
+
readonly relOffset: number;
|
|
9
|
+
readonly count: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function readSpan32Descriptor(view: DataView, offset: number, littleEndian?: boolean): Span32Descriptor;
|
|
12
|
+
export declare function writeSpan32Descriptor(view: DataView, offset: number, descriptor: Span32Descriptor, littleEndian?: boolean): void;
|
|
13
|
+
export declare function readVector32Descriptor(view: DataView, offset: number, littleEndian?: boolean): Vector32Descriptor;
|
|
14
|
+
export declare function writeVector32Descriptor(view: DataView, offset: number, descriptor: Vector32Descriptor, littleEndian?: boolean): void;
|
|
15
|
+
//# sourceMappingURL=descriptor32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor32.d.ts","sourceRoot":"","sources":["../src/descriptor32.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,EACd,YAAY,UAAO,GAClB,gBAAgB,CAOlB;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,gBAAgB,EAC5B,YAAY,UAAO,GAClB,IAAI,CAON;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,EACd,YAAY,UAAO,GAClB,kBAAkB,CAOpB;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,EAC9B,YAAY,UAAO,GAClB,IAAI,CAON"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { assertDataViewRange, assertUint32 } from "./range.js";
|
|
2
|
+
export const SPAN32_BYTE_LENGTH = 8;
|
|
3
|
+
export const VECTOR32_BYTE_LENGTH = 8;
|
|
4
|
+
export function readSpan32Descriptor(view, offset, littleEndian = true) {
|
|
5
|
+
assertDataViewRange(view, offset, SPAN32_BYTE_LENGTH);
|
|
6
|
+
return {
|
|
7
|
+
relOffset: view.getUint32(offset, littleEndian),
|
|
8
|
+
byteLength: view.getUint32(offset + 4, littleEndian),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function writeSpan32Descriptor(view, offset, descriptor, littleEndian = true) {
|
|
12
|
+
assertDataViewRange(view, offset, SPAN32_BYTE_LENGTH);
|
|
13
|
+
assertUint32(descriptor.relOffset, "Span32.relOffset");
|
|
14
|
+
assertUint32(descriptor.byteLength, "Span32.byteLength");
|
|
15
|
+
view.setUint32(offset, descriptor.relOffset, littleEndian);
|
|
16
|
+
view.setUint32(offset + 4, descriptor.byteLength, littleEndian);
|
|
17
|
+
}
|
|
18
|
+
export function readVector32Descriptor(view, offset, littleEndian = true) {
|
|
19
|
+
assertDataViewRange(view, offset, VECTOR32_BYTE_LENGTH);
|
|
20
|
+
return {
|
|
21
|
+
relOffset: view.getUint32(offset, littleEndian),
|
|
22
|
+
count: view.getUint32(offset + 4, littleEndian),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function writeVector32Descriptor(view, offset, descriptor, littleEndian = true) {
|
|
26
|
+
assertDataViewRange(view, offset, VECTOR32_BYTE_LENGTH);
|
|
27
|
+
assertUint32(descriptor.relOffset, "Vector32.relOffset");
|
|
28
|
+
assertUint32(descriptor.count, "Vector32.count");
|
|
29
|
+
view.setUint32(offset, descriptor.relOffset, littleEndian);
|
|
30
|
+
view.setUint32(offset + 4, descriptor.count, littleEndian);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=descriptor32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor32.js","sourceRoot":"","sources":["../src/descriptor32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAYtC,MAAM,UAAU,oBAAoB,CAClC,IAAc,EACd,MAAc,EACd,YAAY,GAAG,IAAI;IAEnB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAEtD,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC;QAC/C,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,YAAY,CAAC;KACrD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAc,EACd,MAAc,EACd,UAA4B,EAC5B,YAAY,GAAG,IAAI;IAEnB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtD,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACvD,YAAY,CAAC,UAAU,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;IAEzD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC3D,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,IAAc,EACd,MAAc,EACd,YAAY,GAAG,IAAI;IAEnB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAExD,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC;QAC/C,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,YAAY,CAAC;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,IAAc,EACd,MAAc,EACd,UAA8B,EAC9B,YAAY,GAAG,IAAI;IAEnB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACxD,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IACzD,YAAY,CAAC,UAAU,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAEjD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC3D,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type TextEncoding } from "./fixed.js";
|
|
2
|
+
import { type ScalarKind } from "./scalar.js";
|
|
3
|
+
import { ProjectionView } from "./view-base.js";
|
|
4
|
+
export declare abstract class FixedArrayView<T> extends ProjectionView {
|
|
5
|
+
private readonly payloadOffset;
|
|
6
|
+
readonly length: number;
|
|
7
|
+
protected readonly elementByteLength: number;
|
|
8
|
+
protected constructor(view: DataView, payloadOffset: number, length: number, elementByteLength: number, baseOffset?: number, littleEndian?: boolean);
|
|
9
|
+
abstract at(index: number): T;
|
|
10
|
+
toArray(): T[];
|
|
11
|
+
protected elementOffset(index: number): number;
|
|
12
|
+
protected assertIndex(index: number): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class FixedScalarArrayView<T extends number | bigint | boolean> extends FixedArrayView<T> {
|
|
15
|
+
private readonly scalarKind;
|
|
16
|
+
constructor(view: DataView, payloadOffset: number, length: number, scalarKind: ScalarKind, baseOffset?: number, littleEndian?: boolean);
|
|
17
|
+
at(index: number): T;
|
|
18
|
+
set(index: number, value: T): void;
|
|
19
|
+
}
|
|
20
|
+
export declare class FixedBytesArrayView extends FixedArrayView<Uint8Array> {
|
|
21
|
+
constructor(view: DataView, payloadOffset: number, length: number, elementByteLength: number, baseOffset?: number, littleEndian?: boolean);
|
|
22
|
+
bytesAt(index: number): Uint8Array;
|
|
23
|
+
set(index: number, value: ArrayLike<number> | Uint8Array): void;
|
|
24
|
+
at(index: number): Uint8Array;
|
|
25
|
+
}
|
|
26
|
+
export declare class FixedStringArrayView extends FixedArrayView<string> {
|
|
27
|
+
private readonly encoding;
|
|
28
|
+
constructor(view: DataView, payloadOffset: number, length: number, elementByteLength: number, baseOffset?: number, littleEndian?: boolean, encoding?: TextEncoding);
|
|
29
|
+
bytesAt(index: number): Uint8Array;
|
|
30
|
+
textAt(index: number): string;
|
|
31
|
+
setText(index: number, value: string): void;
|
|
32
|
+
at(index: number): string;
|
|
33
|
+
}
|
|
34
|
+
export declare class FixedStructArrayView<TView extends ProjectionView> extends FixedArrayView<TView> {
|
|
35
|
+
private readonly factory;
|
|
36
|
+
constructor(view: DataView, payloadOffset: number, length: number, elementByteLength: number, factory: (view: DataView, baseOffset: number, littleEndian: boolean) => TView, baseOffset?: number, littleEndian?: boolean);
|
|
37
|
+
at(index: number): TView;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=fixed-arrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed-arrays.d.ts","sourceRoot":"","sources":["../src/fixed-arrays.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KA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} from "./fixed.js";
|
|
2
|
+
import { readScalar, scalarByteLength, writeScalar, } from "./scalar.js";
|
|
3
|
+
import { ProjectionView } from "./view-base.js";
|
|
4
|
+
export class FixedArrayView extends ProjectionView {
|
|
5
|
+
payloadOffset;
|
|
6
|
+
length;
|
|
7
|
+
elementByteLength;
|
|
8
|
+
constructor(view, payloadOffset, length, elementByteLength, baseOffset = 0, littleEndian = true) {
|
|
9
|
+
super(view, baseOffset, littleEndian);
|
|
10
|
+
this.payloadOffset = payloadOffset;
|
|
11
|
+
this.length = length;
|
|
12
|
+
this.elementByteLength = elementByteLength;
|
|
13
|
+
}
|
|
14
|
+
toArray() {
|
|
15
|
+
return Array.from({ length: this.length }, (_, index) => this.at(index));
|
|
16
|
+
}
|
|
17
|
+
elementOffset(index) {
|
|
18
|
+
this.assertIndex(index);
|
|
19
|
+
return this.payloadOffset + index * this.elementByteLength;
|
|
20
|
+
}
|
|
21
|
+
assertIndex(index) {
|
|
22
|
+
if (!Number.isInteger(index) || index < 0 || index >= this.length) {
|
|
23
|
+
throw new RangeError(`Fixed array index out of bounds: ${index}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class FixedScalarArrayView extends FixedArrayView {
|
|
28
|
+
scalarKind;
|
|
29
|
+
constructor(view, payloadOffset, length, scalarKind, baseOffset = 0, littleEndian = true) {
|
|
30
|
+
super(view, payloadOffset, length, scalarByteLength(scalarKind), baseOffset, littleEndian);
|
|
31
|
+
this.scalarKind = scalarKind;
|
|
32
|
+
}
|
|
33
|
+
at(index) {
|
|
34
|
+
const localOffset = this.elementOffset(index);
|
|
35
|
+
return readScalar(this.view, this.scalarKind, this.absoluteOffset(localOffset), this.littleEndian);
|
|
36
|
+
}
|
|
37
|
+
set(index, value) {
|
|
38
|
+
const localOffset = this.elementOffset(index);
|
|
39
|
+
writeScalar(this.view, this.scalarKind, this.absoluteOffset(localOffset), value, this.littleEndian);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class FixedBytesArrayView extends FixedArrayView {
|
|
43
|
+
constructor(view, payloadOffset, length, elementByteLength, baseOffset = 0, littleEndian = true) {
|
|
44
|
+
super(view, payloadOffset, length, elementByteLength, baseOffset, littleEndian);
|
|
45
|
+
}
|
|
46
|
+
bytesAt(index) {
|
|
47
|
+
const localOffset = this.elementOffset(index);
|
|
48
|
+
this.assertRange(localOffset, this.elementByteLength);
|
|
49
|
+
return fixedBytesView(this.backingBuffer(), this.backingOffset(localOffset), this.elementByteLength);
|
|
50
|
+
}
|
|
51
|
+
set(index, value) {
|
|
52
|
+
const localOffset = this.elementOffset(index);
|
|
53
|
+
writeFixedBytes(this.backingBuffer(), this.backingOffset(localOffset), this.elementByteLength, value);
|
|
54
|
+
}
|
|
55
|
+
at(index) {
|
|
56
|
+
return this.bytesAt(index);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export class FixedStringArrayView extends FixedArrayView {
|
|
60
|
+
encoding;
|
|
61
|
+
constructor(view, payloadOffset, length, elementByteLength, baseOffset = 0, littleEndian = true, encoding = "utf8") {
|
|
62
|
+
super(view, payloadOffset, length, elementByteLength, baseOffset, littleEndian);
|
|
63
|
+
this.encoding = encoding;
|
|
64
|
+
}
|
|
65
|
+
bytesAt(index) {
|
|
66
|
+
const localOffset = this.elementOffset(index);
|
|
67
|
+
this.assertRange(localOffset, this.elementByteLength);
|
|
68
|
+
return fixedBytesView(this.backingBuffer(), this.backingOffset(localOffset), this.elementByteLength);
|
|
69
|
+
}
|
|
70
|
+
textAt(index) {
|
|
71
|
+
return decodeText(this.bytesAt(index), this.encoding);
|
|
72
|
+
}
|
|
73
|
+
setText(index, value) {
|
|
74
|
+
const localOffset = this.elementOffset(index);
|
|
75
|
+
writeFixedText(this.backingBuffer(), this.backingOffset(localOffset), this.elementByteLength, value, this.encoding);
|
|
76
|
+
}
|
|
77
|
+
at(index) {
|
|
78
|
+
return this.textAt(index);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export class FixedStructArrayView extends FixedArrayView {
|
|
82
|
+
factory;
|
|
83
|
+
constructor(view, payloadOffset, length, elementByteLength, factory, baseOffset = 0, littleEndian = true) {
|
|
84
|
+
super(view, payloadOffset, length, elementByteLength, baseOffset, littleEndian);
|
|
85
|
+
this.factory = factory;
|
|
86
|
+
}
|
|
87
|
+
at(index) {
|
|
88
|
+
const localOffset = this.elementOffset(index);
|
|
89
|
+
this.assertRange(localOffset, this.elementByteLength);
|
|
90
|
+
return this.factory(this.view, this.absoluteOffset(localOffset), this.littleEndian);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=fixed-arrays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed-arrays.js","sourceRoot":"","sources":["../src/fixed-arrays.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,eAAe,EACf,cAAc,GAEf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,WAAW,GAEZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,OAAgB,cAAkB,SAAQ,cAAc;IAGzC;IACR;IACU;IAJrB,YACE,IAAc,EACG,aAAqB,EAC7B,MAAc,EACJ,iBAAyB,EAC5C,UAAU,GAAG,CAAC,EACd,YAAY,GAAG,IAAI;QAEnB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QANrB,kBAAa,GAAb,aAAa,CAAQ;QAC7B,WAAM,GAAN,MAAM,CAAQ;QACJ,sBAAiB,GAAjB,iBAAiB,CAAQ;IAK9C,CAAC;IAID,OAAO;QACL,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CA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E,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACtF,CAAC;CACF"}
|
package/dist/fixed.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type TextEncoding = "ascii" | "utf8";
|
|
2
|
+
export declare const UTF8_DECODER: TextDecoder;
|
|
3
|
+
export declare const UTF8_ENCODER: TextEncoder;
|
|
4
|
+
export declare function fixedBytesView(buffer: ArrayBufferLike, offset: number, length: number): Uint8Array;
|
|
5
|
+
export declare function writeFixedBytes(buffer: ArrayBufferLike, offset: number, length: number, value: ArrayLike<number> | Uint8Array): void;
|
|
6
|
+
export declare function decodeFixedUtf8(buffer: ArrayBufferLike, offset: number, length: number, decoder?: TextDecoder): string;
|
|
7
|
+
export declare function decodeText(bytes: Uint8Array, encoding?: TextEncoding): string;
|
|
8
|
+
export declare function encodeText(value: string, encoding?: TextEncoding): Uint8Array;
|
|
9
|
+
export declare function decodeFixedText(buffer: ArrayBufferLike, offset: number, length: number, encoding?: TextEncoding): string;
|
|
10
|
+
export declare function writeFixedUtf8(buffer: ArrayBufferLike, offset: number, length: number, value: string, encoder?: TextEncoder): void;
|
|
11
|
+
export declare function writeFixedText(buffer: ArrayBufferLike, offset: number, length: number, value: string, encoding?: TextEncoding): void;
|
|
12
|
+
//# sourceMappingURL=fixed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed.d.ts","sourceRoot":"","sources":["../src/fixed.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,YAAY,aAAoB,CAAC;AAE9C,wBAAgB,cAAc,CAC5B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,UAAU,CAGZ;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,UAAU,GACpC,IAAI,CAYN;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,cAAe,GACrB,MAAM,CAGR;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,GAAE,YAAqB,GAAG,MAAM,CAYrF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAqB,GAAG,UAAU,CAcrF;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,YAAqB,GAC9B,MAAM,CAGR;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,cAAe,GACrB,IAAI,CAEN;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,YAAqB,GAC9B,IAAI,CAEN"}
|
package/dist/fixed.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { assertBufferRange } from "./range.js";
|
|
2
|
+
export const UTF8_DECODER = new TextDecoder();
|
|
3
|
+
export const UTF8_ENCODER = new TextEncoder();
|
|
4
|
+
export function fixedBytesView(buffer, offset, length) {
|
|
5
|
+
assertBufferRange(buffer, offset, length);
|
|
6
|
+
return new Uint8Array(buffer, offset, length);
|
|
7
|
+
}
|
|
8
|
+
export function writeFixedBytes(buffer, offset, length, value) {
|
|
9
|
+
assertBufferRange(buffer, offset, length);
|
|
10
|
+
if (value.length > length) {
|
|
11
|
+
throw new RangeError(`Fixed bytes value length ${value.length} exceeds field length ${length}`);
|
|
12
|
+
}
|
|
13
|
+
const target = new Uint8Array(buffer, offset, length);
|
|
14
|
+
target.fill(0);
|
|
15
|
+
target.set(value);
|
|
16
|
+
}
|
|
17
|
+
export function decodeFixedUtf8(buffer, offset, length, decoder = UTF8_DECODER) {
|
|
18
|
+
assertBufferRange(buffer, offset, length);
|
|
19
|
+
return decoder.decode(new Uint8Array(buffer, offset, length));
|
|
20
|
+
}
|
|
21
|
+
export function decodeText(bytes, encoding = "utf8") {
|
|
22
|
+
if (encoding === "utf8") {
|
|
23
|
+
return UTF8_DECODER.decode(bytes);
|
|
24
|
+
}
|
|
25
|
+
for (const byte of bytes) {
|
|
26
|
+
if (byte > 0x7f) {
|
|
27
|
+
throw new RangeError(`ASCII text contains non-ASCII byte: ${byte}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return UTF8_DECODER.decode(bytes);
|
|
31
|
+
}
|
|
32
|
+
export function encodeText(value, encoding = "utf8") {
|
|
33
|
+
if (encoding === "utf8") {
|
|
34
|
+
return UTF8_ENCODER.encode(value);
|
|
35
|
+
}
|
|
36
|
+
const bytes = new Uint8Array(value.length);
|
|
37
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
38
|
+
const codePoint = value.charCodeAt(index);
|
|
39
|
+
if (codePoint > 0x7f) {
|
|
40
|
+
throw new RangeError(`ASCII text contains non-ASCII code point: ${codePoint}`);
|
|
41
|
+
}
|
|
42
|
+
bytes[index] = codePoint;
|
|
43
|
+
}
|
|
44
|
+
return bytes;
|
|
45
|
+
}
|
|
46
|
+
export function decodeFixedText(buffer, offset, length, encoding = "utf8") {
|
|
47
|
+
assertBufferRange(buffer, offset, length);
|
|
48
|
+
return decodeText(new Uint8Array(buffer, offset, length), encoding);
|
|
49
|
+
}
|
|
50
|
+
export function writeFixedUtf8(buffer, offset, length, value, encoder = UTF8_ENCODER) {
|
|
51
|
+
writeFixedBytes(buffer, offset, length, encoder.encode(value));
|
|
52
|
+
}
|
|
53
|
+
export function writeFixedText(buffer, offset, length, value, encoding = "utf8") {
|
|
54
|
+
writeFixedBytes(buffer, offset, length, encodeText(value, encoding));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=fixed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed.js","sourceRoot":"","sources":["../src/fixed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,WAAW,EAAE,CAAC;AAC9C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9C,MAAM,UAAU,cAAc,CAC5B,MAAuB,EACvB,MAAc,EACd,MAAc;IAEd,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,MAAuB,EACvB,MAAc,EACd,MAAc,EACd,KAAqC;IAErC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1C,IAAI,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;QAC1B,MAAM,IAAI,UAAU,CAClB,4BAA4B,KAAK,CAAC,MAAM,yBAAyB,MAAM,EAAE,CAC1E,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACf,MAAM,CAAC,GAAG,CAAC,KAA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,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,MAAuB,EACvB,MAAc,EACd,MAAc,EACd,WAAyB,MAAM;IAE/B,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAAuB,EACvB,MAAc,EACd,MAAc,EACd,KAAa,EACb,OAAO,GAAG,YAAY;IAEtB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAAuB,EACvB,MAAc,EACd,MAAc,EACd,KAAa,EACb,WAAyB,MAAM;IAE/B,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/frame.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const ZENO_FRAME_HEADER_BYTE_LENGTH = 24;
|
|
2
|
+
export declare const ZENO_FRAME_VERSION_MAJOR = 1;
|
|
3
|
+
export declare const ZENO_FRAME_LAYOUT_HASH_NONE = 0n;
|
|
4
|
+
export type ZenoFrameEndianness = "little" | "big";
|
|
5
|
+
export interface ZenoFrameHeader {
|
|
6
|
+
readonly versionMajor: number;
|
|
7
|
+
readonly versionMinor: number;
|
|
8
|
+
readonly endianness: ZenoFrameEndianness;
|
|
9
|
+
readonly flags: number;
|
|
10
|
+
readonly layoutHash: bigint;
|
|
11
|
+
readonly payloadOffset: number;
|
|
12
|
+
readonly payloadByteLength: number;
|
|
13
|
+
}
|
|
14
|
+
export interface WriteZenoFrameHeaderOptions {
|
|
15
|
+
readonly versionMinor?: number;
|
|
16
|
+
readonly endianness: ZenoFrameEndianness;
|
|
17
|
+
readonly flags?: number;
|
|
18
|
+
readonly layoutHash?: bigint;
|
|
19
|
+
readonly payloadOffset?: number;
|
|
20
|
+
readonly payloadByteLength: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ZenoFrameExpectation {
|
|
23
|
+
readonly endianness?: ZenoFrameEndianness;
|
|
24
|
+
readonly layoutHash?: bigint;
|
|
25
|
+
}
|
|
26
|
+
export interface ZenoFramePayloadExpectation extends ZenoFrameExpectation {
|
|
27
|
+
readonly payloadByteLength?: number;
|
|
28
|
+
readonly minPayloadByteLength?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function writeZenoFrameHeader(view: DataView, header: WriteZenoFrameHeaderOptions, offset?: number): ZenoFrameHeader;
|
|
31
|
+
export declare function readZenoFrameHeader(view: DataView, offset?: number): ZenoFrameHeader;
|
|
32
|
+
export declare function assertZenoFrameHeader(view: DataView, expectation?: ZenoFrameExpectation, offset?: number): ZenoFrameHeader;
|
|
33
|
+
export declare function assertZenoFramePayload(view: DataView, expectation?: ZenoFramePayloadExpectation, offset?: number): ZenoFrameHeader;
|
|
34
|
+
export declare function zenoFramePayloadView(view: DataView, offset?: number): DataView;
|
|
35
|
+
export declare function checkedZenoFramePayloadView(view: DataView, expectation?: ZenoFramePayloadExpectation, offset?: number): DataView;
|
|
36
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../src/frame.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAU9C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEnD,M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,eAAe,CAsBjB;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,QAAQ,EACd,WAAW,GAAE,2BAAgC,EAC7C,MAAM,SAAI,GACT,eAAe,CAsBjB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAI,GAAG,QAAQ,CAOzE;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,QAAQ,EACd,WAAW,GAAE,2BAAgC,EAC7C,MAAM,SAAI,GACT,QAAQ,CAOV"}
|
package/dist/frame.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { assertDataViewRange, assertUint32 } from "./range.js";
|
|
2
|
+
export const ZENO_FRAME_HEADER_BYTE_LENGTH = 24;
|
|
3
|
+
export const ZENO_FRAME_VERSION_MAJOR = 1;
|
|
4
|
+
export const ZENO_FRAME_LAYOUT_HASH_NONE = 0n;
|
|
5
|
+
const ZENO_FRAME_MAGIC_0 = 0x5a;
|
|
6
|
+
const ZENO_FRAME_MAGIC_1 = 0x45;
|
|
7
|
+
const ZENO_FRAME_MAGIC_2 = 0x4e;
|
|
8
|
+
const ZENO_FRAME_MAGIC_3 = 0x4f;
|
|
9
|
+
const ZENO_FRAME_ENDIAN_LITTLE = 1;
|
|
10
|
+
const ZENO_FRAME_ENDIAN_BIG = 2;
|
|
11
|
+
const MAX_UINT64 = 0xffffffffffffffffn;
|
|
12
|
+
export function writeZenoFrameHeader(view, header, offset = 0) {
|
|
13
|
+
assertDataViewRange(view, offset, ZENO_FRAME_HEADER_BYTE_LENGTH);
|
|
14
|
+
const versionMinor = header.versionMinor ?? 0;
|
|
15
|
+
const flags = header.flags ?? 0;
|
|
16
|
+
const layoutHash = header.layoutHash ?? ZENO_FRAME_LAYOUT_HASH_NONE;
|
|
17
|
+
const payloadOffset = header.payloadOffset ?? ZENO_FRAME_HEADER_BYTE_LENGTH;
|
|
18
|
+
assertUint8(versionMinor, "Zeno frame versionMinor");
|
|
19
|
+
assertUint8(flags, "Zeno frame flags");
|
|
20
|
+
if (flags !== 0) {
|
|
21
|
+
throw new RangeError(`Unsupported Zeno frame flags: ${flags}`);
|
|
22
|
+
}
|
|
23
|
+
assertUint64(layoutHash, "Zeno frame layoutHash");
|
|
24
|
+
assertUint32(payloadOffset, "Zeno frame payloadOffset");
|
|
25
|
+
assertUint32(header.payloadByteLength, "Zeno frame payloadByteLength");
|
|
26
|
+
assertPayloadRange(view, offset, payloadOffset, header.payloadByteLength);
|
|
27
|
+
view.setUint8(offset + 0, ZENO_FRAME_MAGIC_0);
|
|
28
|
+
view.setUint8(offset + 1, ZENO_FRAME_MAGIC_1);
|
|
29
|
+
view.setUint8(offset + 2, ZENO_FRAME_MAGIC_2);
|
|
30
|
+
view.setUint8(offset + 3, ZENO_FRAME_MAGIC_3);
|
|
31
|
+
view.setUint8(offset + 4, ZENO_FRAME_VERSION_MAJOR);
|
|
32
|
+
view.setUint8(offset + 5, versionMinor);
|
|
33
|
+
view.setUint8(offset + 6, endianMarker(header.endianness));
|
|
34
|
+
view.setUint8(offset + 7, flags);
|
|
35
|
+
view.setBigUint64(offset + 8, layoutHash, true);
|
|
36
|
+
view.setUint32(offset + 16, payloadOffset, true);
|
|
37
|
+
view.setUint32(offset + 20, header.payloadByteLength, true);
|
|
38
|
+
return {
|
|
39
|
+
versionMajor: ZENO_FRAME_VERSION_MAJOR,
|
|
40
|
+
versionMinor,
|
|
41
|
+
endianness: header.endianness,
|
|
42
|
+
flags,
|
|
43
|
+
layoutHash,
|
|
44
|
+
payloadOffset,
|
|
45
|
+
payloadByteLength: header.payloadByteLength,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function readZenoFrameHeader(view, offset = 0) {
|
|
49
|
+
assertDataViewRange(view, offset, ZENO_FRAME_HEADER_BYTE_LENGTH);
|
|
50
|
+
assertMagic(view, offset);
|
|
51
|
+
const versionMajor = view.getUint8(offset + 4);
|
|
52
|
+
if (versionMajor !== ZENO_FRAME_VERSION_MAJOR) {
|
|
53
|
+
throw new RangeError(`Unsupported Zeno frame major version: ${versionMajor}`);
|
|
54
|
+
}
|
|
55
|
+
const versionMinor = view.getUint8(offset + 5);
|
|
56
|
+
const endianness = markerEndianness(view.getUint8(offset + 6));
|
|
57
|
+
const flags = view.getUint8(offset + 7);
|
|
58
|
+
if (flags !== 0) {
|
|
59
|
+
throw new RangeError(`Unsupported Zeno frame flags: ${flags}`);
|
|
60
|
+
}
|
|
61
|
+
const layoutHash = view.getBigUint64(offset + 8, true);
|
|
62
|
+
const payloadOffset = view.getUint32(offset + 16, true);
|
|
63
|
+
const payloadByteLength = view.getUint32(offset + 20, true);
|
|
64
|
+
assertPayloadRange(view, offset, payloadOffset, payloadByteLength);
|
|
65
|
+
return {
|
|
66
|
+
versionMajor,
|
|
67
|
+
versionMinor,
|
|
68
|
+
endianness,
|
|
69
|
+
flags,
|
|
70
|
+
layoutHash,
|
|
71
|
+
payloadOffset,
|
|
72
|
+
payloadByteLength,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function assertZenoFrameHeader(view, expectation = {}, offset = 0) {
|
|
76
|
+
const header = readZenoFrameHeader(view, offset);
|
|
77
|
+
if (expectation.endianness !== undefined &&
|
|
78
|
+
header.endianness !== expectation.endianness) {
|
|
79
|
+
throw new RangeError(`Zeno frame endianness mismatch: expected ${expectation.endianness}, got ${header.endianness}`);
|
|
80
|
+
}
|
|
81
|
+
if (expectation.layoutHash !== undefined &&
|
|
82
|
+
header.layoutHash !== expectation.layoutHash) {
|
|
83
|
+
throw new RangeError(`Zeno frame layout hash mismatch: expected ${expectation.layoutHash}, got ${header.layoutHash}`);
|
|
84
|
+
}
|
|
85
|
+
return header;
|
|
86
|
+
}
|
|
87
|
+
export function assertZenoFramePayload(view, expectation = {}, offset = 0) {
|
|
88
|
+
const header = assertZenoFrameHeader(view, expectation, offset);
|
|
89
|
+
if (expectation.payloadByteLength !== undefined &&
|
|
90
|
+
header.payloadByteLength !== expectation.payloadByteLength) {
|
|
91
|
+
throw new RangeError(`Zeno frame payload length mismatch: expected ${expectation.payloadByteLength}, got ${header.payloadByteLength}`);
|
|
92
|
+
}
|
|
93
|
+
if (expectation.minPayloadByteLength !== undefined &&
|
|
94
|
+
header.payloadByteLength < expectation.minPayloadByteLength) {
|
|
95
|
+
throw new RangeError(`Zeno frame payload is too small: expected at least ${expectation.minPayloadByteLength}, got ${header.payloadByteLength}`);
|
|
96
|
+
}
|
|
97
|
+
return header;
|
|
98
|
+
}
|
|
99
|
+
export function zenoFramePayloadView(view, offset = 0) {
|
|
100
|
+
const header = readZenoFrameHeader(view, offset);
|
|
101
|
+
return new DataView(view.buffer, view.byteOffset + offset + header.payloadOffset, header.payloadByteLength);
|
|
102
|
+
}
|
|
103
|
+
export function checkedZenoFramePayloadView(view, expectation = {}, offset = 0) {
|
|
104
|
+
const header = assertZenoFramePayload(view, expectation, offset);
|
|
105
|
+
return new DataView(view.buffer, view.byteOffset + offset + header.payloadOffset, header.payloadByteLength);
|
|
106
|
+
}
|
|
107
|
+
function assertMagic(view, offset) {
|
|
108
|
+
if (view.getUint8(offset + 0) !== ZENO_FRAME_MAGIC_0 ||
|
|
109
|
+
view.getUint8(offset + 1) !== ZENO_FRAME_MAGIC_1 ||
|
|
110
|
+
view.getUint8(offset + 2) !== ZENO_FRAME_MAGIC_2 ||
|
|
111
|
+
view.getUint8(offset + 3) !== ZENO_FRAME_MAGIC_3) {
|
|
112
|
+
throw new RangeError("Invalid Zeno frame magic");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function assertPayloadRange(view, frameOffset, payloadOffset, payloadByteLength) {
|
|
116
|
+
if (payloadOffset < ZENO_FRAME_HEADER_BYTE_LENGTH) {
|
|
117
|
+
throw new RangeError(`Zeno frame payloadOffset must be at least ${ZENO_FRAME_HEADER_BYTE_LENGTH}: ${payloadOffset}`);
|
|
118
|
+
}
|
|
119
|
+
assertDataViewRange(view, frameOffset + payloadOffset, payloadByteLength);
|
|
120
|
+
}
|
|
121
|
+
function assertUint8(value, label) {
|
|
122
|
+
if (!Number.isInteger(value) || value < 0 || value > 0xff) {
|
|
123
|
+
throw new RangeError(`${label} must be a uint8 value: ${value}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function assertUint64(value, label) {
|
|
127
|
+
if (typeof value !== "bigint" || value < 0n || value > MAX_UINT64) {
|
|
128
|
+
throw new RangeError(`${label} must be a uint64 value: ${value}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function endianMarker(endianness) {
|
|
132
|
+
switch (endianness) {
|
|
133
|
+
case "little":
|
|
134
|
+
return ZENO_FRAME_ENDIAN_LITTLE;
|
|
135
|
+
case "big":
|
|
136
|
+
return ZENO_FRAME_ENDIAN_BIG;
|
|
137
|
+
default:
|
|
138
|
+
throw new RangeError(`Invalid Zeno frame endianness: ${endianness}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function markerEndianness(marker) {
|
|
142
|
+
switch (marker) {
|
|
143
|
+
case ZENO_FRAME_ENDIAN_LITTLE:
|
|
144
|
+
return "little";
|
|
145
|
+
case ZENO_FRAME_ENDIAN_BIG:
|
|
146
|
+
return "big";
|
|
147
|
+
default:
|
|
148
|
+
throw new RangeError(`Invalid Zeno frame endianness marker: ${marker}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../src/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,kBAAkB,GA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