kui-shell
Version:
This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool
74 lines (73 loc) • 2.96 kB
TypeScript
import { Tab } from './cli';
import { Table, MultiTable } from './models/table';
import { CustomSpec } from './views/sidecar';
import { ExecOptions } from '../models/execOptions';
import { Entity, EntitySpec, MetadataBearing } from '../models/entity';
import { Label, ModeTraits, Button } from '../models/mmr/types';
import { Content as HighLevelContent } from '../models/mmr/content-types';
declare type DirectViewController = string | DirectViewControllerFunction | DirectViewControllerSpec | DirectViewEntity;
export declare type DirectViewControllerFunction<E = object, R = object> = (tab: Tab, entity: E) => PromiseLike<R> | R | void;
declare type DirectViewEntity = CustomSpec;
export interface DirectViewControllerSpec {
plugin: string;
operation: string;
parameters: object;
}
interface Toggle {
toggle: {
mode: string;
disabled: boolean;
}[];
}
export declare type DirectResult = Toggle | Entity;
export interface LowLevelContent<Direct = DirectViewController> {
flush?: 'right' | 'weak';
selected?: boolean;
selectionController?: {
on: (evt: 'change', cb: (selected: boolean) => void) => void;
};
visibleWhen?: string;
leaveBottomStripeAlone?: boolean;
fontawesome?: string;
labelBelow?: boolean;
balloon?: string;
balloonLength?: string;
data?: Record<string, any>;
command?: (entity: EntitySpec | CustomSpec) => string;
direct?: Direct;
url?: string;
execOptions?: ExecOptions;
actAsButton?: boolean;
radioButton?: boolean;
echo?: boolean;
noHistory?: boolean;
replSilence?: boolean;
}
declare type Content<Direct = DirectViewController, T = MetadataBearing> = Button<T> | HighLevelContent<T> | LowLevelContent<Direct>;
export declare type SidecarMode<Direct = DirectViewController> = Label & ModeTraits & Content<Direct>;
export declare function isSidecarMode(entity: string | HTMLElement | Table | MultiTable | SidecarMode): entity is SidecarMode;
interface BottomStripOptions {
show?: string;
preserveBackButton?: boolean;
}
export declare const rawCSS: {
buttons: string;
};
export declare const css: {
buttons: (tab: Tab) => HTMLElement;
backContainer: (tab: Tab) => HTMLElement;
backButton: (tab: Tab) => HTMLElement;
button: string;
tab: string[];
buttonAction: string;
buttonActingAsButton: string;
buttonActingAsRadioButton: string;
modeContainer: (tab: Tab) => HTMLElement;
bottomContainer: (tab: Tab) => HTMLElement;
active: string;
selected: string;
hidden: string;
};
export declare const addModeButton: (tab: Tab, mode: SidecarMode<DirectViewController>, entity: Record<string, any>) => HTMLAnchorElement | HTMLLIElement;
export declare const addModeButtons: <Direct = DirectViewController>(tab: Tab, modesUnsorted: SidecarMode<DirectViewController>[], entity: EntitySpec | CustomSpec<void>, options?: BottomStripOptions) => void;
export {};