From be79d4820b4ecde72f0832cca4dfcac227d25201 Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Thu, 24 Jul 2025 15:37:14 +0800 Subject: [PATCH] add getRecommendation Signed-off-by: zhaolinglan --- api/@ohos.inputMethodEngine.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/api/@ohos.inputMethodEngine.d.ts b/api/@ohos.inputMethodEngine.d.ts index 622a573b0c..9fcb255df9 100644 --- a/api/@ohos.inputMethodEngine.d.ts +++ b/api/@ohos.inputMethodEngine.d.ts @@ -1561,6 +1561,16 @@ declare namespace inputMethodEngine { * @since 20 */ getAttachOptions(): AttachOptions; + + /** + * Get recommended words. + * @param { Array } Keywords for querying recommended words. + * @returns { Recommendation } The recommendation. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + getRecommendation(keywords: Array): Recommendation; + /** * Subscribe 'attachOptionsDidChange' event. * @@ -2992,6 +3002,25 @@ declare namespace inputMethodEngine { */ CHARACTERS } + + /** + * Recommendataion. + * + * @interface Recommendation + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + export interface Recommendation { + /** + * Recommended words. + * + * @type { Array } + * @readonly + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + readonly recommendedWords: Array; + } } export default inputMethodEngine; -- Gitee