import type { CollectionFieldSchema } from 'typesense/lib/Typesense/Collection';
import type { FacetCountsRequestParams, SearchRequestParams, SearchResponse } from '../../../types/index.js';
import type { SearchDocument, SearchFacet, SearchFacetCount } from '@redocly/theme';
import type { ExportHandler } from 'flexsearch';
import type { AuthDetails } from '../../types';
export type SearchEngineType = 'flexsearch' | 'typesense';
export interface SearchEngine {
    addDocuments(group: string, locale: string, documents: SearchDocument[]): void;
    search(params: SearchRequestParams): Record<string, any>;
    export(outDir: string, facets: Map<string, SearchFacet>): Promise<void>;
    import(sourceDir: string): Promise<void>;
    countFacets(params: FacetCountsRequestParams, facets: Map<string, SearchFacet>): Record<string, SearchFacetCount[]> | object;
}
export type SearchParameters = {
    auth: AuthDetails;
    query: string;
    offset: number;
    groupFacetField?: string;
    product?: string;
    versions?: string[];
};
export interface SearchIndex {
    add(documents: SearchDocument[]): void;
    search(params: SearchParameters): Promise<SearchResponse>;
    export(handler: ExportHandler<string | SearchDocument>): void;
    import(searchData: FlexSearchData): void;
}
export type FlexSearchData = {
    documents: [number, SearchDocument][];
    index: Record<string, any>;
};
export type TypesenseSearchData = {
    documents: SearchDocument[];
    schemaFields: CollectionFieldSchema[];
};
export type AiSearchDocument = {
    url: string;
    fsPath: string;
    content: string;
    title: string;
    locale: string;
    product?: string;
    facets?: Record<string, string>;
};
//# sourceMappingURL=search.d.ts.map