161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit IMEKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ciimport type { Callback, AsyncCallback } from './@ohos.base';
2161847f8eSopenharmony_ciimport type { ElementName } from './bundleManager/ElementName';
2261847f8eSopenharmony_ciimport InputMethodSubtype from './@ohos.InputMethodSubtype';
2361847f8eSopenharmony_ciimport type { PanelInfo } from './@ohos.inputMethod.Panel';
2461847f8eSopenharmony_ci
2561847f8eSopenharmony_ci/**
2661847f8eSopenharmony_ci * Input method
2761847f8eSopenharmony_ci *
2861847f8eSopenharmony_ci * @namespace inputMethod
2961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework
3061847f8eSopenharmony_ci * @since 6
3161847f8eSopenharmony_ci */
3261847f8eSopenharmony_cideclare namespace inputMethod {
3361847f8eSopenharmony_ci  /**
3461847f8eSopenharmony_ci   * Keyboard max number
3561847f8eSopenharmony_ci   *
3661847f8eSopenharmony_ci   * @constant
3761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
3861847f8eSopenharmony_ci   * @since 8
3961847f8eSopenharmony_ci   */
4061847f8eSopenharmony_ci  const MAX_TYPE_NUM: number;
4161847f8eSopenharmony_ci
4261847f8eSopenharmony_ci  /**
4361847f8eSopenharmony_ci   * Input method setting
4461847f8eSopenharmony_ci   *
4561847f8eSopenharmony_ci   * @returns { InputMethodSetting } the object of InputMethodSetting
4661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
4761847f8eSopenharmony_ci   * @since 8
4861847f8eSopenharmony_ci   * @deprecated since 9
4961847f8eSopenharmony_ci   * @useinstead inputMethod#getSetting
5061847f8eSopenharmony_ci   */
5161847f8eSopenharmony_ci  function getInputMethodSetting(): InputMethodSetting;
5261847f8eSopenharmony_ci
5361847f8eSopenharmony_ci  /**
5461847f8eSopenharmony_ci   * Input method controller
5561847f8eSopenharmony_ci   *
5661847f8eSopenharmony_ci   * @returns { InputMethodController } the object of InputMethodController.
5761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
5861847f8eSopenharmony_ci   * @since 6
5961847f8eSopenharmony_ci   * @deprecated since 9
6061847f8eSopenharmony_ci   * @useinstead inputMethod#getController
6161847f8eSopenharmony_ci   */
6261847f8eSopenharmony_ci  function getInputMethodController(): InputMethodController;
6361847f8eSopenharmony_ci
6461847f8eSopenharmony_ci  /**
6561847f8eSopenharmony_ci   * Input method setting
6661847f8eSopenharmony_ci   *
6761847f8eSopenharmony_ci   * @returns { InputMethodSetting } the object of InputMethodSetting.
6861847f8eSopenharmony_ci   * @throws { BusinessError } 12800007 - settings extension error.
6961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
7061847f8eSopenharmony_ci   * @since 9
7161847f8eSopenharmony_ci   */
7261847f8eSopenharmony_ci  function getSetting(): InputMethodSetting;
7361847f8eSopenharmony_ci
7461847f8eSopenharmony_ci  /**
7561847f8eSopenharmony_ci   * Input method controller
7661847f8eSopenharmony_ci   *
7761847f8eSopenharmony_ci   * @returns { InputMethodController } the object of InputMethodController.
7861847f8eSopenharmony_ci   * @throws { BusinessError } 12800006 - input method controller error.
7961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
8061847f8eSopenharmony_ci   * @since 9
8161847f8eSopenharmony_ci   */
8261847f8eSopenharmony_ci  function getController(): InputMethodController;
8361847f8eSopenharmony_ci
8461847f8eSopenharmony_ci  /**
8561847f8eSopenharmony_ci   * Get default input method
8661847f8eSopenharmony_ci   *
8761847f8eSopenharmony_ci   * @returns { InputMethodProperty } property of the default input method.
8861847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
8961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
9061847f8eSopenharmony_ci   * @since 11
9161847f8eSopenharmony_ci   */
9261847f8eSopenharmony_ci  function getDefaultInputMethod(): InputMethodProperty;
9361847f8eSopenharmony_ci
9461847f8eSopenharmony_ci  /**
9561847f8eSopenharmony_ci   * Get system input method config ability
9661847f8eSopenharmony_ci   *
9761847f8eSopenharmony_ci   * @returns { ElementName } the information of system input method config ability.
9861847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
9961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
10061847f8eSopenharmony_ci   * @since 11
10161847f8eSopenharmony_ci   */
10261847f8eSopenharmony_ci  function getSystemInputMethodConfigAbility(): ElementName;
10361847f8eSopenharmony_ci
10461847f8eSopenharmony_ci  /**
10561847f8eSopenharmony_ci   * Switch input method
10661847f8eSopenharmony_ci   *
10761847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
10861847f8eSopenharmony_ci   * @param { InputMethodProperty } target - indicates the input method which will replace the current one.
10961847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchInputMethod.
11061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
11161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
11261847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
11361847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
11461847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
11561847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
11661847f8eSopenharmony_ci   * @since 9
11761847f8eSopenharmony_ci   */
11861847f8eSopenharmony_ci  /**
11961847f8eSopenharmony_ci   * Switch input method. The caller must be the current inputmethod.
12061847f8eSopenharmony_ci   *
12161847f8eSopenharmony_ci   * @param { InputMethodProperty } target - indicates the target input method.
12261847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchInputMethod.
12361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
12461847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
12561847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
12661847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
12761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
12861847f8eSopenharmony_ci   * @since 11
12961847f8eSopenharmony_ci   */
13061847f8eSopenharmony_ci  function switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolean>): void;
13161847f8eSopenharmony_ci
13261847f8eSopenharmony_ci  /**
13361847f8eSopenharmony_ci   * Switch input method
13461847f8eSopenharmony_ci   *
13561847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
13661847f8eSopenharmony_ci   * @param { InputMethodProperty } target - Indicates the input method which will replace the current one.
13761847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
13861847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
13961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
14061847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
14161847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
14261847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
14361847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
14461847f8eSopenharmony_ci   * @since 9
14561847f8eSopenharmony_ci   */
14661847f8eSopenharmony_ci  /**
14761847f8eSopenharmony_ci   * Switch input method. The caller must be the current inputmethod.
14861847f8eSopenharmony_ci   *
14961847f8eSopenharmony_ci   * @param { InputMethodProperty } target - indicates the target input method.
15061847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
15161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
15261847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
15361847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
15461847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
15561847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
15661847f8eSopenharmony_ci   * @since 11
15761847f8eSopenharmony_ci   */
15861847f8eSopenharmony_ci  function switchInputMethod(target: InputMethodProperty): Promise<boolean>;
15961847f8eSopenharmony_ci
16061847f8eSopenharmony_ci  /**
16161847f8eSopenharmony_ci   * Get current input method
16261847f8eSopenharmony_ci   *
16361847f8eSopenharmony_ci   * @returns { InputMethodProperty } the property of current inputmethod.
16461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
16561847f8eSopenharmony_ci   * @since 9
16661847f8eSopenharmony_ci   */
16761847f8eSopenharmony_ci  function getCurrentInputMethod(): InputMethodProperty;
16861847f8eSopenharmony_ci
16961847f8eSopenharmony_ci  /**
17061847f8eSopenharmony_ci   * Switch current input method subtype
17161847f8eSopenharmony_ci   *
17261847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
17361847f8eSopenharmony_ci   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
17461847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype.
17561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
17661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
17761847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
17861847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
17961847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
18061847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
18161847f8eSopenharmony_ci   * @since 9
18261847f8eSopenharmony_ci   */
18361847f8eSopenharmony_ci  /**
18461847f8eSopenharmony_ci   * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored.
18561847f8eSopenharmony_ci   *
18661847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
18761847f8eSopenharmony_ci   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
18861847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype.
18961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
19061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
19161847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
19261847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
19361847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
19461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
19561847f8eSopenharmony_ci   * @since 10
19661847f8eSopenharmony_ci   */
19761847f8eSopenharmony_ci  /**
19861847f8eSopenharmony_ci   * Switch current input method subtype. The caller must be the current inputmethod.
19961847f8eSopenharmony_ci   *
20061847f8eSopenharmony_ci   * @param { InputMethodSubtype } target - indicates the target input method subtype.
20161847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype.
20261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
20361847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
20461847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
20561847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
20661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
20761847f8eSopenharmony_ci   * @since 11
20861847f8eSopenharmony_ci   */
20961847f8eSopenharmony_ci  function switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback<boolean>): void;
21061847f8eSopenharmony_ci
21161847f8eSopenharmony_ci  /**
21261847f8eSopenharmony_ci   * Switch current input method subtype
21361847f8eSopenharmony_ci   *
21461847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
21561847f8eSopenharmony_ci   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
21661847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
21761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
21861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
21961847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
22061847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
22161847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
22261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
22361847f8eSopenharmony_ci   * @since 9
22461847f8eSopenharmony_ci   */
22561847f8eSopenharmony_ci  /**
22661847f8eSopenharmony_ci   * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored.
22761847f8eSopenharmony_ci   *
22861847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
22961847f8eSopenharmony_ci   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
23061847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
23161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
23261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
23361847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
23461847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
23561847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
23661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
23761847f8eSopenharmony_ci   * @since 10
23861847f8eSopenharmony_ci   */
23961847f8eSopenharmony_ci  /**
24061847f8eSopenharmony_ci   * Switch current input method subtype. The caller must be the current inputmethod.
24161847f8eSopenharmony_ci   *
24261847f8eSopenharmony_ci   * @param { InputMethodSubtype } target - indicates the target input method subtype.
24361847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
24461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
24561847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
24661847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
24761847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
24861847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
24961847f8eSopenharmony_ci   * @since 11
25061847f8eSopenharmony_ci   */
25161847f8eSopenharmony_ci  function switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean>;
25261847f8eSopenharmony_ci
25361847f8eSopenharmony_ci  /**
25461847f8eSopenharmony_ci   * Get the current input method subtype
25561847f8eSopenharmony_ci   *
25661847f8eSopenharmony_ci   * @returns { InputMethodSubtype } the subtype of the current input method.
25761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
25861847f8eSopenharmony_ci   * @since 9
25961847f8eSopenharmony_ci   */
26061847f8eSopenharmony_ci  function getCurrentInputMethodSubtype(): InputMethodSubtype;
26161847f8eSopenharmony_ci
26261847f8eSopenharmony_ci  /**
26361847f8eSopenharmony_ci   * Switch input method and subtype. If the caller is an input method, it must be the current inputmethod.
26461847f8eSopenharmony_ci   *
26561847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
26661847f8eSopenharmony_ci   * @param { InputMethodProperty } inputMethodProperty - Indicates the target input method.
26761847f8eSopenharmony_ci   * @param { InputMethodSubtype } inputMethodSubtype - Indicates the target input method subtype.
26861847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodAndSubtype.
26961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
27061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
27161847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
27261847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
27361847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
27461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
27561847f8eSopenharmony_ci   * @since 9
27661847f8eSopenharmony_ci   */
27761847f8eSopenharmony_ci  /**
27861847f8eSopenharmony_ci   * Switch input method and subtype. The caller must be the current inputmethod.
27961847f8eSopenharmony_ci   *
28061847f8eSopenharmony_ci   * @param { InputMethodProperty } inputMethodProperty - indicates the target input method.
28161847f8eSopenharmony_ci   * @param { InputMethodSubtype } inputMethodSubtype - indicates the target input method subtype.
28261847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodAndSubtype.
28361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
28461847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
28561847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
28661847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
28761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
28861847f8eSopenharmony_ci   * @since 11
28961847f8eSopenharmony_ci   */
29061847f8eSopenharmony_ci  function switchCurrentInputMethodAndSubtype(
29161847f8eSopenharmony_ci    inputMethodProperty: InputMethodProperty,
29261847f8eSopenharmony_ci    inputMethodSubtype: InputMethodSubtype,
29361847f8eSopenharmony_ci    callback: AsyncCallback<boolean>
29461847f8eSopenharmony_ci  ): void;
29561847f8eSopenharmony_ci
29661847f8eSopenharmony_ci  /**
29761847f8eSopenharmony_ci   * Switch input method and subtype. If the caller is an input method, it must be the current inputmethod.
29861847f8eSopenharmony_ci   *
29961847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
30061847f8eSopenharmony_ci   * @param { InputMethodProperty } inputMethodProperty - Indicates the target input method.
30161847f8eSopenharmony_ci   * @param { InputMethodSubtype } inputMethodSubtype - Indicates the target input method subtype.
30261847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
30361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
30461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
30561847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
30661847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
30761847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
30861847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
30961847f8eSopenharmony_ci   * @since 9
31061847f8eSopenharmony_ci   */
31161847f8eSopenharmony_ci  /**
31261847f8eSopenharmony_ci   * Switch input method and subtype. The caller must be the current inputmethod.
31361847f8eSopenharmony_ci   *
31461847f8eSopenharmony_ci   * @param { InputMethodProperty } inputMethodProperty - indicates the target input method.
31561847f8eSopenharmony_ci   * @param { InputMethodSubtype } inputMethodSubtype - indicates the target input method subtype.
31661847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
31761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
31861847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
31961847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
32061847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
32161847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
32261847f8eSopenharmony_ci   * @since 11
32361847f8eSopenharmony_ci   */
32461847f8eSopenharmony_ci  function switchCurrentInputMethodAndSubtype(
32561847f8eSopenharmony_ci    inputMethodProperty: InputMethodProperty,
32661847f8eSopenharmony_ci    inputMethodSubtype: InputMethodSubtype
32761847f8eSopenharmony_ci  ): Promise<boolean>;
32861847f8eSopenharmony_ci
32961847f8eSopenharmony_ci  /**
33061847f8eSopenharmony_ci   * Switch input method and subtype
33161847f8eSopenharmony_ci   *
33261847f8eSopenharmony_ci   * @permission ohos.permission.CONNECT_IME_ABILITY
33361847f8eSopenharmony_ci   * @param { string } bundleName - indicates the bundleName of target input method.
33461847f8eSopenharmony_ci   * @param { string } [subtypeId] - indicates the id of the input method subtype. 
33561847f8eSopenharmony_ci   *     If the param is not set, switch to the target input method with a default subtype.
33661847f8eSopenharmony_ci   * @returns { Promise<void> } the promise returned by the function.
33761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permissions check fails.
33861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - not system application.
33961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - parameter error. Possible causes:
34061847f8eSopenharmony_ci   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
34161847f8eSopenharmony_ci   * @throws { BusinessError } 12800005 - configuration persisting error.
34261847f8eSopenharmony_ci   * @throws { BusinessError } 12800008 - input method manager service error.
34361847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
34461847f8eSopenharmony_ci   * @systemapi
34561847f8eSopenharmony_ci   * @since 11
34661847f8eSopenharmony_ci   */
34761847f8eSopenharmony_ci  function switchInputMethod(bundleName: string, subtypeId?: string): Promise<void>;
34861847f8eSopenharmony_ci
34961847f8eSopenharmony_ci  /**
35061847f8eSopenharmony_ci   * @interface InputMethodSetting
35161847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
35261847f8eSopenharmony_ci   * @since 8
35361847f8eSopenharmony_ci   */
35461847f8eSopenharmony_ci  interface InputMethodSetting {
35561847f8eSopenharmony_ci    /**
35661847f8eSopenharmony_ci     * Subscribe input method or subtype change.
35761847f8eSopenharmony_ci     *
35861847f8eSopenharmony_ci     * @param { 'imeChange' } type - Indicates the event type.
35961847f8eSopenharmony_ci     * @param { function } callback - the callback of 'imeChange'
36061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
36161847f8eSopenharmony_ci     * @since 9
36261847f8eSopenharmony_ci     */
36361847f8eSopenharmony_ci    on(
36461847f8eSopenharmony_ci      type: 'imeChange',
36561847f8eSopenharmony_ci      callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void
36661847f8eSopenharmony_ci    ): void;
36761847f8eSopenharmony_ci
36861847f8eSopenharmony_ci    /**
36961847f8eSopenharmony_ci     * Unsubscribe input method or subtype change.
37061847f8eSopenharmony_ci     *
37161847f8eSopenharmony_ci     * @param { 'imeChange' } type - Indicates the event type.
37261847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'imeChange',
37361847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'imeChange', this parameter can be left blank.
37461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
37561847f8eSopenharmony_ci     * @since 9
37661847f8eSopenharmony_ci     */
37761847f8eSopenharmony_ci    off(
37861847f8eSopenharmony_ci      type: 'imeChange',
37961847f8eSopenharmony_ci      callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void
38061847f8eSopenharmony_ci    ): void;
38161847f8eSopenharmony_ci
38261847f8eSopenharmony_ci    /**
38361847f8eSopenharmony_ci     * Subscribes to input window show events.
38461847f8eSopenharmony_ci     *
38561847f8eSopenharmony_ci     * @param { 'imeShow' } type - Indicates the event type.
38661847f8eSopenharmony_ci     * @param { function } callback - the callback of 'imeShow'.
38761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - not system application.
38861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
38961847f8eSopenharmony_ci     * @systemapi
39061847f8eSopenharmony_ci     * @since 10
39161847f8eSopenharmony_ci     */
39261847f8eSopenharmony_ci    on(type: 'imeShow', callback: (info: Array<InputWindowInfo>) => void): void;
39361847f8eSopenharmony_ci
39461847f8eSopenharmony_ci    /**
39561847f8eSopenharmony_ci     * Unsubscribe input window show event.
39661847f8eSopenharmony_ci     *
39761847f8eSopenharmony_ci     * @param { 'imeShow' } type - Indicates the event type.
39861847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'imeShow',
39961847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'imeShow', this parameter can be left blank.
40061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
40161847f8eSopenharmony_ci     * @systemapi
40261847f8eSopenharmony_ci     * @since 10
40361847f8eSopenharmony_ci     */
40461847f8eSopenharmony_ci    off(type: 'imeShow', callback?: (info: Array<InputWindowInfo>) => void): void;
40561847f8eSopenharmony_ci
40661847f8eSopenharmony_ci    /**
40761847f8eSopenharmony_ci     * Subscribes to input window hidden events.
40861847f8eSopenharmony_ci     *
40961847f8eSopenharmony_ci     * @param { 'imeHide' } type - Indicates the event type.
41061847f8eSopenharmony_ci     * @param { function } callback - the callback of 'imeHide'.
41161847f8eSopenharmony_ci     * @throws { BusinessError } 202 - not system application.
41261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
41361847f8eSopenharmony_ci     * @systemapi
41461847f8eSopenharmony_ci     * @since 10
41561847f8eSopenharmony_ci     */
41661847f8eSopenharmony_ci    on(type: 'imeHide', callback: (info: Array<InputWindowInfo>) => void): void;
41761847f8eSopenharmony_ci
41861847f8eSopenharmony_ci    /**
41961847f8eSopenharmony_ci     * Unsubscribe input window hide event.
42061847f8eSopenharmony_ci     *
42161847f8eSopenharmony_ci     * @param { 'imeHide' } type - Indicates the event type.
42261847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'imeHide',
42361847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'imeHide', this parameter can be left blank.
42461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
42561847f8eSopenharmony_ci     * @systemapi
42661847f8eSopenharmony_ci     * @since 10
42761847f8eSopenharmony_ci     */
42861847f8eSopenharmony_ci    off(type: 'imeHide', callback?: (info: Array<InputWindowInfo>) => void): void;
42961847f8eSopenharmony_ci
43061847f8eSopenharmony_ci    /**
43161847f8eSopenharmony_ci     * Query whether a panel with specified information is shown.
43261847f8eSopenharmony_ci     *
43361847f8eSopenharmony_ci     * @param { PanelInfo } panelInfo - the information of panel which is queried.
43461847f8eSopenharmony_ci     * @returns { boolean }
43561847f8eSopenharmony_ci     *     If true, the panel being queried is shown.
43661847f8eSopenharmony_ci     *     If false, the panel being queried is hidden.
43761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - not system application.
43861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
43961847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
44061847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
44161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
44261847f8eSopenharmony_ci     * @systemapi
44361847f8eSopenharmony_ci     * @since 11
44461847f8eSopenharmony_ci     */
44561847f8eSopenharmony_ci    isPanelShown(panelInfo: PanelInfo): boolean;
44661847f8eSopenharmony_ci
44761847f8eSopenharmony_ci    /**
44861847f8eSopenharmony_ci     * List subtype of the specified input method.
44961847f8eSopenharmony_ci     *
45061847f8eSopenharmony_ci     * @param { InputMethodProperty } inputMethodProperty - the property of the specified inputmethod.
45161847f8eSopenharmony_ci     * @param { AsyncCallback<Array<InputMethodSubtype>> } callback - the callback of listInputMethodSubtype.
45261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
45361847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
45461847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - package manager error.
45561847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
45661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
45761847f8eSopenharmony_ci     * @since 9
45861847f8eSopenharmony_ci     */
45961847f8eSopenharmony_ci    listInputMethodSubtype(
46061847f8eSopenharmony_ci      inputMethodProperty: InputMethodProperty,
46161847f8eSopenharmony_ci      callback: AsyncCallback<Array<InputMethodSubtype>>
46261847f8eSopenharmony_ci    ): void;
46361847f8eSopenharmony_ci
46461847f8eSopenharmony_ci    /**
46561847f8eSopenharmony_ci     * List subtype of the specified input method.
46661847f8eSopenharmony_ci     *
46761847f8eSopenharmony_ci     * @param { InputMethodProperty } inputMethodProperty - Indicates the specified input method.
46861847f8eSopenharmony_ci     * @returns { Promise<Array<InputMethodSubtype>> } the promise returned by the function.
46961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
47061847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
47161847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - package manager error.
47261847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
47361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
47461847f8eSopenharmony_ci     * @since 9
47561847f8eSopenharmony_ci     */
47661847f8eSopenharmony_ci    listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Array<InputMethodSubtype>>;
47761847f8eSopenharmony_ci
47861847f8eSopenharmony_ci    /**
47961847f8eSopenharmony_ci     * List subtype of current input method
48061847f8eSopenharmony_ci     *
48161847f8eSopenharmony_ci     * @param { AsyncCallback<Array<InputMethodSubtype>> } callback - the callback of listCurrentInputMethodSubtype.
48261847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - package manager error.
48361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
48461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
48561847f8eSopenharmony_ci     * @since 9
48661847f8eSopenharmony_ci     */
48761847f8eSopenharmony_ci    listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSubtype>>): void;
48861847f8eSopenharmony_ci
48961847f8eSopenharmony_ci    /**
49061847f8eSopenharmony_ci     * List subtype of current input method
49161847f8eSopenharmony_ci     *
49261847f8eSopenharmony_ci     * @returns { Promise<Array<InputMethodSubtype>> } the promise returned by the function.
49361847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - package manager error.
49461847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
49561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
49661847f8eSopenharmony_ci     * @since 9
49761847f8eSopenharmony_ci     */
49861847f8eSopenharmony_ci    listCurrentInputMethodSubtype(): Promise<Array<InputMethodSubtype>>;
49961847f8eSopenharmony_ci
50061847f8eSopenharmony_ci    /**
50161847f8eSopenharmony_ci     * List input methods
50261847f8eSopenharmony_ci     *
50361847f8eSopenharmony_ci     * @param { boolean } enable -
50461847f8eSopenharmony_ci     *     If true, collect enabled input methods.
50561847f8eSopenharmony_ci     *     If false, collect disabled input methods.
50661847f8eSopenharmony_ci     * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of getInputMethods.
50761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
50861847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
50961847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - package manager error.
51061847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
51161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
51261847f8eSopenharmony_ci     * @since 9
51361847f8eSopenharmony_ci     */
51461847f8eSopenharmony_ci    getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethodProperty>>): void;
51561847f8eSopenharmony_ci
51661847f8eSopenharmony_ci    /**
51761847f8eSopenharmony_ci     * List input methods
51861847f8eSopenharmony_ci     *
51961847f8eSopenharmony_ci     * @param { boolean } enable -
52061847f8eSopenharmony_ci     *     If true, collect enabled input methods.
52161847f8eSopenharmony_ci     *     If false, collect disabled input methods.
52261847f8eSopenharmony_ci     * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function.
52361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
52461847f8eSopenharmony_ci     *      1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
52561847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - package manager error.
52661847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
52761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
52861847f8eSopenharmony_ci     * @since 9
52961847f8eSopenharmony_ci     */
53061847f8eSopenharmony_ci    getInputMethods(enable: boolean): Promise<Array<InputMethodProperty>>;
53161847f8eSopenharmony_ci
53261847f8eSopenharmony_ci    /**
53361847f8eSopenharmony_ci     * List enabled or disabled input methods sync
53461847f8eSopenharmony_ci     *
53561847f8eSopenharmony_ci     * @param { boolean } enable -
53661847f8eSopenharmony_ci     *     If true, collect enabled input methods.
53761847f8eSopenharmony_ci     *     If false, collect disabled input methods.
53861847f8eSopenharmony_ci     * @returns { Array<InputMethodProperty> } the list of inputmethod.
53961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
54061847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
54161847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - bundle manager error.
54261847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
54361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
54461847f8eSopenharmony_ci     * @since 11
54561847f8eSopenharmony_ci     */
54661847f8eSopenharmony_ci    getInputMethodsSync(enable: boolean): Array<InputMethodProperty>;
54761847f8eSopenharmony_ci
54861847f8eSopenharmony_ci    /**
54961847f8eSopenharmony_ci     * List all input methods
55061847f8eSopenharmony_ci     *
55161847f8eSopenharmony_ci     * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of getInputMethods.
55261847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - bundle manager error.
55361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
55461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
55561847f8eSopenharmony_ci     * @since 11
55661847f8eSopenharmony_ci     */
55761847f8eSopenharmony_ci    getAllInputMethods(callback: AsyncCallback<Array<InputMethodProperty>>): void;
55861847f8eSopenharmony_ci
55961847f8eSopenharmony_ci    /**
56061847f8eSopenharmony_ci     * List all input methods
56161847f8eSopenharmony_ci     *
56261847f8eSopenharmony_ci     * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function.
56361847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - bundle manager error.
56461847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
56561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
56661847f8eSopenharmony_ci     * @since 11
56761847f8eSopenharmony_ci     */
56861847f8eSopenharmony_ci    getAllInputMethods(): Promise<Array<InputMethodProperty>>;
56961847f8eSopenharmony_ci
57061847f8eSopenharmony_ci    /**
57161847f8eSopenharmony_ci     * List all input methods sync
57261847f8eSopenharmony_ci     *
57361847f8eSopenharmony_ci     * @returns { Array<InputMethodProperty> } the list of all inputmethod.
57461847f8eSopenharmony_ci     * @throws { BusinessError } 12800001 - bundle manager error.
57561847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
57661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
57761847f8eSopenharmony_ci     * @since 11
57861847f8eSopenharmony_ci     */
57961847f8eSopenharmony_ci    getAllInputMethodsSync(): Array<InputMethodProperty>;
58061847f8eSopenharmony_ci
58161847f8eSopenharmony_ci    /**
58261847f8eSopenharmony_ci     * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of listInputMethod.
58361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
58461847f8eSopenharmony_ci     * @since 8
58561847f8eSopenharmony_ci     * @deprecated since 9
58661847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodSetting#getInputMethods
58761847f8eSopenharmony_ci     */
58861847f8eSopenharmony_ci    listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>): void;
58961847f8eSopenharmony_ci
59061847f8eSopenharmony_ci    /**
59161847f8eSopenharmony_ci     * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function.
59261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
59361847f8eSopenharmony_ci     * @since 8
59461847f8eSopenharmony_ci     * @deprecated since 9
59561847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodSetting#getInputMethods
59661847f8eSopenharmony_ci     */
59761847f8eSopenharmony_ci    listInputMethod(): Promise<Array<InputMethodProperty>>;
59861847f8eSopenharmony_ci
59961847f8eSopenharmony_ci    /**
60061847f8eSopenharmony_ci     * Show input method setting extension dialog
60161847f8eSopenharmony_ci     *
60261847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - the callback of showOptionalInputMethods.
60361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
60461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
60561847f8eSopenharmony_ci     * @since 9
60661847f8eSopenharmony_ci     */
60761847f8eSopenharmony_ci    showOptionalInputMethods(callback: AsyncCallback<boolean>): void;
60861847f8eSopenharmony_ci
60961847f8eSopenharmony_ci    /**
61061847f8eSopenharmony_ci     * Show input method setting extension dialog
61161847f8eSopenharmony_ci     *
61261847f8eSopenharmony_ci     * @returns { Promise<boolean> } the promise returned by the function.
61361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
61461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
61561847f8eSopenharmony_ci     * @since 9
61661847f8eSopenharmony_ci     */
61761847f8eSopenharmony_ci    showOptionalInputMethods(): Promise<boolean>;
61861847f8eSopenharmony_ci
61961847f8eSopenharmony_ci    /**
62061847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of displayOptionalInputMethod.
62161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
62261847f8eSopenharmony_ci     * @since 8
62361847f8eSopenharmony_ci     * @deprecated since 9
62461847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodSetting#showOptionalInputMethods
62561847f8eSopenharmony_ci     */
62661847f8eSopenharmony_ci    displayOptionalInputMethod(callback: AsyncCallback<void>): void;
62761847f8eSopenharmony_ci
62861847f8eSopenharmony_ci    /**
62961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
63061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
63161847f8eSopenharmony_ci     * @since 8
63261847f8eSopenharmony_ci     * @deprecated since 9
63361847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodSetting#showOptionalInputMethods
63461847f8eSopenharmony_ci     */
63561847f8eSopenharmony_ci    displayOptionalInputMethod(): Promise<void>;
63661847f8eSopenharmony_ci  }
63761847f8eSopenharmony_ci
63861847f8eSopenharmony_ci  /**
63961847f8eSopenharmony_ci   * @interface InputMethodController
64061847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
64161847f8eSopenharmony_ci   * @since 6
64261847f8eSopenharmony_ci   */
64361847f8eSopenharmony_ci  interface InputMethodController {
64461847f8eSopenharmony_ci    /**
64561847f8eSopenharmony_ci     * Attach application to the input method service.
64661847f8eSopenharmony_ci     *
64761847f8eSopenharmony_ci     * @param { boolean } showKeyboard - show the keyboard or not when attach the input method.
64861847f8eSopenharmony_ci     * @param { TextConfig } textConfig - indicates the config of the textInput.
64961847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of attach.
65061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
65161847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
65261847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
65361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
65461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
65561847f8eSopenharmony_ci     * @since 10
65661847f8eSopenharmony_ci     */
65761847f8eSopenharmony_ci    attach(showKeyboard: boolean, textConfig: TextConfig, callback: AsyncCallback<void>): void;
65861847f8eSopenharmony_ci
65961847f8eSopenharmony_ci    /**
66061847f8eSopenharmony_ci     * Attach application to the input method service.
66161847f8eSopenharmony_ci     *
66261847f8eSopenharmony_ci     * @param { boolean } showKeyboard - show the keyboard or not when attach the input method.
66361847f8eSopenharmony_ci     * @param { TextConfig } textConfig - indicates the config of the textInput.
66461847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
66561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
66661847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
66761847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
66861847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
66961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
67061847f8eSopenharmony_ci     * @since 10
67161847f8eSopenharmony_ci     */
67261847f8eSopenharmony_ci    attach(showKeyboard: boolean, textConfig: TextConfig): Promise<void>;
67361847f8eSopenharmony_ci
67461847f8eSopenharmony_ci    /**
67561847f8eSopenharmony_ci     * Show the text input and start typing.
67661847f8eSopenharmony_ci     *
67761847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of showTextInput.
67861847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
67961847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
68061847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
68161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
68261847f8eSopenharmony_ci     * @since 10
68361847f8eSopenharmony_ci     */
68461847f8eSopenharmony_ci    showTextInput(callback: AsyncCallback<void>): void;
68561847f8eSopenharmony_ci
68661847f8eSopenharmony_ci    /**
68761847f8eSopenharmony_ci     * Show the text input and start typing.
68861847f8eSopenharmony_ci     *
68961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
69061847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
69161847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
69261847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
69361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
69461847f8eSopenharmony_ci     * @since 10
69561847f8eSopenharmony_ci     */
69661847f8eSopenharmony_ci    showTextInput(): Promise<void>;
69761847f8eSopenharmony_ci
69861847f8eSopenharmony_ci    /**
69961847f8eSopenharmony_ci     * Hide the text input and stop typing.
70061847f8eSopenharmony_ci     *
70161847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of hideTextInput.
70261847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
70361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
70461847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
70561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
70661847f8eSopenharmony_ci     * @since 10
70761847f8eSopenharmony_ci     */
70861847f8eSopenharmony_ci    hideTextInput(callback: AsyncCallback<void>): void;
70961847f8eSopenharmony_ci
71061847f8eSopenharmony_ci    /**
71161847f8eSopenharmony_ci     * Hide the text input and stop typing.
71261847f8eSopenharmony_ci     *
71361847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
71461847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
71561847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
71661847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
71761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
71861847f8eSopenharmony_ci     * @since 10
71961847f8eSopenharmony_ci     */
72061847f8eSopenharmony_ci    hideTextInput(): Promise<void>;
72161847f8eSopenharmony_ci
72261847f8eSopenharmony_ci    /**
72361847f8eSopenharmony_ci     * Detach the applications from the input method manager service.
72461847f8eSopenharmony_ci     *
72561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of detach.
72661847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
72761847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
72861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
72961847f8eSopenharmony_ci     * @since 10
73061847f8eSopenharmony_ci     */
73161847f8eSopenharmony_ci    detach(callback: AsyncCallback<void>): void;
73261847f8eSopenharmony_ci
73361847f8eSopenharmony_ci    /**
73461847f8eSopenharmony_ci     * Detach the applications from the input method manager service.
73561847f8eSopenharmony_ci     *
73661847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
73761847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
73861847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
73961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
74061847f8eSopenharmony_ci     * @since 10
74161847f8eSopenharmony_ci     */
74261847f8eSopenharmony_ci    detach(): Promise<void>;
74361847f8eSopenharmony_ci
74461847f8eSopenharmony_ci    /**
74561847f8eSopenharmony_ci     * Inform the system of the window ID of the application currently bound to the input method.
74661847f8eSopenharmony_ci     * After the correct setting, the window where the client is located can avoid the input method window.
74761847f8eSopenharmony_ci     *
74861847f8eSopenharmony_ci     * @param { number } windowId - the window ID of the application currently bound to the input method.
74961847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of setCallingWindow.
75061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
75161847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
75261847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
75361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
75461847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
75561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
75661847f8eSopenharmony_ci     * @since 10
75761847f8eSopenharmony_ci     */
75861847f8eSopenharmony_ci    setCallingWindow(windowId: number, callback: AsyncCallback<void>): void;
75961847f8eSopenharmony_ci
76061847f8eSopenharmony_ci    /**
76161847f8eSopenharmony_ci     * Inform the system of the window ID of the application currently bound to the input method.
76261847f8eSopenharmony_ci     * After the correct setting, the window where the client is located can avoid the input method window.
76361847f8eSopenharmony_ci     *
76461847f8eSopenharmony_ci     * @param { number } windowId - the window ID of the application currently bound to the input method.
76561847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
76661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
76761847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
76861847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
76961847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
77061847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
77161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
77261847f8eSopenharmony_ci     * @since 10
77361847f8eSopenharmony_ci     */
77461847f8eSopenharmony_ci    setCallingWindow(windowId: number): Promise<void>;
77561847f8eSopenharmony_ci
77661847f8eSopenharmony_ci    /**
77761847f8eSopenharmony_ci     * Update Cursor and notify the input method that the current application cursor has changed.
77861847f8eSopenharmony_ci     *
77961847f8eSopenharmony_ci     * @param { CursorInfo } cursorInfo - the CursorInfo object.
78061847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of updateCursor.
78161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
78261847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
78361847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
78461847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
78561847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
78661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
78761847f8eSopenharmony_ci     * @since 10
78861847f8eSopenharmony_ci     */
78961847f8eSopenharmony_ci    updateCursor(cursorInfo: CursorInfo, callback: AsyncCallback<void>): void;
79061847f8eSopenharmony_ci
79161847f8eSopenharmony_ci    /**
79261847f8eSopenharmony_ci     * Update Cursor and notify the input method that the current application cursor has changed.
79361847f8eSopenharmony_ci     *
79461847f8eSopenharmony_ci     * @param { CursorInfo } cursorInfo - the CursorInfo object.
79561847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
79661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
79761847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
79861847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
79961847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
80061847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
80161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
80261847f8eSopenharmony_ci     * @since 10
80361847f8eSopenharmony_ci     */
80461847f8eSopenharmony_ci    updateCursor(cursorInfo: CursorInfo): Promise<void>;
80561847f8eSopenharmony_ci
80661847f8eSopenharmony_ci    /**
80761847f8eSopenharmony_ci     * Notify the input method the selected text and the selection range of the current application text has changed.
80861847f8eSopenharmony_ci     *
80961847f8eSopenharmony_ci     * @param { string } text - the whole input text.
81061847f8eSopenharmony_ci     * @param { number } start - start position of selected text.
81161847f8eSopenharmony_ci     * @param { number } end - end position of selected text.
81261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of changeSelection.
81361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
81461847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
81561847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
81661847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
81761847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
81861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
81961847f8eSopenharmony_ci     * @since 10
82061847f8eSopenharmony_ci     */
82161847f8eSopenharmony_ci    changeSelection(text: string, start: number, end: number, callback: AsyncCallback<void>): void;
82261847f8eSopenharmony_ci
82361847f8eSopenharmony_ci    /**
82461847f8eSopenharmony_ci     * Notify the input method the selected text and the selection range of the current application text has changed.
82561847f8eSopenharmony_ci     *
82661847f8eSopenharmony_ci     * @param { string } text - the selected text.
82761847f8eSopenharmony_ci     * @param { number } start - start position of selected text.
82861847f8eSopenharmony_ci     * @param { number } end - end position of selected text.
82961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
83061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
83161847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
83261847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
83361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
83461847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
83561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
83661847f8eSopenharmony_ci     * @since 10
83761847f8eSopenharmony_ci     */
83861847f8eSopenharmony_ci    changeSelection(text: string, start: number, end: number): Promise<void>;
83961847f8eSopenharmony_ci
84061847f8eSopenharmony_ci    /**
84161847f8eSopenharmony_ci     * Update InputAttribute information of input text.
84261847f8eSopenharmony_ci     *
84361847f8eSopenharmony_ci     * @param { InputAttribute } attribute - the InputAttribute object.
84461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of updateAttribute.
84561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
84661847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
84761847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
84861847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
84961847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
85061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
85161847f8eSopenharmony_ci     * @since 10
85261847f8eSopenharmony_ci     */
85361847f8eSopenharmony_ci    updateAttribute(attribute: InputAttribute, callback: AsyncCallback<void>): void;
85461847f8eSopenharmony_ci
85561847f8eSopenharmony_ci    /**
85661847f8eSopenharmony_ci     * Update InputAttribute information of input text.
85761847f8eSopenharmony_ci     *
85861847f8eSopenharmony_ci     * @param { InputAttribute } attribute - the InputAttribute object.
85961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
86061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
86161847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
86261847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
86361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
86461847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
86561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
86661847f8eSopenharmony_ci     * @since 10
86761847f8eSopenharmony_ci     */
86861847f8eSopenharmony_ci    updateAttribute(attribute: InputAttribute): Promise<void>;
86961847f8eSopenharmony_ci    /**
87061847f8eSopenharmony_ci     * Stop input session
87161847f8eSopenharmony_ci     *
87261847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - the callback of stopInputSession.
87361847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
87461847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
87561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
87661847f8eSopenharmony_ci     * @since 9
87761847f8eSopenharmony_ci     */
87861847f8eSopenharmony_ci    stopInputSession(callback: AsyncCallback<boolean>): void;
87961847f8eSopenharmony_ci
88061847f8eSopenharmony_ci    /**
88161847f8eSopenharmony_ci     * Stop input session
88261847f8eSopenharmony_ci     *
88361847f8eSopenharmony_ci     * @returns { Promise<boolean> } the promise returned by the function.
88461847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
88561847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
88661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
88761847f8eSopenharmony_ci     * @since 9
88861847f8eSopenharmony_ci     */
88961847f8eSopenharmony_ci    stopInputSession(): Promise<boolean>;
89061847f8eSopenharmony_ci
89161847f8eSopenharmony_ci    /**
89261847f8eSopenharmony_ci     * Stop input
89361847f8eSopenharmony_ci     *
89461847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - the callback of stopInput.
89561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
89661847f8eSopenharmony_ci     * @since 6
89761847f8eSopenharmony_ci     * @deprecated since 9
89861847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodController#stopInputSession
89961847f8eSopenharmony_ci     */
90061847f8eSopenharmony_ci    stopInput(callback: AsyncCallback<boolean>): void;
90161847f8eSopenharmony_ci
90261847f8eSopenharmony_ci    /**
90361847f8eSopenharmony_ci     * Stop input
90461847f8eSopenharmony_ci     *
90561847f8eSopenharmony_ci     * @returns { Promise<boolean> } the promise returned by the function.
90661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
90761847f8eSopenharmony_ci     * @since 6
90861847f8eSopenharmony_ci     * @deprecated since 9
90961847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodController#stopInputSession
91061847f8eSopenharmony_ci     */
91161847f8eSopenharmony_ci    stopInput(): Promise<boolean>;
91261847f8eSopenharmony_ci
91361847f8eSopenharmony_ci    /**
91461847f8eSopenharmony_ci     * Show soft keyboard.
91561847f8eSopenharmony_ci     * This API can be called only by system applications.
91661847f8eSopenharmony_ci     *
91761847f8eSopenharmony_ci     * @permission ohos.permission.CONNECT_IME_ABILITY
91861847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of showSoftKeyboard.
91961847f8eSopenharmony_ci     * @throws { BusinessError } 201 - permissions check fails.
92061847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
92161847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
92261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
92361847f8eSopenharmony_ci     * @since 9
92461847f8eSopenharmony_ci     */
92561847f8eSopenharmony_ci    showSoftKeyboard(callback: AsyncCallback<void>): void;
92661847f8eSopenharmony_ci
92761847f8eSopenharmony_ci    /**
92861847f8eSopenharmony_ci     * Show soft keyboard.
92961847f8eSopenharmony_ci     * This API can be called only by system applications.
93061847f8eSopenharmony_ci     *
93161847f8eSopenharmony_ci     * @permission ohos.permission.CONNECT_IME_ABILITY
93261847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
93361847f8eSopenharmony_ci     * @throws { BusinessError } 201 - permissions check fails.
93461847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
93561847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
93661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
93761847f8eSopenharmony_ci     * @since 9
93861847f8eSopenharmony_ci     */
93961847f8eSopenharmony_ci    showSoftKeyboard(): Promise<void>;
94061847f8eSopenharmony_ci
94161847f8eSopenharmony_ci    /**
94261847f8eSopenharmony_ci     * Hide soft keyboard.
94361847f8eSopenharmony_ci     * This API can be called only by system applications.
94461847f8eSopenharmony_ci     *
94561847f8eSopenharmony_ci     * @permission ohos.permission.CONNECT_IME_ABILITY
94661847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of hideSoftKeyboard.
94761847f8eSopenharmony_ci     * @throws { BusinessError } 201 - permissions check fails.
94861847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
94961847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
95061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
95161847f8eSopenharmony_ci     * @since 9
95261847f8eSopenharmony_ci     */
95361847f8eSopenharmony_ci    hideSoftKeyboard(callback: AsyncCallback<void>): void;
95461847f8eSopenharmony_ci
95561847f8eSopenharmony_ci    /**
95661847f8eSopenharmony_ci     * Hide soft keyboard.
95761847f8eSopenharmony_ci     * This API can be called only by system applications.
95861847f8eSopenharmony_ci     *
95961847f8eSopenharmony_ci     * @permission ohos.permission.CONNECT_IME_ABILITY
96061847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
96161847f8eSopenharmony_ci     * @throws { BusinessError } 201 - permissions check fails.
96261847f8eSopenharmony_ci     * @throws { BusinessError } 12800003 - input method client error.
96361847f8eSopenharmony_ci     * @throws { BusinessError } 12800008 - input method manager service error.
96461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
96561847f8eSopenharmony_ci     * @since 9
96661847f8eSopenharmony_ci     */
96761847f8eSopenharmony_ci    hideSoftKeyboard(): Promise<void>;
96861847f8eSopenharmony_ci
96961847f8eSopenharmony_ci    /**
97061847f8eSopenharmony_ci     * Register a callback and when IME sends select event with range of selection,
97161847f8eSopenharmony_ci     * the callback will be invoked.
97261847f8eSopenharmony_ci     *
97361847f8eSopenharmony_ci     * @param { 'selectByRange' } type - event type, fixed as 'selectByRange'.
97461847f8eSopenharmony_ci     * @param { Callback<Range> } callback - processes selectByRange command. The range of selection is provided for
97561847f8eSopenharmony_ci     *        this callback, and subscribers are expected to select corresponding text in callback according to
97661847f8eSopenharmony_ci     *        the range.
97761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
97861847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
97961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
98061847f8eSopenharmony_ci     * @since 10
98161847f8eSopenharmony_ci     */
98261847f8eSopenharmony_ci    on(type: 'selectByRange', callback: Callback<Range>): void;
98361847f8eSopenharmony_ci
98461847f8eSopenharmony_ci    /**
98561847f8eSopenharmony_ci     * Unregister the callback of selectedByRange.
98661847f8eSopenharmony_ci     *
98761847f8eSopenharmony_ci     * @param { 'selectByRange' } type - event type, fixed as 'selectByRange'.
98861847f8eSopenharmony_ci     * @param { Callback<Range> } [callback] - the callback of 'selectByRange',
98961847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'selectByRange', this parameter can be left blank.
99061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
99161847f8eSopenharmony_ci     * @since 10
99261847f8eSopenharmony_ci     */
99361847f8eSopenharmony_ci    off(type: 'selectByRange', callback?: Callback<Range>): void;
99461847f8eSopenharmony_ci
99561847f8eSopenharmony_ci    /**
99661847f8eSopenharmony_ci     * Register a callback and when IME sends select event witch movement of cursor,
99761847f8eSopenharmony_ci     * the callback will be invoked.
99861847f8eSopenharmony_ci     *
99961847f8eSopenharmony_ci     * @param { 'selectByMovement' } type - event type, fixed as 'selectByMovement'.
100061847f8eSopenharmony_ci     * @param { Callback<Movement> } callback - processes selectByMovement command. The movement of cursor is provided
100161847f8eSopenharmony_ci     *        for this callback, and subscribers are expected to select corresponding text in callback according to
100261847f8eSopenharmony_ci     *        the movement.
100361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
100461847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
100561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
100661847f8eSopenharmony_ci     * @since 10
100761847f8eSopenharmony_ci     */
100861847f8eSopenharmony_ci    on(type: 'selectByMovement', callback: Callback<Movement>): void;
100961847f8eSopenharmony_ci
101061847f8eSopenharmony_ci    /**
101161847f8eSopenharmony_ci     * Unregister the callback of selectedByMovement.
101261847f8eSopenharmony_ci     *
101361847f8eSopenharmony_ci     * @param { 'selectByMovement' } type - event type, fixed as 'selectByMovement'.
101461847f8eSopenharmony_ci     * @param { Callback<Movement> } [callback] - the callback of 'selectByMovement',
101561847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'selectByMovement', this parameter can be left blank.
101661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
101761847f8eSopenharmony_ci     * @since 10
101861847f8eSopenharmony_ci     */
101961847f8eSopenharmony_ci    off(type: 'selectByMovement', callback?: Callback<Movement>): void;
102061847f8eSopenharmony_ci
102161847f8eSopenharmony_ci    /**
102261847f8eSopenharmony_ci     * Register a callback and when IME sends insert text event, the callback will be invoked.
102361847f8eSopenharmony_ci     *
102461847f8eSopenharmony_ci     * @param { 'insertText' } type - event type, fixed as 'insertText'.
102561847f8eSopenharmony_ci     * @param { function } callback - processes insertText command. The text of insert is provided for this callback.
102661847f8eSopenharmony_ci     *        Subscribers are expected to process the inserted text and update changes in editor by changeSelection and updateCursor as needed.
102761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
102861847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
102961847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
103061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
103161847f8eSopenharmony_ci     * @since 10
103261847f8eSopenharmony_ci     */
103361847f8eSopenharmony_ci    on(type: 'insertText', callback: (text: string) => void): void;
103461847f8eSopenharmony_ci
103561847f8eSopenharmony_ci    /**
103661847f8eSopenharmony_ci     * Unregister the callback of insertText.
103761847f8eSopenharmony_ci     *
103861847f8eSopenharmony_ci     * @param { 'insertText' } type - event type, fixed as 'insertText'.
103961847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'insertText',
104061847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'insertText', this parameter can be left blank.
104161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
104261847f8eSopenharmony_ci     * @since 10
104361847f8eSopenharmony_ci     */
104461847f8eSopenharmony_ci    off(type: 'insertText', callback?: (text: string) => void): void;
104561847f8eSopenharmony_ci
104661847f8eSopenharmony_ci    /**
104761847f8eSopenharmony_ci     * Register a callback and when IME sends delete left event with length,
104861847f8eSopenharmony_ci     * the callback will be invoked.
104961847f8eSopenharmony_ci     *
105061847f8eSopenharmony_ci     * @param { 'deleteLeft' } type - event type, fixed as 'deleteLeft'.
105161847f8eSopenharmony_ci     * @param { function } callback - processes deleteLeft command. The length of
105261847f8eSopenharmony_ci     *     delete is provided for this callback. Subscribers are expected to delete specified length of text
105361847f8eSopenharmony_ci     *     to the left of the cursor and update changes in editor by changeSelection and updateCursor as needed.
105461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
105561847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
105661847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
105761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
105861847f8eSopenharmony_ci     * @since 10
105961847f8eSopenharmony_ci     */
106061847f8eSopenharmony_ci    on(type: 'deleteLeft', callback: (length: number) => void): void;
106161847f8eSopenharmony_ci
106261847f8eSopenharmony_ci    /**
106361847f8eSopenharmony_ci     * Unregister the callback of deleteLeft.
106461847f8eSopenharmony_ci     *
106561847f8eSopenharmony_ci     * @param { 'deleteLeft' } type - event type, fixed as 'deleteLeft'.
106661847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'deleteLeft',
106761847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'deleteLeft', this parameter can be left blank.
106861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
106961847f8eSopenharmony_ci     * @since 10
107061847f8eSopenharmony_ci     */
107161847f8eSopenharmony_ci    off(type: 'deleteLeft', callback?: (length: number) => void): void;
107261847f8eSopenharmony_ci
107361847f8eSopenharmony_ci    /**
107461847f8eSopenharmony_ci     * Register a callback and when IME sends delete right event with length,
107561847f8eSopenharmony_ci     * the callback will be invoked.
107661847f8eSopenharmony_ci     *
107761847f8eSopenharmony_ci     * @param { 'deleteRight' } type - event type, fixed as 'deleteRight'.
107861847f8eSopenharmony_ci     * @param { function } callback - processes deleteRight command. The length of
107961847f8eSopenharmony_ci     *     delete is provided for this callback. Subscribers are expected to delete specified length of text
108061847f8eSopenharmony_ci     *     to the right of the cursor and update changes in editor by changeSelection and updateCursor as needed.
108161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
108261847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
108361847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
108461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
108561847f8eSopenharmony_ci     * @since 10
108661847f8eSopenharmony_ci     */
108761847f8eSopenharmony_ci    on(type: 'deleteRight', callback: (length: number) => void): void;
108861847f8eSopenharmony_ci
108961847f8eSopenharmony_ci    /**
109061847f8eSopenharmony_ci     * Unregister the callback of deleteRight.
109161847f8eSopenharmony_ci     *
109261847f8eSopenharmony_ci     * @param { 'deleteRight' } type - event type, fixed as 'deleteRight'.
109361847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'deleteRight',
109461847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'deleteRight', this parameter can be left blank.
109561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
109661847f8eSopenharmony_ci     * @since 10
109761847f8eSopenharmony_ci     */
109861847f8eSopenharmony_ci    off(type: 'deleteRight', callback?: (length: number) => void): void;
109961847f8eSopenharmony_ci
110061847f8eSopenharmony_ci    /**
110161847f8eSopenharmony_ci     * Register a callback and when IME sends keyboard status, the callback will be invoked.
110261847f8eSopenharmony_ci     *
110361847f8eSopenharmony_ci     * @param { 'sendKeyboardStatus' } type - event type, fixed as 'sendKeyboardStatus'.
110461847f8eSopenharmony_ci     * @param { function } callback - processes sendKeyboardStatus command.
110561847f8eSopenharmony_ci     *     The keyboardStatus is provided for this callback.
110661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
110761847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
110861847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
110961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
111061847f8eSopenharmony_ci     * @since 10
111161847f8eSopenharmony_ci     */
111261847f8eSopenharmony_ci    on(type: 'sendKeyboardStatus', callback: (keyboardStatus: KeyboardStatus) => void): void;
111361847f8eSopenharmony_ci
111461847f8eSopenharmony_ci    /**
111561847f8eSopenharmony_ci     * Unregister the callback of sendKeyboardStatus.
111661847f8eSopenharmony_ci     *
111761847f8eSopenharmony_ci     * @param { 'sendKeyboardStatus' } type - event type, fixed as 'sendKeyboardStatus'.
111861847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'sendKeyboardStatus',
111961847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'sendKeyboardStatus', this parameter can be left blank.
112061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
112161847f8eSopenharmony_ci     * @since 10
112261847f8eSopenharmony_ci     */
112361847f8eSopenharmony_ci    off(type: 'sendKeyboardStatus', callback?: (keyboardStatus: KeyboardStatus) => void): void;
112461847f8eSopenharmony_ci
112561847f8eSopenharmony_ci    /**
112661847f8eSopenharmony_ci     * Register a callback and when IME sends functionKey, the callback will be invoked.
112761847f8eSopenharmony_ci     *
112861847f8eSopenharmony_ci     * @param { 'sendFunctionKey' } type - event type, fixed as 'sendFunctionKey'.
112961847f8eSopenharmony_ci     * @param { function } callback - processes sendFunctionKey command.
113061847f8eSopenharmony_ci     *     The functionKey is provided for this callback.Subscribers are expected to complete the
113161847f8eSopenharmony_ci     *     corresponding task based on the value of functionKey.
113261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
113361847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
113461847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
113561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
113661847f8eSopenharmony_ci     * @since 10
113761847f8eSopenharmony_ci     */
113861847f8eSopenharmony_ci    on(type: 'sendFunctionKey', callback: (functionKey: FunctionKey) => void): void;
113961847f8eSopenharmony_ci
114061847f8eSopenharmony_ci    /**
114161847f8eSopenharmony_ci     * Unregister the callback of sendFunctionKey.
114261847f8eSopenharmony_ci     *
114361847f8eSopenharmony_ci     * @param { 'sendFunctionKey' } type - event type, fixed as 'sendFunctionKey'.
114461847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'sendFunctionKey',
114561847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'sendFunctionKey', this parameter can be left blank.
114661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
114761847f8eSopenharmony_ci     * @since 10
114861847f8eSopenharmony_ci     */
114961847f8eSopenharmony_ci    off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void;
115061847f8eSopenharmony_ci
115161847f8eSopenharmony_ci    /**
115261847f8eSopenharmony_ci     * Register a callback and when IME sends move cursor, the callback will be invoked.
115361847f8eSopenharmony_ci     *
115461847f8eSopenharmony_ci     * @param { 'moveCursor' } type - event type, fixed as 'moveCursor'.
115561847f8eSopenharmony_ci     * @param { function } callback - processes moveCursor command. The direction of
115661847f8eSopenharmony_ci     *     cursor is provided for this callback. Subscribers are expected to move the cursor and update changes
115761847f8eSopenharmony_ci     *     in editor by changeSelection and updateCursor.
115861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
115961847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
116061847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
116161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
116261847f8eSopenharmony_ci     * @since 10
116361847f8eSopenharmony_ci     */
116461847f8eSopenharmony_ci    on(type: 'moveCursor', callback: (direction: Direction) => void): void;
116561847f8eSopenharmony_ci
116661847f8eSopenharmony_ci    /**
116761847f8eSopenharmony_ci     * Unregister the callback of moveCursor.
116861847f8eSopenharmony_ci     *
116961847f8eSopenharmony_ci     * @param { 'moveCursor' } type - event type, fixed as 'moveCursor'.
117061847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'moveCursor',
117161847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'moveCursor', this parameter can be left blank.
117261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
117361847f8eSopenharmony_ci     * @since 10
117461847f8eSopenharmony_ci     */
117561847f8eSopenharmony_ci    off(type: 'moveCursor', callback?: (direction: Direction) => void): void;
117661847f8eSopenharmony_ci
117761847f8eSopenharmony_ci    /**
117861847f8eSopenharmony_ci     * Register a callback and when IME sends extend action code, the callback will be invoked.
117961847f8eSopenharmony_ci     *
118061847f8eSopenharmony_ci     * @param { 'handleExtendAction' } type - event type, fixed as 'handleExtendAction'.
118161847f8eSopenharmony_ci     * @param { function } callback - processes handleExtendAction command. The action code
118261847f8eSopenharmony_ci     *     is provided for this callback.
118361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
118461847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
118561847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
118661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
118761847f8eSopenharmony_ci     * @since 10
118861847f8eSopenharmony_ci     */
118961847f8eSopenharmony_ci    on(type: 'handleExtendAction', callback: (action: ExtendAction) => void): void;
119061847f8eSopenharmony_ci
119161847f8eSopenharmony_ci    /**
119261847f8eSopenharmony_ci     * Unregister the callback of handleExtendAction.
119361847f8eSopenharmony_ci     *
119461847f8eSopenharmony_ci     * @param { 'handleExtendAction' } type - event type, fixed as 'handleExtendAction'.
119561847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'handleExtendAction',
119661847f8eSopenharmony_ci     *        when subscriber unsubscribes all callback functions of event 'handleExtendAction', this parameter can be left blank.
119761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
119861847f8eSopenharmony_ci     * @since 10
119961847f8eSopenharmony_ci     */
120061847f8eSopenharmony_ci    off(type: 'handleExtendAction', callback?: (action: ExtendAction) => void): void;
120161847f8eSopenharmony_ci
120261847f8eSopenharmony_ci    /**
120361847f8eSopenharmony_ci     * Register a callback and when input method ability gets left text of cursor, the callback will be invoked.
120461847f8eSopenharmony_ci     *
120561847f8eSopenharmony_ci     * @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'.
120661847f8eSopenharmony_ci     * @param { function } callback - processes getLeftTextOfCursor command. The callback
120761847f8eSopenharmony_ci     *     must be a synchronization method and will block the input method application.
120861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
120961847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
121061847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
121161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
121261847f8eSopenharmony_ci     * @since 10
121361847f8eSopenharmony_ci     */
121461847f8eSopenharmony_ci    on(type: 'getLeftTextOfCursor', callback: (length: number) => string): void;
121561847f8eSopenharmony_ci
121661847f8eSopenharmony_ci    /**
121761847f8eSopenharmony_ci     * Unregister the callback of getLeftTextOfCursor event.
121861847f8eSopenharmony_ci     *
121961847f8eSopenharmony_ci     * @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'.
122061847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'getLeftTextOfCursor',
122161847f8eSopenharmony_ci     *     when subscriber unsubscribes all callback functions of event 'getLeftTextOfCursor', this parameter can be left blank.
122261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
122361847f8eSopenharmony_ci     * @since 10
122461847f8eSopenharmony_ci     */
122561847f8eSopenharmony_ci    off(type: 'getLeftTextOfCursor', callback?: (length: number) => string): void;
122661847f8eSopenharmony_ci
122761847f8eSopenharmony_ci    /**
122861847f8eSopenharmony_ci     * Register a callback and when input method ability gets right text of cursor, the callback will be invoked.
122961847f8eSopenharmony_ci     *
123061847f8eSopenharmony_ci     * @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'.
123161847f8eSopenharmony_ci     * @param { function } callback - processes getRightTextOfCursor command. The callback
123261847f8eSopenharmony_ci     *     must be a synchronization method and will block the input method application.
123361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
123461847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
123561847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
123661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
123761847f8eSopenharmony_ci     * @since 10
123861847f8eSopenharmony_ci     */
123961847f8eSopenharmony_ci    on(type: 'getRightTextOfCursor', callback: (length: number) => string): void;
124061847f8eSopenharmony_ci
124161847f8eSopenharmony_ci    /**
124261847f8eSopenharmony_ci     * Unregister the callback of getRightTextOfCursor event.
124361847f8eSopenharmony_ci     *
124461847f8eSopenharmony_ci     * @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'.
124561847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'getRightTextOfCursor',
124661847f8eSopenharmony_ci     *     when subscriber unsubscribes all callback functions of event 'getRightTextOfCursor', this parameter can be left blank.
124761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
124861847f8eSopenharmony_ci     * @since 10
124961847f8eSopenharmony_ci     */
125061847f8eSopenharmony_ci    off(type: 'getRightTextOfCursor', callback?: (length: number) => string): void;
125161847f8eSopenharmony_ci
125261847f8eSopenharmony_ci    /**
125361847f8eSopenharmony_ci     * Register a callback and when input method ability gets the text index at cursor, the callback will be invoked.
125461847f8eSopenharmony_ci     *
125561847f8eSopenharmony_ci     * @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'.
125661847f8eSopenharmony_ci     * @param { function } callback - processes getTextIndexAtCursor command. The callback
125761847f8eSopenharmony_ci     *     must be a synchronization method, and should return the text index at the cursor.
125861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - parameter error. Possible causes:
125961847f8eSopenharmony_ci     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
126061847f8eSopenharmony_ci     * @throws { BusinessError } 12800009 - input method client is detached.
126161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
126261847f8eSopenharmony_ci     * @since 10
126361847f8eSopenharmony_ci     */
126461847f8eSopenharmony_ci    on(type: 'getTextIndexAtCursor', callback: () => number): void;
126561847f8eSopenharmony_ci
126661847f8eSopenharmony_ci    /**
126761847f8eSopenharmony_ci     * Unregister the callback of getTextIndexAtCursor.
126861847f8eSopenharmony_ci     *
126961847f8eSopenharmony_ci     * @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'.
127061847f8eSopenharmony_ci     * @param { function } [callback] - the callback of 'getTextIndexAtCursor',
127161847f8eSopenharmony_ci     *     when subscriber unsubscribes all callback functions of event 'getTextIndexAtCursor', this parameter can be left blank.
127261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
127361847f8eSopenharmony_ci     * @since 10
127461847f8eSopenharmony_ci     */
127561847f8eSopenharmony_ci    off(type: 'getTextIndexAtCursor', callback?: () => number): void;
127661847f8eSopenharmony_ci  }
127761847f8eSopenharmony_ci
127861847f8eSopenharmony_ci  /**
127961847f8eSopenharmony_ci   * input method property
128061847f8eSopenharmony_ci   *
128161847f8eSopenharmony_ci   * @interface InputMethodProperty
128261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
128361847f8eSopenharmony_ci   * @since 8
128461847f8eSopenharmony_ci   */
128561847f8eSopenharmony_ci  interface InputMethodProperty {
128661847f8eSopenharmony_ci    /**
128761847f8eSopenharmony_ci     * The name of input method
128861847f8eSopenharmony_ci     *
128961847f8eSopenharmony_ci     * @type { string }
129061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
129161847f8eSopenharmony_ci     * @since 8
129261847f8eSopenharmony_ci     * @deprecated since 9
129361847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodProperty#name
129461847f8eSopenharmony_ci     */
129561847f8eSopenharmony_ci    readonly packageName: string;
129661847f8eSopenharmony_ci
129761847f8eSopenharmony_ci    /**
129861847f8eSopenharmony_ci     * The id of input method
129961847f8eSopenharmony_ci     *
130061847f8eSopenharmony_ci     * @type { string }
130161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
130261847f8eSopenharmony_ci     * @since 8
130361847f8eSopenharmony_ci     * @deprecated since 9
130461847f8eSopenharmony_ci     * @useinstead inputMethod.InputMethodProperty#id
130561847f8eSopenharmony_ci     */
130661847f8eSopenharmony_ci    readonly methodId: string;
130761847f8eSopenharmony_ci
130861847f8eSopenharmony_ci    /**
130961847f8eSopenharmony_ci     * The name of input method
131061847f8eSopenharmony_ci     *
131161847f8eSopenharmony_ci     * @type { string }
131261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
131361847f8eSopenharmony_ci     * @since 9
131461847f8eSopenharmony_ci     */
131561847f8eSopenharmony_ci    readonly name: string;
131661847f8eSopenharmony_ci
131761847f8eSopenharmony_ci    /**
131861847f8eSopenharmony_ci     * The id of input method
131961847f8eSopenharmony_ci     *
132061847f8eSopenharmony_ci     * @type { string }
132161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
132261847f8eSopenharmony_ci     * @since 9
132361847f8eSopenharmony_ci     */
132461847f8eSopenharmony_ci    readonly id: string;
132561847f8eSopenharmony_ci
132661847f8eSopenharmony_ci    /**
132761847f8eSopenharmony_ci     * The label of input method
132861847f8eSopenharmony_ci     *
132961847f8eSopenharmony_ci     * @type { ?string }
133061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
133161847f8eSopenharmony_ci     * @since 9
133261847f8eSopenharmony_ci     */
133361847f8eSopenharmony_ci    readonly label?: string;
133461847f8eSopenharmony_ci
133561847f8eSopenharmony_ci    /**
133661847f8eSopenharmony_ci     * The label id of input method
133761847f8eSopenharmony_ci     *
133861847f8eSopenharmony_ci     * @type { ?number }
133961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
134061847f8eSopenharmony_ci     * @since 10
134161847f8eSopenharmony_ci     */
134261847f8eSopenharmony_ci    readonly labelId?: number;
134361847f8eSopenharmony_ci
134461847f8eSopenharmony_ci    /**
134561847f8eSopenharmony_ci     * The icon of input method
134661847f8eSopenharmony_ci     *
134761847f8eSopenharmony_ci     * @type { ?string }
134861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
134961847f8eSopenharmony_ci     * @since 9
135061847f8eSopenharmony_ci     */
135161847f8eSopenharmony_ci    readonly icon?: string;
135261847f8eSopenharmony_ci
135361847f8eSopenharmony_ci    /**
135461847f8eSopenharmony_ci     * The icon id of input method
135561847f8eSopenharmony_ci     *
135661847f8eSopenharmony_ci     * @type { ?number }
135761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
135861847f8eSopenharmony_ci     * @since 9
135961847f8eSopenharmony_ci     */
136061847f8eSopenharmony_ci    readonly iconId?: number;
136161847f8eSopenharmony_ci
136261847f8eSopenharmony_ci    /**
136361847f8eSopenharmony_ci     * The extra info of input method
136461847f8eSopenharmony_ci     *
136561847f8eSopenharmony_ci     * @type { object }
136661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
136761847f8eSopenharmony_ci     * @since 9
136861847f8eSopenharmony_ci     */
136961847f8eSopenharmony_ci    /**
137061847f8eSopenharmony_ci     * The extra info of input method
137161847f8eSopenharmony_ci     *
137261847f8eSopenharmony_ci     * @type { ?object }
137361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
137461847f8eSopenharmony_ci     * @since 10
137561847f8eSopenharmony_ci     */
137661847f8eSopenharmony_ci    extra?: object;
137761847f8eSopenharmony_ci  }
137861847f8eSopenharmony_ci
137961847f8eSopenharmony_ci  /**
138061847f8eSopenharmony_ci   * Enumerates the moving direction of cursor
138161847f8eSopenharmony_ci   *
138261847f8eSopenharmony_ci   * @enum { number }
138361847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
138461847f8eSopenharmony_ci   * @since 10
138561847f8eSopenharmony_ci   */
138661847f8eSopenharmony_ci  export enum Direction {
138761847f8eSopenharmony_ci    /**
138861847f8eSopenharmony_ci     * Cursor moves up
138961847f8eSopenharmony_ci     *
139061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
139161847f8eSopenharmony_ci     * @since 10
139261847f8eSopenharmony_ci     */
139361847f8eSopenharmony_ci    CURSOR_UP = 1,
139461847f8eSopenharmony_ci
139561847f8eSopenharmony_ci    /**
139661847f8eSopenharmony_ci     * Cursor moves down
139761847f8eSopenharmony_ci     *
139861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
139961847f8eSopenharmony_ci     * @since 10
140061847f8eSopenharmony_ci     */
140161847f8eSopenharmony_ci    CURSOR_DOWN,
140261847f8eSopenharmony_ci
140361847f8eSopenharmony_ci    /**
140461847f8eSopenharmony_ci     * Cursor moves left
140561847f8eSopenharmony_ci     *
140661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
140761847f8eSopenharmony_ci     * @since 10
140861847f8eSopenharmony_ci     */
140961847f8eSopenharmony_ci    CURSOR_LEFT,
141061847f8eSopenharmony_ci
141161847f8eSopenharmony_ci    /**
141261847f8eSopenharmony_ci     * Cursor moves right
141361847f8eSopenharmony_ci     *
141461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
141561847f8eSopenharmony_ci     * @since 10
141661847f8eSopenharmony_ci     */
141761847f8eSopenharmony_ci    CURSOR_RIGHT
141861847f8eSopenharmony_ci  }
141961847f8eSopenharmony_ci
142061847f8eSopenharmony_ci  /**
142161847f8eSopenharmony_ci   * Range of selected text.
142261847f8eSopenharmony_ci   *
142361847f8eSopenharmony_ci   * @typedef Range
142461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
142561847f8eSopenharmony_ci   * @since 10
142661847f8eSopenharmony_ci   */
142761847f8eSopenharmony_ci  export interface Range {
142861847f8eSopenharmony_ci    /**
142961847f8eSopenharmony_ci     * Indicates the index of the first character of the selected text.
143061847f8eSopenharmony_ci     *
143161847f8eSopenharmony_ci     * @type { number }
143261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
143361847f8eSopenharmony_ci     * @since 10
143461847f8eSopenharmony_ci     */
143561847f8eSopenharmony_ci    start: number;
143661847f8eSopenharmony_ci
143761847f8eSopenharmony_ci    /**
143861847f8eSopenharmony_ci     * Indicates the index of the last character of the selected text.
143961847f8eSopenharmony_ci     *
144061847f8eSopenharmony_ci     * @type { number }
144161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
144261847f8eSopenharmony_ci     * @since 10
144361847f8eSopenharmony_ci     */
144461847f8eSopenharmony_ci    end: number;
144561847f8eSopenharmony_ci  }
144661847f8eSopenharmony_ci
144761847f8eSopenharmony_ci  /**
144861847f8eSopenharmony_ci   * Movement of cursor.
144961847f8eSopenharmony_ci   *
145061847f8eSopenharmony_ci   * @typedef Movement
145161847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
145261847f8eSopenharmony_ci   * @since 10
145361847f8eSopenharmony_ci   */
145461847f8eSopenharmony_ci  export interface Movement {
145561847f8eSopenharmony_ci    /**
145661847f8eSopenharmony_ci     * Indicates the direction of cursor movement
145761847f8eSopenharmony_ci     *
145861847f8eSopenharmony_ci     * @type { Direction }
145961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
146061847f8eSopenharmony_ci     * @since 10
146161847f8eSopenharmony_ci     */
146261847f8eSopenharmony_ci    direction: Direction;
146361847f8eSopenharmony_ci  }
146461847f8eSopenharmony_ci
146561847f8eSopenharmony_ci  /**
146661847f8eSopenharmony_ci   * Enumerates the text input type.
146761847f8eSopenharmony_ci   *
146861847f8eSopenharmony_ci   * @enum { number }
146961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
147061847f8eSopenharmony_ci   * @since 10
147161847f8eSopenharmony_ci   */
147261847f8eSopenharmony_ci  export enum TextInputType {
147361847f8eSopenharmony_ci    /**
147461847f8eSopenharmony_ci     * The text input type is NONE.
147561847f8eSopenharmony_ci     *
147661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
147761847f8eSopenharmony_ci     * @since 10
147861847f8eSopenharmony_ci     */
147961847f8eSopenharmony_ci    NONE = -1,
148061847f8eSopenharmony_ci
148161847f8eSopenharmony_ci    /**
148261847f8eSopenharmony_ci     * The text input type is TEXT.
148361847f8eSopenharmony_ci     *
148461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
148561847f8eSopenharmony_ci     * @since 10
148661847f8eSopenharmony_ci     */
148761847f8eSopenharmony_ci    TEXT = 0,
148861847f8eSopenharmony_ci
148961847f8eSopenharmony_ci    /**
149061847f8eSopenharmony_ci     * The text input type is MULTILINE.
149161847f8eSopenharmony_ci     *
149261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
149361847f8eSopenharmony_ci     * @since 10
149461847f8eSopenharmony_ci     */
149561847f8eSopenharmony_ci    MULTILINE,
149661847f8eSopenharmony_ci
149761847f8eSopenharmony_ci    /**
149861847f8eSopenharmony_ci     * The text input type is NUMBER.
149961847f8eSopenharmony_ci     *
150061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
150161847f8eSopenharmony_ci     * @since 10
150261847f8eSopenharmony_ci     */
150361847f8eSopenharmony_ci    NUMBER,
150461847f8eSopenharmony_ci
150561847f8eSopenharmony_ci    /**
150661847f8eSopenharmony_ci     * The text input type is PHONE.
150761847f8eSopenharmony_ci     *
150861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
150961847f8eSopenharmony_ci     * @since 10
151061847f8eSopenharmony_ci     */
151161847f8eSopenharmony_ci    PHONE,
151261847f8eSopenharmony_ci
151361847f8eSopenharmony_ci    /**
151461847f8eSopenharmony_ci     * The text input type is DATETIME.
151561847f8eSopenharmony_ci     *
151661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
151761847f8eSopenharmony_ci     * @since 10
151861847f8eSopenharmony_ci     */
151961847f8eSopenharmony_ci    DATETIME,
152061847f8eSopenharmony_ci
152161847f8eSopenharmony_ci    /**
152261847f8eSopenharmony_ci     * The text input type is EMAIL_ADDRESS.
152361847f8eSopenharmony_ci     *
152461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
152561847f8eSopenharmony_ci     * @since 10
152661847f8eSopenharmony_ci     */
152761847f8eSopenharmony_ci    EMAIL_ADDRESS,
152861847f8eSopenharmony_ci
152961847f8eSopenharmony_ci    /**
153061847f8eSopenharmony_ci     * The text input type is URL.
153161847f8eSopenharmony_ci     *
153261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
153361847f8eSopenharmony_ci     * @since 10
153461847f8eSopenharmony_ci     */
153561847f8eSopenharmony_ci    URL,
153661847f8eSopenharmony_ci
153761847f8eSopenharmony_ci    /**
153861847f8eSopenharmony_ci     * The text input type is VISIBLE_PASSWORD.
153961847f8eSopenharmony_ci     *
154061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
154161847f8eSopenharmony_ci     * @since 10
154261847f8eSopenharmony_ci     */
154361847f8eSopenharmony_ci    VISIBLE_PASSWORD,
154461847f8eSopenharmony_ci
154561847f8eSopenharmony_ci    /**
154661847f8eSopenharmony_ci     * The text input type is NUMBER_PASSWORD.
154761847f8eSopenharmony_ci     *
154861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
154961847f8eSopenharmony_ci     * @since 11
155061847f8eSopenharmony_ci     */
155161847f8eSopenharmony_ci    NUMBER_PASSWORD
155261847f8eSopenharmony_ci  }
155361847f8eSopenharmony_ci
155461847f8eSopenharmony_ci  /**
155561847f8eSopenharmony_ci   * Enumerates the enter key type.
155661847f8eSopenharmony_ci   *
155761847f8eSopenharmony_ci   * @enum { number }
155861847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
155961847f8eSopenharmony_ci   * @since 10
156061847f8eSopenharmony_ci   */
156161847f8eSopenharmony_ci  export enum EnterKeyType {
156261847f8eSopenharmony_ci    /**
156361847f8eSopenharmony_ci     * The enter key type is UNSPECIFIED.
156461847f8eSopenharmony_ci     *
156561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
156661847f8eSopenharmony_ci     * @since 10
156761847f8eSopenharmony_ci     */
156861847f8eSopenharmony_ci    UNSPECIFIED = 0,
156961847f8eSopenharmony_ci
157061847f8eSopenharmony_ci    /**
157161847f8eSopenharmony_ci     * The enter key type is NONE.
157261847f8eSopenharmony_ci     *
157361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
157461847f8eSopenharmony_ci     * @since 10
157561847f8eSopenharmony_ci     */
157661847f8eSopenharmony_ci    NONE,
157761847f8eSopenharmony_ci
157861847f8eSopenharmony_ci    /**
157961847f8eSopenharmony_ci     * The enter key type is GO.
158061847f8eSopenharmony_ci     *
158161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
158261847f8eSopenharmony_ci     * @since 10
158361847f8eSopenharmony_ci     */
158461847f8eSopenharmony_ci    GO,
158561847f8eSopenharmony_ci
158661847f8eSopenharmony_ci    /**
158761847f8eSopenharmony_ci     * The enter key type is SEARCH.
158861847f8eSopenharmony_ci     *
158961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
159061847f8eSopenharmony_ci     * @since 10
159161847f8eSopenharmony_ci     */
159261847f8eSopenharmony_ci    SEARCH,
159361847f8eSopenharmony_ci
159461847f8eSopenharmony_ci    /**
159561847f8eSopenharmony_ci     * The enter key type is SEND.
159661847f8eSopenharmony_ci     *
159761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
159861847f8eSopenharmony_ci     * @since 10
159961847f8eSopenharmony_ci     */
160061847f8eSopenharmony_ci    SEND,
160161847f8eSopenharmony_ci
160261847f8eSopenharmony_ci    /**
160361847f8eSopenharmony_ci     * The enter key type is NEXT.
160461847f8eSopenharmony_ci     *
160561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
160661847f8eSopenharmony_ci     * @since 10
160761847f8eSopenharmony_ci     */
160861847f8eSopenharmony_ci    NEXT,
160961847f8eSopenharmony_ci
161061847f8eSopenharmony_ci    /**
161161847f8eSopenharmony_ci     * The enter key type is DONE.
161261847f8eSopenharmony_ci     *
161361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
161461847f8eSopenharmony_ci     * @since 10
161561847f8eSopenharmony_ci     */
161661847f8eSopenharmony_ci    DONE,
161761847f8eSopenharmony_ci
161861847f8eSopenharmony_ci    /**
161961847f8eSopenharmony_ci     * The enter key type is PREVIOUS.
162061847f8eSopenharmony_ci     *
162161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
162261847f8eSopenharmony_ci     * @since 10
162361847f8eSopenharmony_ci     */
162461847f8eSopenharmony_ci    PREVIOUS,
162561847f8eSopenharmony_ci
162661847f8eSopenharmony_ci      /**
162761847f8eSopenharmony_ci     * The enter key type is NEWLINE.
162861847f8eSopenharmony_ci     *
162961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
163061847f8eSopenharmony_ci     * @since 12
163161847f8eSopenharmony_ci     */
163261847f8eSopenharmony_ci    NEWLINE
163361847f8eSopenharmony_ci  }
163461847f8eSopenharmony_ci
163561847f8eSopenharmony_ci  /**
163661847f8eSopenharmony_ci   * Enumerates the keyboard status.
163761847f8eSopenharmony_ci   *
163861847f8eSopenharmony_ci   * @enum { number }
163961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
164061847f8eSopenharmony_ci   * @since 10
164161847f8eSopenharmony_ci   */
164261847f8eSopenharmony_ci  export enum KeyboardStatus {
164361847f8eSopenharmony_ci    /**
164461847f8eSopenharmony_ci     * The keyboard status is none.
164561847f8eSopenharmony_ci     *
164661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
164761847f8eSopenharmony_ci     * @since 10
164861847f8eSopenharmony_ci     */
164961847f8eSopenharmony_ci    NONE = 0,
165061847f8eSopenharmony_ci
165161847f8eSopenharmony_ci    /**
165261847f8eSopenharmony_ci     * The keyboard status is hide.
165361847f8eSopenharmony_ci     *
165461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
165561847f8eSopenharmony_ci     * @since 10
165661847f8eSopenharmony_ci     */
165761847f8eSopenharmony_ci    HIDE = 1,
165861847f8eSopenharmony_ci
165961847f8eSopenharmony_ci    /**
166061847f8eSopenharmony_ci     * The keyboard status is show.
166161847f8eSopenharmony_ci     *
166261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
166361847f8eSopenharmony_ci     * @since 10
166461847f8eSopenharmony_ci     */
166561847f8eSopenharmony_ci    SHOW = 2
166661847f8eSopenharmony_ci  }
166761847f8eSopenharmony_ci
166861847f8eSopenharmony_ci  /**
166961847f8eSopenharmony_ci   * Attribute of Input.
167061847f8eSopenharmony_ci   *
167161847f8eSopenharmony_ci   * @typedef InputAttribute
167261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
167361847f8eSopenharmony_ci   * @since 10
167461847f8eSopenharmony_ci   */
167561847f8eSopenharmony_ci  export interface InputAttribute {
167661847f8eSopenharmony_ci    /**
167761847f8eSopenharmony_ci     * Indicates the text input type of the input method.
167861847f8eSopenharmony_ci     *
167961847f8eSopenharmony_ci     * @type { TextInputType }
168061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
168161847f8eSopenharmony_ci     * @since 10
168261847f8eSopenharmony_ci     */
168361847f8eSopenharmony_ci    textInputType: TextInputType;
168461847f8eSopenharmony_ci
168561847f8eSopenharmony_ci    /**
168661847f8eSopenharmony_ci     * Indicates the enter key type of the input method.
168761847f8eSopenharmony_ci     *
168861847f8eSopenharmony_ci     * @type { EnterKeyType }
168961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
169061847f8eSopenharmony_ci     * @since 10
169161847f8eSopenharmony_ci     */
169261847f8eSopenharmony_ci    enterKeyType: EnterKeyType;
169361847f8eSopenharmony_ci  }
169461847f8eSopenharmony_ci
169561847f8eSopenharmony_ci  /**
169661847f8eSopenharmony_ci   * FunctionKey of Input.
169761847f8eSopenharmony_ci   *
169861847f8eSopenharmony_ci   * @typedef FunctionKey
169961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
170061847f8eSopenharmony_ci   * @since 10
170161847f8eSopenharmony_ci   */
170261847f8eSopenharmony_ci  export interface FunctionKey {
170361847f8eSopenharmony_ci    /**
170461847f8eSopenharmony_ci     * Indicates the enter key type of the input method.
170561847f8eSopenharmony_ci     *
170661847f8eSopenharmony_ci     * @type { EnterKeyType }
170761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
170861847f8eSopenharmony_ci     * @since 10
170961847f8eSopenharmony_ci     */
171061847f8eSopenharmony_ci    enterKeyType: EnterKeyType;
171161847f8eSopenharmony_ci  }
171261847f8eSopenharmony_ci
171361847f8eSopenharmony_ci  /**
171461847f8eSopenharmony_ci   * Information of Cursor.
171561847f8eSopenharmony_ci   *
171661847f8eSopenharmony_ci   * @typedef CursorInfo
171761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
171861847f8eSopenharmony_ci   * @since 10
171961847f8eSopenharmony_ci   */
172061847f8eSopenharmony_ci  export interface CursorInfo {
172161847f8eSopenharmony_ci    /**
172261847f8eSopenharmony_ci     * Indicates the left point of the cursor info and must be absolute coordinate of the physical screen.
172361847f8eSopenharmony_ci     *
172461847f8eSopenharmony_ci     * @type { number }
172561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
172661847f8eSopenharmony_ci     * @since 10
172761847f8eSopenharmony_ci     */
172861847f8eSopenharmony_ci    left: number;
172961847f8eSopenharmony_ci
173061847f8eSopenharmony_ci    /**
173161847f8eSopenharmony_ci     * Indicates the top point of the cursor info and must be absolute coordinate of the physical screen.
173261847f8eSopenharmony_ci     *
173361847f8eSopenharmony_ci     * @type { number }
173461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
173561847f8eSopenharmony_ci     * @since 10
173661847f8eSopenharmony_ci     */
173761847f8eSopenharmony_ci    top: number;
173861847f8eSopenharmony_ci
173961847f8eSopenharmony_ci    /**
174061847f8eSopenharmony_ci     * Indicates the width point of the cursor info.
174161847f8eSopenharmony_ci     *
174261847f8eSopenharmony_ci     * @type { number }
174361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
174461847f8eSopenharmony_ci     * @since 10
174561847f8eSopenharmony_ci     */
174661847f8eSopenharmony_ci    width: number;
174761847f8eSopenharmony_ci
174861847f8eSopenharmony_ci    /**
174961847f8eSopenharmony_ci     * Indicates the height point of the cursor info.
175061847f8eSopenharmony_ci     *
175161847f8eSopenharmony_ci     * @type { number }
175261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
175361847f8eSopenharmony_ci     * @since 10
175461847f8eSopenharmony_ci     */
175561847f8eSopenharmony_ci    height: number;
175661847f8eSopenharmony_ci  }
175761847f8eSopenharmony_ci
175861847f8eSopenharmony_ci  /**
175961847f8eSopenharmony_ci   * Config of editor.
176061847f8eSopenharmony_ci   *
176161847f8eSopenharmony_ci   * @typedef TextConfig
176261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
176361847f8eSopenharmony_ci   * @since 10
176461847f8eSopenharmony_ci   */
176561847f8eSopenharmony_ci  export interface TextConfig {
176661847f8eSopenharmony_ci    /**
176761847f8eSopenharmony_ci     * Attribute of Input.
176861847f8eSopenharmony_ci     *
176961847f8eSopenharmony_ci     * @type { InputAttribute }
177061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
177161847f8eSopenharmony_ci     * @since 10
177261847f8eSopenharmony_ci     */
177361847f8eSopenharmony_ci    inputAttribute: InputAttribute;
177461847f8eSopenharmony_ci
177561847f8eSopenharmony_ci    /**
177661847f8eSopenharmony_ci     * Cursor information.
177761847f8eSopenharmony_ci     *
177861847f8eSopenharmony_ci     * @type { ?CursorInfo }
177961847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
178061847f8eSopenharmony_ci     * @since 10
178161847f8eSopenharmony_ci     */
178261847f8eSopenharmony_ci    cursorInfo?: CursorInfo;
178361847f8eSopenharmony_ci
178461847f8eSopenharmony_ci    /**
178561847f8eSopenharmony_ci     * Selection information.
178661847f8eSopenharmony_ci     *
178761847f8eSopenharmony_ci     * @type { ?Range }
178861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
178961847f8eSopenharmony_ci     * @since 10
179061847f8eSopenharmony_ci     */
179161847f8eSopenharmony_ci    selection?: Range;
179261847f8eSopenharmony_ci
179361847f8eSopenharmony_ci    /**
179461847f8eSopenharmony_ci     * The window ID of the application currently bound to the input method.
179561847f8eSopenharmony_ci     *
179661847f8eSopenharmony_ci     * @type { ?number }
179761847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
179861847f8eSopenharmony_ci     * @since 10
179961847f8eSopenharmony_ci     */
180061847f8eSopenharmony_ci    windowId?: number;
180161847f8eSopenharmony_ci  }
180261847f8eSopenharmony_ci
180361847f8eSopenharmony_ci  /**
180461847f8eSopenharmony_ci   * Enumerates the extend action.
180561847f8eSopenharmony_ci   *
180661847f8eSopenharmony_ci   * @enum { number }
180761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
180861847f8eSopenharmony_ci   * @since 10
180961847f8eSopenharmony_ci   */
181061847f8eSopenharmony_ci  export enum ExtendAction {
181161847f8eSopenharmony_ci    /**
181261847f8eSopenharmony_ci     * Select all text.
181361847f8eSopenharmony_ci     *
181461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
181561847f8eSopenharmony_ci     * @since 10
181661847f8eSopenharmony_ci     */
181761847f8eSopenharmony_ci    SELECT_ALL = 0,
181861847f8eSopenharmony_ci
181961847f8eSopenharmony_ci    /**
182061847f8eSopenharmony_ci     * Cut selecting text.
182161847f8eSopenharmony_ci     *
182261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
182361847f8eSopenharmony_ci     * @since 10
182461847f8eSopenharmony_ci     */
182561847f8eSopenharmony_ci    CUT = 3,
182661847f8eSopenharmony_ci
182761847f8eSopenharmony_ci    /**
182861847f8eSopenharmony_ci     * Copy selecting text.
182961847f8eSopenharmony_ci     *
183061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
183161847f8eSopenharmony_ci     * @since 10
183261847f8eSopenharmony_ci     */
183361847f8eSopenharmony_ci    COPY = 4,
183461847f8eSopenharmony_ci
183561847f8eSopenharmony_ci    /**
183661847f8eSopenharmony_ci     * Paste from paste board.
183761847f8eSopenharmony_ci     *
183861847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
183961847f8eSopenharmony_ci     * @since 10
184061847f8eSopenharmony_ci     */
184161847f8eSopenharmony_ci    PASTE = 5
184261847f8eSopenharmony_ci  }
184361847f8eSopenharmony_ci
184461847f8eSopenharmony_ci  /**
184561847f8eSopenharmony_ci   * Information of input window.
184661847f8eSopenharmony_ci   *
184761847f8eSopenharmony_ci   * @typedef InputWindowInfo
184861847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.InputMethodFramework
184961847f8eSopenharmony_ci   * @since 10
185061847f8eSopenharmony_ci   */
185161847f8eSopenharmony_ci  export interface InputWindowInfo {
185261847f8eSopenharmony_ci    /**
185361847f8eSopenharmony_ci     * Indicates name of the input window.
185461847f8eSopenharmony_ci     *
185561847f8eSopenharmony_ci     * @type { string }
185661847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
185761847f8eSopenharmony_ci     * @since 10
185861847f8eSopenharmony_ci     */
185961847f8eSopenharmony_ci    name: string;
186061847f8eSopenharmony_ci
186161847f8eSopenharmony_ci    /**
186261847f8eSopenharmony_ci     * Indicates the abscissa of the upper-left vertex of input window.
186361847f8eSopenharmony_ci     *
186461847f8eSopenharmony_ci     * @type { number }
186561847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
186661847f8eSopenharmony_ci     * @since 10
186761847f8eSopenharmony_ci     */
186861847f8eSopenharmony_ci    left: number;
186961847f8eSopenharmony_ci
187061847f8eSopenharmony_ci    /**
187161847f8eSopenharmony_ci     * Indicates the ordinate of the upper-left vertex of input window.
187261847f8eSopenharmony_ci     *
187361847f8eSopenharmony_ci     * @type { number }
187461847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
187561847f8eSopenharmony_ci     * @since 10
187661847f8eSopenharmony_ci     */
187761847f8eSopenharmony_ci    top: number;
187861847f8eSopenharmony_ci
187961847f8eSopenharmony_ci    /**
188061847f8eSopenharmony_ci     * Indicates the width of the input window.
188161847f8eSopenharmony_ci     *
188261847f8eSopenharmony_ci     * @type { number }
188361847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
188461847f8eSopenharmony_ci     * @since 10
188561847f8eSopenharmony_ci     */
188661847f8eSopenharmony_ci    width: number;
188761847f8eSopenharmony_ci
188861847f8eSopenharmony_ci    /**
188961847f8eSopenharmony_ci     * Indicates the height of the input window.
189061847f8eSopenharmony_ci     *
189161847f8eSopenharmony_ci     * @type { number }
189261847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.InputMethodFramework
189361847f8eSopenharmony_ci     * @since 10
189461847f8eSopenharmony_ci     */
189561847f8eSopenharmony_ci    height: number;
189661847f8eSopenharmony_ci  }
189761847f8eSopenharmony_ci}
189861847f8eSopenharmony_ci
189961847f8eSopenharmony_ciexport default inputMethod;