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

    Interface WireValueCodec<T>

    How one class is written into, and read back out of, a tagged wire object.

    dump and load deal in plain fields only — the surrounding encoder walks whatever they return, so a field may itself hold bytes, a Date, or another registered value without either side knowing.

    interface WireValueCodec<T = unknown> {
        dump: (value: T) => StatusOr<Fields>;
        load: (fields: Fields) => StatusOr<T>;
        tag: string;
        test: (value: unknown) => boolean;
    }

    Type Parameters

    • T = unknown
    Index
    dump: (value: T) => StatusOr<Fields>

    Convert a runtime value to plain serializable fields.

    load: (fields: Fields) => StatusOr<T>

    Rebuild and validate a runtime value from plain fields.

    tag: string

    Canonical tag from serial_tags.ts, written as the object's key.

    test: (value: unknown) => boolean

    Whether a runtime value belongs to this codec.