import * as k8s from "@kubernetes/client-node";
import { PortForwardTracker, WatchTracker } from "../types.js";
export declare class KubernetesManager {
    private resources;
    private portForwards;
    private watches;
    private kc;
    private k8sApi;
    private k8sAppsApi;
    private k8sBatchApi;
    /** Set when API client construction fails (e.g. no active cluster/context). */
    private clientInitError;
    constructor();
    /**
     * Attempt to build Kubernetes API clients. On failure, keep the process
     * alive in a degraded state; getters and refresh will surface the error.
     */
    private tryInitApiClients;
    /**
     * Ensure API clients exist, retrying construction if we started degraded.
     * Throws a clear configuration error if the kubeconfig still has no active cluster.
     */
    private ensureApiClients;
    /**
     * A very simple test to check if the application is running inside a Kubernetes cluster
     */
    private isRunningInCluster;
    /**
     * Check if KUBECONFIG_YAML environment variable is available
     */
    private hasEnvKubeconfigYaml;
    /**
     * Check if KUBECONFIG_JSON environment variable is available
     */
    private hasEnvKubeconfigJson;
    /**
     * Check if minimal K8S_SERVER and K8S_TOKEN environment variables are available
     */
    private hasEnvMinimalKubeconfig;
    /**
     * Load kubeconfig from KUBECONFIG_PATH environment variable (file path)
     */
    private loadEnvKubeconfigPath;
    /**
     * Load kubeconfig from KUBECONFIG_YAML environment variable (YAML format)
     */
    private loadEnvKubeconfigYaml;
    /**
     * Load kubeconfig from KUBECONFIG_JSON environment variable (JSON format)
     */
    private loadEnvKubeconfigJson;
    /**
     * Load kubeconfig from minimal K8S_SERVER and K8S_TOKEN environment variables
     */
    private loadEnvMinimalKubeconfig;
    /**
     * Check if KUBECONFIG_PATH environment variable is available
     */
    private hasEnvKubeconfigPath;
    private hasEnvKubeconfig;
    /**
     * Set the current context to the desired context name.
     *
     * @param contextName
     */
    refreshApiClients(): void;
    setCurrentContext(contextName: string): void;
    cleanup(): Promise<void>;
    trackResource(kind: string, name: string, namespace: string): void;
    deleteResource(kind: string, name: string, namespace: string): Promise<void>;
    trackPortForward(pf: PortForwardTracker): void;
    getPortForward(id: string): PortForwardTracker | undefined;
    removePortForward(id: string): void;
    trackWatch(watch: WatchTracker): void;
    getKubeConfig(): k8s.KubeConfig;
    getCoreApi(): k8s.CoreV1Api;
    getAppsApi(): k8s.AppsV1Api;
    getBatchApi(): k8s.BatchV1Api;
    /**
     * True when API clients failed to initialize (e.g. empty current-context).
     */
    hasClientInitError(): boolean;
    getClientInitError(): Error | undefined;
    /**
     * Get the default namespace for operations
     * Uses K8S_NAMESPACE environment variable if set, otherwise defaults to "default"
     */
    getDefaultNamespace(): string;
    /**
     * Create temporary kubeconfig file from YAML content for kubectl commands
     * @param kubeconfigYaml YAML content of the kubeconfig
     */
    private createTempKubeconfigFromYaml;
}
