/**
 * Seekora DocSearch Types
 */
import type React from "react";
export interface DocSearchHit {
    objectID: string;
    url: string;
    anchor?: string;
    title: string;
    content: string;
    section_level: number;
    hierarchy: {
        lvl0?: string;
        lvl1?: string;
        lvl2?: string;
        lvl3?: string;
        lvl4?: string;
        lvl5?: string;
    };
    _highlightResult?: {
        title?: {
            value: string;
            matchLevel: string;
        };
        content?: {
            value: string;
            matchLevel: string;
        };
        hierarchy?: {
            lvl0?: {
                value: string;
                matchLevel: string;
            };
            lvl1?: {
                value: string;
                matchLevel: string;
            };
            lvl2?: {
                value: string;
                matchLevel: string;
            };
            lvl3?: {
                value: string;
                matchLevel: string;
            };
        };
    };
    _source?: string;
}
export interface DocSearchSuggestion {
    url: string;
    title: string;
    content?: string;
    description?: string;
    category?: string;
    hierarchy?: {
        lvl0?: string;
        lvl1?: string;
        lvl2?: string;
        lvl3?: string;
        lvl4?: string;
        lvl5?: string;
    };
    highlight?: {
        title?: string;
        content?: string;
    };
    _source?: string;
    route?: string;
    parentTitle?: string;
    type?: string;
    anchor?: string;
}
export interface SearchSource {
    id: string;
    name: string;
    endpoint: string;
    apiKey?: string;
    storeId?: string;
    storeSecret?: string;
    maxResults?: number;
    minQueryLength?: number;
    transformResults?: (data: any) => DocSearchSuggestion[];
    openInNewTab?: boolean;
    icon?: string;
}
export interface DocSearchResponse {
    hits: DocSearchHit[];
    query: string;
    total?: number;
    page?: number;
    nbPages?: number;
}
export interface DocSearchSuggestionsResponse {
    suggestions: DocSearchSuggestion[];
    query: string;
}
export interface DocSearchProps {
    storeId?: string;
    storeSecret?: string;
    seekoraApiEndpoint?: string;
    apiEndpoint?: string;
    apiKey?: string;
    sources?: SearchSource[];
    indexName?: string;
    placeholder?: string;
    maxResults?: number;
    debounceMs?: number;
    onSelect?: (hit: DocSearchHit | DocSearchSuggestion) => void;
    onClose?: () => void;
    translations?: DocSearchTranslations;
    renderButton?: boolean;
    buttonComponent?: React.ComponentType<DocSearchButtonProps>;
    initialOpen?: boolean;
    disableShortcut?: boolean;
    shortcutKey?: string;
    /** Post-process results per source (e.g. filter by permission, resolve :storeId). */
    processGroupedResults?: (sourceId: string, items: DocSearchSuggestion[]) => DocSearchSuggestion[];
    /** Additional CSS class applied to the modal overlay and container — use to scope CSS variable overrides. */
    className?: string;
    /**
     * V4 analytics. Supply all four (writeKey + host + orgcode +
     * xstoreid) to route docsearch analytics — "Search Submitted" + "Object
     * Clicked" — to the tenant's analytics workspace via analytics-next, instead of
     * the legacy V3 event-queue. Partial/absent config falls back to V3.
     * SCRUM-269.
     */
    analyticsWriteKey?: string;
    ingestHost?: string;
    orgcode?: string;
    xstoreid?: string;
    /** Optional logged-in user id for identity stitching (stamped on V4 events). */
    userId?: string;
}
export interface DocSearchButtonProps {
    onClick: () => void;
    placeholder?: string;
    /** Additional CSS class for the button element. */
    className?: string;
}
export interface DocSearchTranslations {
    buttonText?: string;
    buttonAriaLabel?: string;
    searchPlaceholder?: string;
    noResultsText?: string;
    errorText?: string;
    footerText?: string;
    closeText?: string;
    searchByText?: string;
}
export interface DocSearchState {
    query: string;
    results: DocSearchHit[];
    suggestions: DocSearchSuggestion[];
    isLoading: boolean;
    error: string | null;
    selectedIndex: number;
    mode: "suggestions" | "results";
}
export type DocSearchAction = {
    type: "SET_QUERY";
    payload: string;
} | {
    type: "SET_RESULTS";
    payload: DocSearchHit[];
} | {
    type: "SET_SUGGESTIONS";
    payload: DocSearchSuggestion[];
} | {
    type: "SET_LOADING";
    payload: boolean;
} | {
    type: "SET_ERROR";
    payload: string | null;
} | {
    type: "SET_SELECTED_INDEX";
    payload: number;
} | {
    type: "SELECT_NEXT";
} | {
    type: "SELECT_PREV";
} | {
    type: "SET_MODE";
    payload: "suggestions" | "results";
} | {
    type: "RESET";
};
//# sourceMappingURL=types.d.ts.map