ContentCodec
Defined in: sdks/browser/dist/typescript-wasm/runtime/public/codec.d.ts:12
A content codec over public values. The send helpers run its steps before
the send starts: encode, then fallback when the envelope has none, then
shouldPush when the send has no explicit shouldPush option. A step that
throws, rejects, or returns a value of the wrong type fails the send with
XmtpError.CodecEncodeFailed, and the SDK makes no publish attempt. Each
step is a function property, so the value type is checked in both
directions.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”decode
Section titled “decode”
readonlydecode: (encoded) =>T
Defined in: sdks/browser/dist/typescript-wasm/runtime/public/codec.d.ts:15
Parameters
Section titled “Parameters”encoded
Section titled “encoded”Returns
Section titled “Returns”T
encode
Section titled “encode”
readonlyencode: (value) =>EncodedContent
Defined in: sdks/browser/dist/typescript-wasm/runtime/public/codec.d.ts:14
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”fallback?
Section titled “fallback?”
readonlyoptionalfallback?: (value) =>string|undefined
Defined in: sdks/browser/dist/typescript-wasm/runtime/public/codec.d.ts:17
Text for recipients without this codec. Absent: no fallback.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”string | undefined
shouldPush?
Section titled “shouldPush?”
readonlyoptionalshouldPush?: (value) =>boolean
Defined in: sdks/browser/dist/typescript-wasm/runtime/public/codec.d.ts:19
Whether sending this value notifies recipients. Absent: it does.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”boolean
readonlytype:ContentTypeId
Defined in: sdks/browser/dist/typescript-wasm/runtime/public/codec.d.ts:13