import React from "react";
import ReactDOM from "react-dom/client";
import * as RestApi from "../components/client";
import { SearchToken } from "../components/client";
import * as RendererComponents from "../renderer-components";
import { QueryState } from "./Main";
import { ResultsDisplayMode } from "../components/ResultList";
import { Tab } from "../components/Tabs";
import { Options } from "../components/Select";
import { TypeAllFilters } from "../components/AllFiltersConfigurable";
export declare const rendererComponents: typeof RendererComponents;
export declare class OpenK9 {
    static dependencies: {
        React: typeof React;
        ReactDOM: typeof ReactDOM;
        RestApi: typeof RestApi;
        SearchFrontend: {
            OpenK9: typeof OpenK9;
            rendererComponents: typeof RendererComponents;
        };
    };
    private configuration;
    /**
     * rest client instance used by this ui
     * @see {@link OpenK9Client} from **@openk9/rest-api** package
     */
    readonly client: {
        authInit: Promise<boolean> | null;
        authenticate({ token }: {
            token?: string;
        }): Promise<void>;
        deauthenticate(): Promise<void>;
        getUserProfile(): Promise<{}>;
        getGenerateResponse({ searchQuery, controller, }: {
            searchQuery: RestApi.GenerateRequest;
            controller: AbortController;
        }): Promise<Response>;
        getServiceStatus(): Promise<"up" | "down">;
        doSearch<E>(searchRequest: {
            searchQuery: Array<SearchToken>;
            range: [number, number];
            sort: RestApi.SortField[];
            language: string;
            sortAfterKey: string;
            overrideSearchWithCorrection?: boolean;
        }): Promise<{
            result: RestApi.GenericResultItem<E>[];
            total: number;
            autocorrection: RestApi.AutocorrectionType;
        }>;
        generateResponse<E>(searchRequest: RestApi.GenerateRequest): Promise<any>;
        getDateFilterFields(): Promise<{
            id: number;
            field: string;
            label: string;
        }[]>;
        getLabelSort(): Promise<{
            field: string;
            id: number;
            label: string;
        }[]>;
        getLanguages(): Promise<{
            createDate: any;
            modifiedDate: any;
            id: number;
            name: string;
            value: "value";
        }[]>;
        getSortingInfo(): Promise<{
            field: string;
            id: number;
            isDefault: boolean;
            type: string;
            label: string;
            translationMap: {
                "label.en_US"?: string;
                "label.es_ES"?: string;
                "label.it_IT"?: string;
            };
        }[]>;
        getRefreshFilters(): Promise<{
            retrieveType: string;
            refreshOnSuggestionCategory: boolean;
            refreshOnTab: boolean;
            refreshOnDate: boolean;
            refreshOnQuery: boolean;
        }>;
        getLanguageDefault(): Promise<{
            value: string;
        }>;
        getSuggestions({ searchQuery, suggestionCategoryId, range, afterKey, suggestKeyword, order, language, }: {
            searchQuery: SearchToken[];
            suggestionCategoryId?: number;
            range?: [number, number];
            afterKey?: string;
            suggestKeyword?: string;
            order: "desc" | "asc";
            language: string;
        }): Promise<{
            result: RestApi.SuggestionResult[];
            afterKey: string;
        }>;
        getAutocompletes({ searchText, }: {
            searchText: string;
        }): Promise<RestApi.AutocompleteResponse>;
        handle_dynamic_filters(): Promise<{
            handleDynamicFilters: boolean;
        }>;
        getSuggestionCategories(): Promise<{
            name: string;
            id: number;
            multiSelect: boolean;
            translationMap: {
                [key: string]: string;
            };
        }[]>;
        getTabsByVirtualHost(): Promise<Array<{
            label: string;
            tokens: Array<SearchToken>;
            translationMap: {
                [key: string]: string;
            };
            sortings: import("../components/SortResults").Options;
        }>>;
        getTemplatesByVirtualHost(): Promise<Array<string>>;
        loadTemplate<E>(id: string): Promise<RestApi.Template<E> | null>;
        fetchQueryAnalysis(request: RestApi.AnalysisRequest): Promise<RestApi.AnalysisResponse | null>;
    };
    private root;
    private queryClient;
    constructor(configuration?: Partial<Configuration>);
    /** returns current configuration */
    getConfiguration(): {
        autocompleteEnabled: boolean;
        autoselectTab?: boolean | null | undefined;
        debounceTimeSearch: number | null | undefined;
        defaultTokens: Array<SearchToken>;
        externalSearchTokens?: ExternalSearchTokens;
        defaultString: string | null | undefined;
        extraClass?: ExtraClassProps | null | undefined;
        languageSelect: string | null | undefined;
        enabled: boolean;
        callbackClient(): void | null | undefined;
        filterTokens: Array<SearchToken>;
        icons: IconsCustom;
        isQueryAnalysis: boolean | null;
        isActiveSkeleton: {
            results?: boolean | null;
            filters?: boolean | null;
            tabs?: boolean | null;
        } | null;
        filtersMobileBasicCallback: () => void | null | undefined;
        mobileFiltersBasicLiveChange: {
            closeFiltersMobileLiveChangeCallback?: () => void | null | undefined;
            applyfiltersMobileLiveChangeCallback?: () => void | null | undefined;
            viewTabs?: boolean | null | undefined;
            addExtraClass?: string | null | undefined;
        } | null | undefined;
        numberResult: number | null | undefined;
        numberResultOfFilters: number | null | undefined;
        memoryResults: boolean | null | undefined;
        searchAutoselect: boolean;
        searchReplaceText: boolean;
        skeletonTabsCustom: React.ReactNode | null;
        skeletonResultsCustom: React.ReactNode | null;
        skeletonFiltersCustom: React.ReactNode | null;
        skeletonSuggestionCustom: React.ReactNode | null;
        sort: Array<RestApi.SortField>;
        showSyntax: boolean;
        styledSkeletonResults: {
            background?: string | undefined | null;
        } | null | undefined;
        tenant: string | null;
        token: string | null;
        useQueryAnalysis: boolean;
        useKeycloak: boolean;
        useGenerativeApi: boolean | null | undefined;
        useQueryString: boolean;
        useQueryStringFilters: boolean;
        useFilterConfiguration: boolean;
        viewButton: boolean;
        waitKeycloackForToken: boolean;
        activeFilters: Element | string | null;
        calendar: Element | string | null;
        calendarVertical: Element | string | null;
        changeLanguage: Element | string | null;
        detailMobile: Element | string | null;
        details: Element | string | null;
        filters: Element | string | null;
        filtersMobileBasic: Element | string | null;
        generateResponse: Element | string | null;
        login: Element | string | null;
        queryStringValues: queryStringValues;
        queryStringMap: queryStringMapType;
        results: Element | string | null;
        search: Element | string | null;
        searchWithButton: Element | string | null;
        sortable: Element | string | null;
        tabs: Element | string | null;
        totalResult: Element | string | null;
        totalResultMobile: Element | string | null;
        removeFilters: Element | string | null;
        activeFiltersConfigurable: activeFiltersConfigurableProps | null | undefined;
        allFilters: allFiltersConfigurableProps | undefined | null;
        calendarMobile: CalendarMobileConfiguration | null;
        correction: correctionType | undefined | null;
        dataRangePicker: DataRangePickerProps | null;
        dataRangePickerVertical: DataRangePickerVerticalProps | null;
        filtersConfigurable: FilterProps | null;
        filtersHorizontal: FiltersHorizontalConfiguration | null;
        filtersMobile: FiltersHorizontalMobileConfiguration | null;
        filtersMobileLiveChange: FiltersLiveMobileConfiguration | null;
        filtersMobileLiveChangeBasic: Element | string | null;
        removeFiltersConfigurable: RemoveFiltersProps | null;
        resultList: ResultListProps | null;
        resultListPagination: ResulListPaginationProps | null;
        resultsDisplayMode: ResultsDisplayMode;
        searchConfigurable: SearchProps | null;
        searchWithSuggestions: searchWithSuggestionsProps;
        searchMobile: SearchMobileConfiguration | null;
        select: SelectProps | null;
        skeleton: SkeletonProps | null;
        sortableConfigurable: SortableProps | null;
        sortResults: SortResultsProps | null;
        sortResultConfigurable: SortResultConfigurableProps | null;
        sortResultListCustom: SortResultListCustomProps | null;
        tabsConfigurable: TabsProps | null;
        template: TemplatesProps | null;
        totalResultConfigurable: totalResultProps | null;
        changeSortResult: (sort: Array<RestApi.SortField>) => Array<RestApi.SortField>;
        overrideTabs: (tabs: Array<Tab>) => Array<Tab>;
    };
    /**
     * updates configuration with provided fields
     *
     * also accepts a function that produces an object with fields to update
     */
    updateConfiguration: ConfigurationUpdateFunction;
    private render;
    private getRootElement;
    /** authenticate the user with given token */
    authenticate: ({ token }: {
        token?: string;
    }) => Promise<void>;
    /** logs out the user, all subsequent queries will be anonymous */
    deauthenticate: () => Promise<void>;
    private listeners;
    private notify;
    addEventListener<E extends keyof Events>(event: E, listener: (payload: Events[E]) => void): void;
    removeEventListener<E extends keyof Events>(event: E, listener: (payload: Events[E]) => void): void;
    private onQueryStateChange;
}
type FiltersHorizontalConfiguration = {
    element: Element | string | null;
    callback: () => void | null;
    callbackSubmit: () => void | null;
    callbackReset: () => void | null;
    refButton?: React.RefObject<HTMLButtonElement>;
};
type FiltersHorizontalMobileConfiguration = {
    element: Element | string | null;
    isVisible: boolean;
    setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
};
type FiltersLiveMobileConfiguration = {
    element: Element | string | null;
    isVisible: boolean;
    setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
    viewTabs?: boolean | null;
    isCollapsable?: boolean | null;
    haveSearch?: boolean | null;
};
type SearchMobileConfiguration = {
    search: Element | string | null;
    isVisible: boolean;
    setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
    isShowSyntax?: boolean | undefined | null;
};
type CalendarMobileConfiguration = {
    element: Element | string | null;
    isVisible: boolean;
    setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
    startDate: any;
    setStartDate: any;
    endDate: any;
    setEndDate: any;
    focusedInput: any;
    setFocusedInput: any;
    isCLickReset: boolean;
    setIsCLickReset: React.Dispatch<React.SetStateAction<boolean>>;
};
type DataRangePickerProps = {
    element: Element | string | null;
    start?: any;
    end?: any;
};
type DataRangePickerVerticalProps = {
    element: Element | string | null;
    start?: any;
    end?: any;
    readOnly?: boolean;
    internationalLabel?: {
        labelStart?: string;
        labelEnd?: string;
        placeholderStart?: string;
        placeholderEnd?: string;
        errorFormatData?: string;
        errorSelectData?: string;
    };
};
type ResultListProps = {
    element: Element | string | null;
    changeOnOver: boolean;
    counterIsVisible?: boolean;
    label?: string;
    noResultsCustom?: React.ReactNode;
};
type SortResultConfigurableProps = {
    sort: Element | string | null;
    relevance: string;
    htmlKey?: string | null | undefined;
};
type SortResultListCustomProps = {
    selectOptions: Array<{
        value: {
            value: string;
            sort: string;
        };
        label: string;
        sort: string;
        isDefault: boolean;
        hasAscDesc: boolean;
    }>;
    labelSort?: string | null | undefined;
    element: Element | string | null;
};
type SortableProps = {
    element: Element | string | null;
    relevance: string;
};
export type characterControlType = {
    actionCharacter(): void;
    numberOfCharacters: number;
};
type SearchProps = {
    element: Element | string | null;
    btnSearch: boolean;
    defaultValue?: string | undefined | null;
    htmlKey?: string | undefined | null;
    messageSearchIsVisible?: boolean;
    customMessageSearch?: string;
    characterControl?: characterControlType;
    actionOnClick?(): void;
    callbackClickSearch?(): void;
    callbackChangeSearch?(text: string): void;
};
type FilterProps = {
    element: Element | string | null;
    numberItems?: number | null | undefined;
    noResultMessage?: string | null | undefined;
    placeholder?: string | null | undefined;
    haveSearch?: boolean | null | undefined;
};
type ResulListPaginationProps = {
    element: Element | string | null;
    callback?: () => void | null | undefined;
    noResultsCustom?: React.ReactNode | null | undefined;
};
export type ExternalSearchTokenKind = "tabs" | "search" | "filters";
export type ExternalSearchTokenEntry = {
    kind: ExternalSearchTokenKind;
    tokens: Array<SearchToken>;
};
export type ExternalSearchTokens = Array<ExternalSearchTokenEntry> | null | undefined;
export type TabsCallbackProps = ({ callbackSelectTab, callbackUnselectTab, tabs, selectedTabIndex, }: {
    callbackSelectTab: (tabSelect: {
        index: number;
    }) => void;
    callbackUnselectTab: (index: number) => void;
    tabs: Tab[];
    selectedTabIndex: number;
}) => React.ReactNode;
type TabsProps = {
    element: Element | string | null;
    onAction?(): void;
    scrollMode?: boolean;
    speed?: number;
    distance?: number;
    step?: number;
    pxHiddenRightArrow?: number;
    reset?: {
        filters: boolean;
        calendar: boolean;
        sort: boolean;
        search: boolean;
    };
    readMessageScreenReader?: boolean;
    textLabelScreenReader?: string;
    tabs?: TabsCallbackProps;
    isUnselectTab: boolean;
};
type SelectProps = {
    element: Element | string | null;
    options: Options;
    extraClass?: string;
    handleChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
};
type SortResultsProps = {
    element: Element | string | null;
    extraClass?: string;
    classNameLabel?: string | undefined;
    labelText?: string | undefined;
    defaultLabelName?: string | undefined;
};
type totalResultProps = {
    element: Element | string | null;
    saveTotalResultState?: React.Dispatch<React.SetStateAction<number | null>>;
};
type activeFiltersConfigurableProps = {
    element: Element | string | null;
    actioneRemoveFilters?(): void;
    callbackRemoveFilter?(): void;
};
type SkeletonProps = {
    skeleton: Element | string | null;
    width?: string | null | undefined;
    height?: string | null | undefined;
    counter?: number | null | undefined;
    circle?: boolean | null | undefined;
    backgroundColor?: string | null | undefined;
    itereitorKey?: string | null | undefined;
    containerMax?: boolean | null | undefined;
    position?: "column" | "row";
    gap?: string | null | undefined;
};
type searchWithSuggestionsProps = {
    element: Element | string | null;
    callbackSearchButton?(): void;
    ariaLabelIcon?: string;
    placeholder?: string;
} | null | undefined;
type RemoveFiltersProps = {
    element: Element | string | null;
    itemsRemove?: resetFiltersType;
    label?: string | null | undefined;
    ariaLabel?: string | null | undefined;
    callback?: () => void;
};
export type resetFiltersType = Array<"filters" | "calendar" | "sort" | "search" | "language">;
export type TemplatesProps = Array<{
    source: string;
    Template: React.FC<any>;
    TemplateDetail: React.FC<any>;
}>;
export type ExtraClassProps = {
    classSearch?: {
        input?: string;
        button?: string;
    } | null | undefined;
    classResultsListPagination?: {
        buttonPagination?: string;
        activeButtonPagination?: string;
    } | null | undefined;
};
export type IconsCustom = {
    Search?: React.ReactNode;
} | null | undefined;
export type queryStringMapType = ({
    keyObj?: string | null | undefined;
} & Partial<{
    text: string;
    textOnChange: string;
    filters: string;
    selection: string;
}>) | null | undefined;
type correctionType = {
    element: Element | string | null;
    information: (correctedQuery: string, errorQuery: string, confirm: () => void, hasAutocorretion?: boolean, confirmedErrorQuery?: () => void) => React.ReactNode;
};
export type translationGlobalType = {
    labelStart?: string;
    labelEnd?: string;
    placeholderStart?: string;
    placeholderEnd?: string;
    errorFormatData?: string;
    errorSelectData?: string;
    filtersLabel?: string;
    calendarLabel?: string;
    buttonResetFilters?: string;
    buttonSaveFilters?: string;
    ariaLabelSave?: string;
    ariaLabelReset?: string;
    labelContainerDateTitleStart?: string;
    labelContainerDateTitleEnd?: string;
};
type allFiltersConfigurableProps = {
    element: Element | string | null;
    typeFilters: TypeAllFilters;
    translationLabel?: translationGlobalType;
    callbackSave?(): void | null | undefined;
    callbackReset?(): void | null | undefined;
};
export type Configuration = {
    autocompleteEnabled: boolean;
    autoselectTab?: boolean | null | undefined;
    debounceTimeSearch: number | null | undefined;
    defaultTokens: Array<SearchToken>;
    externalSearchTokens?: ExternalSearchTokens;
    defaultString: string | null | undefined;
    extraClass?: ExtraClassProps | null | undefined;
    languageSelect: string | null | undefined;
    enabled: boolean;
    callbackClient(): void | null | undefined;
    filterTokens: Array<SearchToken>;
    icons: IconsCustom;
    isQueryAnalysis: boolean | null;
    isActiveSkeleton: {
        results?: boolean | null;
        filters?: boolean | null;
        tabs?: boolean | null;
    } | null;
    filtersMobileBasicCallback: () => void | null | undefined;
    mobileFiltersBasicLiveChange: {
        closeFiltersMobileLiveChangeCallback?: () => void | null | undefined;
        applyfiltersMobileLiveChangeCallback?: () => void | null | undefined;
        viewTabs?: boolean | null | undefined;
        addExtraClass?: string | null | undefined;
    } | null | undefined;
    numberResult: number | null | undefined;
    numberResultOfFilters: number | null | undefined;
    memoryResults: boolean | null | undefined;
    searchAutoselect: boolean;
    searchReplaceText: boolean;
    skeletonTabsCustom: React.ReactNode | null;
    skeletonResultsCustom: React.ReactNode | null;
    skeletonFiltersCustom: React.ReactNode | null;
    skeletonSuggestionCustom: React.ReactNode | null;
    sort: Array<RestApi.SortField>;
    showSyntax: boolean;
    styledSkeletonResults: {
        background?: string | undefined | null;
    } | null | undefined;
    tenant: string | null;
    token: string | null;
    useQueryAnalysis: boolean;
    useKeycloak: boolean;
    useGenerativeApi: boolean | null | undefined;
    useQueryString: boolean;
    useQueryStringFilters: boolean;
    useFilterConfiguration: boolean;
    viewButton: boolean;
    waitKeycloackForToken: boolean;
    activeFilters: Element | string | null;
    calendar: Element | string | null;
    calendarVertical: Element | string | null;
    changeLanguage: Element | string | null;
    detailMobile: Element | string | null;
    details: Element | string | null;
    filters: Element | string | null;
    filtersMobileBasic: Element | string | null;
    generateResponse: Element | string | null;
    login: Element | string | null;
    queryStringValues: queryStringValues;
    queryStringMap: queryStringMapType;
    results: Element | string | null;
    search: Element | string | null;
    searchWithButton: Element | string | null;
    sortable: Element | string | null;
    tabs: Element | string | null;
    totalResult: Element | string | null;
    totalResultMobile: Element | string | null;
    removeFilters: Element | string | null;
    activeFiltersConfigurable: activeFiltersConfigurableProps | null | undefined;
    allFilters: allFiltersConfigurableProps | undefined | null;
    calendarMobile: CalendarMobileConfiguration | null;
    correction: correctionType | undefined | null;
    dataRangePicker: DataRangePickerProps | null;
    dataRangePickerVertical: DataRangePickerVerticalProps | null;
    filtersConfigurable: FilterProps | null;
    filtersHorizontal: FiltersHorizontalConfiguration | null;
    filtersMobile: FiltersHorizontalMobileConfiguration | null;
    filtersMobileLiveChange: FiltersLiveMobileConfiguration | null;
    filtersMobileLiveChangeBasic: Element | string | null;
    removeFiltersConfigurable: RemoveFiltersProps | null;
    resultList: ResultListProps | null;
    resultListPagination: ResulListPaginationProps | null;
    resultsDisplayMode: ResultsDisplayMode;
    searchConfigurable: SearchProps | null;
    searchWithSuggestions: searchWithSuggestionsProps;
    searchMobile: SearchMobileConfiguration | null;
    select: SelectProps | null;
    skeleton: SkeletonProps | null;
    sortableConfigurable: SortableProps | null;
    sortResults: SortResultsProps | null;
    sortResultConfigurable: SortResultConfigurableProps | null;
    sortResultListCustom: SortResultListCustomProps | null;
    tabsConfigurable: TabsProps | null;
    template: TemplatesProps | null;
    totalResultConfigurable: totalResultProps | null;
    changeSortResult: (sort: Array<RestApi.SortField>) => Array<RestApi.SortField>;
    overrideTabs: (tabs: Array<Tab>) => Array<Tab>;
};
export type ConfigurationUpdateFunction = (configuration: Partial<Configuration> | ((configuration: Configuration) => Partial<Configuration>)) => void;
type Events = {
    configurationChange: Configuration;
    queryStateChange: QueryState;
};
declare global {
    interface Window {
        OpenK9: typeof OpenK9;
    }
}
export type queryStringValues = ("text" | "selection" | "textOnChange" | "filters")[] | null | undefined;
export {};
