콘텐츠로 이동
한국어

ProtobufSerializerOptionsType

이 콘텐츠는 아직 번역되지 않았습니다.

ProtobufSerializerOptionsType<T> = object

Defined in: src/serialization/ProtobufSerializerOptions.ts:65

Plain options-object shape accepted by a ProtobufSerializer.

T = unknown

readonly id: 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).


readonly optional manifest?: 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.


readonly messageType: ProtobufMessageType<T>

Defined in: src/serialization/ProtobufSerializerOptions.ts:67

The compiled Protobuf message type that does the encoding. Required.


readonly optional name?: string

Defined in: src/serialization/ProtobufSerializerOptions.ts:74

Diagnostic name shown in error messages. Default 'protobuf'.


readonly optional plainObjects?: 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.