mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-08-28 00:01:31 +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<
|
export type DefaultFieldOptions<
|
||||||
D = DocumentData,
|
D = DocumentData,
|
||||||
C extends CustomFN<D> | boolean = false
|
|
||||||
> = IndexOptions & {
|
> = IndexOptions & {
|
||||||
custom?: C;
|
field: FieldName<D>;
|
||||||
field: C extends false ? FieldName<D> : FieldName;
|
filter?: (doc: D) => boolean;
|
||||||
|
db?: StorageInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DefaultCustomFieldOptions<
|
||||||
|
D = DocumentData,
|
||||||
|
> = IndexOptions & {
|
||||||
|
custom: CustomFN<D>;
|
||||||
|
field: FieldName;
|
||||||
filter?: (doc: D) => boolean;
|
filter?: (doc: D) => boolean;
|
||||||
db?: StorageInterface;
|
db?: StorageInterface;
|
||||||
};
|
};
|
||||||
@@ -418,7 +425,7 @@ declare module "flexsearch" {
|
|||||||
|
|
||||||
export type TagOptions<D = DocumentData> = DefaultFieldOptions<D>;
|
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
|
* # Document Search Result
|
||||||
|
Reference in New Issue
Block a user