import type { ConfigSetting, ConfigurableEntity, ConfigurableEntityConfigSetting, ConfigurableEntityType, EntityType, TypedEntity, TypedEntityConfigSetting } from '..'; import type SvelteCMS from '..'; import type { Content } from './ContentStore'; import type ContentType from './ContentType'; import type { EntityTemplate } from './EntityTemplate'; import type { Changeset } from './Hook'; import type { Media } from './MediaStore'; export type IndexItem = Content; export type IndexChange = { before?: IndexItem; after?: IndexItem; }; export declare function isIndexItem(item: IndexItem | any): item is IndexItem; export type IndexerType = EntityType & ConfigurableEntityType & { getIndex: (id: string) => Promise; updateIndex: (id: string, changes: IndexChange[]) => Promise; saveIndex: (id: string, index: IndexItem[]) => Promise; searchIndex: (id: string, search?: string, options?: Object) => Promise<(Content | Media) & { _score?: number; }[]>; saveContent: (contentType: string | ContentType, content: IndexItem | IndexItem[]) => Promise; deleteContent: (contentType: string | ContentType, content: IndexItem | IndexItem[]) => Promise; indexMedia: (changeset: Changeset, cms: SvelteCMS, options: { [key: string]: any; }) => Promise; saveMedia: (media: Media | Media[]) => Promise; deleteMedia: (media: Media | Media[]) => Promise; searchContent: (contentType: string | ContentType, search: string | Object, options?: Object) => Promise; searchMedia: (search: string | Object, options?: Object) => Promise; }; export declare const templateIndexer: EntityTemplate; export type IndexerConfigSetting = TypedEntityConfigSetting & ConfigurableEntityConfigSetting & { mediaKeys?: string | string[]; }; export declare class Indexer implements ConfigurableEntity, TypedEntity { id: string; type: string; getIndex: (id: string) => Promise; updateIndex: (id: string, changes: IndexChange[]) => Promise; saveIndex: (id: string, index: IndexItem | IndexItem[]) => Promise; searchIndex: (id: string, search?: string, options?: Object) => Promise<(Content | Media) & { _score?: number; }[]>; saveContent: (contentType: ContentType, content: Content | Content[]) => Promise; deleteContent: (contentType: ContentType, content: Content | Content[]) => Promise; indexMedia: (changeset: Changeset, cms: SvelteCMS, options: { [key: string]: any; }) => Promise; saveMedia: (media: Media | Media[]) => Promise; deleteMedia: (media: Media | Media[]) => Promise; searchContent: (contentType: ContentType, search: string | Object, options?: Object) => Promise; searchMedia: (search: string | Object, options?: Object) => Promise; mediaKeys: string[]; options: ConfigSetting; constructor(id: string, conf: string | IndexerConfigSetting, cms: SvelteCMS); } export default Indexer;