import { Client } from 'typesense'; import { SearchParams } from 'typesense/lib/Typesense/Documents.js'; declare const getSearchClient: ( /** * The _searchKey taken from a collection of our GraphQL API. */ _searchKey: string | null) => Client | undefined; type SearchOptions = { queryBy: SearchParams["query_by"]; filterBy?: SearchParams["filter_by"]; sortBy?: SearchParams["sort_by"]; groupBy?: SearchParams["group_by"]; includeFields?: SearchParams["include_fields"]; excludeFields?: SearchParams["exclude_fields"]; page?: SearchParams["page"]; perPage?: SearchParams["per_page"]; highlightFields?: SearchParams["highlight_fields"]; highlightFullFields?: SearchParams["highlight_full_fields"]; highlightStartTag?: SearchParams["highlight_start_tag"]; highlightEndTag?: SearchParams["highlight_end_tag"]; limitHits?: SearchParams["limit_hits"]; pinnedHits?: SearchParams["pinned_hits"]; hiddenHits?: SearchParams["hidden_hits"]; offset?: SearchParams["offset"]; limit?: SearchParams["limit"]; stopwords?: SearchParams["stopwords"]; numTypos?: SearchParams["num_typos"]; prioritizeExactMatch?: SearchParams["prioritize_exact_match"]; textMatchType?: SearchParams["text_match_type"]; prefix?: SearchParams["prefix"]; queryByWeights?: SearchParams["query_by_weights"]; }; type BaseDoc = { _id: string; _idPath: string; _title?: string; _slug?: string; _slugPath?: string; }; type Highlight = { fieldPath: string; fieldValue: unknown; indices: number[]; matchedTokens: string[] | string[][]; snippet: string | undefined; snippets: string[]; value: string | undefined; }; type Hit> = { _key: string; document: Doc & BaseDoc; highlight: Record | undefined; highlights: Array; curated: boolean; textMatch: number; _getField: (fieldPath: string) => unknown; _getFieldHighlight: (fieldPath: string, fallbackFieldPaths?: string[]) => ReturnType; }; type SearchResult> = { empty: boolean; found: number; outOf: number; page: number; searchTimeMs: number; hits: Array>; }; declare const search: >(_searchKey: string | null, q: string, opts: SearchOptions) => Promise>; type AskAiOptions = { conversationId?: string; }; type AskAiResult> = SearchResult & { conversation: { id: string; answer: string; history: { key: string; question: string; answer: string; }[]; }; }; declare const askAi: >(_searchKey: string | null, q: string, opts: SearchOptions) => Promise>; type HighlightedField = undefined | { _type: "rich-text-section"; _content: string; _id?: string; _level?: number; } | { _type: "text"; _content: string; } | { _type: "unknown"; _content: unknown; }; declare function _getFieldHighlightImpl({ hit, fieldPath, fallbackFieldPaths, includeFallback, }: { hit: Hit; fieldPath: string; fallbackFieldPaths?: string[]; includeFallback?: boolean; }): null | { highlightedField: HighlightedField; snippet: string | undefined; snippetByExactMatch: string | undefined; snippetByPrefix: string | undefined; fallbackSnippet: string | undefined; }; export { type AskAiResult as A, type BaseDoc as B, type Hit as H, type SearchOptions as S, type SearchResult as a, askAi as b, type Highlight as c, type AskAiOptions as d, getSearchClient as g, search as s };