import type Accessor from "../../core/Accessor.js";
import type { EsriNamedTypeCategories } from "./wasmInterface/WasmDataModelWrapperInterfaces.js";

export interface SearchIndexProperties {}

/**
 * Defines a search index for a [KnowledgeGraph](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-KnowledgeGraph.html).
 *
 * @since 4.26
 * @example
 * //structure of a search index in a knowledge graph data model.
 * {
 * 	"analizers": [
 * 		{
 * 			"name": "text_en"
 * 		}
 * 	],
 * 	"name": "esri__search_idx",
 * 	"searchProperties": [
 * 		{
 * 			"key": "Supplier",
 * 			"value": {
 * 				"propertyNames": [
 * 					"name",
 * 					"EmployeeCount",
 * 					"globalid"
 * 				]
 * 			}
 * 		},
 * 		{
 * 			"key": "buys_part",
 * 			"value": {
 * 				"propertyNames": [
 * 					"quantity",
 * 					"globalid"
 * 				]
 * 			}
 * 		},
 * 		{
 * 			"key": "Part",
 * 			"value": {
 * 				"propertyNames": [
 * 					"name",
 * 					"globalid"
 * 				]
 * 			}
 * 		}
 * 	],
 * 	"supportedCategory": "Both"
 * }
 */
export default class SearchIndex extends Accessor {
  constructor(properties?: SearchIndexProperties);
  /** Additional analyzers for string processing during search such as support for languages. */
  get analyzers(): SearchIndexAnalyzer[];
  /** The name of the search index. */
  get name(): string;
  /** A map of the {@link rest/knowledgeGraph/GraphNamedTyp named types} and their properties that are included in the search index. */
  get searchProperties(): Map<string, SearchProperties>;
  /**
   * Specifies if the index supports searching provenance, entities, relationships or both.
   *
   * @default "esriTypeUNSPECIFIED"
   */
  get supportedCategory(): EsriNamedTypeCategories;
}

export interface SearchIndexAnalyzer {
  /** The name of the analyzer. */
  name: string;
}

/** Search properties. */
export interface SearchProperties {
  /** The properties of the named type that are included in the search index. */
  propertyNames: string[];
}