Skip to main content
Module

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

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

Reflected message field.

Constructors

new
Field(
name: string,
id: number,
type: string,
rule?: (string | { [k: string]: any; }),
extend?: (string | { [k: string]: any; }),
options?: { [k: string]: any; },
)

Constructs a new message field instance. Note that map fields have their own class.

Properties

readonly
packed: boolean

Determines whether this field is packed. Only relevant when repeated and working with proto2.

Static Methods

d<T extends
| number
| number[]
| Long
| Long[]
| string
| string[]
| boolean
| boolean[]
| Uint8Array
| Uint8Array[]
| Buffer[]
>
(
fieldId: number,
fieldType: (
| "double"
| "float"
| "int32"
| "uint32"
| "sint32"
| "fixed32"
| "sfixed32"
| "int64"
| "uint64"
| "sint64"
| "fixed64"
| "sfixed64"
| "string"
| "bool"
| "bytes"
| object
)
,
fieldRule?: ("optional" | "required" | "repeated"),
defaultValue?: T,
): FieldDecorator

Field decorator (TypeScript).

d<T extends Message<T>>(
fieldId: number,
fieldType: (Constructor<T> | string),
fieldRule?: ("optional" | "required" | "repeated"),
): FieldDecorator

Field decorator (TypeScript).

fromJSON(name: string, json: IField): Field

Constructs a field from a field descriptor.