1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-01 01:51:57 +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);
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.