MessageType represents a protobuf message. It provides:

  • a constructor that produces an instance of the message
  • metadata for reflection-based operations
  • common functionality like serialization
interface MessageType {
    new MessageTypenew (data?): T;
    fieldWrapper?: FieldWrapper<T, any>;
    fields: FieldList;
    runtime: ProtoRuntime;
    typeName: string;
    equals(a, b): boolean;
    fromBinary(data, options?): T;
    fromJson(jsonValue, options?): T;
    fromJsonString(jsonString, options?): T;
}

Type Parameters

Constructors

  • Create a new instance of this type.

    Parameters

    Returns T

Properties

fieldWrapper?: FieldWrapper<T, any>

When used as a field, unwrap this message to a simple value.

fields: FieldList

Field metadata.

runtime: ProtoRuntime

Provides serialization and other functionality.

typeName: string

The fully qualified name of the message.

Methods

  • Returns true if the given arguments have equal field values, recursively. Will also return true if both messages are undefined or null.

    Parameters

    Returns boolean

  • Parse serialized binary data.

    Parameters

    Returns T

  • Parse a JSON object.

    Parameters

    Returns T

  • Parse a JSON string.

    Parameters

    Returns T

Generated using TypeDoc