A facade that provides serialization and other internal functionality.

interface ProtoRuntime {
    bin: BinaryFormat;
    json: JsonFormat;
    syntax: string;
    util: Util;
    getEnumType(enumObject): EnumType;
    makeEnum(typeName, values, opt?): EnumObject;
    makeEnumType(typeName, values, opt?): EnumType;
    makeMessageType<T>(typeName, fields, opt?): MessageType<T>;
}

Properties

syntax: string
util: Util

Methods

  • Get reflection information - the EnumType - from an enum object. If this function is called on something other than a generated enum, or an enum constructed with makeEnum(), it raises an error.

    Parameters

    Returns EnumType

  • Create an enum object at runtime, without generating code.

    The object conforms to TypeScript enums, and comes with mapping from name to value, and from value to name.

    The type name and other reflection information is accessible via getEnumType().

    Parameters

    Returns EnumObject

  • Create an enum type at runtime, without generating code. Note that this only creates the reflection information, not an actual enum object.

    Parameters

    Returns EnumType

  • Create a message type at runtime, without generating code.

    Type Parameters

    Parameters

    • typeName: string
    • fields: FieldListSource
    • Optional opt: {
          localName?: string;
      }
      • Optional localName?: string

    Returns MessageType<T>

Generated using TypeDoc