A11 TypeScript API - v0.7.0
    Preparing search index...

    Class SerializationRegistry

    Ordered collection of codecs between application values and A11 chunks.

    AsyncNodes use a registry on every typed put/read. Register domain codecs (model messages, audio frames, tool events) before generic defaults when they need a distinct MIME/tag contract. MIME patterns and stable type tags let consumers constrain what they will decode instead of trusting arbitrary peer data.

    Index
    • Select a decoder from the chunk's metadata and return a typed value.

      mimetypePatterns constrains the representation. Which type comes back is the chunk's ;type=, or expectedTag when the caller names one. A chunk with no type parameter is not underspecified — it holds exactly what its format describes, and decodes to that.

      Type Parameters

      • T = unknown

      Parameters

      • chunk: Chunk
      • mimetypePatterns: string | readonly string[] = ''
      • OptionalexpectedTag: string

      Returns Promise<StatusOr<T>>

    • Select a matching serializer and produce a tagged, owned Chunk.

      Parameters

      • value: unknown
      • mimetype: string = ''

      Returns Promise<StatusOr<Chunk>>