kui-shell
Version:
This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool
35 lines (34 loc) • 1.27 kB
TypeScript
import { Tab } from '@kui-shell/core/api/ui-lite';
import Models from '@kui-shell/core/api/models';
import Commands from '@kui-shell/core/api/commands';
import { Persister } from './persisters';
interface ExecSpec {
kind: string;
code: string;
}
interface KeyValuePair {
key: string;
value: string;
}
export interface Entity extends Models.ResourceWithMetadata {
type: string;
name: string;
version?: string;
isNew?: boolean;
namespace?: string;
noZoom?: boolean;
viewName?: string;
extract?: (raw: string, entity: Entity) => Entity;
extractName?: (raw: string) => string;
lock?: any;
filepath?: string;
exec: ExecSpec;
persister?: Persister;
gotoReadonlyView?: (Getter: any) => any;
annotations: KeyValuePair[];
}
export default Entity;
export declare type IFetcher = (entityName: string, parsedOptions?: Commands.ParsedOptions, execOptions?: Commands.ExecOptions, createIfAbsent?: boolean, tab?: Tab) => Promise<Entity>;
export declare const registerFetcher: (fetcher: IFetcher) => void;
export declare const fetchFile: IFetcher;
export declare const fetchEntity: (tab: Tab, entityName: string, parsedOptions: Commands.ParsedOptions, execOptions: Commands.ExecOptions) => Promise<Entity>;