Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/grpc_basic/proto.ts>Field

Very basic gRPC implementation for Deno
Latest
class Field
extends FieldBase
Re-export
import { Field } from "https://deno.land/x/grpc_basic@0.4.7/proto.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 MapField | 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
| 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.