Options
All
  • Public
  • Public/Protected
  • All
Menu

Module lib/proto/google/protobuf/descriptor

Index

Enumerations

Interfaces

Type aliases

Variables

Functions

Type aliases

DeepPartial

DeepPartial<T>: T extends Builtin ? T : T extends infer U[] ? DeepPartial<U>[] : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {[ K in keyof T]: DeepPartial<T[K]> } : Partial<T>

Type parameters

  • T

Variables

DescriptorProto

DescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { enumType?: { name?: string | undefined; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | u...[]; extension?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]; extensionRange?: { start?: number | undefined; end?: number | undefined; options?: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]; name?: string; nestedType?: { name?: string | undefined; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[] | undefined; ... 7 more ...; reservedName?: string[] | undefined; }[]; oneofDecl?: { name?: string | undefined; options?: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]; options?: { messageSetWireFormat?: boolean | undefined; noStandardDescriptorAccessor?: boolean | undefined; deprecated?: boolean | undefined; mapEntry?: boolean | undefined; uninterpretedOption?: { ...; }[] | undefined; }; reservedName?: string[]; reservedRange?: { start?: number | undefined; end?: number | undefined; }[] }): DescriptorProto
    • Parameters

      • object: { enumType?: { name?: string | undefined; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | u...[]; extension?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]; extensionRange?: { start?: number | undefined; end?: number | undefined; options?: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]; name?: string; nestedType?: { name?: string | undefined; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[] | undefined; ... 7 more ...; reservedName?: string[] | undefined; }[]; oneofDecl?: { name?: string | undefined; options?: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]; options?: { messageSetWireFormat?: boolean | undefined; noStandardDescriptorAccessor?: boolean | undefined; deprecated?: boolean | undefined; mapEntry?: boolean | undefined; uninterpretedOption?: { ...; }[] | undefined; }; reservedName?: string[]; reservedRange?: { start?: number | undefined; end?: number | undefined; }[] }
        • Optional enumType?: { name?: string | undefined; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | u...[]
        • Optional extension?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]
        • Optional extensionRange?: { start?: number | undefined; end?: number | undefined; options?: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]
        • Optional field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]
        • Optional name?: string
        • Optional nestedType?: { name?: string | undefined; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[] | undefined; ... 7 more ...; reservedName?: string[] | undefined; }[]
        • Optional oneofDecl?: { name?: string | undefined; options?: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]
        • Optional options?: { messageSetWireFormat?: boolean | undefined; noStandardDescriptorAccessor?: boolean | undefined; deprecated?: boolean | undefined; mapEntry?: boolean | undefined; uninterpretedOption?: { ...; }[] | undefined; }
        • Optional reservedName?: string[]

          Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once.

        • Optional reservedRange?: { start?: number | undefined; end?: number | undefined; }[]

      Returns DescriptorProto

  • toJSON: function

DescriptorProto_ExtensionRange

DescriptorProto_ExtensionRange: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

DescriptorProto_ReservedRange

DescriptorProto_ReservedRange: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

EnumDescriptorProto

EnumDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { name?: string; options?: { allowAlias?: boolean | undefined; deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; }; reservedName?: string[]; reservedRange?: { start?: number | undefined; end?: number | undefined; }[]; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[] }): EnumDescriptorProto
    • Parameters

      • object: { name?: string; options?: { allowAlias?: boolean | undefined; deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; }; reservedName?: string[]; reservedRange?: { start?: number | undefined; end?: number | undefined; }[]; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[] }
        • Optional name?: string
        • Optional options?: { allowAlias?: boolean | undefined; deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; }
        • Optional reservedName?: string[]

          Reserved enum value names, which may not be reused. A given name may only be reserved once.

        • Optional reservedRange?: { start?: number | undefined; end?: number | undefined; }[]

          Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap.

        • Optional value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; } | undefined; }[]

      Returns EnumDescriptorProto

  • toJSON: function

EnumDescriptorProto_EnumReservedRange

EnumDescriptorProto_EnumReservedRange: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

EnumOptions

EnumOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
    • decode(input: Uint8Array | Reader, length?: number): EnumOptions
  • encode: function
    • encode(message: EnumOptions, writer?: Writer): Writer
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { allowAlias?: boolean; deprecated?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): EnumOptions
    • Parameters

      • object: { allowAlias?: boolean; deprecated?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional allowAlias?: boolean

          Set this option to true to allow mapping different tag names to the same value.

        • Optional deprecated?: boolean

          Is this enum deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum, or it will be completely ignored; in the very least, this is a formalization for deprecating enums.

        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

      Returns EnumOptions

  • toJSON: function

EnumValueDescriptorProto

EnumValueDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

EnumValueOptions

EnumValueOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { deprecated?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): EnumValueOptions
    • Parameters

      • object: { deprecated?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional deprecated?: boolean

          Is this enum value deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum value, or it will be completely ignored; in the very least, this is a formalization for deprecating enum values.

        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

      Returns EnumValueOptions

  • toJSON: function

ExtensionRangeOptions

ExtensionRangeOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

FieldDescriptorProto

FieldDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { defaultValue?: string; extendee?: string; jsonName?: string; label?: FieldDescriptorProto_Label; name?: string; number?: number; oneofIndex?: number; options?: { ctype?: FieldOptions_CType | undefined; packed?: boolean | undefined; jstype?: FieldOptions_JSType | undefined; lazy?: boolean | undefined; deprecated?: boolean | undefined; weak?: boolean | undefined; uninterpretedOption?: { ...; }[] | undefined; }; proto3Optional?: boolean; type?: FieldDescriptorProto_Type; typeName?: string }): FieldDescriptorProto
    • Parameters

      • object: { defaultValue?: string; extendee?: string; jsonName?: string; label?: FieldDescriptorProto_Label; name?: string; number?: number; oneofIndex?: number; options?: { ctype?: FieldOptions_CType | undefined; packed?: boolean | undefined; jstype?: FieldOptions_JSType | undefined; lazy?: boolean | undefined; deprecated?: boolean | undefined; weak?: boolean | undefined; uninterpretedOption?: { ...; }[] | undefined; }; proto3Optional?: boolean; type?: FieldDescriptorProto_Type; typeName?: string }
        • Optional defaultValue?: string

          For numeric types, contains the original text representation of the value. For booleans, "true" or "false". For strings, contains the default text contents (not escaped in any way). For bytes, contains the C escaped value. All bytes >= 128 are escaped. TODO(kenton): Base-64 encode?

        • Optional extendee?: string

          For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.

        • Optional jsonName?: string

          JSON name of this field. The value is set by protocol compiler. If the user has set a "json_name" option on this field, that option's value will be used. Otherwise, it's deduced from the field's name by converting it to camelCase.

        • Optional label?: FieldDescriptorProto_Label
        • Optional name?: string
        • Optional number?: number
        • Optional oneofIndex?: number

          If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof.

        • Optional options?: { ctype?: FieldOptions_CType | undefined; packed?: boolean | undefined; jstype?: FieldOptions_JSType | undefined; lazy?: boolean | undefined; deprecated?: boolean | undefined; weak?: boolean | undefined; uninterpretedOption?: { ...; }[] | undefined; }
        • Optional proto3Optional?: boolean

          If true, this is a proto3 "optional". When a proto3 field is optional, it tracks presence regardless of field type.

          When proto3_optional is true, this field must be belong to a oneof to signal to old proto3 clients that presence is tracked for this field. This oneof is known as a "synthetic" oneof, and this field must be its sole member (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs exist in the descriptor only, and do not generate any API. Synthetic oneofs must be ordered after all "real" oneofs.

          For message fields, proto3_optional doesn't create any semantic change, since non-repeated message fields always track presence. However it still indicates the semantic detail of whether the user wrote "optional" or not. This can be useful for round-tripping the .proto file. For consistency we give message fields a synthetic oneof also, even though it is not required to track presence. This is especially important because the parser can't tell if a field is a message or an enum, so it must always create a synthetic oneof.

          Proto2 optional fields do not set this flag, because they already indicate optional with LABEL_OPTIONAL.

        • Optional type?: FieldDescriptorProto_Type

          If type_name is set, this need not be set. If both this and type_name are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.

        • Optional typeName?: string

          For message and enum types, this is the name of the type. If the name starts with a '.', it is fully-qualified. Otherwise, C++-like scoping rules are used to find the type (i.e. first the nested types within this message are searched, then within the parent, on up to the root namespace).

      Returns FieldDescriptorProto

  • toJSON: function

FieldOptions

FieldOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
    • decode(input: Uint8Array | Reader, length?: number): FieldOptions
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { ctype?: FieldOptions_CType; deprecated?: boolean; jstype?: FieldOptions_JSType; lazy?: boolean; packed?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]; weak?: boolean }): FieldOptions
    • Parameters

      • object: { ctype?: FieldOptions_CType; deprecated?: boolean; jstype?: FieldOptions_JSType; lazy?: boolean; packed?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]; weak?: boolean }
        • Optional ctype?: FieldOptions_CType

          The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version!

        • Optional deprecated?: boolean

          Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields.

        • Optional jstype?: FieldOptions_JSType

          The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING is represented as JavaScript string, which avoids loss of precision that can happen when a large value is converted to a floating point JavaScript. Specifying JS_NUMBER for the jstype causes the generated JavaScript code to use the JavaScript "number" type. The behavior of the default option JS_NORMAL is implementation dependent.

          This option is an enum to permit additional types to be added, e.g. goog.math.Integer.

        • Optional lazy?: boolean

          Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the inner message's contents will not be parsed but instead stored in encoded form. The inner message will actually be parsed when it is first accessed.

          This is only a hint. Implementations are free to choose whether to use eager or lazy parsing regardless of the value of this option. However, setting this option true suggests that the protocol author believes that using lazy parsing on this field is worth the additional bookkeeping overhead typically needed to implement it.

          This option does not affect the public interface of any generated code; all method signatures remain the same. Furthermore, thread-safety of the interface is not affected by this option; const methods remain safe to call from multiple threads concurrently, while non-const methods continue to require exclusive access.

          Note that implementations may choose not to check required fields within a lazy sub-message. That is, calling IsInitialized() on the outer message may return true even if the inner message has missing required fields. This is necessary because otherwise the inner message would have to be parsed in order to perform the check, defeating the purpose of lazy parsing. An implementation which chooses not to check required fields must be consistent about it. That is, for any particular sub-message, the implementation must either always check its required fields, or never check its required fields, regardless of whether or not the message has been parsed.

        • Optional packed?: boolean

          The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly writing the tag and type for each element, the entire array is encoded as a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding.

        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

        • Optional weak?: boolean

          For Google-internal migration only. Do not use.

      Returns FieldOptions

  • toJSON: function

