/// <reference types="node" />
/// <reference types="node" />
import { EventEmitter } from 'events';
import { Client } from '@grpc/grpc-js';
import { VerifyOptions } from '@grpc/grpc-js/build/src/channel-credentials';
import { Options } from '@grpc/proto-loader';
import { MaybeTimeDuration } from 'typed-duration';
import { CamundaPlatform8Configuration } from '../../lib';
import { IOAuthProvider } from '../../oauth';
import { Loglevel, ZBCustomLogger } from './interfaces-published-contract';
export interface GrpcClientExtendedOptions {
    longPoll?: MaybeTimeDuration;
    pollInterval?: MaybeTimeDuration;
}
export declare const MiddlewareSignals: {
    Log: {
        Error: string;
        Info: string;
        Debug: string;
    };
    Event: {
        Error: string;
        Ready: string;
        GrpcInterceptError: string;
    };
};
export interface GrpcClientCtor {
    config: CamundaPlatform8Configuration;
    connectionTolerance: MaybeTimeDuration;
    host: string;
    loglevel: Loglevel;
    oAuth?: IOAuthProvider;
    options: Options & GrpcClientExtendedOptions;
    packageName: string;
    protoPath: string;
    service: string;
    namespace: string;
    tasktype?: string;
    useTLS: boolean;
    stdout: ZBCustomLogger;
    customSSL?: CustomSSL;
}
export interface CustomSSL {
    rootCerts?: Buffer;
    privateKey?: Buffer;
    certChain?: Buffer;
    verifyOptions?: VerifyOptions;
}
export declare class GrpcClient extends EventEmitter {
    channelClosed: boolean;
    longPoll?: MaybeTimeDuration;
    connected: boolean;
    client: Client;
    host: string;
    private closing;
    private channelState;
    private packageDefinition;
    private listNameMethods;
    private gRPCRetryCount;
    private oAuth?;
    private readyTimer?;
    private failTimer?;
    private connectionTolerance;
    private userAgentString;
    private config;
    constructor({ config, connectionTolerance, host, oAuth, options, packageName, protoPath, service, useTLS, customSSL, }: GrpcClientCtor);
    runService(fnName: any, data: any, fnAnswer: any): void;
    listMethods(): string[];
    close(timeout?: number): Promise<void>;
    private getAuthToken;
    private waitForGrpcChannelReconnect;
    private setReady;
    private setNotReady;
    private interceptor;
}
