import type { JSONSupport } from "../../core/JSONSupport.js";
import type { FieldType } from "../../layers/support/types.js";

export interface SearchTableFieldProperties extends Partial<Pick<SearchTableField, "exactMatch" | "name" | "type">> {}

/**
 * Represents the field of a table to use for search.
 *
 * @since 4.18
 */
export default class SearchTableField extends JSONSupport {
  constructor(properties?: SearchTableFieldProperties);
  /**
   * Whether or not the field is an exact match.
   *
   * @default false
   */
  accessor exactMatch: boolean;
  /** The name of the field. */
  accessor name: string | null | undefined;
  /** The data type of the field. */
  type?: FieldType | null;
  /**
   * Creates a deep clone of this object.
   *
   * @returns Creates a deep clone of the instance calling this method.
   */
  clone(): SearchTableField;
}