From 7779644cd73865debadbda9470032f571cd6df29 Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Fri, 19 Apr 2024 11:28:12 +0800 Subject: [PATCH] add api Signed-off-by: zhaolinglan --- api/@ohos.inputMethodEngine.d.ts | 57 +++++++++++++++++++ .../plugin/dictionaries_supplementary.txt | 1 + 2 files changed, 58 insertions(+) diff --git a/api/@ohos.inputMethodEngine.d.ts b/api/@ohos.inputMethodEngine.d.ts index 6cd44831d..7fbea7892 100644 --- a/api/@ohos.inputMethodEngine.d.ts +++ b/api/@ohos.inputMethodEngine.d.ts @@ -1301,6 +1301,54 @@ declare namespace inputMethodEngine { * @since 12 */ getCallingWindowInfo(): Promise; + + /** + * Insert the provided text as preview text. + * + * @param { string } text - the text to be previewed. + * @param { Range } range - the range of the text to be replaced by the preview text. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800011 - text preview is not supported. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + */ + setPreviewText(text: string, range: Range): Promise; + + /** + * Insert the provided text as preview text. + * + * @param { string } text - the text to be previewed. + * @param { Range } range - the range of the text to be replaced by the preview text. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800011 - text preview is not supported. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + */ + setPreviewTextSync(text: string, range: Range): void; + + /** + * Finish the text preview. + * + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800011 - text preview is not supported. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + */ + finishTextPreview(): Promise; + + /** + * Finish the text preview. + * + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800011 - text preview is not supported. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + */ + finishTextPreviewSync(): void; } /** @@ -1674,6 +1722,15 @@ declare namespace inputMethodEngine { * @since 8 */ readonly enterKeyType: number; + + /** + * Indicates whether the editor supports the text preview. + * + * @type { boolean } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + */ + isTextPreviewSupported: boolean; } /** diff --git a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt index 102a07f42..f9e03da2e 100644 --- a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt +++ b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt @@ -657,6 +657,7 @@ preresolve presentationml presently presistent +previewed prevgroup prikey primaries