/**
 * Services Manager for Onebox
 *
 * Orchestrates service deployment: Docker + Nginx + DNS + SSL
 */
import type { IService, IServiceDeployOptions } from '../types.js';
export type TServiceUpdateProgressStep = 'stopping' | 'pulling-image' | 'updating-record' | 'removing-container' | 'creating-container' | 'starting' | 'restoring-route' | 'syncing-gateway' | 'complete';
export interface IServiceUpdateProgress {
    step: TServiceUpdateProgressStep;
    message: string;
}
export interface IServiceUpdateOptions {
    onProgress?: (progressArg: IServiceUpdateProgress) => void | Promise<void>;
}
export declare class OneboxServicesManager {
    private oneboxRef;
    private database;
    private docker;
    private autoUpdateIntervalId;
    constructor(oneboxRef: any);
    private broadcastServiceUpdate;
    private syncExternalGatewayRoute;
    private deleteExternalGatewayPublicRoutesStrict;
    private deleteExternalGatewayRouteStrict;
    private deleteExternalGatewayRoutesStrict;
    private getRuntimeImageName;
    private isImageReferencedByOtherService;
    private isDomainUsedByOtherService;
    private removeDnsRecordIfServiceOwned;
    private cleanupUnreferencedCertificates;
    private cleanupOneboxRegistryImage;
    private resolveStorageVolumes;
    private normalizeServicePortConfig;
    private resolveServiceRoutePort;
    private getServiceDomainNames;
    private hasExternalGatewayRoutes;
    private publicRouteRef;
    private getServicePublicRouteRefs;
    private getStalePublicPortMappings;
    private preflightPublicPortRoutes;
    private rollbackPulledImage;
    private recoverPendingImageCleanup;
    private createHostedAppControlToken;
    private createHostedAppRuntimeEnvVars;
    private rollbackFailedDeployment;
    /**
     * Deploy a new service (full workflow)
     */
    deployService(options: IServiceDeployOptions): Promise<IService>;
    /**
     * Start a service
     */
    startService(name: string): Promise<void>;
    /**
     * Stop a service
     */
    stopService(name: string): Promise<void>;
    /**
     * Restart a service
     */
    restartService(name: string): Promise<void>;
    /**
     * Remove a service (full cleanup)
     */
    removeService(name: string): Promise<void>;
    /**
     * List all services
     */
    listServices(): Promise<IService[]>;
    /**
     * Get service by name
     */
    getService(name: string): Promise<IService | null>;
    /**
     * Get service logs
     */
    getServiceLogs(name: string, tail?: number): Promise<string>;
    /**
     * Stream service logs (real-time)
     */
    streamServiceLogs(name: string, callback: (line: string, isError: boolean) => void): Promise<void>;
    /**
     * Get service metrics
     */
    getServiceMetrics(name: string): Promise<import("../types.js").IContainerStats | null>;
    /**
     * Get platform resources for a service
     */
    getServicePlatformResources(name: string): Promise<{
        resource: import("../types.js").IPlatformResource;
        platformService: import("../types.js").IPlatformService;
        credentials: Record<string, string>;
    }[]>;
    /**
     * Get service status
     */
    getServiceStatus(name: string): Promise<string>;
    /**
     * Update service environment variables
     */
    updateServiceEnv(name: string, envVars: Record<string, string>): Promise<void>;
    private rollbackServiceUpdate;
    /**
     * Update service configuration (image, port, domain, env vars)
     * Recreates the container with new configuration and auto-restarts
     */
    updateService(name: string, updates: {
        image?: string;
        registry?: string;
        port?: number;
        domain?: string;
        envVars?: Record<string, string>;
        secretEnvVars?: Record<string, string>;
        containerArgs?: string[] | null;
        secretFiles?: IService['secretFiles'] | null;
        volumes?: IService['volumes'];
        publishedPorts?: IService['publishedPorts'];
        targetPorts?: IService['targetPorts'];
        domains?: IService['domains'];
        publicPortMappings?: IService['publicPortMappings'];
        imageDigest?: string;
        appTemplateVersion?: string;
        forcePull?: boolean;
    }, optionsArg?: IServiceUpdateOptions): Promise<IService>;
    /**
     * Sync service status from Docker
     */
    syncServiceStatus(name: string): Promise<void>;
    /**
     * Sync all service statuses from Docker
     */
    syncAllServiceStatuses(): Promise<void>;
    /**
     * Start auto-update monitoring for registry services
     * Polls every 30 seconds for digest changes and restarts services if needed
     */
    startAutoUpdateMonitoring(): void;
    /**
     * Stop auto-update monitoring
     */
    stopAutoUpdateMonitoring(): void;
    /**
     * Check all services using onebox registry for updates
     */
    private checkForRegistryUpdates;
}
