Defined in: packages/wire/src/artifact-format.ts:10
What one module declares, once, about the binary artifact it writes and reads.
Type Parameters
Section titled “Type Parameters”Kind extends string
Failure
Section titled “Failure”Failure extends KnotkitError
InvalidInputCode
Section titled “InvalidInputCode”InvalidInputCode extends string
Properties
Section titled “Properties”
readonlyname:string
Defined in: packages/wire/src/artifact-format.ts:16
How messages name the artifact, such as heap or segmented-trie.
readonlymagic:Uint8Array
Defined in: packages/wire/src/artifact-format.ts:18
The four bytes that identify the owning module.
payloadVersion
Section titled “payloadVersion”
readonlypayloadVersion: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.
kindTags
Section titled “kindTags”
readonlykindTags: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.
sectionTags
Section titled “sectionTags”
readonlysectionTags: readonlynumber[]
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.
wrongFormatHint?
Section titled “wrongFormatHint?”
readonlyoptionalwrongFormatHint?:string
Defined in: packages/wire/src/artifact-format.ts:26
Where a value that is not bytes belongs, appended to the wrong-format message.
parseError
Section titled “parseError”
readonlyparseError: (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.
Parameters
Section titled “Parameters”detail
Section titled “detail”string
Returns
Section titled “Returns”Failure
serializationCodes
Section titled “serializationCodes”
readonlyserializationCodes:WireSerializationCodeMap<InvalidInputCode>
Defined in: packages/wire/src/artifact-format.ts:30
The module’s translation of each wire caller-contract code raised while writing.
invalidInputError
Section titled “invalidInputError”
readonlyinvalidInputError: (code,detail) =>KnotkitError
Defined in: packages/wire/src/artifact-format.ts:32
Builds the module’s invalid-input error from a translated code.
Parameters
Section titled “Parameters”InvalidInputCode
detail
Section titled “detail”string