Interface DescFile

Describes a protobuf source file.

interface DescFile {
    dependencies: DescFile[];
    deprecated: boolean;
    edition: EDITION_UNKNOWN | EDITION_LEGACY | EDITION_PROTO2 | EDITION_PROTO3 | EDITION_2023 | EDITION_2024 | EDITION_MAX;
    enums: DescEnum[];
    extensions: DescExtension[];
    kind: "file";
    messages: DescMessage[];
    name: string;
    proto: FileDescriptorProto;
    services: DescService[];
    syntax: "proto3" | "proto2" | "editions";
    getFeatures(): MergedFeatureSet;
    getPackageComments(): DescComments;
    getSyntaxComments(): DescComments;
    toString(): string;
}

Properties

dependencies: DescFile[]

Files imported by this file.

deprecated: boolean

Marked as deprecated in the protobuf source.

The edition of the protobuf file. Will be EDITION_PROTO2 for syntax="proto2", EDITION_PROTO3 for syntax="proto3";

enums: DescEnum[]

Top-level enumerations declared in this file. Note that more enumerations might be declared within message declarations.

extensions: DescExtension[]

Top-level extensions declared in this file. Note that more extensions might be declared within message declarations.

kind: "file"
messages: DescMessage[]

Top-level messages declared in this file. Note that more messages might be declared within message declarations.

name: string

The name of the file, excluding the .proto suffix. For a protobuf file foo/bar.proto, this is foo/bar.

The compiler-generated descriptor.

services: DescService[]

Services declared in this file.

syntax: "proto3" | "proto2" | "editions"

The syntax specified in the protobuf source.

Methods

  • Get the edition features for this protobuf element.

    Returns MergedFeatureSet

  • Get comments on the package element in the protobuf source.

    Returns DescComments

  • Get comments on the syntax element in the protobuf source.

    Returns DescComments

  • Returns string