/** * @fileoverview Utility for suggesting word and phrase completions based on a trie model. * Used for search autocomplete and real-time query suggestions. */ export interface SuggestCompletionsOptions { phrasesModel: Record>>; limitMaxResults?: number; numberOfLastWordsToCheck?: number; optionShowFullQuery?: boolean; } export interface SuggestionResult { name?: string; word?: string; phrase?: string; } /** * ### Autocomplete Topic Phrase Completions * * * Completes the query with the most likely next words for phrases. * If typing 2+ letters of a word, returns all possible words matching those few letters. * * * @param {string} query - The input query which can be pertial words or phrases. * @param {Object} [options] * @param {Object} options.phrasesModel - A custom phrases model to use for autocomplete suggestions. * @param {number} options.limitMaxResults default=10 - The maximum number of autocomplete suggestions to return. * @param {number} options.numberOfLastWordsToCheck default=5 - The number of last words in the query to check for phrase completions. * @returns {Promise>} An array of autocomplete suggestions, each containing either a 'phrase' or 'word' property. * @example * // Basic usage * const suggestions = await suggestNextWordCompletions("self att"); * // Possible output: [{ phrase: "self attention" }, { phrase: "self attract" }, { phrase: "self attack" }] * * @example * // Using options * const customModel = await import("./custom-phrases-model.json"); * const suggestions = await suggestNextWordCompletions("artificial int", { * phrasesModel: customModel, * limitMaxResults: 5, * numberOfLastWordsToCheck: 3 * }); * // Possible output: [{ phrase: "artificial intelligence" }, { phrase: "artificial interpretation" }] * * @author [vtempest (2025)](https://github.com/vtempest) * @category Topics */ export declare function suggestNextWordCompletions(query: string, options?: Partial): Promise;