import { Arguments, ExecOptions } from '@kui-shell/core'; import { EntityFormat, OutputFormat, TableFormat, KubeOptions } from '@kui-shell/plugin-kubectl-core'; import { FinalState } from '../../lib/model/states'; export { KubeOptions }; /** @return the -f or --filename option */ export declare function fileOf(args: Pick, 'parsedOptions'>): string | string[]; /** @return same as fileOf, but also specify whether this came from a -f or --filename option */ export declare function fileOfWithDetail(args: Pick, 'parsedOptions'>): { filepath: string | string[]; isFor: 'f' | 'filename'; }; /** @return the -R or --recursive option */ export declare function isRecursive(args: Arguments): any; /** @return the -k or --kustomize option */ export declare function kustomizeOf(args: Arguments): string; export declare function getFileForArgv(args: Arguments, addSpace?: boolean): string; export declare function getFileFromArgv(args: Arguments): string | string[]; export declare function formatOf({ parsedOptions }: Pick, 'parsedOptions'>): OutputFormat; export declare function isEntityFormat(format: OutputFormat): format is EntityFormat; export declare function isEntityRequest(args: Arguments): boolean; export declare function isCustomColumns(format: OutputFormat): format is TableFormat; export declare function isDashHelp(args: Arguments): boolean; export declare function isHelpRequest(args: Arguments): boolean; export declare function isTableRequest(args: Pick, 'parsedOptions'>): boolean; export declare function isWatchRequest(args: Pick, 'parsedOptions'>): boolean; export declare function watchRequestFrom(args: Arguments, forceWatch?: boolean): "" | "-w" | "--watch-only" | "--watch"; export declare function isTableWatchRequest(args: Arguments): boolean; export declare function getLabel({ parsedOptions }: Pick, 'parsedOptions'>): string; export declare function getLabelForArgv(args: Arguments): string; /** * Due to deficiencies in yargs-parser (used by @kui-shell/core), the * form -lapp=name (i.e. without a whitespace after the -l) is not * parsed properly. */ export declare function hasLabel(args: Arguments): boolean; /** @return the namespace as expressed in the command line, or undefined if not */ export declare function getNamespaceAsExpressed(args: Pick, 'parsedOptions'>): string; /** @return the namespace as expressed in the command line, or the default from context */ export declare function getNamespace(args: Arguments): Promise; /** * A variant of getNamespace where you *only* want to use what was * provided by the user in their command line. */ export declare function getNamespaceForArgv(args: Pick, 'parsedOptions'>): string; /** @return the resource names array as expressed in the command line */ export declare function getResourceNamesForArgv(kindFromArgv: string, args: Arguments): string[]; export declare function getContext(args: Arguments): string; /** e.g. for kubectl logs */ export declare function getContainer(args: Arguments, verb: string): string; export declare function getContextForArgv(args: Arguments): string; export interface KubeExecOptions extends ExecOptions { finalState: FinalState; nResourcesToWaitFor: number; /** e.g. kubectl delete followed by a watch; if the watch fails, * we'd like to report the initial response from the delete */ initialResponse: string; } /** Options that specify a filepath */ export type FilepathOption = 'kubeconfig' | 'f' | 'filename' | 'k' | 'kustomize' | 'client-key' | 'client-certificate' | 'certificate-authority' | 'cache-dir'; export declare function isForAllNamespaces(parsedOptions: KubeOptions): boolean; /** Copy over any kubeconfig/context/cluster/namespace specifications from the given args */ export declare function withKubeconfigFrom(args: Pick, 'parsedOptions'>, cmdline: string, context?: string): string; /** As with `withKubeconfigFrom`, and also copy over the leading command (e.g. `kubectl`) */ export declare function withKubeconfigAndCommandFrom(args: Pick, 'argvNoOptions' | 'execOptions' | 'parsedOptions'>, cmdline: string): string; /** Apply --dry-run? */ export declare function isDryRun(args: Arguments): boolean; export declare function isDiffRequest(args: Arguments): boolean; export default KubeOptions;