import https from 'node:https'; import { RequestInit } from 'node-fetch'; import { RequestContext } from './api.js'; import { Authenticator } from './auth.js'; import { Cluster, ConfigOptions, Context, User } from './config_types.js'; import { Configuration, SecurityAuthentication } from './gen/index.js'; import WebSocket from 'isomorphic-ws'; export interface ApiType { } export declare class KubeConfig implements SecurityAuthentication { private static authenticators; private custom_authenticators; addAuthenticator(authenticator: Authenticator): void; /** * The list of all known clusters */ 'clusters': Cluster[]; /** * The list of all known users */ 'users': User[]; /** * The list of all known contexts */ 'contexts': Context[]; /** * The name of the current context */ 'currentContext': string; constructor(); getContexts(): Context[]; getClusters(): Cluster[]; getUsers(): User[]; getCurrentContext(): string; setCurrentContext(context: string): void; getContextObject(name: string): Context | null; getCurrentCluster(): Cluster | null; getCluster(name: string): Cluster | null; getCurrentUser(): User | null; getUser(name: string): User | null; loadFromFile(file: string, opts?: Partial): void; applyToFetchOptions(opts: https.RequestOptions): Promise; applyToHTTPSOptions(opts: https.RequestOptions | WebSocket.ClientOptions): Promise; /** * Applies SecurityAuthentication to RequestContext of an API Call from API Client * @param context */ applySecurityAuthentication(context: RequestContext): Promise; /** * Returns name of this security authentication method * @returns string */ getName(): string; loadFromString(config: string, opts?: Partial): void; loadFromOptions(options: any): void; loadFromClusterAndUser(cluster: Cluster, user: User): void; loadFromCluster(pathPrefix?: string): void; mergeConfig(config: KubeConfig, preserveContext?: boolean): void; addCluster(cluster: Cluster): void; addUser(user: User): void; addContext(ctx: Context): void; loadFromDefault(opts?: Partial, contextFromStartingConfig?: boolean, platform?: string): void; makeApiClient(apiClientType: ApiConstructor): T; makePathsAbsolute(rootDirectory: string): void; exportConfig(): string; private getCurrentContextObject; private createAgent; private applyHTTPSOptions; private applyAuthorizationHeader; private applyOptions; } export type ApiConstructor = new (config: Configuration) => T; export declare function makeAbsolutePath(root: string, file: string): string; export declare function bufferFromFileOrString(file?: string, data?: string): Buffer | null; export declare function findHomeDir(platform?: string): string | null; export interface Named { name: string; } export declare function findObject(list: T[], name: string, key: string): T | null;