@kui-shell/plugin-client-common
Version:
Kui plugin that offers stylesheets
35 lines (34 loc) • 1.42 kB
TypeScript
/// <reference types="react" />
import { TabState } from '@kui-shell/core/mdist/api/Tab';
import { NewTabRequestEvent, StatusStripeChangeEvent } from '@kui-shell/core/mdist/api/Events';
/** cheapo uuid; we only need single-threaded uniqueness. Start from 2 so that we ensure the first tab always gets uuid 1. */
export declare function uuidForFirstTab(): number;
export interface TopTabButton<P extends {
key: string;
} = {
key: string;
}> {
icon: React.ReactElement<P>;
}
export default class TabModel {
private readonly _uuid;
private readonly desiredStatusStripeDecoration?;
private readonly _title?;
private readonly _state;
private readonly _buttons;
private readonly _initialCommandLine?;
private readonly _onClose?;
private readonly _exec?;
constructor(_uuid?: string, desiredStatusStripeDecoration?: StatusStripeChangeEvent, doNotChangeActiveTab?: boolean, _title?: string, _state?: TabState, _buttons?: TopTabButton[], _initialCommandLine?: string, _onClose?: string, _exec?: NewTabRequestEvent['tabs'][0]['exec']);
get uuid(): string;
get state(): TabState;
get buttons(): TopTabButton<{
key: string;
}>[];
get title(): string;
setTitle(newTitle: string): TabModel;
get initialCommandLine(): string;
get onClose(): string;
get exec(): "pexec" | "qexec";
update(buttons: TopTabButton[], newTitle?: string): TabModel;
}