import { type GraphQLFieldResolver, type GraphQLSchema } from 'graphql';
import type protobufjs from 'protobufjs';
import type { Logger } from '@graphql-mesh/types';
import { type MaybePromise } from '@graphql-tools/utils';
import type { ChannelCredentials } from '@grpc/grpc-js';
import { loadPackageDefinition } from '@grpc/grpc-js';
import type { ServiceClient } from '@grpc/grpc-js/build/src/make-client.cjs';
import { DisposableStack } from '@whatwg-node/disposablestack';
import './patchLongJs.cjs';
/**
 * SSL Credentials
 */
interface GrpcCredentialsSsl {
    rootCA?: string;
    certChain?: string;
    privateKey?: string;
}
export interface gRPCTransportOptions {
    /**
     * Request timeout in milliseconds
     * Default: 200000
     */
    requestTimeout?: number;
    credentialsSsl?: GrpcCredentialsSsl;
    /**
     * Use https instead of http for gRPC connection
     */
    useHTTPS?: boolean;
    /**
     * MetaData
     */
    metaData?: {
        [k: string]: any;
    };
}
interface LoadOptions {
    includeDirs?: string[];
}
export declare class GrpcTransportHelper extends DisposableStack {
    private subgraphName;
    private baseDir;
    private logger;
    private endpoint;
    private config;
    constructor(subgraphName: string, baseDir: string, logger: Logger, endpoint: string, config: gRPCTransportOptions);
    getCredentials(): MaybePromise<ChannelCredentials>;
    getGrpcObject({ rootJson, loadOptions, rootLogger, }: {
        rootJson: protobufjs.INamespace;
        loadOptions: LoadOptions;
        rootLogger: Logger;
    }): import("@grpc/grpc-js").GrpcObject;
    private grpcObjectByserviceClientByObjPath;
    getServiceClient({ grpcObject, objPath, creds, }: {
        grpcObject: ReturnType<typeof loadPackageDefinition>;
        objPath: string;
        creds: ChannelCredentials;
    }): ServiceClient;
    getFieldResolver({ client, methodName, isResponseStream, }: {
        client: ServiceClient;
        methodName: string;
        isResponseStream: boolean;
    }): GraphQLFieldResolver<any, any>;
    getConnectivityStateResolver({ client, }: {
        client: ServiceClient;
    }): GraphQLFieldResolver<any, any>;
    processDirectives({ schema, creds }: {
        schema: GraphQLSchema;
        creds: ChannelCredentials;
    }): void;
}
declare const _default: {
    getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }: import("@graphql-mesh/transport-common").TransportGetSubgraphExecutorOptions<gRPCTransportOptions>): MaybePromise<import("@graphql-mesh/transport-common").Executor & Disposable>;
};
export default _default;
