Options
All
  • Public
  • Public/Protected
  • All
Menu

pinus-protobuf

Index

Variables

Parser

Parser: any = module.exports

Functions

decodeSInt32

  • decodeSInt32(bytes: Array<number>): number
  • Parameters

    • bytes: Array<number>

    Returns number

decodeUInt32

  • decodeUInt32(bytes: Array<any>): number
  • Parameters

    • bytes: Array<any>

    Returns number

encodeSInt32

  • encodeSInt32(num: any): number[]
  • [encode a sInt32, return a byte array]

    Parameters

    • num: any

      The sInt32 need to encode

    Returns number[]

    A byte array represent the integer

encodeUInt32

  • encodeUInt32(num: any): number[]
  • [encode an uInt32, return a array of bytes]

    Parameters

    • num: any

    Returns number[]

equal

  • equal(obj0: object, obj1: object): boolean
  • Parameters

    • obj0: object
      • [key: string]: any
    • obj1: object
      • [key: string]: any

    Returns boolean

isSimpleType

  • isSimpleType(type: string): boolean
  • Parameters

    • type: string

    Returns boolean

parse

  • parse(protos: object): object
  • [parse the original protos, give the paresed result can be used by protobuf encode/decode.]

    Parameters

    • protos: object

      Original protos, in a js map.

      • [key: string]: any

    Returns object

    The presed result, a js object represent all the meta data of the given protos.

    • [key: string]: any

parseObject

  • parseObject(obj: object): object
  • [parse a single protos, return a object represent the result. The method can be invocked recursively.]

    Parameters

    • obj: object

      The origin proto need to parse.

      • [key: string]: any

    Returns object

    The parsed result, a js object.

    • [key: string]: any

Object literals

TYPES

TYPES: object

double

double: number = 1

float

float: number = 5

int32

int32: number = 0

message

message: number = 2

sInt32

sInt32: number = 0

string

string: number = 2

uInt32

uInt32: number = 0