import type { estypes } from "@elastic/elasticsearch"; import type { Client, RequestParams, opensearchtypes } from "@opensearch-project/opensearch"; import type { MappingToDocument } from "./mapping.js"; import type { CountRequest, SearchRequest } from "./query/search-query.js"; import type { SearchResponse } from "./search-response.js"; import t from "type-fest"; export type SearchIndexProperties = { [propertyName: string]: estypes.MappingProperty; }; export type IndexRequest = Omit, "index">; export type UpdateRequest = Omit, "index">; export type DeleteRequest = Omit; export type BulkOperation = { index: IndexRequest; } | { upsert: IndexRequest; } | { doc: Document; } | { delete: DeleteRequest; }; export interface BulkRequest extends Omit[]>, "body"> { operations: BulkOperation[]; } export interface SearchIndex { kind: "SearchIndex"; name: Name; /** * Name of the index stored in the cluster. It must be in snake case form */ indexName: t.SnakeCase; options: SearchIndexOptions; client: Client; index(request: IndexRequest): Promise; delete(request: DeleteRequest): Promise; update(request: UpdateRequest): Promise; bulk(request: BulkRequest): Promise; count(request: CountRequest<{ properties: Properties; }>): Promise; search>(request: Q, options?: Omit): Promise>; } export interface SearchIndexOptions extends Partial { mappings: opensearchtypes.MappingTypeMapping & { properties: Properties; }; settings?: opensearchtypes.IndicesIndexSettings; } export declare function index(name: Name, options: SearchIndexOptions): SearchIndex; }, Properties>; //# sourceMappingURL=search-index.d.ts.map