/**
 * CoreTraffic Manager for Onebox
 *
 * Manages CoreTraffic as a Docker Swarm service so it can route to services on
 * the Onebox overlay network.
 */
export declare const CORETRAFFIC_SERVICE_NAME = "onebox-coretraffic";
export interface ICoreTrafficRoute {
    domain: string;
    upstream: string;
}
export interface ICoreTrafficPublicPortRoute {
    name: string;
    listenPort: number;
    transport: 'tcp' | 'udp';
    targetHost: string;
    targetPort: number;
}
export interface ICoreTrafficCertificate {
    domain: string;
    certPem: string;
    keyPem: string;
}
export interface ICoreTrafficStatusObservation {
    state: 'starting' | 'running' | 'stopped' | 'failed' | 'unknown';
    running: boolean | null;
    observedAt: number;
    httpPort: number;
    httpsPort: number;
    routes: number;
    certificates: number;
}
interface ICoreTrafficManagerOptions {
    certsDir?: string;
    adminPort?: number;
    httpPort?: number;
    httpsPort?: number;
    observationTimeoutMs?: number;
    getAdminToken?: () => Promise<string>;
}
interface ICoreTrafficStopOptions {
    throwOnError?: boolean;
}
export declare class CoreTrafficManager {
    private dockerClient;
    private dockerClientInitializationPromise;
    private certsDir;
    private adminUrl;
    private adminPort;
    private httpPort;
    private httpsPort;
    private routes;
    private publicPortRoutes;
    private certificates;
    private networkName;
    private serviceRunning;
    private observationPromise;
    private lastObservation;
    private observationTimeoutMs;
    private adminToken;
    private getAdminTokenFromOptions?;
    constructor(options?: ICoreTrafficManagerOptions);
    private ensureDockerClient;
    private withTimeout;
    private createObservation;
    private classifyTaskState;
    private performStatusObservation;
    observeStatus(): Promise<ICoreTrafficStatusObservation>;
    setPorts(httpPort: number, httpsPort: number): void;
    start(): Promise<void>;
    private getAdminToken;
    private getAdminHeaders;
    private discardResponseBody;
    private getExistingService;
    private removeService;
    private getNetworkId;
    private waitForReady;
    private waitForServiceTaskRunning;
    stop(optionsArg?: ICoreTrafficStopOptions): Promise<void>;
    isHealthy(): Promise<boolean>;
    isRunning(): Promise<boolean>;
    private routeName;
    private buildEndpointPorts;
    private publicPortRouteKey;
    private publicPortRouteKeySnapshot;
    private buildPublicPortRouteMap;
    validatePublicPortRoutes(routesArg: ICoreTrafficPublicPortRoute[]): void;
    private parseUpstream;
    private buildRoutes;
    setPublicPortRoutes(routesArg: ICoreTrafficPublicPortRoute[]): Promise<void>;
    reloadConfig(options?: {
        skipRunningCheck?: boolean;
    }): Promise<void>;
    addRoute(domain: string, upstream: string): Promise<void>;
    removeRoute(domain: string): Promise<void>;
    clearPublicPortRoutes(): Promise<void>;
    addCertificate(domain: string, certPem: string, keyPem: string): Promise<void>;
    removeCertificate(domain: string): Promise<void>;
    getRoutes(): ICoreTrafficRoute[];
    getCertificates(): ICoreTrafficCertificate[];
    clear(): void;
    getStatus(): {
        running: boolean;
        httpPort: number;
        httpsPort: number;
        routes: number;
        certificates: number;
    };
}
export {};
