from _typeshed import Unused
from typing import Any
from typing_extensions import Self

from .descriptor import (
    Descriptor,
    EnumDescriptor,
    FieldDescriptor,
    FileDescriptor,
    MethodDescriptor,
    OneofDescriptor,
    ServiceDescriptor,
)
from .descriptor_pb2 import FeatureSetDefaults, FileDescriptorProto

class DescriptorPool:
    def __new__(cls, descriptor_db: Any = None) -> Self: ...
    def __init__(  # pyright: ignore[reportInconsistentConstructor]
        self, descriptor_db: Any = None, use_deprecated_legacy_json_field_conflicts: Unused = False
    ) -> None: ...
    def Add(self, file_desc_proto: FileDescriptorProto) -> None: ...
    def AddSerializedFile(self, serialized_file_desc_proto: bytes) -> FileDescriptor: ...
    def FindFileByName(self, file_name: str) -> FileDescriptor: ...
    def FindFileContainingSymbol(self, symbol: str) -> FileDescriptor: ...
    def FindMessageTypeByName(self, full_name: str) -> Descriptor: ...
    def FindEnumTypeByName(self, full_name: str) -> EnumDescriptor: ...
    def FindFieldByName(self, full_name: str) -> FieldDescriptor: ...
    def FindOneofByName(self, full_name: str) -> OneofDescriptor: ...
    def FindExtensionByName(self, full_name: str) -> FieldDescriptor: ...
    def FindExtensionByNumber(self, message_descriptor: Descriptor, number: int) -> FieldDescriptor: ...
    def FindAllExtensions(self, message_descriptor: Descriptor) -> list[FieldDescriptor]: ...
    def FindServiceByName(self, full_name: str) -> ServiceDescriptor: ...
    def FindMethodByName(self, full_name: str) -> MethodDescriptor: ...
    def SetFeatureSetDefaults(self, defaults: FeatureSetDefaults) -> None: ...

def Default() -> DescriptorPool: ...
