FieldDescription
FieldDescription holds metadata related to fields declared within a type.
Implements
Section titled “Implements”description
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FieldDescription(
descValue,keyType?,valueType?,reflectTypeValue?,zeroMsgValue?,jsonFieldName?):FieldDescription
Parameters
Section titled “Parameters”descValue
Section titled “descValue”DescField | DescExtension
keyType?
Section titled “keyType?”FieldDescription
KeyType holds the key FieldDescription for map fields.
valueType?
Section titled “valueType?”FieldDescription
ValueType holds the value FieldDescription for map fields.
reflectTypeValue?
Section titled “reflectTypeValue?”unknown
zeroMsgValue?
Section titled “zeroMsgValue?”Message
jsonFieldName?
Section titled “jsonFieldName?”boolean = false
Returns
Section titled “Returns”FieldDescription
Properties
Section titled “Properties”jsonFieldName
Section titled “jsonFieldName”
readonlyjsonFieldName:boolean=false
keyType?
Section titled “keyType?”
readonlyoptionalkeyType?:FieldDescription
KeyType holds the key FieldDescription for map fields.
valueType?
Section titled “valueType?”
readonlyoptionalvalueType?:FieldDescription
ValueType holds the value FieldDescription for map fields.
Methods
Section titled “Methods”checkedType()
Section titled “checkedType()”checkedType():
Type
CheckedType returns the type-definition used at type-check time.
Returns
Section titled “Returns”Type
descriptor()
Section titled “descriptor()”descriptor():
DescField|DescExtension
Descriptor returns the field descriptor.
Returns
Section titled “Returns”DescField | DescExtension
documentation()
Section titled “documentation()”documentation():
string
Documentation returns the documentation for the field.
Returns
Section titled “Returns”string
getFrom()
Section titled “getFrom()”getFrom(
target): [unknown,Error|undefined]
GetFrom returns the accessor method associated with the field on the proto generated struct.
Parameters
Section titled “Parameters”target
Section titled “target”unknown
Returns
Section titled “Returns”[unknown, Error | undefined]
isEnum()
Section titled “isEnum()”isEnum():
boolean
IsEnum returns true if the field type refers to an enum value.
Returns
Section titled “Returns”boolean
isList()
Section titled “isList()”isList():
boolean
IsList returns true if the field is a repeated value.
Returns
Section titled “Returns”boolean
isMap()
Section titled “isMap()”isMap():
boolean
IsMap returns true if the field is of map type.
Returns
Section titled “Returns”boolean
isMessage()
Section titled “isMessage()”isMessage():
boolean
IsMessage returns true if the field is a message type.
Returns
Section titled “Returns”boolean
isOneof()
Section titled “isOneof()”isOneof():
boolean
IsOneof returns true if the field is declared within a oneof block.
Returns
Section titled “Returns”boolean
isSet()
Section titled “isSet()”isSet(
target):boolean
IsSet returns whether the field is set on the target value.
Parameters
Section titled “Parameters”target
Section titled “target”unknown
Returns
Section titled “Returns”boolean
jsonName()
Section titled “jsonName()”jsonName():
string
JSONName returns the JSON name of the field, if present.
Returns
Section titled “Returns”string
maybeUnwrapDynamic()
Section titled “maybeUnwrapDynamic()”maybeUnwrapDynamic(
msg): [unknown,boolean,Error|undefined]
MaybeUnwrapDynamic takes the reflected message and determines whether the value can be unwrapped.
Parameters
Section titled “Parameters”Message
Returns
Section titled “Returns”[unknown, boolean, Error | undefined]
name()
Section titled “name()”name():
string
Name returns the snake_case name of the field within the proto-based struct.
Returns
Section titled “Returns”string
protoKind()
Section titled “protoKind()”protoKind():
string
ProtoKind returns the protobuf kind of the field.
Returns
Section titled “Returns”string
reflectType()
Section titled “reflectType()”reflectType():
unknown
ReflectType returns the reflected runtime type token for this field.
Returns
Section titled “Returns”unknown
toString()
Section titled “toString()”toString():
string
String returns the fully qualified name of the field within its type.
Returns
Section titled “Returns”string
zero()
Section titled “zero()”zero():
Message|undefined
Zero returns the zero value for the protobuf message represented by this field.
Returns
Section titled “Returns”Message | undefined
Implementation of
Section titled “Implementation of”description.zero