import type Widget from "../Widget.js";
import type SearchViewModel from "./SearchViewModel.js";
import type { SearchViewModelProperties } from "./SearchViewModel.js";
import type { WidgetProperties } from "../Widget.js";

export interface SearchResultRendererProperties extends WidgetProperties, Partial<Pick<SearchResultRenderer, "showMoreResultsOpen">> {
  /**
   * The view model for this Search. This is a class that contains all the logic
   * (properties and methods) that controls behavior. See the
   * [SearchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/SearchViewModel/) class to access
   * all properties and methods.
   *
   * @example
   * const searchResult = new SearchResultRenderer({
   *   view: view,
   *   container: document.createElement("div"),
   *   showMoreResultsOpen: true,
   *   viewModel: searchViewModel
   * });
   *
   * // Add the result to the bottom-right corner of the view
   * view.ui.add(searchResult, {
   *   position: "bottom-right"
   * });
   */
  viewModel?: SearchViewModelProperties | null;
}

/**
 * The `SearchResultRenderer` renders the [Search][Search](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/) widget
 * or [Search component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-search/) results and allows expanding a DOM element to show alternative matches. These alternative matches
 * appear in the `Show more results` link.
 *
 * @since 4.3
 * @see [Search widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/) - _Deprecated since 4.33. Use the [Search component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-search/) instead._
 * @see [Search component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-search/)
 * @see [SearchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/SearchViewModel/)
 */
export default class SearchResultRenderer extends Widget {
  constructor(properties?: SearchResultRendererProperties);
  /**
   * Indicates whether to display the `Show more results` link within the search result's popup.
   * A value of `true` will not display the link in the popup.
   *
   * @default false
   * @example
   * const searchResult = new SearchResultRenderer({
   *   view: view,
   *   container: document.createElement("div"),
   *   showMoreResultsOpen: true,
   *   viewModel: searchViewModel
   * });
   *
   * // Add the result to the bottom-right corner of the view
   * view.ui.add(searchResult, {
   *   position: "bottom-right"
   * });
   */
  accessor showMoreResultsOpen: boolean;
  /**
   * The view model for this Search. This is a class that contains all the logic
   * (properties and methods) that controls behavior. See the
   * [SearchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/SearchViewModel/) class to access
   * all properties and methods.
   *
   * @example
   * const searchResult = new SearchResultRenderer({
   *   view: view,
   *   container: document.createElement("div"),
   *   showMoreResultsOpen: true,
   *   viewModel: searchViewModel
   * });
   *
   * // Add the result to the bottom-right corner of the view
   * view.ui.add(searchResult, {
   *   position: "bottom-right"
   * });
   */
  get viewModel(): SearchViewModel | null | undefined;
  set viewModel(value: SearchViewModelProperties | null | undefined);
}