1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-02 10:23:50 +02:00

add doc to CreateOptions and change type from o to string in add(...)

This commit is contained in:
gritschf
2019-08-14 15:59:59 +02:00
parent f8fee5a511
commit 9de476bb8f

8
index.d.ts vendored
View File

@@ -9,7 +9,7 @@ declare module "flexsearch" {
init(options: CreateOptions); init(options: CreateOptions);
info(); info();
add(o: T); add(o: T);
add(id: number, o: T); add(id: number, o: string);
// Result without pagination -> T[] // Result without pagination -> T[]
search(query: string, options: number | SearchOptions, callback: (results: T[]) => void): void; search(query: string, options: number | SearchOptions, callback: (results: T[]) => void): void;
@@ -52,6 +52,11 @@ declare module "flexsearch" {
result: T[] result: T[]
} }
interface Document {
id: string;
field: any;
}
export type CreateOptions = { export type CreateOptions = {
profile?: IndexProfile; profile?: IndexProfile;
@@ -67,6 +72,7 @@ declare module "flexsearch" {
stemmer?: Stemmer | string | false; stemmer?: Stemmer | string | false;
filter?: FilterFn | string | false; filter?: FilterFn | string | false;
rtl?: boolean; rtl?: boolean;
doc?: Document;
}; };
// limit number Sets the limit of results. // limit number Sets the limit of results.