import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSupport.js";
import type { TableElementType } from "../../portal/jsonTypes.js";

export interface AttributeTableElementProperties extends JSONSupportMixinProperties, Partial<Pick<AttributeTableElement, "description" | "label">> {}

/**
 * Attribute table elements define what should display within the [AttributeTableTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-AttributeTableTemplate.html) elements. These elements can be fields, groups, relationships, or attachments and are used to configure how the data is presented in a [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html).
 *
 * There are four specific table element types:
 *
 * * [AttributeTableFieldElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableFieldElement.html)
 * * [AttributeTableGroupElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableGroupElement.html)
 * * [AttributeTableRelationshipElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableRelationshipElement.html)
 * * [AttributeTableAttachmentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableAttachmentElement.html)
 *
 * The `AttributeTableElement` class is a read-only base class which has no constructor.
 *
 * @since 4.31
 * @see [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html)
 * @see {@link tables/AttributeTableTemplate/}
 */
export default abstract class AttributeTableElement extends JSONSupport {
  /** The table element's description which provides the purpose behind it. */
  accessor description: string | null | undefined;
  /** A string value containing the field alias. */
  accessor label: string | null | undefined;
  /**
   * The type of table element to display.
   *
   * Possible Value | Description
   * ---------------|-------------
   * attachment | An individual [attachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableAttachmentElement.html) element that defines an input for attachments in a [AttributeTableTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-AttributeTableTemplate.html).
   * field | An individual [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableFieldElement.html) element that defines the field within the [table template](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-AttributeTableTemplate.html).
   * group | Contains a {@link tables/elements/TableGroupElement grouping} of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableFieldElement.html) elements.
   * relationship | A [relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tables-elements-AttributeTableRelationshipElement.html) element defines a relationship between [Map#layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) and [Map#tables](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#tables) and how they participate in the [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html).
   */
  get type(): TableElementType;
}