Ir al contenido
Español

AvroType

Esta página aún no está disponible en tu idioma.

Defined in: src/serialization/AvroSerializerOptions.ts:21

The slice of an Avro type object that AvroSerializer uses.

Declared structurally rather than imported from avsc, for the same reason zodCodec takes a ParserLike instead of importing zod: the schema library belongs to the user’s project, and actor-ts has no business pinning a version of it or shipping a lazy import for something it never calls itself. avsc’s Type satisfies this shape as-is:

import avsc from 'avsc';
const avroType = avsc.Type.forSchema({ name: 'Order', type: 'record', fields: [...] });

Any other library whose compiled type exposes toBuffer / fromBuffer fits too.

T = unknown

readonly optional name?: string

Defined in: src/serialization/AvroSerializerOptions.ts:27

Record name from the schema, used as the default manifest when set.

fromBuffer(bytes): T

Defined in: src/serialization/AvroSerializerOptions.ts:25

Decode Avro binary back to a value. Needs a Node Buffer in avsc’s case.

Uint8Array

T


toBuffer(value): Uint8Array

Defined in: src/serialization/AvroSerializerOptions.ts:23

Encode a value to Avro binary. Throws when the value doesn’t match the schema.

T

Uint8Array