import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import type { CallContext, CallOptions } from "nice-grpc-common";
import type { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors";
export declare const protobufPackage = "grpc.reflection.v1";
/** The message sent by the client when calling ServerReflectionInfo method. */
export interface ServerReflectionRequest {
    host?: string | undefined;
    /** Find a proto file by the file name. */
    fileByFilename?: string | undefined;
    /**
     * Find the proto file that declares the given fully-qualified symbol name.
     * This field should be a fully-qualified symbol name
     * (e.g. <package>.<service>[.<method>] or <package>.<type>).
     */
    fileContainingSymbol?: string | undefined;
    /**
     * Find the proto file which defines an extension extending the given
     * message type with the given field number.
     */
    fileContainingExtension?: ExtensionRequest | undefined;
    /**
     * Finds the tag numbers used by all known extensions of the given message
     * type, and appends them to ExtensionNumberResponse in an undefined order.
     * Its corresponding method is best-effort: it's not guaranteed that the
     * reflection service will implement this method, and it's not guaranteed
     * that this method will provide all extensions. Returns
     * StatusCode::UNIMPLEMENTED if it's not implemented.
     * This field should be a fully-qualified type name. The format is
     * <package>.<type>
     */
    allExtensionNumbersOfType?: string | undefined;
    /**
     * List the full names of registered services. The content will not be
     * checked.
     */
    listServices?: string | undefined;
}
/**
 * The type name and extension number sent by the client when requesting
 * file_containing_extension.
 */
export interface ExtensionRequest {
    /** Fully-qualified type name. The format should be <package>.<type> */
    containingType?: string | undefined;
    extensionNumber?: number | undefined;
}
/** The message sent by the server to answer ServerReflectionInfo method. */
export interface ServerReflectionResponse {
    validHost?: string | undefined;
    originalRequest?: ServerReflectionRequest | undefined;
    /**
     * This message is used to answer file_by_filename, file_containing_symbol,
     * file_containing_extension requests with transitive dependencies.
     * As the repeated label is not allowed in oneof fields, we use a
     * FileDescriptorResponse message to encapsulate the repeated fields.
     * The reflection service is allowed to avoid sending FileDescriptorProtos
     * that were previously sent in response to earlier requests in the stream.
     */
    fileDescriptorResponse?: FileDescriptorResponse | undefined;
    /** This message is used to answer all_extension_numbers_of_type requests. */
    allExtensionNumbersResponse?: ExtensionNumberResponse | undefined;
    /** This message is used to answer list_services requests. */
    listServicesResponse?: ListServiceResponse | undefined;
    /** This message is used when an error occurs. */
    errorResponse?: ErrorResponse | undefined;
}
/**
 * Serialized FileDescriptorProto messages sent by the server answering
 * a file_by_filename, file_containing_symbol, or file_containing_extension
 * request.
 */
export interface FileDescriptorResponse {
    /**
     * Serialized FileDescriptorProto messages. We avoid taking a dependency on
     * descriptor.proto, which uses proto2 only features, by making them opaque
     * bytes instead.
     */
    fileDescriptorProto?: Buffer[] | undefined;
}
/**
 * A list of extension numbers sent by the server answering
 * all_extension_numbers_of_type request.
 */
export interface ExtensionNumberResponse {
    /**
     * Full name of the base type, including the package name. The format
     * is <package>.<type>
     */
    baseTypeName?: string | undefined;
    extensionNumber?: number[] | undefined;
}
/** A list of ServiceResponse sent by the server answering list_services request. */
export interface ListServiceResponse {
    /**
     * The information of each service may be expanded in the future, so we use
     * ServiceResponse message to encapsulate it.
     */
    service?: ServiceResponse[] | undefined;
}
/**
 * The information of a single service used by ListServiceResponse to answer
 * list_services request.
 */
export interface ServiceResponse {
    /**
     * Full name of a registered service, including its package name. The format
     * is <package>.<service>
     */
    name?: string | undefined;
}
/** The error code and error message sent by the server when an error occurs. */
export interface ErrorResponse {
    /** This field uses the error codes defined in grpc::StatusCode. */
    errorCode?: number | undefined;
    errorMessage?: string | undefined;
}
export declare const ServerReflectionRequest: MessageFns<ServerReflectionRequest>;
export declare const ExtensionRequest: MessageFns<ExtensionRequest>;
export declare const ServerReflectionResponse: MessageFns<ServerReflectionResponse>;
export declare const FileDescriptorResponse: MessageFns<FileDescriptorResponse>;
export declare const ExtensionNumberResponse: MessageFns<ExtensionNumberResponse>;
export declare const ListServiceResponse: MessageFns<ListServiceResponse>;
export declare const ServiceResponse: MessageFns<ServiceResponse>;
export declare const ErrorResponse: MessageFns<ErrorResponse>;
export type ServerReflectionDefinition = typeof ServerReflectionDefinition;
export declare const ServerReflectionDefinition: {
    readonly name: "ServerReflection";
    readonly fullName: "grpc.reflection.v1.ServerReflection";
    readonly methods: {
        /**
         * The reflection service is structured as a bidirectional stream, ensuring
         * all related requests go to a single server.
         */
        readonly serverReflectionInfo: {
            readonly name: "ServerReflectionInfo";
            readonly requestType: typeof ServerReflectionRequest;
            readonly requestStream: true;
            readonly responseType: typeof ServerReflectionResponse;
            readonly responseStream: true;
            readonly options: {};
        };
    };
};
export interface ServerReflectionServiceImplementation<CallContextExt = {}> {
    /**
     * The reflection service is structured as a bidirectional stream, ensuring
     * all related requests go to a single server.
     */
    serverReflectionInfo(request: AsyncIterable<ServerReflectionRequest>, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<ServerReflectionResponse>>;
}
export interface ServerReflectionClient<CallOptionsExt = {}> {
    /**
     * The reflection service is structured as a bidirectional stream, ensuring
     * all related requests go to a single server.
     */
    serverReflectionInfo(request: AsyncIterable<DeepPartial<ServerReflectionRequest>>, options?: CallOptions & CallOptionsExt): AsyncIterable<ServerReflectionResponse>;
}
type ProtoMetaMessageOptions = {
    options?: {
        [key: string]: any;
    };
    fields?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    oneof?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    nested?: {
        [key: string]: ProtoMetaMessageOptions;
    };
};
export interface ProtoMetadata {
    fileDescriptor: FileDescriptorProto1;
    references: {
        [key: string]: any;
    };
    dependencies?: ProtoMetadata[];
    options?: {
        options?: {
            [key: string]: any;
        };
        services?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                methods?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
        messages?: {
            [key: string]: ProtoMetaMessageOptions;
        };
        enums?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                values?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
    };
}
export declare const protoMetadata: ProtoMetadata;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export type ServerStreamingMethodResult<Response> = {
    [Symbol.asyncIterator](): AsyncIterator<Response, void>;
};
export interface MessageFns<T> {
    encode(message: T, writer?: BinaryWriter): BinaryWriter;
    decode(input: BinaryReader | Uint8Array, length?: number): T;
    fromJSON(object: any): T;
    toJSON(message: T): unknown;
    create(base?: DeepPartial<T>): T;
    fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=reflection.d.ts.map