mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-08-27 15:50:44 +02:00
- 修正StoreOptions
类型推断。
This commit is contained in:
15
index.d.ts
vendored
15
index.d.ts
vendored
@@ -404,10 +404,17 @@ declare module "flexsearch" {
|
||||
|
||||
export type DefaultFieldOptions<
|
||||
D = DocumentData,
|
||||
C extends CustomFN<D> | boolean = false
|
||||
> = IndexOptions & {
|
||||
custom?: C;
|
||||
field: C extends false ? FieldName<D> : FieldName;
|
||||
field: FieldName<D>;
|
||||
filter?: (doc: D) => boolean;
|
||||
db?: StorageInterface;
|
||||
};
|
||||
|
||||
export type DefaultCustomFieldOptions<
|
||||
D = DocumentData,
|
||||
> = IndexOptions & {
|
||||
custom: CustomFN<D>;
|
||||
field: FieldName;
|
||||
filter?: (doc: D) => boolean;
|
||||
db?: StorageInterface;
|
||||
};
|
||||
@@ -418,7 +425,7 @@ declare module "flexsearch" {
|
||||
|
||||
export type TagOptions<D = DocumentData> = DefaultFieldOptions<D>;
|
||||
|
||||
export type StoreOptions<D = DocumentData> = DefaultFieldOptions<D>;
|
||||
export type StoreOptions<D = DocumentData> = DefaultFieldOptions<D> | DefaultCustomFieldOptions<D>;
|
||||
|
||||
/**
|
||||
* # Document Search Result
|
||||
|
Reference in New Issue
Block a user