mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-08-30 01:00:11 +02:00
25
index.d.ts
vendored
25
index.d.ts
vendored
@@ -404,21 +404,32 @@ 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;
|
filter?: (doc: D) => boolean;
|
||||||
db?: StorageInterface;
|
db?: StorageInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type FieldOptions<D = DocumentData> = IndexOptions & DefaultFieldOptions<D> & {
|
export type DefaultCustomFieldOptions<
|
||||||
config?: WorkerConfigURL | WorkerConfigPath;
|
D = DocumentData,
|
||||||
|
> = IndexOptions & {
|
||||||
|
custom: CustomFN<D>;
|
||||||
|
field: FieldName;
|
||||||
|
filter?: (doc: D) => boolean;
|
||||||
|
db?: StorageInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TagOptions<D = DocumentData> = DefaultFieldOptions<D>;
|
export type TagOptions<D = DocumentData> = DefaultFieldOptions<D> | DefaultCustomFieldOptions<D>;
|
||||||
|
|
||||||
export type StoreOptions<D = DocumentData> = DefaultFieldOptions<D>;
|
export type StoreOptions<D = DocumentData> = DefaultFieldOptions<D> | DefaultCustomFieldOptions<D>;
|
||||||
|
|
||||||
|
export interface IndexWorkerConfig {
|
||||||
|
config?: WorkerConfigURL | WorkerConfigPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type FieldOptions<D extends DocumentData> =
|
||||||
|
(DefaultFieldOptions<D> & IndexWorkerConfig)
|
||||||
|
| (DefaultCustomFieldOptions<D> & IndexWorkerConfig)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* # Document Search Result
|
* # Document Search Result
|
||||||
|
Reference in New Issue
Block a user