import { ChannelCredentials, Client, Metadata, requestCallback, ClientWritableStream, ClientReadableStream, ClientDuplexStream, Channel } from "grpc";
import EnvoyContext from "./envoy-context";
import { EnvoyGrpcRequestInit } from "./envoy-grpc-request-params";
/**
 * the HTTP header signature
 */
export interface HttpHeader {
    [s: string]: string | string[];
}
/**
 * original constructor of gRPC
 */
export declare type ClientConstructor = new (address: string, credentials: ChannelCredentials, options?: object) => Client;
/**
 * the API call
 * @param request the request body
 * @param options the option like timeout, retry, etc.
 */
export declare type RequestFunc = (request: any, options?: EnvoyGrpcRequestInit) => Promise<any>;
export declare type ClientStreamFunc = (callback: requestCallback<any>, options?: EnvoyGrpcRequestInit) => ClientWritableStream<any>;
export declare type ServerStreamFunc = (request: any, options?: EnvoyGrpcRequestInit) => ClientReadableStream<any>;
export declare type BidiStreamFunc = (options?: EnvoyGrpcRequestInit) => ClientDuplexStream<any, any>;
export interface EnvoyClientFuncEnabled {
    /**
     * the API signature, dynamic attached for each gRPC request
     */
    [methodName: string]: RequestFunc | ClientStreamFunc | ServerStreamFunc | BidiStreamFunc | any;
}
/**
 * the envoy client for gRPC
 */
export interface EnvoyClient extends Client, EnvoyClientFuncEnabled {
    /**
     * the original target remote address (hostname:port)
     */
    readonly originalAddress: string;
    /**
     * the envoy context of this client
     */
    readonly envoyContext: EnvoyContext;
}
/**
 * the wrapped class generator of EnvoyClient
 * create a new instance of Envoy client
 * @param address the address of remote target server
 * @param ctx the context, you can either tell me EnvoyContext, grpc.Metadata, or HttpHeader.
 *  for the last two option, I will create EnvoyContext base of them.
 */
export declare type EnvoyClientConstructor<T extends EnvoyClient> = new (address: string, ctx: EnvoyContext | Metadata | HttpHeader) => T;
export declare type ChannelFactoryOverride = (target: string, credentials: ChannelCredentials, options: {
    [key: string]: string | number;
}) => Channel;
