Defined in: packages/wire/src/artifact-format.ts:51
One module’s binary artifact: the prelude every decoder runs before it reads its own header, and the framing every encoder applies after it has built its own sections.
Type Parameters
Section titled “Type Parameters”Kind extends string
Failure
Section titled “Failure”Failure extends KnotkitError
Properties
Section titled “Properties”failures
Section titled “failures”
readonlyfailures:WireFailureFactories<Failure>
Defined in: packages/wire/src/artifact-format.ts:53
The module’s parse-error factory for every wire failure reason, for the wire guards and readers.
serialize
Section titled “serialize”
readonlyserialize: (build,options?) =>Uint8Array
Defined in: packages/wire/src/artifact-format.ts:60
Run build and frame its payload under this format’s magic and payload version.
Parameters
Section titled “Parameters”() => ArtifactPayload
options?
Section titled “options?”Returns
Section titled “Returns”Uint8Array
Throws
Section titled “Throws”The module’s invalid-input error for every wire caller-contract failure raised by
build or by the framing; any other error is rethrown untouched.
deserialize
Section titled “deserialize”
readonlydeserialize: (value) =>ArtifactPayload
Defined in: packages/wire/src/artifact-format.ts:67
Validate untrusted input as this format’s envelope and return the module-owned bytes.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”Throws
Section titled “Throws”The module’s parse error: wrong-format for a value that is not a Uint8Array, an
envelope reason for malformed bytes, and unsupported-payload-version for another payload version.
kindTag
Section titled “kindTag”
readonlykindTag: (kind) =>number
Defined in: packages/wire/src/artifact-format.ts:69
The byte kind is written as.
Parameters
Section titled “Parameters”Kind
Returns
Section titled “Returns”number
kindOf
Section titled “kindOf”
readonlykindOf: (tag) =>Kind
Defined in: packages/wire/src/artifact-format.ts:75
The kind a header’s tag byte names.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Kind
Throws
Section titled “Throws”The module’s unknown-kind parse error for a tag no kind is written as.