///
import { BodyData } from 'needle';
import { Arguments, ExecOptions } from '@kui-shell/core';
import { KubeOptions as _KubeOptions } from '../../controller/kubectl/options';
import { ContextArgs } from '../../controller/kubectl/contexts';
type KubeOptions = Pick<_KubeOptions, 'context'>;
export interface ObjectStream {
on(evt: 'data', cb: (obj: T) => void): any;
on(evt: 'done', cb: () => void): any;
}
export declare function openStream(args: ContextArgs, url: string, mgmt: Pick, headers?: Record): Promise;
interface FetchOptions {
returnErrors?: boolean;
data?: Data;
headers?: Record;
method?: 'get' | 'put' | 'post' | 'delete';
tryFetchEvenInBrowser?: boolean;
}
export declare function _needle(args: ContextArgs, url: string, opts?: FetchOptions, retryCount?: number): Promise<{
statusCode: number;
body: string | object;
}>;
export type ReturnedError = {
code: number | string;
error: string;
};
export type FetchedFile = string | Buffer | object | ReturnedError;
export declare function isReturnedError(file: FetchedFile): file is ReturnedError;
/**
* Either fetch a remote file or read a local one
*
*/
export declare function fetchFile(args: ContextArgs, url: string, opts?: FetchOptions): Promise;
/** same as fetchFile, but returning a string rather than a Buffer */
export declare function fetchFileString(args: ContextArgs, url: string, headers?: Record): Promise<(void | string)[]>;
export declare function fetchFileKustomize(args: ContextArgs, url: string): Promise<{
data: string;
dir?: string;
}>;
/**
* fetch raw files from `filepath`
*/
export declare function fetchRawFiles(args: Arguments, filepath: string): Promise;
export default fetchFileString;
export declare function fetchFilesVFS(args: Arguments, srcs: string | string[], fetchNestedYamls?: boolean): Promise<{
filepath: string;
data: string;
}[]>;
export declare function fetchKusto(args: Arguments, kusto: string): Promise<{
customization: {
filepath: string;
data: string;
contentType: string;
isFor: string;
};
templates: {
filepath: string;
data: string;
contentType: string;
isFor: string;
}[];
}>;