FileDescriptorProto

FileDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { dependency?: string[]; enumType?: { name?: string | undefined; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | u...[]; extension?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]; messageType?: { name?: string | undefined; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[] | undefined; ... 7 more ...; reservedName?: string[] | undefined; }[]; name?: string; options?: { javaPackage?: string | undefined; javaOuterClassname?: string | undefined; javaMultipleFiles?: boolean | undefined; javaGenerateEqualsAndHash?: boolean | undefined; javaStringCheckUtf8?: boolean | undefined; ... 15 more ...; uninterpretedOption?: { ...; }[] | undefined; }; package?: string; publicDependency?: number[]; service?: { name?: string | undefined; method?: { name?: string | undefined; inputType?: string | undefined; outputType?: string | undefined; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { ...; }[] | undefined; } | undefined; clientStreaming...[]; sourceCodeInfo?: { location?: { path?: number[] | undefined; span?: number[] | undefined; leadingComments?: string | undefined; trailingComments?: string | undefined; leadingDetachedComments?: string[] | undefined; }[] | undefined; }; syntax?: string; weakDependency?: number[] }): FileDescriptorProto
    • Parameters

      • object: { dependency?: string[]; enumType?: { name?: string | undefined; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | u...[]; extension?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]; messageType?: { name?: string | undefined; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[] | undefined; ... 7 more ...; reservedName?: string[] | undefined; }[]; name?: string; options?: { javaPackage?: string | undefined; javaOuterClassname?: string | undefined; javaMultipleFiles?: boolean | undefined; javaGenerateEqualsAndHash?: boolean | undefined; javaStringCheckUtf8?: boolean | undefined; ... 15 more ...; uninterpretedOption?: { ...; }[] | undefined; }; package?: string; publicDependency?: number[]; service?: { name?: string | undefined; method?: { name?: string | undefined; inputType?: string | undefined; outputType?: string | undefined; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { ...; }[] | undefined; } | undefined; clientStreaming...[]; sourceCodeInfo?: { location?: { path?: number[] | undefined; span?: number[] | undefined; leadingComments?: string | undefined; trailingComments?: string | undefined; leadingDetachedComments?: string[] | undefined; }[] | undefined; }; syntax?: string; weakDependency?: number[] }
        • Optional dependency?: string[]

          Names of files imported by this file.

        • Optional enumType?: { name?: string | undefined; value?: { name?: string | undefined; number?: number | undefined; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | u...[]
        • Optional extension?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[]
        • Optional messageType?: { name?: string | undefined; field?: { name?: string | undefined; number?: number | undefined; label?: FieldDescriptorProto_Label | undefined; type?: FieldDescriptorProto_Type | undefined; ... 6 more ...; proto3Optional?: boolean | undefined; }[] | undefined; ... 7 more ...; reservedName?: string[] | undefined; }[]

          All top-level definitions in this file.

        • Optional name?: string

          file name, relative to root of source tree

        • Optional options?: { javaPackage?: string | undefined; javaOuterClassname?: string | undefined; javaMultipleFiles?: boolean | undefined; javaGenerateEqualsAndHash?: boolean | undefined; javaStringCheckUtf8?: boolean | undefined; ... 15 more ...; uninterpretedOption?: { ...; }[] | undefined; }
        • Optional package?: string

          e.g. "foo", "foo.bar", etc.

        • Optional publicDependency?: number[]

          Indexes of the public imported files in the dependency list above.

        • Optional service?: { name?: string | undefined; method?: { name?: string | undefined; inputType?: string | undefined; outputType?: string | undefined; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { ...; }[] | undefined; } | undefined; clientStreaming...[]
        • Optional sourceCodeInfo?: { location?: { path?: number[] | undefined; span?: number[] | undefined; leadingComments?: string | undefined; trailingComments?: string | undefined; leadingDetachedComments?: string[] | undefined; }[] | undefined; }

          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.

        • Optional syntax?: string

          The syntax of the proto file. The supported values are "proto2" and "proto3".

        • Optional weakDependency?: number[]

          Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.

      Returns FileDescriptorProto

  • toJSON: function

FileDescriptorSet

FileDescriptorSet: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

FileOptions

FileOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
    • decode(input: Uint8Array | Reader, length?: number): FileOptions
  • encode: function
    • encode(message: FileOptions, writer?: Writer): Writer
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { ccEnableArenas?: boolean; ccGenericServices?: boolean; csharpNamespace?: string; deprecated?: boolean; goPackage?: string; javaGenerateEqualsAndHash?: boolean; javaGenericServices?: boolean; javaMultipleFiles?: boolean; javaOuterClassname?: string; javaPackage?: string; javaStringCheckUtf8?: boolean; objcClassPrefix?: string; optimizeFor?: FileOptions_OptimizeMode; phpClassPrefix?: string; phpGenericServices?: boolean; phpMetadataNamespace?: string; phpNamespace?: string; pyGenericServices?: boolean; rubyPackage?: string; swiftPrefix?: string; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): FileOptions
    • Parameters

      • object: { ccEnableArenas?: boolean; ccGenericServices?: boolean; csharpNamespace?: string; deprecated?: boolean; goPackage?: string; javaGenerateEqualsAndHash?: boolean; javaGenericServices?: boolean; javaMultipleFiles?: boolean; javaOuterClassname?: string; javaPackage?: string; javaStringCheckUtf8?: boolean; objcClassPrefix?: string; optimizeFor?: FileOptions_OptimizeMode; phpClassPrefix?: string; phpGenericServices?: boolean; phpMetadataNamespace?: string; phpNamespace?: string; pyGenericServices?: boolean; rubyPackage?: string; swiftPrefix?: string; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional ccEnableArenas?: boolean

          Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++.

        • Optional ccGenericServices?: boolean

          Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the main code generators in each language (without additional plugins). Generic services were the only kind of service generation supported by early versions of google.protobuf.

          Generic services are now considered deprecated in favor of using plugins that generate code specific to your particular RPC system. Therefore, these default to false. Old code which depends on generic services should explicitly set them to true.

        • Optional csharpNamespace?: string

          Namespace for generated classes; defaults to the package.

        • Optional deprecated?: boolean

          Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files.

        • Optional goPackage?: string

          Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following:

          • The basename of the package import path, if provided.
          • Otherwise, the package statement in the .proto file, if present.
          • Otherwise, the basename of the .proto file, without extension.
        • Optional javaGenerateEqualsAndHash?: boolean

          This option does nothing.

          deprecated
        • Optional javaGenericServices?: boolean
        • Optional javaMultipleFiles?: boolean

          If set true, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto file. Thus, these types will not be nested inside the outer class named by java_outer_classname. However, the outer class will still be generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file.

        • Optional javaOuterClassname?: string

          If set, all the classes from the .proto file are wrapped in a single outer class with the given name. This applies to both Proto1 (equivalent to the old "--one_java_file" option) and Proto2 (where a .proto always translates to a single class, but you may want to explicitly choose the class name).

        • Optional javaPackage?: string

          Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names.

        • Optional javaStringCheckUtf8?: boolean

          If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 byte sequence to a string field. Message reflection will do the same. However, an extension field still accepts non-UTF-8 byte sequences. This option has no effect on when used with the lite runtime.

        • Optional objcClassPrefix?: string

          Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default.

        • Optional optimizeFor?: FileOptions_OptimizeMode
        • Optional phpClassPrefix?: string

          Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty.

        • Optional phpGenericServices?: boolean
        • Optional phpMetadataNamespace?: string

          Use this option to change the namespace of php generated metadata classes. Default is empty. When this option is empty, the proto file name will be used for determining the namespace.

        • Optional phpNamespace?: string

          Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.

        • Optional pyGenericServices?: boolean
        • Optional rubyPackage?: string

          Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package.

        • Optional swiftPrefix?: string

          By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined.

        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See the documentation for the "Options" section above.

      Returns FileOptions

  • toJSON: function

GeneratedCodeInfo

GeneratedCodeInfo: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

GeneratedCodeInfo_Annotation

GeneratedCodeInfo_Annotation: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

MessageOptions

MessageOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { deprecated?: boolean; mapEntry?: boolean; messageSetWireFormat?: boolean; noStandardDescriptorAccessor?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): MessageOptions
    • Parameters

      • object: { deprecated?: boolean; mapEntry?: boolean; messageSetWireFormat?: boolean; noStandardDescriptorAccessor?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional deprecated?: boolean

          Is this message deprecated? Depending on the target platform, this can emit Deprecated annotations for the message, or it will be completely ignored; in the very least, this is a formalization for deprecating messages.

        • Optional mapEntry?: boolean

          Whether the message is an automatically generated map entry type for the maps field.

          For maps fields: map<KeyType, ValueType> map_field = 1; The parsed descriptor looks like: message MapFieldEntry { option map_entry = true; optional KeyType key = 1; optional ValueType value = 2; } repeated MapFieldEntry map_field = 1;

          Implementations may choose not to generate the map_entry=true message, but use a native map in the target language to hold the keys and values. The reflection APIs in such implementations still need to work as if the field is a repeated message field.

          NOTE: Do not set the option in .proto files. Always use the maps syntax instead. The option should only be implicitly set by the proto compiler parser.

        • Optional messageSetWireFormat?: boolean

          Set true to use the old proto1 MessageSet wire format for extensions. This is provided for backwards-compatibility with the MessageSet wire format. You should not use this for any other reason: It's less efficient, has fewer features, and is more complicated.

          The message must be defined exactly as follows: message Foo { option message_set_wire_format = true; extensions 4 to max; } Note that the message cannot have any defined fields; MessageSets only have extensions.

          All extensions of your type must be singular messages; e.g. they cannot be int32s, enums, or repeated messages.

          Because this is an option, the above two restrictions are not enforced by the protocol compiler.

        • Optional noStandardDescriptorAccessor?: boolean

          Disables the generation of the standard "descriptor()" accessor, which can conflict with a field of the same name. This is meant to make migration from proto1 easier; new code should avoid fields named "descriptor".

        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

      Returns MessageOptions

  • toJSON: function

MethodDescriptorProto

MethodDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { clientStreaming?: boolean; inputType?: string; name?: string; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; }; outputType?: string; serverStreaming?: boolean }): MethodDescriptorProto
    • Parameters

      • object: { clientStreaming?: boolean; inputType?: string; name?: string; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; }; outputType?: string; serverStreaming?: boolean }
        • Optional clientStreaming?: boolean

          Identifies if client streams multiple client messages

        • Optional inputType?: string

          Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

        • Optional name?: string
        • Optional options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; ... 5 more ...; aggregateValue?: string | undefined; }[] | undefined; }
        • Optional outputType?: string
        • Optional serverStreaming?: boolean

          Identifies if server streams multiple server messages

      Returns MethodDescriptorProto

  • toJSON: function

MethodOptions

MethodOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
    • decode(input: Uint8Array | Reader, length?: number): MethodOptions
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { deprecated?: boolean; idempotencyLevel?: MethodOptions_IdempotencyLevel; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): MethodOptions
    • Parameters

      • object: { deprecated?: boolean; idempotencyLevel?: MethodOptions_IdempotencyLevel; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional deprecated?: boolean

          Is this method deprecated? Depending on the target platform, this can emit Deprecated annotations for the method, or it will be completely ignored; in the very least, this is a formalization for deprecating methods.

        • Optional idempotencyLevel?: MethodOptions_IdempotencyLevel
        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

      Returns MethodOptions

  • toJSON: function

OneofDescriptorProto

OneofDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

OneofOptions

OneofOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
    • decode(input: Uint8Array | Reader, length?: number): OneofOptions
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): OneofOptions
    • Parameters

      • object: { uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

      Returns OneofOptions

  • toJSON: function

ServiceDescriptorProto

ServiceDescriptorProto: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { method?: { name?: string | undefined; inputType?: string | undefined; outputType?: string | undefined; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { ...; }[] | undefined; } | undefined; clientStreaming?: boolean | undefined; serverStreamin...[]; name?: string; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } }): ServiceDescriptorProto
    • Parameters

      • object: { method?: { name?: string | undefined; inputType?: string | undefined; outputType?: string | undefined; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { ...; }[] | undefined; } | undefined; clientStreaming?: boolean | undefined; serverStreamin...[]; name?: string; options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; } }
        • Optional method?: { name?: string | undefined; inputType?: string | undefined; outputType?: string | undefined; options?: { deprecated?: boolean | undefined; idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; uninterpretedOption?: { ...; }[] | undefined; } | undefined; clientStreaming?: boolean | undefined; serverStreamin...[]
        • Optional name?: string
        • Optional options?: { deprecated?: boolean | undefined; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; ... 4 more ...; aggregateValue?: string | undefined; }[] | undefined; }

      Returns ServiceDescriptorProto

  • toJSON: function

