1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import {AsyncCallback} from './basic'; 17 18/** 19 * inputmethod 20 * 21 * @since 8 22 * @devices phone, tablet, tv, wearable 23 */ 24declare namespace inputMethod { 25 const MAX_TYPE_NUM: number 26 27 function getInputMethodSetting(): InputMethodSetting; 28 29 function getInputMethodController(): InputMethodController; 30 31 interface InputMethodSetting { 32 listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>): void; 33 listInputMethod(): Promise<Array<InputMethodProperty>>; 34 35 displayOptionalInputMethod(callback: AsyncCallback<void>): void; 36 displayOptionalInputMethod(): Promise<void>; 37 } 38 39 interface InputMethodController { 40 stopInput(callback: AsyncCallback<boolean>): void; 41 stopInput(): Promise<boolean>; 42 } 43 44 interface InputMethodProperty { 45 readonly packageName: string; 46 readonly methodId: string; 47 } 48} 49 50export default inputMethod; 51