/**
 * Copyright (c) OpenLens Maintainers. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */
import { KubeConfig } from "@kubernetes/client-node";
import type { Cluster, Context, User } from "@kubernetes/client-node/dist/config_types";
import Joi from "joi";
import type { PartialDeep } from "type-fest";
interface KubeConfigOptions {
    clusters: Cluster[];
    users: User[];
    contexts: Context[];
    currentContext?: string;
}
export declare function loadFromOptions(options: KubeConfigOptions): KubeConfig;
export interface ConfigResult {
    config: KubeConfig;
    error: Joi.ValidationError | undefined;
}
export declare function loadConfigFromString(content: string): ConfigResult;
export declare function loadValidatedConfig(content: string, contextName: string): ValidateKubeConfigResult;
export interface SplitConfigEntry {
    config: KubeConfig;
    validationResult: ValidateKubeConfigResult;
}
/**
 * Breaks kube config into several configs. Each context as it own KubeConfig object
 */
export declare function splitConfig(kubeConfig: KubeConfig): SplitConfigEntry[];
/**
 * Pretty format the object as human readable yaml, such as would be on the filesystem
 * @param kubeConfig The kubeconfig object to format as pretty yaml
 * @returns The yaml representation of the kubeconfig object
 */
export declare function dumpConfigYaml(kubeConfig: PartialDeep<KubeConfig>): string;
export type ValidateKubeConfigResult = {
    error: Error;
} | {
    error?: undefined;
    context: Context;
    cluster: Cluster;
    user: User;
};
/**
 * Checks if `config` has valid `Context`, `User`, `Cluster`, and `exec` fields (if present when required)
 *
 * Note: This function returns an error instead of throwing it, returning `undefined` if the validation passes
 */
export declare function validateKubeConfig(config: KubeConfig, contextName: string): ValidateKubeConfigResult;
export {};