ServiceOptions

ServiceOptions: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { deprecated?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }): ServiceOptions
    • Parameters

      • object: { deprecated?: boolean; uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[] }
        • Optional deprecated?: boolean

          Is this service deprecated? Depending on the target platform, this can emit Deprecated annotations for the service, or it will be completely ignored; in the very least, this is a formalization for deprecating services.

        • Optional uninterpretedOption?: { name?: { namePart?: string | undefined; isExtension?: boolean | undefined; }[] | undefined; identifierValue?: string | undefined; positiveIntValue?: number | undefined; negativeIntValue?: number | undefined; doubleValue?: number | undefined; stringValue?: Uint8Array | undefined; aggregateValue?: string | undefined...[]

          The parser stores options it doesn't recognize here. See above.

      Returns ServiceOptions

  • toJSON: function

SourceCodeInfo

SourceCodeInfo: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { location?: { path?: number[] | undefined; span?: number[] | undefined; leadingComments?: string | undefined; trailingComments?: string | undefined; leadingDetachedComments?: string[] | undefined; }[] }): SourceCodeInfo
    • Parameters

      • object: { location?: { path?: number[] | undefined; span?: number[] | undefined; leadingComments?: string | undefined; trailingComments?: string | undefined; leadingDetachedComments?: string[] | undefined; }[] }
        • Optional location?: { path?: number[] | undefined; span?: number[] | undefined; leadingComments?: string | undefined; trailingComments?: string | undefined; leadingDetachedComments?: string[] | undefined; }[]

          A Location identifies a piece of source code in a .proto file which corresponds to a particular definition. This information is intended to be useful to IDEs, code indexers, documentation generators, and similar tools.

          For example, say we have a file like: message Foo { optional string foo = 1; } Let's look at just the field definition: optional string foo = 1; ^ ^^ ^^ ^ ^^^ a bc de f ghi We have the following locations: span path represents [a,i) [ 4, 0, 2, 0 ] The whole field definition. [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). [c,d) [ 4, 0, 2, 0, 5 ] The type (string). [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). [g,h) [ 4, 0, 2, 0, 3 ] The number (1).

          Notes:

          • A location may refer to a repeated field itself (i.e. not to any particular index within it). This is used whenever a set of elements are logically enclosed in a single code segment. For example, an entire extend block (possibly containing multiple extension definitions) will have an outer location whose path refers to the "extensions" repeated field without an index.
          • Multiple locations may have the same path. This happens when a single logical declaration is spread out across multiple places. The most obvious example is the "extend" block again -- there may be multiple extend blocks in the same scope, each of which will have the same path.
          • A location's span is not always a subset of its parent's span. For example, the "extendee" of an extension declaration appears at the beginning of the "extend" block and is shared by all extensions within the block.
          • Just because a location's span is a subset of some other location's span does not mean that it is a descendant. For example, a "group" defines both a type and a field in a single declaration. Thus, the locations corresponding to the type and field and their components will overlap.
          • Code which tries to interpret locations should probably be designed to ignore those that it doesn't understand, as more types of locations could be recorded in the future.

      Returns SourceCodeInfo

  • toJSON: function

