import { Nullable } from '../../../types/general';
import { VegaRTECreateElementFunction, VegaRTEToolbarRenderContext, VegaRTERenderResult, RTEToolbarDropdownProps, RTEDropdownListItem, RTEToolbarButtonProps, RTEDropdownListGroup, RTEExtensionContext } from '../interface';
/**
 * Base class for rendering extension toolbar button in the rich text editor.
 * The renderer provides common functionalities for rendering toolbar buttons, including:
 * - Rendering a button with an icon, label, and optional arrow icon.
 * - Rendering a dropdown with a list of items.
 * - Rendering dropdown items.
 * - Rendering template for dropdown list.
 * - Determining if the button should be disabled based on the editor context.
 * - Handling button and dropdown click events.
 * Override the methods to customize the rendering and behavior of the button.
 */
export declare abstract class VegaRTEToolbarButtonRenderer {
  /**
   * Checks if the button should be hidden.
   *
   * @param {VegaRTEToolbarRenderContext} editorContext The render context for the editor.
   * @returns {boolean} True if the button is hidden, false otherwise.
   */
  isHidden(editorContext: VegaRTEToolbarRenderContext): boolean;
  /**
   * Renders the toolbar button.
   *
   * @param createElement Function to create elements in the rich text editor.
   * @returns {VegaRTERenderResult} Toolbar button.
   */
  abstract render(createElement: VegaRTECreateElementFunction, editorContext?: VegaRTEToolbarRenderContext): VegaRTERenderResult;
  /**
   * Get the extension context for the given rich text editor host element.
   *
   * @typedef HTMLVegaRichTextEditorElement - The type definition for the rich text editor host element.
   * @param {HTMLVegaRichTextEditorElement} el - The host rich text editor element.
   * @returns {Nullable<RTEExtensionContext>} - The extension context associated with the host.
   */
  protected getExtensionContext(el: HTMLVegaRichTextEditorElement): Nullable<RTEExtensionContext>;
  /**
   * Renders a dropdown component with the specified properties and children.
   *
   * @param {VegaRTECreateElementFunction} h - Create element function.
   * @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
   * @param {RTEToolbarDropdownProps} dropdownProps - The properties for the dropdown.
   * @param {VegaRTERenderResult[]} children - The children elements for the dropdown.
   * @returns {VegaRTERenderResult} - The render result for the dropdown.
   */
  protected renderDropdown(h: VegaRTECreateElementFunction, editorContext: VegaRTEToolbarRenderContext, dropdownProps: RTEToolbarDropdownProps, children: VegaRTERenderResult[]): VegaRTERenderResult;
  /**
   * Renders the dropdown list template.
   *
   * @param {VegaRTECreateElementFunction} h - Create element function.
   * @param {(RTEDropdownListItem | RTEDropdownListGroup)[]} itemList - The list of dropdown items.
   * @returns {VegaRTERenderResult} - The render result for the dropdown list.
   */
  protected renderDropdownListTemplate(h: VegaRTECreateElementFunction, itemList: (RTEDropdownListItem | RTEDropdownListGroup)[]): VegaRTERenderResult;
  /**
   * Renders a dropdown item for the toolbar button.
   *
   * @param {VegaRTECreateElementFunction} h - Create element function.
   * @param {RTEDropdownListItem} item - The dropdown item.
   * @returns {VegaRTERenderResult} - The render result for the dropdown item.
   */
  protected renderDropdownItem(h: VegaRTECreateElementFunction, item: RTEDropdownListItem): VegaRTERenderResult;
  /**
   * Renders a dropdown item for the toolbar button.
   *
   * @param {VegaRTECreateElementFunction} h - Create element function.
   * @param {RTEDropdownListGroup} item - The dropdown group.
   * @returns {VegaRTERenderResult} - The render result for the dropdown item.
   */
  protected renderDropdownGroup(h: VegaRTECreateElementFunction, item: RTEDropdownListGroup): VegaRTERenderResult;
  /**
   * Renders a common toolbar button with optional icon, label, and arrow icon.
   * When a tooltip is provided via `buttonProps.tooltip`, the button is wrapped
   * in a `vega-tooltip` element, matching the behavior of default toolbar buttons.
   *
   * @param {VegaRTECreateElementFunction} h - Create element function.
   * @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
   * @param {RTEToolbarButtonProps} buttonProps - The properties for the button.
   * @returns {VegaRTERenderResult} - The render result for the button.
   */
  protected renderButton(h: VegaRTECreateElementFunction, editorContext: VegaRTEToolbarRenderContext, buttonProps: RTEToolbarButtonProps): VegaRTERenderResult;
  /**
   * Renders the button label.
   *
   * @param {VegaRTECreateElementFunction} h - Create element function.
   * @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
   * @param {Nullable<string>} label - The button label if exist.
   * @returns {Nullable<VegaRTERenderResult>} - The render result for the button.
   */
  protected renderButtonLabel(h: VegaRTECreateElementFunction, editorContext: VegaRTEToolbarRenderContext, label: Nullable<string>): Nullable<VegaRTERenderResult>;
  /**
   * Determines if the button should be disabled based on the editor context.
   *
   * @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
   * @returns {boolean} - True if the button should be disabled, false otherwise.
   */
  protected isDisabled(editorContext: VegaRTEToolbarRenderContext): boolean;
  /**
   * Checks if the button should be selected.
   *
   * @param {VegaRTEToolbarRenderContext} _editorContext The render context for the editor.
   * @returns {boolean} True if the button is selected, false otherwise.
   */
  protected isSelected(_editorContext: VegaRTEToolbarRenderContext): boolean;
  /**
   * Prevents the default action of the click event. This is to avoid losing focus from the editor when the button is clicked.
   *
   * @param {MouseEvent} e The mouse event to prevent default action for.
   */
  protected preventDefault(e: MouseEvent): void;
  /**
   * Recursively searches for a dropdown list item by its key.
   *
   * @param {(RTEDropdownListItem | RTEDropdownListGroup)[]} itemList The list of dropdown items or groups to search through.
   * @param {string} key The key of the item to find.
   * @returns {Nullable<RTEDropdownListItem>} The dropdown list item if found, otherwise null.
   */
  protected getListItemByKey(itemList: (RTEDropdownListItem | RTEDropdownListGroup)[], key: string): Nullable<RTEDropdownListItem>;
  /**
   * Handles the button click event.
   *
   * @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
   */
  protected abstract handleButtonClick(editorContext: VegaRTEToolbarRenderContext): void;
  /**
   * Handles the dropdown click event.
   *
   * @param {string} itemKey - The key of the clicked dropdown item.
   * @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
   */
  protected abstract handleDropdownClick(itemKey: string, editorContext?: VegaRTEToolbarRenderContext): void;
}
