import type { JSONSupport } from "../../core/JSONSupport.js";

export interface RelatedRecordsInfoFieldOrderProperties extends Partial<Pick<RelatedRecordsInfoFieldOrder, "field" | "order">> {}

/**
 * The `RelatedRecordsInfoFieldOrder` class indicates the field display order for the
 * related records in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/).
 *
 * @since 4.11
 * @see [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
 * @see [RelatedRecordsInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/RelatedRecordsInfo/)
 * @see [Sample - Intro to PopupTemplate](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/)
 * @see [Sample - Custom popup actions per feature](https://developers.arcgis.com/javascript/latest/sample-code/popup-custom-action/)
 * @see [Sample - Multiple popup elements](https://developers.arcgis.com/javascript/latest/sample-code/popup-multipleelements/)
 * @see [Sample - PopupTemplate function](https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-function/)
 * @see [Sample - PopupTemplate with promise](https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-promise/)
 */
export default class RelatedRecordsInfoFieldOrder extends JSONSupport {
  constructor(properties?: RelatedRecordsInfoFieldOrderProperties);
  /**
   * The attribute value of the field selected that will drive
   * the sorting of related records.
   */
  accessor field: string;
  /** Set the ascending or descending sort order of the returned related records. */
  accessor order: "asc" | "desc";
  /**
   * Creates a deep clone of the RelatedRecordsInfoFieldOrder class.
   *
   * @returns A deep clone of the RelatedRecordsInfoFieldOrder instance.
   */
  clone(): RelatedRecordsInfoFieldOrder;
}