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 51c4d02ed..95c3f5df5 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