import { IDisposable } from '@vscode-alt/monaco-editor/esm/vs/base/common/lifecycle'; import { IStatusbarAlignment, IStatusbarEntry, IStatusbarItem } from '../generated-model'; // export const IStatusbarService = createDecorator('statusbarService'); export const enum StatusbarAlignment { LEFT, RIGHT, } export interface StatusbarEntry { /** * The text to show for the entry. You can embed icons in the text by leveraging the syntax: * * `My text ${icon name} contains icons like ${icon name} this one.` */ readonly text: string; /** * An optional tooltip text to show when you hover over the entry */ readonly tooltip?: string; /** * An optional color to use for the entry */ readonly color?: string; /** * An optional background color to use for the entry */ readonly backgroundColor?: string; /** * An optional id of a command that is known to the workbench to execute on click */ readonly command?: string; /** * Optional arguments for the command. */ readonly arguments?: any[]; /** * An optional extension ID if this entry is provided from an extension. */ readonly extensionId?: string; /** * Wether to show a beak above the status bar entry. */ readonly showBeak?: boolean; } export interface IStatusbarItemDescriptor { id: string; name: string; } export type IStatusbarItemName = Pick; export interface IStatusbarRegistry { /** * Registers an item to the platform for the given input type. The second parameter also supports an * array of input classes to be passed in. If the more than one item is registered for the same item * input, the input itself will be asked which item it prefers if this method is provided. Otherwise * the first item in the list will be returned. * * registered status bar items should be used for. * @param descriptor * @param itemDescriptor */ registerStatusbarItem(descriptor: IStatusbarItemDescriptor, itemDescriptor: IStatusbarItemName): void; registerStatusbarItem(descriptor: IStatusbarItemDescriptor, itemDescriptor: IStatusbarItemName[]): void; /** * Returns the statusbar item descriptor for the given input or null if none. */ getItem(input: IStatusbarItemName): IStatusbarItemDescriptor | null; /** * Returns an array of registered status bar items known to the platform. */ getItems(): IStatusbarItemDescriptor[] | null; } export interface IStatusbarService { // _serviceBrand: undefined; /** * Adds an entry to the statusbar with the given alignment and priority. Use the returned accessor * to update or remove the statusbar entry. * * @param id identifier of the entry is needed to allow users to hide entries via settings * @param name human readable name the entry is about * @param alignment either LEFT or RIGHT * @param priority items get arranged from highest priority to lowest priority from left to right * in their respective alignment slot */ /** * add new status bar entry */ addEntry(entry: StatusbarEntry, id: string, name: string, alignment: StatusbarAlignment, priority?: number): boolean; /** * removeStatusbarEntry */ removeStatusbarEntry(id: string): boolean; /** * update status bar entry */ updateStatusbarEntry(entry: StatusbarEntry, id: string, alignment: StatusbarAlignment, priority?: number): boolean; /** * set message to show on status bar */ setStatusMessage(id: string, message): string; /** * An event that is triggered when an entry's visibility is changed. */ // readonly onDidChangeEntryVisibility: Event<{ id: string, visible: boolean }>; /** * Return if an entry is visible or not. */ // isEntryVisible(id: string): boolean; /** * Allows to update an entry's visibility with the provided ID. */ // updateEntryVisibility(id: string, visible: boolean): void; /** * Focused the status bar. If one of the status bar entries was focused, focuses it directly. */ // focus(preserveEntryFocus?: boolean): void; /** * Focuses the next status bar entry. If none focused, focuses the first. */ // focusNextEntry(): void; /** * Focuses the previous status bar entry. If none focused, focuses the last. */ // focusPreviousEntry(): void; } export interface IStatusbarEntryAccessor extends IDisposable { /** * Allows to update an existing status bar entry. */ update(properties: StatusbarEntry): void; }