import { VegaSlimmer } from '../../../../vega-slimmer/vega-slimmer-core';
import { VegaDropdownSourceItem } from '../../types';
import { VegaDropdown } from '../../vega-dropdown';
/**
 * The `VegaDropdownSearchController` class is a TypeScript class that provides methods for searching
 * and filtering dropdown items based on a search string.
 */
export declare class VegaDropdownSearchController extends VegaSlimmer {
  host: VegaDropdown['host'];
  searchString: VegaDropdown['searchString'];
  caseSensitive: VegaDropdown['caseSensitive'];
  useDefaultFilter: VegaDropdown['useDefaultFilter'];
  searchable: VegaDropdown['searchable'];
  remoteInvocationController: VegaDropdown['remoteInvocationController'];
  /**
   * The search function returns the source array if there is no search string, otherwise it searches the
   * nested list for matching items.
   *
   * @param {VegaDropdown['source']} source - The `source` parameter is of type `VegaDropdown['source']`, which means it is a
   * property of the `VegaDropdown` object. It is expected to be an array of `VegaDropdownSourceItem`
   * objects.
   * @returns {VegaDropdownSourceItem[]} an array of `VegaDropdownSourceItem` objects.
   */
  search(source: VegaDropdown['source']): VegaDropdownSourceItem[];
  /**
   * The function `canSearch` returns true if the conditions for searching are met.
   *
   * @returns {boolean} The method `canSearch()` returns a boolean value based on the conditions specified in the
   * return statement. It returns `true` if `useDefaultFilter` is true, `searchable` is true, and
   * `searchString` is not an empty string; otherwise, it returns `false`.
   */
  private canSearch;
  /**
   * The function `searchSource` recursively searches through a nested list of `VegaDropdownSourceItem`
   * objects, filtering out items that do not match a search string and modifying the labels of matching
   * items.
   *
   * @param {VegaDropdownSourceItem[]} source - An array of objects of type VegaDropdownSourceItem. Each
   * object represents a dropdown item and may have a "children" property which is an array of nested
   * dropdown items.
   * @param {VegaDropdownSourceItem[]} result - The `result` parameter is an array of
   * `VegaDropdownSourceItem` objects. It is used to store the filtered items that match the search
   * criteria.
   * @returns {VegaDropdownSourceItem[]} an array of VegaDropdownSourceItem objects.
   */
  private searchSource;
  /**
   * The function checks if a given label includes a search string, taking into account case sensitivity.
   *
   * @param {string} label - A string representing the label to be checked for inclusion of the search
   * string.
   * @returns {boolean} a boolean value.
   */
  private isLabelIncludeSearchString;
  /**
   * The function replaces occurrences of a search string in a label with bolded text.
   *
   * @param {string} label - The `label` parameter is a string that represents the label to be modified.
   * @returns {string} a modified version of the input label string. The function uses the `replace` method with a
   * regular expression pattern to find occurrences of the `searchString` within the label. It then
   * replaces each occurrence with the same value wrapped in `<b>` tags. The modified label string is
   * then returned.
   */
  private replaceLabelBySearchString;
}
