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

    Interface SerializationCodec<T>

    Bidirectional application-value codec registered at the node boundary. tag is stable across languages and is written into the MIME type parameter so a remote peer can select the matching decoder.

    interface SerializationCodec<T = unknown> {
        deserialize: (
            data: Uint8Array,
            chunk: Chunk,
        ) => StatusOr<T> | Promise<StatusOr<T>>;
        mimetype: string;
        serialize: (
            value: T,
        ) => StatusOr<SerializedData> | Promise<StatusOr<SerializedData>>;
        tag: string;
        test: (value: unknown) => value is T;
    }

    Type Parameters

    • T = unknown
    Index
    deserialize: (
        data: Uint8Array,
        chunk: Chunk,
    ) => StatusOr<T> | Promise<StatusOr<T>>
    mimetype: string
    serialize: (
        value: T,
    ) => StatusOr<SerializedData> | Promise<StatusOr<SerializedData>>
    tag: string

    Stable, cross-language value tag written as the MIME type parameter.

    test: (value: unknown) => value is T