Class: FileDescriptorProto
google.protobuf.FileDescriptorProto
Describes a complete .proto file.
Implements
Constructors
constructor
• new FileDescriptorProto(properties?): FileDescriptorProto
Constructs a new FileDescriptorProto.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IFileDescriptorProto | Properties to set |
Returns
Properties
dependency
• dependency: string[]
Names of files imported by this file.
Implementation of
IFileDescriptorProto.dependency
edition
• edition: Edition
The edition of the proto file.
Implementation of
enumType
• enumType: IEnumDescriptorProto[]
FileDescriptorProto enumType.
Implementation of
extension
• extension: IFieldDescriptorProto[]
FileDescriptorProto extension.
Implementation of
IFileDescriptorProto.extension
messageType
• messageType: IDescriptorProto[]
All top-level definitions in this file.
Implementation of
IFileDescriptorProto.messageType
name
• name: string
file name, relative to root of source tree
Implementation of
options
• Optional options: null | IFileOptions
FileDescriptorProto options.
Implementation of
package
• package: string
e.g. "foo", "foo.bar", etc.
Implementation of
publicDependency
• publicDependency: number[]
Indexes of the public imported files in the dependency list above.
Implementation of
IFileDescriptorProto.publicDependency
service
• service: IServiceDescriptorProto[]
FileDescriptorProto service.
Implementation of
sourceCodeInfo
• Optional sourceCodeInfo: null | ISourceCodeInfo
This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.
Implementation of
IFileDescriptorProto.sourceCodeInfo
syntax
• syntax: string
The syntax of the proto file. The supported values are "proto2", "proto3", and "editions".
If edition is present, this value must be "editions".
Implementation of
weakDependency
• weakDependency: number[]
Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.
Implementation of
IFileDescriptorProto.weakDependency
Methods
toJSON
▸ toJSON(): Object
Converts this FileDescriptorProto to JSON.
Returns
Object
JSON object
create
▸ create(properties?): FileDescriptorProto
Creates a new FileDescriptorProto instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IFileDescriptorProto | Properties to set |
Returns
FileDescriptorProto instance
decode
▸ decode(reader, length?): FileDescriptorProto
Decodes a FileDescriptorProto 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
FileDescriptorProto
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): FileDescriptorProto
Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
FileDescriptorProto
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 FileDescriptorProto message. Does not implicitly google.protobuf.FileDescriptorProto.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IFileDescriptorProto | FileDescriptorProto message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly google.protobuf.FileDescriptorProto.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IFileDescriptorProto | FileDescriptorProto message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): FileDescriptorProto
Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
FileDescriptorProto
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for FileDescriptorProto
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 FileDescriptorProto message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | FileDescriptorProto | FileDescriptorProto |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object