import { SelectBox } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/selectBox/selectBox"; import { IAction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/actions"; import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { Disposable, DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { IContextViewService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service"; import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service"; import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service"; import { SettingValueType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences"; import { IJSONSchema } from "@codingame/monaco-vscode-api/vscode/vs/base/common/jsonSchema"; type EditKey = "none" | "create" | number; type RowElementGroup = { rowElement: HTMLElement; keyElement: HTMLElement; valueElement?: HTMLElement; }; type IListViewItem = TDataItem & { editing?: boolean; selected?: boolean; }; export declare class ListSettingListModel { protected _dataItems: TDataItem[]; private _editKey; private _selectedIdx; private _newDataItem; get items(): IListViewItem[]; constructor(newItem: TDataItem); setEditKey(key: EditKey): void; setValue(listData: TDataItem[]): void; select(idx: number | null): void; getSelected(): number | null; selectNext(): void; selectPrevious(): void; } export interface ISettingListChangeEvent { type: "change"; originalItem: TDataItem; newItem: TDataItem; targetIndex: number; } export interface ISettingListAddEvent { type: "add"; newItem: TDataItem; targetIndex: number; } export interface ISettingListMoveEvent { type: "move"; originalItem: TDataItem; newItem: TDataItem; targetIndex: number; sourceIndex: number; } export interface ISettingListRemoveEvent { type: "remove"; originalItem: TDataItem; targetIndex: number; } export interface ISettingListResetEvent { type: "reset"; originalItem: TDataItem; targetIndex: number; } export type SettingListEvent = ISettingListChangeEvent | ISettingListAddEvent | ISettingListMoveEvent | ISettingListRemoveEvent | ISettingListResetEvent; export declare abstract class AbstractListSettingWidget extends Disposable { private container; protected readonly themeService: IThemeService; protected readonly contextViewService: IContextViewService; protected readonly configurationService: IConfigurationService; private listElement; private rowElements; protected readonly _onDidChangeList: Emitter>; protected readonly model: ListSettingListModel; protected readonly listDisposables: DisposableStore; readonly onDidChangeList: Event>; get domNode(): HTMLElement; get items(): TDataItem[]; protected get isReadOnly(): boolean; constructor(container: HTMLElement, themeService: IThemeService, contextViewService: IContextViewService, configurationService: IConfigurationService); setValue(listData: TDataItem[]): void; abstract isItemNew(item: TDataItem): boolean; protected abstract getEmptyItem(): TDataItem; protected abstract getContainerClasses(): string[]; protected abstract getActionsForItem(item: TDataItem, idx: number): IAction[]; protected abstract renderItem(item: TDataItem, idx: number): RowElementGroup; protected abstract renderEdit(item: TDataItem, idx: number): HTMLElement; protected abstract addTooltipsToRow(rowElement: RowElementGroup, item: TDataItem): void; protected abstract getLocalizedStrings(): { deleteActionTooltip: string; editActionTooltip: string; addButtonLabel: string; }; protected renderHeader(): HTMLElement | undefined; protected isAddButtonVisible(): boolean; protected renderList(): void; protected createBasicSelectBox(value: IObjectEnumData): SelectBox; protected editSetting(idx: number): void; cancelEdit(): void; protected handleItemChange(originalItem: TDataItem, changedItem: TDataItem, idx: number): void; protected renderDataOrEditItem(item: IListViewItem, idx: number, listFocused: boolean): HTMLElement; private renderDataItem; private renderAddButton; private onListClick; private onListDoubleClick; private getClickedItemIndex; private selectRow; private selectNextRow; private selectPreviousRow; } interface IListSetValueOptions { showAddButton?: boolean; keySuggester?: IObjectKeySuggester; isReadOnly?: boolean; } export interface IListDataItem { value: ObjectKey; sibling?: string; } export declare class ListSettingWidget extends AbstractListSettingWidget { protected readonly hoverService: IHoverService; private keyValueSuggester; private showAddButton; private isEditable; protected get isReadOnly(): boolean; setValue(listData: TListDataItem[], options?: IListSetValueOptions): void; constructor(container: HTMLElement, themeService: IThemeService, contextViewService: IContextViewService, hoverService: IHoverService, configurationService: IConfigurationService); protected getEmptyItem(): TListDataItem; protected isAddButtonVisible(): boolean; protected getContainerClasses(): string[]; protected getActionsForItem(item: TListDataItem, idx: number): IAction[]; private dragDetails; protected renderItem(item: TListDataItem, idx: number): RowElementGroup; protected addDragAndDrop(rowElement: HTMLElement, item: TListDataItem, idx: number): void; protected renderEdit(item: TListDataItem, idx: number): HTMLElement; isItemNew(item: TListDataItem): boolean; protected addTooltipsToRow(rowElementGroup: RowElementGroup, { value, sibling }: TListDataItem): void; protected getLocalizedStrings(): { deleteActionTooltip: string; editActionTooltip: string; addButtonLabel: string; inputPlaceholder: string; siblingInputPlaceholder: string; }; private renderInputBox; private renderDropdown; } export declare class ExcludeSettingWidget extends ListSettingWidget { protected getContainerClasses(): string[]; protected addDragAndDrop(rowElement: HTMLElement, item: IIncludeExcludeDataItem, idx: number): void; protected addTooltipsToRow(rowElementGroup: RowElementGroup, item: IIncludeExcludeDataItem): void; protected getLocalizedStrings(): { deleteActionTooltip: string; editActionTooltip: string; addButtonLabel: string; inputPlaceholder: string; siblingInputPlaceholder: string; }; } export declare class IncludeSettingWidget extends ListSettingWidget { protected getContainerClasses(): string[]; protected addDragAndDrop(rowElement: HTMLElement, item: IIncludeExcludeDataItem, idx: number): void; protected addTooltipsToRow(rowElementGroup: RowElementGroup, item: IIncludeExcludeDataItem): void; protected getLocalizedStrings(): { deleteActionTooltip: string; editActionTooltip: string; addButtonLabel: string; inputPlaceholder: string; siblingInputPlaceholder: string; }; } interface IObjectStringData { type: "string"; data: string; } export interface IObjectEnumOption { value: string; description?: string; } interface IObjectEnumData { type: "enum"; data: string; options: IObjectEnumOption[]; } interface IObjectBoolData { type: "boolean"; data: boolean; } type ObjectKey = IObjectStringData | IObjectEnumData; export type ObjectValue = IObjectStringData | IObjectEnumData | IObjectBoolData; export interface IObjectDataItem { key: ObjectKey; value: ObjectValue; keyDescription?: string; source?: string; removable: boolean; resetable: boolean; } export interface IIncludeExcludeDataItem { value: ObjectKey; elementType: SettingValueType; sibling?: string; source?: string; } export interface IObjectValueSuggester { (key: string): ObjectValue | undefined; } export interface IObjectKeySuggester { (existingKeys: string[], idx?: number): IObjectEnumData | undefined; } interface IObjectSetValueOptions { settingKey: string; showAddButton: boolean; isReadOnly?: boolean; keySuggester?: IObjectKeySuggester; valueSuggester?: IObjectValueSuggester; propertyNames?: IJSONSchema; } export declare class ObjectSettingDropdownWidget extends AbstractListSettingWidget { private readonly hoverService; private editable; private currentSettingKey; private showAddButton; private keySuggester; private valueSuggester; private propertyNames; constructor(container: HTMLElement, themeService: IThemeService, contextViewService: IContextViewService, hoverService: IHoverService, configurationService: IConfigurationService); setValue(listData: IObjectDataItem[], options?: IObjectSetValueOptions): void; isItemNew(item: IObjectDataItem): boolean; protected isAddButtonVisible(): boolean; protected get isReadOnly(): boolean; protected getEmptyItem(): IObjectDataItem; protected getContainerClasses(): string[]; protected getActionsForItem(item: IObjectDataItem, idx: number): IAction[]; protected renderHeader(): HTMLElement; protected renderItem(item: IObjectDataItem, idx: number): RowElementGroup; protected renderEdit(item: IObjectDataItem, idx: number): HTMLElement; private renderEditWidget; private renderStringEditWidget; private renderEnumEditWidget; private shouldUseSuggestion; protected addTooltipsToRow(rowElementGroup: RowElementGroup, item: IObjectDataItem): void; private getEnumDescription; protected getLocalizedStrings(): { deleteActionTooltip: string; resetActionTooltip: string; editActionTooltip: string; addButtonLabel: string; keyHeaderText: string; valueHeaderText: string; }; } interface IBoolObjectSetValueOptions { settingKey: string; } export interface IBoolObjectDataItem { key: IObjectStringData; value: IObjectBoolData; keyDescription?: string; source?: string; removable: false; resetable: boolean; } export declare class ObjectSettingCheckboxWidget extends AbstractListSettingWidget { private readonly hoverService; private currentSettingKey; constructor(container: HTMLElement, themeService: IThemeService, contextViewService: IContextViewService, hoverService: IHoverService, configurationService: IConfigurationService); setValue(listData: IBoolObjectDataItem[], options?: IBoolObjectSetValueOptions): void; isItemNew(item: IBoolObjectDataItem): boolean; protected getEmptyItem(): IBoolObjectDataItem; protected getContainerClasses(): string[]; protected getActionsForItem(item: IBoolObjectDataItem, idx: number): IAction[]; protected isAddButtonVisible(): boolean; protected renderHeader(): undefined; protected renderDataOrEditItem(item: IListViewItem, idx: number, listFocused: boolean): HTMLElement; protected renderItem(item: IBoolObjectDataItem, idx: number): RowElementGroup; protected renderEdit(item: IBoolObjectDataItem, idx: number): HTMLElement; private renderEditWidget; protected addTooltipsToRow(rowElementGroup: RowElementGroup, item: IBoolObjectDataItem): void; protected getLocalizedStrings(): { deleteActionTooltip: string; resetActionTooltip: string; editActionTooltip: string; addButtonLabel: string; keyHeaderText: string; valueHeaderText: string; }; } export {};