import type ColumnTemplateBase from "./ColumnTemplateBase.js";
import type { AttachmentsColumnTemplateProperties } from "./AttachmentsColumnTemplate.js";
import type { ColumnTemplateProperties } from "./ColumnTemplate.js";
import type { ColumnTemplateBaseProperties } from "./ColumnTemplateBase.js";
import type { FieldColumnTemplateProperties } from "./FieldColumnTemplate.js";
import type { RelationshipColumnTemplateProperties } from "./RelationshipColumnTemplate.js";
import type { GroupColumnSupportedTemplates } from "./types.js";

export interface GroupColumnTemplateProperties extends ColumnTemplateBaseProperties {
  /**
   * A collection of [field column templates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/) and/or [group column templates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/GroupColumnTemplate/) that represent an ordered list of column templates.
   *
   * Column templates are designed to allow the developer the ability to
   * define the structure for columns within the [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) widget.
   *
   * @see [FieldColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/)
   * @see [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/)
   * @example
   * // Create a new table template
   * const tableTemplate = new TableTemplate({
   *   columnTemplates: [{ // Autocasts to new GroupColumnTemplate
   *     type: "group",
   *     label: "Inspector information",
   *     columnTemplates: [{
   *       // Autocasts to new FieldColumnTemplate
   *       type: "field",
   *       fieldName: "inspector",
   *       label: "name"
   *     },{
   *       type: "field",
   *       fieldName: "inspemail",
   *       label: "Email address"
   *     },{
   *       type: "field",
   *       fieldName: "insp_date",
   *       label: "Date of inspection"
   *     }]
   *   }]
   * });
   */
  columnTemplates?: ((FieldColumnTemplateProperties & { type: "field"; }) | (ColumnTemplateProperties & { type: "column"; }) | (AttachmentsColumnTemplateProperties & { type: "attachment"; }) | (RelationshipColumnTemplateProperties & { type: "relationship"; }))[];
}

/**
 * A GroupColumnTemplate formats and defines the structure of a [GroupColumn](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/Grid/GroupColumn/) within a
 * [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) widget.
 *
 * The GroupColumnTemplate is set directly on the table's [template](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/) or its [view model](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/FeatureTableViewModel/#tableTemplate).
 * The FeatureTable's [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/) contains a collection of [field/group column templates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/#columnTemplates).
 *
 * @since 4.24
 * @see [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/)
 * @see [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/)
 * @see [FieldColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/)
 * @see [Sample - FeatureTable widget with editing enabled](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-editing/)
 * @example
 * const groupColumnTemplate = new GroupColumnTemplate({
 *   fieldName: "full_name",
 *   label: "Full name"
 * });
 */
export default class GroupColumnTemplate extends ColumnTemplateBase {
  constructor(properties?: GroupColumnTemplateProperties);
  /**
   * A collection of [field column templates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/) and/or [group column templates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/GroupColumnTemplate/) that represent an ordered list of column templates.
   *
   * Column templates are designed to allow the developer the ability to
   * define the structure for columns within the [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) widget.
   *
   * @see [FieldColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/)
   * @see [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/)
   * @example
   * // Create a new table template
   * const tableTemplate = new TableTemplate({
   *   columnTemplates: [{ // Autocasts to new GroupColumnTemplate
   *     type: "group",
   *     label: "Inspector information",
   *     columnTemplates: [{
   *       // Autocasts to new FieldColumnTemplate
   *       type: "field",
   *       fieldName: "inspector",
   *       label: "name"
   *     },{
   *       type: "field",
   *       fieldName: "inspemail",
   *       label: "Email address"
   *     },{
   *       type: "field",
   *       fieldName: "insp_date",
   *       label: "Date of inspection"
   *     }]
   *   }]
   * });
   */
  get columnTemplates(): GroupColumnSupportedTemplates[];
  set columnTemplates(value: ((FieldColumnTemplateProperties & { type: "field"; }) | (ColumnTemplateProperties & { type: "column"; }) | (AttachmentsColumnTemplateProperties & { type: "attachment"; }) | (RelationshipColumnTemplateProperties & { type: "relationship"; }))[]);
  /** The type of column that the template represents. */
  get type(): "group";
}