From 9de476bb8fbd6f58a18e9d5b0f0f2151d4b4410d Mon Sep 17 00:00:00 2001 From: gritschf Date: Wed, 14 Aug 2019 15:59:59 +0200 Subject: [PATCH] add doc to CreateOptions and change type from o to string in add(...) --- index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index a4e759b..d2ea57a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -9,7 +9,7 @@ declare module "flexsearch" { init(options: CreateOptions); info(); add(o: T); - add(id: number, o: T); + add(id: number, o: string); // Result without pagination -> T[] search(query: string, options: number | SearchOptions, callback: (results: T[]) => void): void; @@ -52,6 +52,11 @@ declare module "flexsearch" { result: T[] } + interface Document { + id: string; + field: any; + } + export type CreateOptions = { profile?: IndexProfile; @@ -67,6 +72,7 @@ declare module "flexsearch" { stemmer?: Stemmer | string | false; filter?: FilterFn | string | false; rtl?: boolean; + doc?: Document; }; // limit number Sets the limit of results.