import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common'; import { CollectionService, EventBus, JobQueueService, ProductService, ProductVariantService, RequestContext, SerializedRequestContext, TransactionalConnection } from '@vendure/core'; import MiniSearch from 'minisearch'; import { BetterSearchConfig } from '../types'; export declare class IndexService implements OnModuleInit, OnApplicationBootstrap { private connection; private options; private jobQueueService; private productService; private productVariantService; private eventBus; private collectionService; private jobQueue; private rebuildIndicesQueue; constructor(connection: TransactionalConnection, options: BetterSearchConfig, jobQueueService: JobQueueService, productService: ProductService, productVariantService: ProductVariantService, eventBus: EventBus, collectionService: CollectionService); onApplicationBootstrap(): void; onModuleInit(): Promise; /** * Builds the index for all products for the given channel for the given language. * Saves the index to the database. */ buildIndex(ctx: RequestContext): Promise; getIndex(ctx: RequestContext): Promise; /** * Creates a job to reindex all products for the given channel for the given language. */ triggerReindex(ctx: RequestContext): Promise>; /** * Instantiates a new MiniSearch instance (index) with the given settings for the given indexable products. */ private createMiniSearch; /** * Adds index rebuild to the queue, and waits for more events to come in before triggering an index rebuild. */ private debouncedRebuildIndex; private getAllVariantsForProduct; }