import { UTSHarmony } from "@dcloudio/uni-runtime" import { API_HIDE_KEYBOARD } from '../protocol.uts' import { HideKeyboardOptions, HideKeyboardSuccess, HideKeyboardFail, HideKeyboard } from '../interface.uts' import inputMethod from '@ohos.inputMethod'; export { HideKeyboardOptions, HideKeyboardSuccess, HideKeyboardFail, } export const hideKeyboard: HideKeyboard = defineAsyncApi( API_HIDE_KEYBOARD, function (options: HideKeyboardOptions, exec: ApiExecutor) { inputMethod.getController().hideTextInput().then(() => { exec.resolve() }, (err: Error) => { exec.reject(err.message) }) } ) as HideKeyboard