import { EventEmitter, ComponentInterface } from '../../stencil-public-runtime';
import { StorageMethods } from '../../utils/store/component-store';
import { SearchChangeEvent } from './algolia-data';
import type { SearchIndex as AlgoliaIndex } from 'algoliasearch/lite';
import type { IndexResult, AlgoliaResultHit, SearchIndex, FilterChangeEventDetail } from './algolia-interface';
interface FacetFilter extends FilterChangeEventDetail {
    element: HTMLNanoAlgoliaFilterElement;
}
type FilterGroup = {
    [prop: string]: FacetFilter;
};
/**
 * Algolia search container to contain and sync nano-algolia-results and nano-algolia-filter components.
 * @slot search-input - optional. Should contain an `input` or `nano-input` component.
 * @slot loader - optional. Elements to show when search results are loading.
 * @slot template - optional. Template string (format depends on 'tplEngine' property). May contain other algolia-... components with nested templates.
 * @slot output - Search result output. Will be a placeholder for template output or optionally nest algolia-... components.
 */
export declare class Algolia implements ComponentInterface {
    private staticFacetFilters;
    private dynFacetFilters;
    private tplSlot;
    private outputSlot;
    private slottedInput;
    private hasLoadSlot;
    private resultsDiv;
    private defaultDiv;
    private tpl;
    private facets;
    private placedAlgoliaEles;
    private algoliaClient;
    private promiseQueue;
    host: HTMLNanoAlgoliaElement;
    _dynFacetFilters: FilterGroup;
    inputField: HTMLNanoInputElement | HTMLInputElement;
    algoliaIndex: AlgoliaIndex;
    indeces: IndexResult[];
    indexResults: IndexResult;
    filterChanged: string;
    currentHits: AlgoliaResultHit[];
    changeEvent: SearchChangeEvent;
    isLoading: boolean;
    wormholeState: any;
    /**
     * Show the result panel. By default it will automatically show when the result receives new hits.
     */
    showResults: boolean;
    /**
     * The current algolia page of results currently being viewed or to get.
     */
    resultsPage: number;
    /**
     * An Algolia App ID key. Used in conjunction with 'searchIndex' & 'apiKey'.
     */
    appId: string;
    /**
     * An Algolia API Key. Used in conjunction with 'searchIndex' & 'appId'.
     */
    apiKey: string;
    /**
     * Algolia search index. Used in conjunction with 'apiKey' & 'appId'.
     * ```
     * { index: string, // algolia index name
     *   domain?: string, // used in template filters to resolve incomplete url fields
     *   filters?: [string], // algolia facets to retrive
     *   hitsPerPage?: number,
     *   name?: string // human readable index name
     * }
     * ```
     */
    searchIndex: SearchIndex;
    /**
     * Algolia search index name. Alternative to 'searchIndex'.
     * A simplified shortcut for setting an index.
     * Properties such as hitsPerPage and facets will come from the algolia index
     */
    searchIndexName: string;
    /**
     * JS querySelector string of a `nano-input` / `input` element from which
     * to listen to `nano-change` or `change` events and change the `query` prop.
     * Not required if an appropriate field is in the 'search-input' slot
     */
    listenTo?: string;
    handleListenToChange(): void;
    /**
     * The query string used to search the index. Will automatically be set with any slotted
     * `search-input` input elements or from elements linked to from `listen-to`
     */
    query: string;
    /**
     * The external operator joining filter values.
     */
    operator: 'or' | 'and';
    /**
     * Query filters to apply to all searches.
     * Refer to https://www.algolia.com/doc/api-reference/api-parameters/filters for format.
     */
    filters: Array<string>;
    /**
     * Template engine render function to use when rendering results and filters.
     * Defaults to Squirrel v8's render (https://squirrelly.js.org/).
     */
    tplRenderFn: (...args: any[]) => any;
    /**
     * Changes the index without removing any current filters. Most appropriate for algolia replicas.
     */
    replicaIndex: string;
    /**
     * Will maintain a search all / '*' on init and reset allowing for a view
     * then filter experience rather than a search first experience
     */
    browseIndex: boolean;
    /**
     * Minimum number of characters before performing a search
     */
    minChars: number;
    /**
     * Store search queries (against this ID) to the component store.
     * Use in conjunction with storeMethod
     */
    storeId?: string;
    /**
     * The method of storage.
     * Either session storage, url hash (after the '#') or url query (after the '?').
     */
    storeMethod: StorageMethods;
    /**
     * Emitted when the algolia element has been created.
     */
    nanoDidLoad: EventEmitter<HTMLNanoAlgoliaElement>;
    /**
     * Emitted when results and all filters are shown and have loaded.
     */
    nanoResultsShown: EventEmitter<{
        meta: IndexResult;
        client: {
            apiKey: string;
            appId: string;
        };
    }>;
    /**
     * Emitted before an algolia search.
     */
    nanoBeforeQuery: EventEmitter<IndexResult>;
    /**
     * Emitted after an algolia search.
     */
    nanoAfterQuery: EventEmitter<IndexResult>;
    /**
     * Emitted after an results have been updated
     */
    nanoNewResults: EventEmitter<IndexResult>;
    /**
     * @param facetName - will clear all filter selections of that type
     * @param facetValue - will remove a single filter selection
     * Remove facet filters (as set from nano-algolia-filter elements).
     * The omission or both will remove all facet filters
     */
    removeFilters(facetName?: string, facetValue?: string): Promise<void>;
    onAllTplUpdate(ev: CustomEvent & {
        target: HTMLElement;
    }): void;
    onPageChange(ev?: CustomEvent): Promise<void>;
    /**
     * nano-algolia-filter changed value.
     * If that happened before a indexResults were setup, it was a static filter.
     * Static filters persist accross search changes
     */
    onFilterChange(ev: CustomEvent): Promise<void>;
    dynFacetFiltersChange(): void;
    browseIndexChange(): void;
    inputFieldSet(): void;
    queryChange(): void;
    private searchChange;
    internalIndexSwitch(): Promise<void>;
    pageChange(): void;
    searchIndexNameChange(): void;
    initAlgoliaClient(): void;
    initAlgoliaIndex(): void;
    showResultsChange(): void;
    handleFilterpropChange(): void;
    private fixDomain;
    private makeAppliedFilters;
    private algoliaSearch;
    private queueSearch;
    private resetPage;
    private clearAllFacetFilters;
    private algoliaFilterStr;
    handleInputChange(ev: CustomEvent | (Event & {
        target: HTMLElement;
    })): void;
    private handleSearchReset;
    private onResultDisplay;
    private updateContent;
    private updateContentQueue;
    componentWillLoad(): void;
    connectedCallback(): void;
    render(): any;
}
export {};
