import { Table, RadioTable, Arguments, MixedResponse, KResponse } from '@kui-shell/core'; import { KubeOptions, KubeResource, KubeStatusAny } from '@kui-shell/plugin-kubectl-core'; import RawResponse from './response'; import { FinalState } from '../../lib/model/states'; import { KubeTableResponse } from '../../lib/view/formatTable'; /** Optional argument prepartion */ export type Prepare = (args: Arguments) => string; /** No-op argument preparation */ export declare const NoPrepare: (args: Arguments) => string; /** Special case preparation for status */ export type PrepareForStatus = (cmd: string, args: Arguments) => string[] | Promise; /** * Execute the given command in the browser; this dispatches to * _kubectl, which runs on the proxy (for electron and headless, these * are the same machine). * */ export declare function doExecWithoutPty(args: Arguments, prepare?: Prepare, exec?: string): Promise; /** * Behaves as does `exec`, except that it projects out just the * `stdout` part -- thus ignoring the exit `code` and `stderr`. * */ export declare function doExecWithStdout(args: Arguments, prepare?: Prepare, exec?: string): Promise; /** * Do we see anything in the given command that indicates a PTY is * required? That is, versus a plain nodejs spawn/exec. * */ export declare function reallyNeedsPty({ argvNoOptions, parsedOptions }: Pick): boolean; /** * Execute the given command using a pty * */ export declare function doExecWithPty = KResponse, O extends KubeOptions = KubeOptions>(args: Arguments, prepare?: Prepare, exec?: string): Promise; /** * Execute the given command using a pty, but return a string * */ export declare function doExecWithStdoutViaPty(args: Arguments, prepare?: Prepare): Promise; /** * Decide whether to use a pty or a raw exec. * */ export declare function exec(args: Arguments, prepare?: Prepare, exec?: string): Promise; /** * Behaves as does `exec`, except that it projects out just the * `stdout` part and parses it into a Table model. * */ export declare function doExecWithTable(args: Arguments, prepare?: Prepare, command?: string, { usePty, nameColumn, verb, entityType }?: { usePty?: boolean; nameColumn?: string; verb?: string; entityType?: string; }): Promise; /** * Execute a command, and then execute the status command which will * poll until the given FinalState is reached. * */ export declare const doExecWithStatus: (verb: string, finalState: FinalState, command?: string, prepareForExec?: Prepare, prepareForStatus?: PrepareForStatus) => (args: Arguments) => Promise; export declare function doExecWithRadioTable>(resources: Resource[], defaultSelectedIdx: number, onSelect: (name: string, resource: Resource) => string, { title, nameColumnTitle }?: { title?: string; nameColumnTitle?: string; }): Promise; export default exec;