Skip to content

Defined in: packages/wire/src/artifact-format.ts:10

What one module declares, once, about the binary artifact it writes and reads.

Kind extends string

Failure extends KnotkitError

InvalidInputCode extends string

readonly name: string

Defined in: packages/wire/src/artifact-format.ts:16

How messages name the artifact, such as heap or segmented-trie.


readonly magic: Uint8Array

Defined in: packages/wire/src/artifact-format.ts:18

The four bytes that identify the owning module.


readonly payloadVersion: number

Defined in: packages/wire/src/artifact-format.ts:20

The one payload version this release writes and reads. The number is the module’s; the comparison is wire’s.


readonly kindTags: Readonly<Record<Kind, number>>

Defined in: packages/wire/src/artifact-format.ts:22

The byte each kind is written as. A tag is part of the wire contract, so it is never reused or renumbered.


readonly sectionTags: readonly number[]

Defined in: packages/wire/src/artifact-format.ts:24

The section tags the module reads. Any other tag is validated and skipped without a copy.


readonly optional wrongFormatHint?: string

Defined in: packages/wire/src/artifact-format.ts:26

Where a value that is not bytes belongs, appended to the wrong-format message.


readonly parseError: (code, detail) => Failure

Defined in: packages/wire/src/artifact-format.ts:28

Builds the module’s parse error from the code it owns for a wire failure reason.

WireFailureCode

string

Failure


readonly serializationCodes: WireSerializationCodeMap<InvalidInputCode>

Defined in: packages/wire/src/artifact-format.ts:30

The module’s translation of each wire caller-contract code raised while writing.


readonly invalidInputError: (code, detail) => KnotkitError

Defined in: packages/wire/src/artifact-format.ts:32

Builds the module’s invalid-input error from a translated code.

InvalidInputCode

string

KnotkitError