import { Chalk } from 'chalk';
import * as ZB from '../lib/interfaces';
import { ZBLogger } from '../lib/ZBLogger';
import { ZBClient } from './ZBClient';
export declare class ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables> {
    activeJobs: number;
    gRPCClient: any;
    maxActiveJobs: number;
    taskType: string;
    timeout: number;
    private closeCallback?;
    private closePromise?;
    private closing;
    private closed;
    private errored;
    private id;
    private onConnectionErrorHandler?;
    private pollHandle?;
    private pollInterval;
    private taskHandler;
    private cancelWorkflowOnException;
    private zbClient;
    private logger;
    constructor({ gRPCClient, id, idColor, onConnectionError, options, taskHandler, taskType, zbClient, }: {
        gRPCClient: any;
        id: string;
        taskType: string;
        taskHandler: ZB.ZBWorkerTaskHandler<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>;
        options: ZB.ZBWorkerOptions & ZB.ZBClientOptions;
        idColor: Chalk;
        onConnectionError: ZB.ConnectionErrorHandler | undefined;
        zbClient: ZBClient;
    });
    /**
     * Returns a promise that the worker has stopped accepting tasks and
     * has drained all current active tasks. Will reject if you try to call it more than once.
     */
    close(): Promise<undefined>;
    work: () => void;
    completeJob(completeJobRequest: ZB.CompleteJobRequest): Promise<void>;
    onConnectionError(handler: (error: any) => void): void;
    log(msg: any): void;
    getNewLogger(options: ZB.ZBWorkerLoggerOptions): ZBLogger;
    private internalLog;
    private handleGrpcError;
    private activateJobs;
    private drainOne;
}