SourceCodeInfo_Location

SourceCodeInfo_Location: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

  • decode: function
  • encode: function
  • fromJSON: function
  • fromPartial: function
    • fromPartial(object: { leadingComments?: string; leadingDetachedComments?: string[]; path?: number[]; span?: number[]; trailingComments?: string }): SourceCodeInfo_Location
    • Parameters

      • object: { leadingComments?: string; leadingDetachedComments?: string[]; path?: number[]; span?: number[]; trailingComments?: string }
        • Optional leadingComments?: string

          If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration.

          A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment.

          leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field.

          Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output.

          Examples:

          optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2;

          optional string baz = 3; // Comment attached to baz. // Another line attached to baz.

          // Comment attached to qux. // // Another line attached to qux. optional double qux = 4;

          // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both.

          // Detached comment for corge paragraph 2.

          optional string corge = 5; /* Block comment attached

          • to corge. Leading asterisks
          • will be removed. * / /* Block comment attached to
          • grault. * / optional int32 grault = 6;

          // ignored detached comments.

        • Optional leadingDetachedComments?: string[]
        • Optional path?: number[]

          Identifies which part of the FileDescriptorProto was defined at this location.

          Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1;

          Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

        • Optional span?: number[]

          Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

        • Optional trailingComments?: string

      Returns SourceCodeInfo_Location

  • toJSON: function

UninterpretedOption

UninterpretedOption: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

UninterpretedOption_NamePart

UninterpretedOption_NamePart: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }

Type declaration

Const protobufPackage

protobufPackage: "google.protobuf" = 'google.protobuf'

Functions

fieldDescriptorProto_LabelFromJSON

fieldDescriptorProto_LabelToJSON

fieldDescriptorProto_TypeFromJSON

fieldDescriptorProto_TypeToJSON

fieldOptions_CTypeFromJSON

fieldOptions_CTypeToJSON

fieldOptions_JSTypeFromJSON

fieldOptions_JSTypeToJSON

fileOptions_OptimizeModeFromJSON

fileOptions_OptimizeModeToJSON

methodOptions_IdempotencyLevelFromJSON

methodOptions_IdempotencyLevelToJSON

Generated using TypeDoc