Pular para o conteúdo
Português (BR)

ProtobufSerializerOptionsBuilder

Este conteúdo não está disponível em sua língua ainda.

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

Fluent builder for ProtobufSerializerOptionsType:

const protobufOptions = ProtobufSerializerOptions.create<Order>()
.withMessageType(messageType)
.withId(101);
const serializer = new ProtobufSerializer(protobufOptions);

T = unknown

new ProtobufSerializerOptionsBuilder<T>(): ProtobufSerializerOptionsBuilder<T>

ProtobufSerializerOptionsBuilder<T>

OptionsBuilder.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

OptionsBuilder.build


withId(id): this

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

Wire identifier embedded in every frame. Must be >= 100.

number

this


withManifest(manifest): this

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

Manifest written alongside the bytes; '' writes none.

string

this


withMessageType(messageType): this

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

The compiled Protobuf message type that does the encoding.

ProtobufMessageType<T>

this


withName(name): this

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

Diagnostic name shown in error messages.

string

this


withPlainObjects(plainObjects): this

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

Decode to a plain object rather than a Message instance.

boolean

this


static create<T>(): ProtobufSerializerOptionsBuilder<T>

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

Start a fresh builder.

T = unknown

ProtobufSerializerOptionsBuilder<T>