diff --git a/index.d.ts b/index.d.ts index f4f1faa..cfa7c0b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3,11 +3,20 @@ import type { SearchClient as AlgoliaSearchClient, CompositionClient } from "ins type SearchClient = CompositionClient | AlgoliaSearchClient; import type { ConfigurationOptions } from "typesense/lib/Typesense/Configuration"; -import type { DocumentSchema, SearchParamsWithPreset } from "typesense/lib/Typesense/Documents"; +import type { DocumentSchema, SearchParams, SearchParamsWithPreset } from "typesense/lib/Typesense/Documents"; +import { OperationMode } from "typesense/lib/Typesense/Documents"; import { default as TypesenseSearchClient } from "typesense/lib/Typesense/SearchClient"; +import { arrayableParams } from "typesense/lib/Typesense/Types"; -interface BaseSearchParameters - extends Partial, "q" | "filter_by">> { +type SearchParamsWithoutArray = { + [K in keyof SearchParams]: K extends keyof typeof arrayableParams + ? Exclude[K], any[]> + : SearchParams[K]; +}; + +interface BaseSearchParameters + extends Partial, "q" | "filter_by" | "infix">> { + preset?: string; /** * @deprecated Please use the snake_cased version of this parameter */ @@ -84,6 +93,8 @@ interface BaseSearchParameters