import { RemoteConfigDataWrapper } from './remote_config_data_wrapper.js';
import { ComponentsDataWrapper } from './components_data_wrapper.js';
import { K8 } from '../../k8.js';
import type { Cluster } from './types.js';
import { SoloLogger } from '../../logging.js';
import { ConfigManager } from '../../config_manager.js';
import { LocalConfig } from '../local_config.js';
import { type ContextClusterStructure } from '../../../types/config_types.js';
import { type EmptyContextConfig, type SoloListrTask } from '../../../types/index.js';
import type * as k8s from '@kubernetes/client-node';
interface ListrContext {
    config: {
        contextCluster: ContextClusterStructure;
    };
}
/**
 * Uses Kubernetes ConfigMaps to manage the remote configuration data by creating, loading, modifying,
 * and saving the configuration data to and from a Kubernetes cluster.
 */
export declare class RemoteConfigManager {
    private readonly k8?;
    private readonly logger?;
    private readonly localConfig?;
    private readonly configManager?;
    /** Stores the loaded remote configuration data. */
    private remoteConfig;
    /**
     * @param k8 - The Kubernetes client used for interacting with ConfigMaps.
     * @param logger - The logger for recording activity and errors.
     * @param localConfig - Local configuration for the remote config.
     * @param configManager - Manager to retrieve application flags and settings.
     */
    constructor(k8?: K8, logger?: SoloLogger, localConfig?: LocalConfig, configManager?: ConfigManager);
    get currentCluster(): Cluster;
    /** @returns the components data wrapper cloned */
    get components(): ComponentsDataWrapper;
    /**
     * Modifies the loaded remote configuration data using a provided callback function.
     * The callback operates on the configuration data, which is then saved to the cluster.
     *
     * @param callback - an async function that modifies the remote configuration data.
     * @throws {@link SoloError} if the configuration is not loaded before modification.
     */
    modify(callback: (remoteConfig: RemoteConfigDataWrapper) => Promise<void>): Promise<void>;
    /**
     * Creates a new remote configuration in the Kubernetes cluster.
     * Gathers data from the local configuration and constructs a new ConfigMap
     * entry in the cluster with initial command history and metadata.
     */
    private create;
    /**
     * Saves the currently loaded remote configuration data to the Kubernetes cluster.
     * @throws {@link SoloError} if there is no remote configuration data to save.
     */
    private save;
    /**
     * Loads the remote configuration from the Kubernetes cluster if it exists.
     * @returns true if the configuration is loaded successfully.
     */
    private load;
    /**
     * Builds a task for loading the remote configuration, intended for use with Listr task management.
     * Checks if the configuration is already loaded, otherwise loads and adds the command to history.
     *
     * @param argv - arguments containing command input for historical reference.
     * @returns a Listr task which loads the remote configuration.
     */
    buildLoadTask(argv: {
        _: string[];
    }): SoloListrTask<EmptyContextConfig>;
    /**
     * Builds a task for creating a new remote configuration, intended for use with Listr task management.
     * Merges cluster mappings from the provided context into the local configuration, then creates the remote config.
     *
     * @returns a Listr task which creates the remote configuration.
     */
    buildCreateTask(): SoloListrTask<ListrContext>;
    isLoaded(): boolean;
    /**
     * Retrieves the ConfigMap containing the remote configuration from the Kubernetes cluster.
     *
     * @returns the remote configuration data.
     * @throws {@link SoloError} if the ConfigMap could not be read and the error is not a 404 status.
     */
    getConfigMap(): Promise<k8s.V1ConfigMap>;
    /**
     * Creates a new ConfigMap entry in the Kubernetes cluster with the remote configuration data.
     */
    private createConfigMap;
    /** Replaces an existing ConfigMap in the Kubernetes cluster with the current remote configuration data. */
    private replaceConfigMap;
    private setDefaultNamespaceIfNotSet;
    private setDefaultContextIfNotSet;
    /**
     * Retrieves the namespace value from the configuration manager's flags.
     * @returns string - The namespace value if set.
     */
    private getNamespace;
}
export {};
