import type { ChainablePromiseElement } from 'webdriverio'; import { IPageDecorator, BasePage, ElementWithContextMenu, VSCodeLocatorMap } from '../utils.js'; import { ViewSection as ViewSectionLocators, TreeItem as TreeItemLocators, CustomTreeItem as CustomTreeItemLocators, DefaultTreeItem as DefaultTreeItemLocators, ExtensionsViewItem as ExtensionsViewItemLocators } from '../../locators/1.73.0.js'; /** * Abstract representation of a row in the tree inside a view content section * @hidden */ export type ViewItemLocators = (typeof ViewSectionLocators & typeof TreeItemLocators & typeof CustomTreeItemLocators & typeof DefaultTreeItemLocators & typeof ExtensionsViewItemLocators); export interface ViewItem extends IPageDecorator { } /** * Arbitrary item in the side bar view * * @category Sidebar */ export declare abstract class ViewItem extends ElementWithContextMenu { /** * Select the item in the view. * Note that selecting the item will toggle its expand state when applicable. * @returns Promise resolving when the item has been clicked */ select(): Promise; } export interface TreeItem extends IPageDecorator { } /** * TreeItem abstract class * * @category Sidebar */ export declare abstract class TreeItem extends ViewItem { /** * Retrieves the label of this view item */ abstract getLabel(): Promise; /** * Retrieves the tooltip of this TreeItem. * @returns A promise resolving to the tooltip or undefined if the TreeItem has no tooltip. */ abstract getTooltip(): Promise; /** * Retrieves the description of this TreeItem. * @returns A promise resolving to the tooltip or undefined if the TreeItem has no description. */ abstract getDescription(): Promise; /** * Finds if the item has children by actually counting the child items * Note that this will expand the item if it was collapsed * @returns Promise resolving to true/false */ hasChildren(): Promise; /** * Finds whether the item is expanded. Always returns false if item has no children. * @returns Promise resolving to true/false */ abstract isExpanded(): Promise; /** * Find children of an item, will try to expand the item in the process * @returns Promise resolving to array of TreeItem objects, empty array if item has no children */ abstract getChildren(): Promise; /** * Finds if the item is expandable/collapsible * @returns Promise resolving to true/false */ abstract isExpandable(): Promise; /** * Expands the current item, if it can be expanded and is collapsed. */ expand(): Promise; /** * Find a child item with the given name * @returns Promise resolving to TreeItem object if the child item exists, undefined otherwise */ findChildItem(name: string): Promise; /** * Collapse the item if expanded */ collapse(): Promise; /** * Find all action buttons bound to the view item * * @returns array of ViewItemAction objects, empty array if item has no * actions associated */ getActionButtons(): Promise; /** * Find action button for view item by label * @param label label of the button to search by * * @returns ViewItemAction object if such button exists, undefined otherwise */ getActionButton(label: string): Promise; /** * Find all child elements of a tree item * @param locator locator of a given type of tree item */ protected getChildItems(locator: string): Promise; protected findTwistie(): Promise; } export interface ViewItemAction extends IPageDecorator { } /** * Action button bound to a view item * * @category Sidebar */ export declare class ViewItemAction extends BasePage { /** * @private */ locatorKey: "ViewSection"; private label; constructor(locators: VSCodeLocatorMap, elem: ChainablePromiseElement, label: string, viewItem: TreeItem); /** * Get label of the action button */ getLabel(): string; } //# sourceMappingURL=ViewItem.d.ts.map