Skip to main content
Module

x/steam_trader/types/protobuf.d.ts>Type

https://deno.land/x/steam_trader
Latest
class Type
extends NamespaceBase
import { Type } from "https://deno.land/x/steam_trader@v0.4.0/types/protobuf.d.ts";

Reflected message type.

Constructors

new
Type(name: string, options?: { [k: string]: any; })

Constructs a new reflected message type instance.

Properties

ctor: Constructor<{ }>

The registered constructor, if any registered, otherwise a generic constructor. Assigning a function replaces the internal constructor. If the function does not extend Message yet, its prototype will be setup accordingly and static methods will be populated. If it already extends Message, it will just replace the internal constructor.

extensions: number[][]

Extension ranges, if any.

fields: { [k: string]: Field; }

Message fields.

readonly
fieldsArray: Field[]

Fields of this message as an array for iteration.

readonly
fieldsById: { [k: number]: Field; }

Message fields by id.

oneofs: { [k: string]: OneOf; }

Oneofs declared within this namespace, if any.

readonly
oneofsArray: OneOf[]

Oneofs of this message as an array for iteration.

reserved: (number[] | string)[]

Reserved ranges, if any.

Methods

Adds a nested object to this type.

create(properties?: { [k: string]: any; }): Message<{ }>

Creates a new message of this type using the specified properties.

decode(reader: (Reader | Uint8Array), length?: number): Message<{ }>

Decodes a message of this type.

decodeDelimited(reader: (Reader | Uint8Array)): Message<{ }>

Decodes a message of this type preceeded by its byte length as a varint.

encode(message: (Message<{ }> | { [k: string]: any; }), writer?: Writer): Writer

Encodes a message of this type. Does not implicitly Type#verify | verify messages.

encodeDelimited(message: (Message<{ }> | { [k: string]: any; }), writer?: Writer): Writer

Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly Type#verify | verify messages.

fromObject(object: { [k: string]: any; }): Message<{ }>

Creates a new message of this type from a plain object. Also converts values to their respective internal types.

isReservedId(id: number): boolean

Tests if the specified id is reserved.

isReservedName(name: string): boolean

Tests if the specified name is reserved.

Removes a nested object from this type.

Sets up Type#encode | encode, Type#decode | decode and Type#verify | verify.

toJSON(toJSONOptions?: IToJSONOptions): IType

Converts this message type to a message type descriptor.

toObject(message: Message<{ }>, options?: IConversionOptions): { [k: string]: any; }

Creates a plain object from a message of this type. Also converts values to other types if specified.

verify(message: { [k: string]: any; }): (null | string)

Verifies that field values are valid and that required fields are present.

Static Methods

d<T extends Message<T>>(typeName?: string): TypeDecorator<T>

Type decorator (TypeScript).

fromJSON(name: string, json: IType): Type

Creates a message type from a message type descriptor.

generateConstructor(mtype: Type): Codegen

Generates a constructor function for the specified type.