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

export interface SearchLayerFieldProperties extends JSONSupportMixinProperties, Partial<Pick<SearchLayerField, "exactMatch" | "name" | "type">> {}

/**
 * Represents the field of a layer to use for search.
 *
 * @since 4.7
 */
export default class SearchLayerField extends JSONSupport {
  constructor(properties?: SearchLayerFieldProperties);
  /**
   * 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(): SearchLayerField;
}