import { SearchSynonyms, SearchServiceOptions, SearchRankModel, SearchResultModel, CommonSearchModel, RawServerData, SynonymsOfWord, PageContentKeys, LastCacheUpdate, ServerDataRequestConfig, AEMTypes } from "./models";
export declare abstract class AbstractSearchService {
    protected rawData: any[];
    protected synonymsList: SearchSynonyms;
    options: SearchServiceOptions;
    lastCacheUpdate: LastCacheUpdate;
    /**
     * This method can be used to build a delay for the fetching
     * in case of having multiple instances of the search service.
     * If there is only one instance, it should be 0
     *
     */
    abstract instanceNumber: number;
    /**
     * This method can be used to build a delay for the fetching
     * in case of having multiple instances of the search service.
     * put the number of minutes which should be the delay
     *
     */
    abstract instanceDelay: number;
    /**
     * a boolean to enable manual cache trigger. should be specified in the .env file
     */
    abstract enableCacheTrigger: boolean;
    /**
     * push different methods to this empty array
     * to run methods after cache has been updated
     */
    protected serverDataCallBacks: (() => void)[];
    /**
     * a method which returns the url string to fetch data from the external (AEM) server
     */
    abstract getSearchUrl(serverDataRequestConfig?: ServerDataRequestConfig): string | string[];
    /**
     * This method can be used to inject custom headers
     *
     */
    abstract getSearchUrlRequestInits(): RequestInit;
    /**
     * return an array of SearchRankModels to define the importance of elements to search in
     * @param searchModel defines the structure of the search model
     */
    abstract getSearchCriteria(searchModel: CommonSearchModel): SearchRankModel[];
    /**
     *
     * @param options defines the options for the search service
     */
    constructor(options: SearchServiceOptions);
    /**
     * sets up the intetvall for refetching the data from the AEM
     */
    setUpCacheInterval(): Promise<void>;
    cacheIntervalLifecycle(): Promise<void>;
    /**
     * async method which will automatically get called
     * by index.ts
     */
    setUpSearchService(): Promise<void>;
    protected setUp(): Promise<void>;
    /***
     * this method should be used to call custom methods before setting up the defaultAPI, cache interval and synonym list
     */
    abstract setUpCallbacksBefore(): Promise<void>;
    /***
     * this method should be used to call custom methods after setting up the defaultAPI, cache interval and synonym list
     */
    abstract setUpCallbacksAfter(): Promise<void>;
    abstract cacheIntervalBefore(): Promise<void>;
    abstract cacheIntervalAfter(): Promise<void>;
    /**
     * transforms any json object to a CommonSearchModel
     * @param child an json object
     */
    abstract getRawDataElement(child: any, type: AEMTypes): any;
    /**
     * creates a default rest endpoint for the search when express and a apiPath is set
     */
    private setUpDefaultAPI;
    /**
     * this method is used to manually trigger the cache update
     */
    triggerGetServerData(): Promise<void>;
    /**
     * fetches the raw data from the (AEM) server.
     * This will be done in intervall depending on the cache config to update the cached data.
     * The fetched data needs  structure like: {pathList:[{...}]}
     */
    getServerData(serverDataRequestConfig?: ServerDataRequestConfig): Promise<void>;
    /**
     * takes a string with one or multiple words and return a SearchResultModel
     * @param search a search string with multiple worlds like: 'imprint page'
     */
    getSearchResult(search: string): SearchResultModel;
    /**
     * takes a string with one word and return a SearchResultModel
     * @param search a search string with only one word like: 'imprint'
     */
    searchForSingleWord(search: string): SearchResultModel;
    /**
     * filters the raw content child for the needed content keys. Injected manipulation method can be used to change
     * the content
     * @param contentChild a content child from the raw data of the (AEM) server api
     * @param pageContentKeys a list of strings which are used as keys in the content child to reduce the raw data
     */
    protected getFilteredContent(contentChild: RawServerData, pageContentKeys: PageContentKeys[]): any;
    protected getObjectKeys(obj: any, pageContentKeys: PageContentKeys[]): any;
    /**
     * looks for synonyms by a given string and reteturns the used string with the list of synonyms
     * @param search a single world string
     */
    getSynonyms(search: string): string[];
    /**
     * takes a string (possibly separated by ,)
     * and returns a json Object with all synonyms for each word
     * @param searchWord
     */
    getSynonymsOfWord(searchWord: string): SynonymsOfWord;
    /**
     * get the searchrank for a search or list of synonyms
     * @param searchModel
     * @param searchWithSynonyms
     */
    getSearchRank(searchModel: CommonSearchModel, searchWithSynonyms: string[]): CommonSearchModel;
    /**
     * checks if a query or it's synonym is in a given search model
     * @param searchModel an elements of the search model with a search rank
     * @param search the query of the search from a user
     */
    isKeyWordFoundInSynonym(searchModel: SearchRankModel, searchWithSynonyms: string[]): boolean;
    matchKeywordToSynonym(synonym: string, searchElement: string, fullMatch: boolean): boolean;
    /**
     *
     * @param data an array of raw data elements from the (AEM) server API
     */
    protected setUpData(data: RawServerData[], type: AEMTypes): void;
    /**
     * returns a german synonym list
     */
    getDefaultSynonyms(): SearchSynonyms;
}
