diff --git a/index.d.ts b/index.d.ts index d02f78c..fa753b7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -994,16 +994,16 @@ declare module "flexsearch" { constructor(options?: ResolverOptions | IntermediateSearchResults); - and(...args: ResolverOptions[]): + and(...args: ResolverOptions[]): IndexSearchResultsWrapper; - or(...args: ResolverOptions[]): + or(...args: ResolverOptions[]): IndexSearchResultsWrapper; - xor(...args: ResolverOptions[]): + xor(...args: ResolverOptions[]): IndexSearchResultsWrapper; - not(...args: ResolverOptions[]): + not(...args: ResolverOptions[]): IndexSearchResultsWrapper; limit(limit: number): Resolver; diff --git a/test/types.ts b/test/types.ts index 566148f..c31bf52 100644 --- a/test/types.ts +++ b/test/types.ts @@ -193,10 +193,12 @@ async function test_document() { const doc26: EnrichedResults = doc24.and({}, { index: document2 }).resolve({ enrich: true }); // highlight within last resolver stage is work in progress: const doc27: EnrichedResults = doc24.and({}, { index: document2, resolve: true, highlight: "" }); + const doc28: DefaultSearchResults = document2.search({ pluck: { field: "meta:title", limit: 10 } }); + const doc30: EnrichedResults = document2.search({ pluck: { field: "meta:title", highlight: true } }); // highlight on .resolve() is never supported: // @ts-expect-error - const doc28: EnrichedResults = doc24.resolve({ highlight: "" }); + const err0: EnrichedResults = doc24.resolve({ highlight: "" }); // @ts-expect-error const err1: DocumentData = doc1[0].result[0].doc;