ProtobufSerializerOptionsType
Esta página aún no está disponible en tu idioma.
ProtobufSerializerOptionsType<
T> =object
Defined in: src/serialization/ProtobufSerializerOptions.ts:65
Plain options-object shape accepted by a ProtobufSerializer.
Type Parameters
Section titled “Type Parameters”T = unknown
Properties
Section titled “Properties”
readonlyid:number
Defined in: src/serialization/ProtobufSerializerOptions.ts:72
Wire identifier embedded in every frame. Required, and must be
= 100: 1–99 are reserved for the built-ins (JSON=1, CBOR=2).
manifest?
Section titled “manifest?”
readonlyoptionalmanifest?:string
Defined in: src/serialization/ProtobufSerializerOptions.ts:79
Manifest written alongside the bytes. Defaults to the message type’s
fully-qualified name; set '' to write no manifest at all.
messageType
Section titled “messageType”
readonlymessageType:ProtobufMessageType<T>
Defined in: src/serialization/ProtobufSerializerOptions.ts:67
The compiled Protobuf message type that does the encoding. Required.
readonlyoptionalname?:string
Defined in: src/serialization/ProtobufSerializerOptions.ts:74
Diagnostic name shown in error messages. Default 'protobuf'.
plainObjects?
Section titled “plainObjects?”
readonlyoptionalplainObjects?:boolean
Defined in: src/serialization/ProtobufSerializerOptions.ts:92
Convert the decoded message to a plain object via toObject instead
of returning protobufjs’s Message instance. Default true, and
a no-op for types that expose no toObject (generated static code).
Persisted payloads want the plain object: a Message carries a
prototype nothing downstream preserves, unset fields are absent
rather than defaulted, and 64-bit fields arrive as Long objects
that would be stored as {low, high, unsigned}. The conversion asks
for defaults: true and long-as-string so what the domain handler
sees is what a re-encode would write back.
