/// <reference types="node" />
import { Logger } from "../shared/Logger";
import { StatsdExporter } from "../shared/StatsdExporter";
import { StatsSink } from "../stats";
import { EventEmitter } from "events";
export interface SyncWorkerConfiguration {
    serviceName: string;
    endpointsName: string;
    dataPath: string;
    syncWorkerGroup: string;
    featureToken: string;
    syncWorkerId: string;
    publicKeyPath: string;
    kubernetesConfig: any;
    logLevel: string;
    enableDownloadLogCompaction?: boolean;
    maxDownloadSize?: number;
    podIp: string;
    podRef: any;
    nodeName: string;
    disableSlave?: boolean;
    disableDiskStats?: boolean;
}
export interface SyncWorkerStartParams {
    logger: Logger;
    statsSink: StatsSink;
    statsdExporter?: StatsdExporter;
    disableWatcher?: boolean;
}
export interface EndpointsMetadata extends Object {
    name: string;
    namespace: string;
    annotations?: {
        [key: string]: string;
    };
    labels?: {
        [key: string]: string;
    };
    resourceVersion: string;
}
export interface EndpointsResource {
    metadata: EndpointsMetadata;
    subsets: any[];
}
export declare class KubernetesSyncWorker extends EventEmitter {
    private readonly masterAnnotationKey;
    private readonly slaveAnnotationKey;
    private readonly config;
    private readonly disableSlave;
    private readonly disableDiskStats;
    private watcher;
    private logger;
    private statsdExporter;
    private statsdSocket;
    private replicaCount;
    private syncServerPromise;
    private coreApi;
    private namespace;
    private role;
    private syncWorkerSlaveStatus;
    private promoting;
    private syncWorkerGroup;
    private currentResourceVersion;
    private statusGauge;
    private statsInterval;
    constructor(config: SyncWorkerConfiguration);
    start(params: SyncWorkerStartParams): Promise<void>;
    shutdown(err?: any): Promise<void>;
    reconcileEndpoints(endpoints: EndpointsResource): Promise<EndpointsResource>;
    private configureDiskStats(statsSink);
    private startSyncWorker();
    private stopSyncWorker();
    private assumeRole(role);
    private patchEndpoints(body);
    private getReplicaCount(endpoints);
    private reconcileSubsets(ports?);
    private registerCandidate();
    private deregisterCandidate();
    private promote(role);
}
