Class: DescriptorProto
google.protobuf.DescriptorProto
Describes a message type.
Implements
Constructors
constructor
• new DescriptorProto(properties?): DescriptorProto
Constructs a new DescriptorProto.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IDescriptorProto | Properties to set |
Returns
Properties
enumType
• enumType: IEnumDescriptorProto[]
DescriptorProto enumType.
Implementation of
extension
• extension: IFieldDescriptorProto[]
DescriptorProto extension.
Implementation of
extensionRange
• extensionRange: IExtensionRange[]
DescriptorProto extensionRange.
Implementation of
IDescriptorProto.extensionRange
field
• field: IFieldDescriptorProto[]
DescriptorProto field.
Implementation of
name
• name: string
DescriptorProto name.
Implementation of
nestedType
• nestedType: IDescriptorProto[]
DescriptorProto nestedType.
Implementation of
oneofDecl
• oneofDecl: IOneofDescriptorProto[]
DescriptorProto oneofDecl.
Implementation of
options
• Optional options: null | IMessageOptions
DescriptorProto options.
Implementation of
reservedName
• reservedName: string[]
Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once.
Implementation of
reservedRange
• reservedRange: IReservedRange[]
DescriptorProto reservedRange.
Implementation of
IDescriptorProto.reservedRange
Methods
toJSON
▸ toJSON(): Object
Converts this DescriptorProto to JSON.
Returns
Object
JSON object
create
▸ create(properties?): DescriptorProto
Creates a new DescriptorProto instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IDescriptorProto | Properties to set |
Returns
DescriptorProto instance
decode
▸ decode(reader, length?): DescriptorProto
Decodes a DescriptorProto message from the specified reader or buffer.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
DescriptorProto
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): DescriptorProto
Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
DescriptorProto
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode
▸ encode(message, writer?): Writer
Encodes the specified DescriptorProto message. Does not implicitly google.protobuf.DescriptorProto.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IDescriptorProto | DescriptorProto message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified DescriptorProto message, length delimited. Does not implicitly google.protobuf.DescriptorProto.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IDescriptorProto | DescriptorProto message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): DescriptorProto
Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
DescriptorProto
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for DescriptorProto
Parameters
| Name | Type | Description |
|---|---|---|
typeUrlPrefix? | string | your custom typeUrlPrefix(default "type.googleapis.com") |
Returns
string
The default type url
toObject
▸ toObject(message, options?): Object
Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | DescriptorProto | DescriptorProto |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object