From 15a9ff334a5efd1a2bdfaba2d8fb159793baf950 Mon Sep 17 00:00:00 2001 From: flycran Date: Mon, 5 May 2025 10:47:57 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E6=9B=B4=E6=96=B0index.d.ts=20=20=20-=20?= =?UTF-8?q?=E4=B8=BAResolver=E6=B7=BB=E5=8A=A0=E6=B3=9B=E5=9E=8B=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新types.ts 测试ts静态类型 --- index.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1a61e90..f4ba065 100644 --- a/index.d.ts +++ b/index.d.ts @@ -217,9 +217,9 @@ declare module "flexsearch" { /* Index Search */ /************************************/ - type DefaultSearchResults = Id[]; + export type DefaultSearchResults = Id[]; type IntermediateSearchResults = Array; - type SearchResults = DefaultSearchResults | Resolver; + type SearchResults = DefaultSearchResults | Resolver; /** * **Document:** @@ -606,14 +606,14 @@ declare module "flexsearch" { enrich?: boolean; }; - type ResolverOptions = DefaultResolve & { - index?: Index | Document; - pluck?: FieldName; - field?: FieldName; - and?: ResolverOptions | Array; - or?: ResolverOptions | Array; - xor?: ResolverOptions | Array; - not?: ResolverOptions | Array; + type ResolverOptions = DefaultResolve & { + index?: Index | Document; + pluck?: FieldName; + field?: FieldName; + and?: ResolverOptions | Array>; + or?: ResolverOptions | Array>; + xor?: ResolverOptions | Array>; + not?: ResolverOptions | Array>; boost?: number; suggest?: boolean; resolve?: boolean; @@ -660,7 +660,7 @@ declare module "flexsearch" { addReplacer(match: string | RegExp, replace: string): this; } - export class Resolver { + export class Resolver { result: IntermediateSearchResults; constructor(options?: ResolverOptions | IntermediateSearchResults); @@ -679,7 +679,7 @@ declare module "flexsearch" { boost(boost: number): this; - resolve(options?: DefaultResolve): SearchResults; + resolve(options?: DefaultResolve): SearchResults; } class StorageInterface {