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:
8
index.d.ts
vendored
8
index.d.ts
vendored
@@ -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.
|
||||
|
Reference in New Issue
Block a user