import { Editor } from "./Editor"; import { ContextMenu } from "../menu/ContextMenu"; import { By } from "selenium-webdriver"; import { AbstractElement } from "../AbstractElement"; import { EditorView, EditorGroup } from "../.."; /** * Page object representing the internal VSCode settings editor */ export declare class SettingsEditor extends Editor { private divider; constructor(view?: EditorView | EditorGroup); /** * Search for a setting with a particular title and category. * Returns an appropriate Setting object if the label is found, * undefined otherwise. * * If your setting has nested categories (i.e `example.general.test`), * pass in each category as a separate string. * * @param title title of the setting * @param categories category of the setting * @returns Promise resolving to a Setting object if found, undefined otherwise */ findSetting(title: string, ...categories: string[]): Promise; /** * Search for a setting with a precise ID. * Returns an appropriate Setting object if it exists, * undefined otherwise. * * @param id of the setting * @returns Promise resolving to a Setting object if found, undefined otherwise */ findSettingByID(id: string): Promise; private _getSettingItem; /** * Switch between settings perspectives * Works only if your vscode instance has both user and workspace settings available * * @param perspective User or Workspace * @returns Promise that resolves when the appropriate button is clicked */ switchToPerspective(perspective: 'User' | 'Workspace'): Promise; /** * Context menu is disabled in this editor, throw an error */ openContextMenu(): Promise; private createSetting; } /** * Abstract item representing a Setting with title, description and * an input element (combo/textbox/checkbox/link) */ export declare abstract class Setting extends AbstractElement { constructor(settingsConstructor: By, settings: SettingsEditor); /** * Get the value of the setting based on its input type * * @returns promise that resolves to the current value of the setting */ abstract getValue(): Promise; /** * Set the value of the setting based on its input type * * @param value boolean for checkboxes, string otherwise */ abstract setValue(value: string | boolean): Promise; /** * Get the category of the setting * All settings are labeled as Category: Title */ getCategory(): Promise; /** * Get description of the setting * @returns Promise resolving to setting description */ getDescription(): Promise; /** * Get title of the setting */ getTitle(): Promise; } /** * Setting with a combo box */ export declare class ComboSetting extends Setting { getValue(): Promise; setValue(value: string): Promise; /** * Get the labels of all options from the combo * @returns Promise resolving to array of string values */ getValues(): Promise; private getOptions; private openCombo; } /** * Setting with a text box input */ export declare class TextSetting extends Setting { getValue(): Promise; setValue(value: string): Promise; } /** * Setting with a checkbox */ export declare class CheckboxSetting extends Setting { getValue(): Promise; setValue(value: boolean): Promise; } /** * Setting with no value, with a link to settings.json instead */ export declare class LinkSetting extends Setting { getValue(): Promise; setValue(value: string | boolean): Promise; /** * Open the link that leads to the value in settings.json * @returns Promise resolving when the link has been clicked */ openLink(): Promise; }