• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit IMEKit
19 */
20import type { Callback, AsyncCallback } from './@ohos.base';
21import type { ElementName } from './bundleManager/ElementName';
22import InputMethodSubtype from './@ohos.InputMethodSubtype';
23import type { PanelInfo } from './@ohos.inputMethod.Panel';
24
25/**
26 * Input method
27 *
28 * @namespace inputMethod
29 * @syscap SystemCapability.MiscServices.InputMethodFramework
30 * @since 6
31 */
32declare namespace inputMethod {
33  /**
34   * Keyboard max number
35   *
36   * @syscap SystemCapability.MiscServices.InputMethodFramework
37   * @since 8
38   */
39  const MAX_TYPE_NUM: number;
40
41  /**
42   * Input method setting
43   *
44   * @returns { InputMethodSetting } the object of InputMethodSetting
45   * @syscap SystemCapability.MiscServices.InputMethodFramework
46   * @since 8
47   * @deprecated since 9
48   * @useinstead inputMethod#getSetting
49   */
50  function getInputMethodSetting(): InputMethodSetting;
51
52  /**
53   * Input method controller
54   *
55   * @returns { InputMethodController } the object of InputMethodController.
56   * @syscap SystemCapability.MiscServices.InputMethodFramework
57   * @since 6
58   * @deprecated since 9
59   * @useinstead inputMethod#getController
60   */
61  function getInputMethodController(): InputMethodController;
62
63  /**
64   * Input method setting
65   *
66   * @returns { InputMethodSetting } the object of InputMethodSetting.
67   * @throws { BusinessError } 12800007 - setter error.
68   * @syscap SystemCapability.MiscServices.InputMethodFramework
69   * @since 9
70   */
71  function getSetting(): InputMethodSetting;
72
73  /**
74   * Input method controller
75   *
76   * @returns { InputMethodController } the object of InputMethodController.
77   * @throws { BusinessError } 12800006 - input method controller error.
78   * @syscap SystemCapability.MiscServices.InputMethodFramework
79   * @since 9
80   */
81  function getController(): InputMethodController;
82
83  /**
84   * Get default input method
85   *
86   * @returns { InputMethodProperty } property of the default input method.
87   * @throws { BusinessError } 12800008 - input method manager service error.
88   * @syscap SystemCapability.MiscServices.InputMethodFramework
89   * @since 11
90   */
91  function getDefaultInputMethod(): InputMethodProperty;
92
93  /**
94   * Get system input method config ability
95   *
96   * @returns { ElementName } the information of system input method config ability.
97   * @throws { BusinessError } 12800008 - input method manager service error.
98   * @syscap SystemCapability.MiscServices.InputMethodFramework
99   * @since 11
100   */
101  function getSystemInputMethodConfigAbility(): ElementName;
102
103  /**
104   * Switch input method
105   *
106   * @permission ohos.permission.CONNECT_IME_ABILITY
107   * @param { InputMethodProperty } target - indicates the input method which will replace the current one.
108   * @param { AsyncCallback<boolean> } callback - the callback of switchInputMethod.
109   * @throws { BusinessError } 201 - permissions check fails.
110   * @throws { BusinessError } 401 - parameter error. Possible causes:
111   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
112   * @throws { BusinessError } 12800005 - configuration persistence error.
113   * @throws { BusinessError } 12800008 - input method manager service error.
114   * @syscap SystemCapability.MiscServices.InputMethodFramework
115   * @since 9
116   */
117  /**
118   * Switch input method. The caller must be the current inputmethod.
119   *
120   * @param { InputMethodProperty } target - indicates the target input method.
121   * @param { AsyncCallback<boolean> } callback - the callback of switchInputMethod.
122   * @throws { BusinessError } 401 - parameter error. Possible causes:
123   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
124   * @throws { BusinessError } 12800005 - configuration persistence error.
125   * @throws { BusinessError } 12800008 - input method manager service error.
126   * @syscap SystemCapability.MiscServices.InputMethodFramework
127   * @since 11
128   */
129  function switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolean>): void;
130
131  /**
132   * Switch input method
133   *
134   * @permission ohos.permission.CONNECT_IME_ABILITY
135   * @param { InputMethodProperty } target - Indicates the input method which will replace the current one.
136   * @returns { Promise<boolean> } the promise returned by the function.
137   * @throws { BusinessError } 201 - permissions check fails.
138   * @throws { BusinessError } 401 - parameter error. Possible causes:
139   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
140   * @throws { BusinessError } 12800005 - configuration persistence error.
141   * @throws { BusinessError } 12800008 - input method manager service error.
142   * @syscap SystemCapability.MiscServices.InputMethodFramework
143   * @since 9
144   */
145  /**
146   * Switch input method. The caller must be the current inputmethod.
147   *
148   * @param { InputMethodProperty } target - indicates the target input method.
149   * @returns { Promise<boolean> } the promise returned by the function.
150   * @throws { BusinessError } 401 - parameter error. Possible causes:
151   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
152   * @throws { BusinessError } 12800005 - configuration persistence error.
153   * @throws { BusinessError } 12800008 - input method manager service error.
154   * @syscap SystemCapability.MiscServices.InputMethodFramework
155   * @since 11
156   */
157  function switchInputMethod(target: InputMethodProperty): Promise<boolean>;
158
159  /**
160   * Get current input method
161   *
162   * @returns { InputMethodProperty } the property of current inputmethod.
163   * @syscap SystemCapability.MiscServices.InputMethodFramework
164   * @since 9
165   */
166  function getCurrentInputMethod(): InputMethodProperty;
167
168  /**
169   * Switch current input method subtype
170   *
171   * @permission ohos.permission.CONNECT_IME_ABILITY
172   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
173   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype.
174   * @throws { BusinessError } 201 - permissions check fails.
175   * @throws { BusinessError } 401 - parameter error. Possible causes:
176   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
177   * @throws { BusinessError } 12800005 - configuration persistence error.
178   * @throws { BusinessError } 12800008 - input method manager service error.
179   * @syscap SystemCapability.MiscServices.InputMethodFramework
180   * @since 9
181   */
182  /**
183   * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored.
184   *
185   * @permission ohos.permission.CONNECT_IME_ABILITY
186   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
187   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype.
188   * @throws { BusinessError } 201 - permissions check fails.
189   * @throws { BusinessError } 401 - parameter error. Possible causes:
190   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
191   * @throws { BusinessError } 12800005 - configuration persistence error.
192   * @throws { BusinessError } 12800008 - input method manager service error.
193   * @syscap SystemCapability.MiscServices.InputMethodFramework
194   * @since 10
195   */
196  /**
197   * Switch current input method subtype. The caller must be the current inputmethod.
198   *
199   * @param { InputMethodSubtype } target - indicates the target input method subtype.
200   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype.
201   * @throws { BusinessError } 401 - parameter error. Possible causes:
202   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
203   * @throws { BusinessError } 12800005 - configuration persistence error.
204   * @throws { BusinessError } 12800008 - input method manager service error.
205   * @syscap SystemCapability.MiscServices.InputMethodFramework
206   * @since 11
207   */
208  function switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback<boolean>): void;
209
210  /**
211   * Switch current input method subtype
212   *
213   * @permission ohos.permission.CONNECT_IME_ABILITY
214   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
215   * @returns { Promise<boolean> } the promise returned by the function.
216   * @throws { BusinessError } 201 - permissions check fails.
217   * @throws { BusinessError } 401 - parameter error. Possible causes:
218   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
219   * @throws { BusinessError } 12800005 - configuration persistence error.
220   * @throws { BusinessError } 12800008 - input method manager service error.
221   * @syscap SystemCapability.MiscServices.InputMethodFramework
222   * @since 9
223   */
224  /**
225   * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored.
226   *
227   * @permission ohos.permission.CONNECT_IME_ABILITY
228   * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one.
229   * @returns { Promise<boolean> } the promise returned by the function.
230   * @throws { BusinessError } 201 - permissions check fails.
231   * @throws { BusinessError } 401 - parameter error. Possible causes:
232   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
233   * @throws { BusinessError } 12800005 - configuration persistence error.
234   * @throws { BusinessError } 12800008 - input method manager service error.
235   * @syscap SystemCapability.MiscServices.InputMethodFramework
236   * @since 10
237   */
238  /**
239   * Switch current input method subtype. The caller must be the current inputmethod.
240   *
241   * @param { InputMethodSubtype } target - indicates the target input method subtype.
242   * @returns { Promise<boolean> } the promise returned by the function.
243   * @throws { BusinessError } 401 - parameter error. Possible causes:
244   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
245   * @throws { BusinessError } 12800005 - configuration persistence error.
246   * @throws { BusinessError } 12800008 - input method manager service error.
247   * @syscap SystemCapability.MiscServices.InputMethodFramework
248   * @since 11
249   */
250  function switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean>;
251
252  /**
253   * Get the current input method subtype
254   *
255   * @returns { InputMethodSubtype } the subtype of the current input method.
256   * @syscap SystemCapability.MiscServices.InputMethodFramework
257   * @since 9
258   */
259  function getCurrentInputMethodSubtype(): InputMethodSubtype;
260
261  /**
262   * Switch input method and subtype. If the caller is an input method, it must be the current inputmethod.
263   *
264   * @permission ohos.permission.CONNECT_IME_ABILITY
265   * @param { InputMethodProperty } inputMethodProperty - Indicates the target input method.
266   * @param { InputMethodSubtype } inputMethodSubtype - Indicates the target input method subtype.
267   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodAndSubtype.
268   * @throws { BusinessError } 201 - permissions check fails.
269   * @throws { BusinessError } 401 - parameter error. Possible causes:
270   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
271   * @throws { BusinessError } 12800005 - configuration persistence error.
272   * @throws { BusinessError } 12800008 - input method manager service error.
273   * @syscap SystemCapability.MiscServices.InputMethodFramework
274   * @since 9
275   */
276  /**
277   * Switch input method and subtype. The caller must be the current inputmethod.
278   *
279   * @param { InputMethodProperty } inputMethodProperty - indicates the target input method.
280   * @param { InputMethodSubtype } inputMethodSubtype - indicates the target input method subtype.
281   * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodAndSubtype.
282   * @throws { BusinessError } 401 - parameter error. Possible causes:
283   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
284   * @throws { BusinessError } 12800005 - configuration persistence error.
285   * @throws { BusinessError } 12800008 - input method manager service error.
286   * @syscap SystemCapability.MiscServices.InputMethodFramework
287   * @since 11
288   */
289  function switchCurrentInputMethodAndSubtype(
290    inputMethodProperty: InputMethodProperty,
291    inputMethodSubtype: InputMethodSubtype,
292    callback: AsyncCallback<boolean>
293  ): void;
294
295  /**
296   * Switch input method and subtype. If the caller is an input method, it must be the current inputmethod.
297   *
298   * @permission ohos.permission.CONNECT_IME_ABILITY
299   * @param { InputMethodProperty } inputMethodProperty - Indicates the target input method.
300   * @param { InputMethodSubtype } inputMethodSubtype - Indicates the target input method subtype.
301   * @returns { Promise<boolean> } the promise returned by the function.
302   * @throws { BusinessError } 201 - permissions check fails.
303   * @throws { BusinessError } 401 - parameter error. Possible causes:
304   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
305   * @throws { BusinessError } 12800005 - configuration persistence error.
306   * @throws { BusinessError } 12800008 - input method manager service error.
307   * @syscap SystemCapability.MiscServices.InputMethodFramework
308   * @since 9
309   */
310  /**
311   * Switch input method and subtype. The caller must be the current inputmethod.
312   *
313   * @param { InputMethodProperty } inputMethodProperty - indicates the target input method.
314   * @param { InputMethodSubtype } inputMethodSubtype - indicates the target input method subtype.
315   * @returns { Promise<boolean> } the promise returned by the function.
316   * @throws { BusinessError } 401 - parameter error. Possible causes:
317   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
318   * @throws { BusinessError } 12800005 - configuration persistence error.
319   * @throws { BusinessError } 12800008 - input method manager service error.
320   * @syscap SystemCapability.MiscServices.InputMethodFramework
321   * @since 11
322   */
323  function switchCurrentInputMethodAndSubtype(
324    inputMethodProperty: InputMethodProperty,
325    inputMethodSubtype: InputMethodSubtype
326  ): Promise<boolean>;
327
328  /**
329   * Switch input method and subtype
330   *
331   * @permission ohos.permission.CONNECT_IME_ABILITY
332   * @param { string } bundleName - indicates the bundleName of target input method.
333   * @param { string } [subtypeId] - indicates the id of the input method subtype.
334   *     If the param is not set, switch to the target input method with a default subtype.
335   * @returns { Promise<void> } the promise returned by the function.
336   * @throws { BusinessError } 201 - permissions check fails.
337   * @throws { BusinessError } 202 - not system application.
338   * @throws { BusinessError } 401 - parameter error. Possible causes:
339   *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
340   * @throws { BusinessError } 12800005 - configuration persistence error.
341   * @throws { BusinessError } 12800008 - input method manager service error.
342   * @syscap SystemCapability.MiscServices.InputMethodFramework
343   * @systemapi
344   * @since 11
345   */
346  function switchInputMethod(bundleName: string, subtypeId?: string): Promise<void>;
347
348  /**
349   * @interface InputMethodSetting
350   * @syscap SystemCapability.MiscServices.InputMethodFramework
351   * @since 8
352   */
353  interface InputMethodSetting {
354    /**
355     * Subscribe input method or subtype change.
356     *
357     * @param { 'imeChange' } type - Indicates the event type.
358     * @param { function } callback - the callback of 'imeChange'
359     * @syscap SystemCapability.MiscServices.InputMethodFramework
360     * @since 9
361     */
362    on(
363      type: 'imeChange',
364      callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void
365    ): void;
366
367    /**
368     * Unsubscribe input method or subtype change.
369     *
370     * @param { 'imeChange' } type - Indicates the event type.
371     * @param { function } [callback] - the callback of 'imeChange',
372     *        when subscriber unsubscribes all callback functions of event 'imeChange', this parameter can be left blank.
373     * @syscap SystemCapability.MiscServices.InputMethodFramework
374     * @since 9
375     */
376    off(
377      type: 'imeChange',
378      callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void
379    ): void;
380
381    /**
382     * Subscribes to input window show events.
383     *
384     * @param { 'imeShow' } type - Indicates the event type.
385     * @param { function } callback - the callback of 'imeShow'.
386     * @throws { BusinessError } 202 - not system application.
387     * @syscap SystemCapability.MiscServices.InputMethodFramework
388     * @systemapi
389     * @since 10
390     */
391    on(type: 'imeShow', callback: (info: Array<InputWindowInfo>) => void): void;
392
393    /**
394     * Unsubscribe input window show event.
395     *
396     * @param { 'imeShow' } type - Indicates the event type.
397     * @param { function } [callback] - the callback of 'imeShow',
398     *        when subscriber unsubscribes all callback functions of event 'imeShow', this parameter can be left blank.
399     * @syscap SystemCapability.MiscServices.InputMethodFramework
400     * @systemapi
401     * @since 10
402     */
403    off(type: 'imeShow', callback?: (info: Array<InputWindowInfo>) => void): void;
404
405    /**
406     * Subscribes to input window hidden events.
407     *
408     * @param { 'imeHide' } type - Indicates the event type.
409     * @param { function } callback - the callback of 'imeHide'.
410     * @throws { BusinessError } 202 - not system application.
411     * @syscap SystemCapability.MiscServices.InputMethodFramework
412     * @systemapi
413     * @since 10
414     */
415    on(type: 'imeHide', callback: (info: Array<InputWindowInfo>) => void): void;
416
417    /**
418     * Unsubscribe input window hide event.
419     *
420     * @param { 'imeHide' } type - Indicates the event type.
421     * @param { function } [callback] - the callback of 'imeHide',
422     *        when subscriber unsubscribes all callback functions of event 'imeHide', this parameter can be left blank.
423     * @syscap SystemCapability.MiscServices.InputMethodFramework
424     * @systemapi
425     * @since 10
426     */
427    off(type: 'imeHide', callback?: (info: Array<InputWindowInfo>) => void): void;
428
429    /**
430     * Query whether a panel with specified information is shown.
431     *
432     * @param { PanelInfo } panelInfo - the information of panel which is queried.
433     * @returns { boolean }
434     *     If true, the panel being queried is shown.
435     *     If false, the panel being queried is hidden.
436     * @throws { BusinessError } 202 - not system application.
437     * @throws { BusinessError } 401 - parameter error. Possible causes:
438     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
439     * @throws { BusinessError } 12800008 - input method manager service error.
440     * @syscap SystemCapability.MiscServices.InputMethodFramework
441     * @systemapi
442     * @since 11
443     */
444    isPanelShown(panelInfo: PanelInfo): boolean;
445
446    /**
447     * List subtype of the specified input method.
448     *
449     * @param { InputMethodProperty } inputMethodProperty - the property of the specified inputmethod.
450     * @param { AsyncCallback<Array<InputMethodSubtype>> } callback - the callback of listInputMethodSubtype.
451     * @throws { BusinessError } 401 - parameter error. Possible causes:
452     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
453     * @throws { BusinessError } 12800001 - bundle manager error.
454     * @throws { BusinessError } 12800008 - input method manager service error.
455     * @syscap SystemCapability.MiscServices.InputMethodFramework
456     * @since 9
457     */
458    listInputMethodSubtype(
459      inputMethodProperty: InputMethodProperty,
460      callback: AsyncCallback<Array<InputMethodSubtype>>
461    ): void;
462
463    /**
464     * List subtype of the specified input method.
465     *
466     * @param { InputMethodProperty } inputMethodProperty - Indicates the specified input method.
467     * @returns { Promise<Array<InputMethodSubtype>> } the promise returned by the function.
468     * @throws { BusinessError } 401 - parameter error. Possible causes:
469     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
470     * @throws { BusinessError } 12800001 - bundle manager error.
471     * @throws { BusinessError } 12800008 - input method manager service error.
472     * @syscap SystemCapability.MiscServices.InputMethodFramework
473     * @since 9
474     */
475    listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Array<InputMethodSubtype>>;
476
477    /**
478     * List subtype of current input method
479     *
480     * @param { AsyncCallback<Array<InputMethodSubtype>> } callback - the callback of listCurrentInputMethodSubtype.
481     * @throws { BusinessError } 12800001 - bundle manager error.
482     * @throws { BusinessError } 12800008 - input method manager service error.
483     * @syscap SystemCapability.MiscServices.InputMethodFramework
484     * @since 9
485     */
486    listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSubtype>>): void;
487
488    /**
489     * List subtype of current input method
490     *
491     * @returns { Promise<Array<InputMethodSubtype>> } the promise returned by the function.
492     * @throws { BusinessError } 12800001 - bundle manager error.
493     * @throws { BusinessError } 12800008 - input method manager service error.
494     * @syscap SystemCapability.MiscServices.InputMethodFramework
495     * @since 9
496     */
497    listCurrentInputMethodSubtype(): Promise<Array<InputMethodSubtype>>;
498
499    /**
500     * List input methods
501     *
502     * @param { boolean } enable -
503     *     If true, collect enabled input methods.
504     *     If false, collect disabled input methods.
505     * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of getInputMethods.
506     * @throws { BusinessError } 401 - parameter error. Possible causes:
507     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
508     * @throws { BusinessError } 12800001 - bundle manager error.
509     * @throws { BusinessError } 12800008 - input method manager service error.
510     * @syscap SystemCapability.MiscServices.InputMethodFramework
511     * @since 9
512     */
513    getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethodProperty>>): void;
514
515    /**
516     * List input methods
517     *
518     * @param { boolean } enable -
519     *     If true, collect enabled input methods.
520     *     If false, collect disabled input methods.
521     * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function.
522     * @throws { BusinessError } 401 - parameter error. Possible causes:
523     *      1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
524     * @throws { BusinessError } 12800001 - bundle manager error.
525     * @throws { BusinessError } 12800008 - input method manager service error.
526     * @syscap SystemCapability.MiscServices.InputMethodFramework
527     * @since 9
528     */
529    getInputMethods(enable: boolean): Promise<Array<InputMethodProperty>>;
530
531    /**
532     * List enabled or disabled input methods sync
533     *
534     * @param { boolean } enable -
535     *     If true, collect enabled input methods.
536     *     If false, collect disabled input methods.
537     * @returns { Array<InputMethodProperty> } the list of inputmethod.
538     * @throws { BusinessError } 401 - parameter error. Possible causes:
539     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
540     * @throws { BusinessError } 12800001 - bundle manager error.
541     * @throws { BusinessError } 12800008 - input method manager service error.
542     * @syscap SystemCapability.MiscServices.InputMethodFramework
543     * @since 11
544     */
545    getInputMethodsSync(enable: boolean): Array<InputMethodProperty>;
546
547    /**
548     * List all input methods
549     *
550     * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of getInputMethods.
551     * @throws { BusinessError } 12800001 - bundle manager error.
552     * @throws { BusinessError } 12800008 - input method manager service error.
553     * @syscap SystemCapability.MiscServices.InputMethodFramework
554     * @since 11
555     */
556    getAllInputMethods(callback: AsyncCallback<Array<InputMethodProperty>>): void;
557
558    /**
559     * List all input methods
560     *
561     * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function.
562     * @throws { BusinessError } 12800001 - bundle manager error.
563     * @throws { BusinessError } 12800008 - input method manager service error.
564     * @syscap SystemCapability.MiscServices.InputMethodFramework
565     * @since 11
566     */
567    getAllInputMethods(): Promise<Array<InputMethodProperty>>;
568
569    /**
570     * List all input methods sync
571     *
572     * @returns { Array<InputMethodProperty> } the list of all inputmethod.
573     * @throws { BusinessError } 12800001 - bundle manager error.
574     * @throws { BusinessError } 12800008 - input method manager service error.
575     * @syscap SystemCapability.MiscServices.InputMethodFramework
576     * @since 11
577     */
578    getAllInputMethodsSync(): Array<InputMethodProperty>;
579
580    /**
581     * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of listInputMethod.
582     * @syscap SystemCapability.MiscServices.InputMethodFramework
583     * @since 8
584     * @deprecated since 9
585     * @useinstead inputMethod.InputMethodSetting#getInputMethods
586     */
587    listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>): void;
588
589    /**
590     * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function.
591     * @syscap SystemCapability.MiscServices.InputMethodFramework
592     * @since 8
593     * @deprecated since 9
594     * @useinstead inputMethod.InputMethodSetting#getInputMethods
595     */
596    listInputMethod(): Promise<Array<InputMethodProperty>>;
597
598    /**
599     * Show input method setting extension dialog
600     *
601     * @param { AsyncCallback<boolean> } callback - the callback of showOptionalInputMethods.
602     * @throws { BusinessError } 12800008 - input method manager service error.
603     * @syscap SystemCapability.MiscServices.InputMethodFramework
604     * @since 9
605     */
606    showOptionalInputMethods(callback: AsyncCallback<boolean>): void;
607
608    /**
609     * Show input method setting extension dialog
610     *
611     * @returns { Promise<boolean> } the promise returned by the function.
612     * @throws { BusinessError } 12800008 - input method manager service error.
613     * @syscap SystemCapability.MiscServices.InputMethodFramework
614     * @since 9
615     */
616    showOptionalInputMethods(): Promise<boolean>;
617
618    /**
619     * @param { AsyncCallback<void> } callback - the callback of displayOptionalInputMethod.
620     * @syscap SystemCapability.MiscServices.InputMethodFramework
621     * @since 8
622     * @deprecated since 9
623     * @useinstead inputMethod.InputMethodSetting#showOptionalInputMethods
624     */
625    displayOptionalInputMethod(callback: AsyncCallback<void>): void;
626
627    /**
628     * @returns { Promise<void> } the promise returned by the function.
629     * @syscap SystemCapability.MiscServices.InputMethodFramework
630     * @since 8
631     * @deprecated since 9
632     * @useinstead inputMethod.InputMethodSetting#showOptionalInputMethods
633     */
634    displayOptionalInputMethod(): Promise<void>;
635  }
636
637  /**
638   * @interface InputMethodController
639   * @syscap SystemCapability.MiscServices.InputMethodFramework
640   * @since 6
641   */
642  interface InputMethodController {
643    /**
644     * Attach application to the input method service.
645     *
646     * @param { boolean } showKeyboard - show the keyboard or not when attach the input method.
647     * @param { TextConfig } textConfig - indicates the config of the textInput.
648     * @param { AsyncCallback<void> } callback - the callback of attach.
649     * @throws { BusinessError } 401 - parameter error. Possible causes:
650     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
651     * @throws { BusinessError } 12800003 - input method client error.
652     * @throws { BusinessError } 12800008 - input method manager service error.
653     * @syscap SystemCapability.MiscServices.InputMethodFramework
654     * @since 10
655     */
656    attach(showKeyboard: boolean, textConfig: TextConfig, callback: AsyncCallback<void>): void;
657
658    /**
659     * Attach application to the input method service.
660     *
661     * @param { boolean } showKeyboard - show the keyboard or not when attach the input method.
662     * @param { TextConfig } textConfig - indicates the config of the textInput.
663     * @returns { Promise<void> } the promise returned by the function.
664     * @throws { BusinessError } 401 - parameter error. Possible causes:
665     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
666     * @throws { BusinessError } 12800003 - input method client error.
667     * @throws { BusinessError } 12800008 - input method manager service error.
668     * @syscap SystemCapability.MiscServices.InputMethodFramework
669     * @since 10
670     */
671    attach(showKeyboard: boolean, textConfig: TextConfig): Promise<void>;
672
673    /**
674     * Show the text input and start typing.
675     *
676     * @param { AsyncCallback<void> } callback - the callback of showTextInput.
677     * @throws { BusinessError } 12800003 - input method client error.
678     * @throws { BusinessError } 12800008 - input method manager service error.
679     * @throws { BusinessError } 12800009 - input method client detached.
680     * @syscap SystemCapability.MiscServices.InputMethodFramework
681     * @since 10
682     */
683    showTextInput(callback: AsyncCallback<void>): void;
684
685    /**
686     * Show the text input and start typing.
687     *
688     * @returns { Promise<void> } the promise returned by the function.
689     * @throws { BusinessError } 12800003 - input method client error.
690     * @throws { BusinessError } 12800008 - input method manager service error.
691     * @throws { BusinessError } 12800009 - input method client detached.
692     * @syscap SystemCapability.MiscServices.InputMethodFramework
693     * @since 10
694     */
695    showTextInput(): Promise<void>;
696
697    /**
698     * Hide the text input and stop typing.
699     *
700     * @param { AsyncCallback<void> } callback - the callback of hideTextInput.
701     * @throws { BusinessError } 12800003 - input method client error.
702     * @throws { BusinessError } 12800008 - input method manager service error.
703     * @throws { BusinessError } 12800009 - input method client detached.
704     * @syscap SystemCapability.MiscServices.InputMethodFramework
705     * @since 10
706     */
707    hideTextInput(callback: AsyncCallback<void>): void;
708
709    /**
710     * Hide the text input and stop typing.
711     *
712     * @returns { Promise<void> } the promise returned by the function.
713     * @throws { BusinessError } 12800003 - input method client error.
714     * @throws { BusinessError } 12800008 - input method manager service error.
715     * @throws { BusinessError } 12800009 - input method client detached.
716     * @syscap SystemCapability.MiscServices.InputMethodFramework
717     * @since 10
718     */
719    hideTextInput(): Promise<void>;
720
721    /**
722     * Detach the applications from the input method manager service.
723     *
724     * @param { AsyncCallback<void> } callback - the callback of detach.
725     * @throws { BusinessError } 12800003 - input method client error.
726     * @throws { BusinessError } 12800008 - input method manager service error.
727     * @syscap SystemCapability.MiscServices.InputMethodFramework
728     * @since 10
729     */
730    detach(callback: AsyncCallback<void>): void;
731
732    /**
733     * Detach the applications from the input method manager service.
734     *
735     * @returns { Promise<void> } the promise returned by the function.
736     * @throws { BusinessError } 12800003 - input method client error.
737     * @throws { BusinessError } 12800008 - input method manager service error.
738     * @syscap SystemCapability.MiscServices.InputMethodFramework
739     * @since 10
740     */
741    detach(): Promise<void>;
742
743    /**
744     * Inform the system of the window ID of the application currently bound to the input method.
745     * After the correct setting, the window where the client is located can avoid the input method window.
746     *
747     * @param { number } windowId - the window ID of the application currently bound to the input method.
748     * @param { AsyncCallback<void> } callback - the callback of setCallingWindow.
749     * @throws { BusinessError } 401 - parameter error. Possible causes:
750     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
751     * @throws { BusinessError } 12800003 - input method client error.
752     * @throws { BusinessError } 12800008 - input method manager service error.
753     * @throws { BusinessError } 12800009 - input method client detached.
754     * @syscap SystemCapability.MiscServices.InputMethodFramework
755     * @since 10
756     */
757    setCallingWindow(windowId: number, callback: AsyncCallback<void>): void;
758
759    /**
760     * Inform the system of the window ID of the application currently bound to the input method.
761     * After the correct setting, the window where the client is located can avoid the input method window.
762     *
763     * @param { number } windowId - the window ID of the application currently bound to the input method.
764     * @returns { Promise<void> } the promise returned by the function.
765     * @throws { BusinessError } 401 - parameter error. Possible causes:
766     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
767     * @throws { BusinessError } 12800003 - input method client error.
768     * @throws { BusinessError } 12800008 - input method manager service error.
769     * @throws { BusinessError } 12800009 - input method client detached.
770     * @syscap SystemCapability.MiscServices.InputMethodFramework
771     * @since 10
772     */
773    setCallingWindow(windowId: number): Promise<void>;
774
775    /**
776     * Update Cursor and notify the input method that the current application cursor has changed.
777     *
778     * @param { CursorInfo } cursorInfo - the CursorInfo object.
779     * @param { AsyncCallback<void> } callback - the callback of updateCursor.
780     * @throws { BusinessError } 401 - parameter error. Possible causes:
781     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
782     * @throws { BusinessError } 12800003 - input method client error.
783     * @throws { BusinessError } 12800008 - input method manager service error.
784     * @throws { BusinessError } 12800009 - input method client detached.
785     * @syscap SystemCapability.MiscServices.InputMethodFramework
786     * @since 10
787     */
788    updateCursor(cursorInfo: CursorInfo, callback: AsyncCallback<void>): void;
789
790    /**
791     * Update Cursor and notify the input method that the current application cursor has changed.
792     *
793     * @param { CursorInfo } cursorInfo - the CursorInfo object.
794     * @returns { Promise<void> } the promise returned by the function.
795     * @throws { BusinessError } 401 - parameter error. Possible causes:
796     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
797     * @throws { BusinessError } 12800003 - input method client error.
798     * @throws { BusinessError } 12800008 - input method manager service error.
799     * @throws { BusinessError } 12800009 - input method client detached.
800     * @syscap SystemCapability.MiscServices.InputMethodFramework
801     * @since 10
802     */
803    updateCursor(cursorInfo: CursorInfo): Promise<void>;
804
805    /**
806     * Notify the input method the selected text and the selection range of the current application text has changed.
807     *
808     * @param { string } text - the whole input text.
809     * @param { number } start - start position of selected text.
810     * @param { number } end - end position of selected text.
811     * @param { AsyncCallback<void> } callback - the callback of changeSelection.
812     * @throws { BusinessError } 401 - parameter error. Possible causes:
813     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
814     * @throws { BusinessError } 12800003 - input method client error.
815     * @throws { BusinessError } 12800008 - input method manager service error.
816     * @throws { BusinessError } 12800009 - input method client detached.
817     * @syscap SystemCapability.MiscServices.InputMethodFramework
818     * @since 10
819     */
820    changeSelection(text: string, start: number, end: number, callback: AsyncCallback<void>): void;
821
822    /**
823     * Notify the input method the selected text and the selection range of the current application text has changed.
824     *
825     * @param { string } text - the selected text.
826     * @param { number } start - start position of selected text.
827     * @param { number } end - end position of selected text.
828     * @returns { Promise<void> } the promise returned by the function.
829     * @throws { BusinessError } 401 - parameter error. Possible causes:
830     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
831     * @throws { BusinessError } 12800003 - input method client error.
832     * @throws { BusinessError } 12800008 - input method manager service error.
833     * @throws { BusinessError } 12800009 - input method client detached.
834     * @syscap SystemCapability.MiscServices.InputMethodFramework
835     * @since 10
836     */
837    changeSelection(text: string, start: number, end: number): Promise<void>;
838
839    /**
840     * Update InputAttribute information of input text.
841     *
842     * @param { InputAttribute } attribute - the InputAttribute object.
843     * @param { AsyncCallback<void> } callback - the callback of updateAttribute.
844     * @throws { BusinessError } 401 - parameter error. Possible causes:
845     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
846     * @throws { BusinessError } 12800003 - input method client error.
847     * @throws { BusinessError } 12800008 - input method manager service error.
848     * @throws { BusinessError } 12800009 - input method client detached.
849     * @syscap SystemCapability.MiscServices.InputMethodFramework
850     * @since 10
851     */
852    updateAttribute(attribute: InputAttribute, callback: AsyncCallback<void>): void;
853
854    /**
855     * Update InputAttribute information of input text.
856     *
857     * @param { InputAttribute } attribute - the InputAttribute object.
858     * @returns { Promise<void> } the promise returned by the function.
859     * @throws { BusinessError } 401 - parameter error. Possible causes:
860     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
861     * @throws { BusinessError } 12800003 - input method client error.
862     * @throws { BusinessError } 12800008 - input method manager service error.
863     * @throws { BusinessError } 12800009 - input method client detached.
864     * @syscap SystemCapability.MiscServices.InputMethodFramework
865     * @since 10
866     */
867    updateAttribute(attribute: InputAttribute): Promise<void>;
868    /**
869     * Stop input session
870     *
871     * @param { AsyncCallback<boolean> } callback - the callback of stopInputSession.
872     * @throws { BusinessError } 12800003 - input method client error.
873     * @throws { BusinessError } 12800008 - input method manager service error.
874     * @syscap SystemCapability.MiscServices.InputMethodFramework
875     * @since 9
876     */
877    stopInputSession(callback: AsyncCallback<boolean>): void;
878
879    /**
880     * Stop input session
881     *
882     * @returns { Promise<boolean> } the promise returned by the function.
883     * @throws { BusinessError } 12800003 - input method client error.
884     * @throws { BusinessError } 12800008 - input method manager service error.
885     * @syscap SystemCapability.MiscServices.InputMethodFramework
886     * @since 9
887     */
888    stopInputSession(): Promise<boolean>;
889
890    /**
891     * Stop input
892     *
893     * @param { AsyncCallback<boolean> } callback - the callback of stopInput.
894     * @syscap SystemCapability.MiscServices.InputMethodFramework
895     * @since 6
896     * @deprecated since 9
897     * @useinstead inputMethod.InputMethodController#stopInputSession
898     */
899    stopInput(callback: AsyncCallback<boolean>): void;
900
901    /**
902     * Stop input
903     *
904     * @returns { Promise<boolean> } the promise returned by the function.
905     * @syscap SystemCapability.MiscServices.InputMethodFramework
906     * @since 6
907     * @deprecated since 9
908     * @useinstead inputMethod.InputMethodController#stopInputSession
909     */
910    stopInput(): Promise<boolean>;
911
912    /**
913     * Show soft keyboard.
914     * This API can be called only by system applications.
915     *
916     * @permission ohos.permission.CONNECT_IME_ABILITY
917     * @param { AsyncCallback<void> } callback - the callback of showSoftKeyboard.
918     * @throws { BusinessError } 201 - permissions check fails.
919     * @throws { BusinessError } 12800003 - input method client error.
920     * @throws { BusinessError } 12800008 - input method manager service error.
921     * @syscap SystemCapability.MiscServices.InputMethodFramework
922     * @since 9
923     */
924    showSoftKeyboard(callback: AsyncCallback<void>): void;
925
926    /**
927     * Show soft keyboard.
928     * This API can be called only by system applications.
929     *
930     * @permission ohos.permission.CONNECT_IME_ABILITY
931     * @returns { Promise<void> } the promise returned by the function.
932     * @throws { BusinessError } 201 - permissions check fails.
933     * @throws { BusinessError } 12800003 - input method client error.
934     * @throws { BusinessError } 12800008 - input method manager service error.
935     * @syscap SystemCapability.MiscServices.InputMethodFramework
936     * @since 9
937     */
938    showSoftKeyboard(): Promise<void>;
939
940    /**
941     * Hide soft keyboard.
942     * This API can be called only by system applications.
943     *
944     * @permission ohos.permission.CONNECT_IME_ABILITY
945     * @param { AsyncCallback<void> } callback - the callback of hideSoftKeyboard.
946     * @throws { BusinessError } 201 - permissions check fails.
947     * @throws { BusinessError } 12800003 - input method client error.
948     * @throws { BusinessError } 12800008 - input method manager service error.
949     * @syscap SystemCapability.MiscServices.InputMethodFramework
950     * @since 9
951     */
952    hideSoftKeyboard(callback: AsyncCallback<void>): void;
953
954    /**
955     * Hide soft keyboard.
956     * This API can be called only by system applications.
957     *
958     * @permission ohos.permission.CONNECT_IME_ABILITY
959     * @returns { Promise<void> } the promise returned by the function.
960     * @throws { BusinessError } 201 - permissions check fails.
961     * @throws { BusinessError } 12800003 - input method client error.
962     * @throws { BusinessError } 12800008 - input method manager service error.
963     * @syscap SystemCapability.MiscServices.InputMethodFramework
964     * @since 9
965     */
966    hideSoftKeyboard(): Promise<void>;
967
968    /**
969     * Register a callback and when IME sends select event with range of selection,
970     * the callback will be invoked.
971     *
972     * @param { 'selectByRange' } type - event type, fixed as 'selectByRange'.
973     * @param { Callback<Range> } callback - processes selectByRange command. The range of selection is provided for
974     *        this callback, and subscribers are expected to select corresponding text in callback according to
975     *        the range.
976     * @throws { BusinessError } 401 - parameter error. Possible causes:
977     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
978     * @syscap SystemCapability.MiscServices.InputMethodFramework
979     * @since 10
980     */
981    on(type: 'selectByRange', callback: Callback<Range>): void;
982
983    /**
984     * Unregister the callback of selectedByRange.
985     *
986     * @param { 'selectByRange' } type - event type, fixed as 'selectByRange'.
987     * @param { Callback<Range> } [callback] - the callback of 'selectByRange',
988     *        when subscriber unsubscribes all callback functions of event 'selectByRange', this parameter can be left blank.
989     * @syscap SystemCapability.MiscServices.InputMethodFramework
990     * @since 10
991     */
992    off(type: 'selectByRange', callback?: Callback<Range>): void;
993
994    /**
995     * Register a callback and when IME sends select event witch movement of cursor,
996     * the callback will be invoked.
997     *
998     * @param { 'selectByMovement' } type - event type, fixed as 'selectByMovement'.
999     * @param { Callback<Movement> } callback - processes selectByMovement command. The movement of cursor is provided
1000     *        for this callback, and subscribers are expected to select corresponding text in callback according to
1001     *        the movement.
1002     * @throws { BusinessError } 401 - parameter error. Possible causes:
1003     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1004     * @syscap SystemCapability.MiscServices.InputMethodFramework
1005     * @since 10
1006     */
1007    on(type: 'selectByMovement', callback: Callback<Movement>): void;
1008
1009    /**
1010     * Unregister the callback of selectedByMovement.
1011     *
1012     * @param { 'selectByMovement' } type - event type, fixed as 'selectByMovement'.
1013     * @param { Callback<Movement> } [callback] - the callback of 'selectByMovement',
1014     *        when subscriber unsubscribes all callback functions of event 'selectByMovement', this parameter can be left blank.
1015     * @syscap SystemCapability.MiscServices.InputMethodFramework
1016     * @since 10
1017     */
1018    off(type: 'selectByMovement', callback?: Callback<Movement>): void;
1019
1020    /**
1021     * Register a callback and when IME sends insert text event, the callback will be invoked.
1022     *
1023     * @param { 'insertText' } type - event type, fixed as 'insertText'.
1024     * @param { function } callback - processes insertText command. The text of insert is provided for this callback.
1025     *        Subscribers are expected to process the inserted text and update changes in editor by changeSelection and updateCursor as needed.
1026     * @throws { BusinessError } 401 - parameter error. Possible causes:
1027     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1028     * @throws { BusinessError } 12800009 - input method client detached.
1029     * @syscap SystemCapability.MiscServices.InputMethodFramework
1030     * @since 10
1031     */
1032    on(type: 'insertText', callback: (text: string) => void): void;
1033
1034    /**
1035     * Unregister the callback of insertText.
1036     *
1037     * @param { 'insertText' } type - event type, fixed as 'insertText'.
1038     * @param { function } [callback] - the callback of 'insertText',
1039     *        when subscriber unsubscribes all callback functions of event 'insertText', this parameter can be left blank.
1040     * @syscap SystemCapability.MiscServices.InputMethodFramework
1041     * @since 10
1042     */
1043    off(type: 'insertText', callback?: (text: string) => void): void;
1044
1045    /**
1046     * Register a callback and when IME sends delete left event with length,
1047     * the callback will be invoked.
1048     *
1049     * @param { 'deleteLeft' } type - event type, fixed as 'deleteLeft'.
1050     * @param { function } callback - processes deleteLeft command. The length of
1051     *     delete is provided for this callback. Subscribers are expected to delete specified length of text
1052     *     to the left of the cursor and update changes in editor by changeSelection and updateCursor as needed.
1053     * @throws { BusinessError } 401 - parameter error. Possible causes:
1054     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1055     * @throws { BusinessError } 12800009 - input method client detached.
1056     * @syscap SystemCapability.MiscServices.InputMethodFramework
1057     * @since 10
1058     */
1059    on(type: 'deleteLeft', callback: (length: number) => void): void;
1060
1061    /**
1062     * Unregister the callback of deleteLeft.
1063     *
1064     * @param { 'deleteLeft' } type - event type, fixed as 'deleteLeft'.
1065     * @param { function } [callback] - the callback of 'deleteLeft',
1066     *        when subscriber unsubscribes all callback functions of event 'deleteLeft', this parameter can be left blank.
1067     * @syscap SystemCapability.MiscServices.InputMethodFramework
1068     * @since 10
1069     */
1070    off(type: 'deleteLeft', callback?: (length: number) => void): void;
1071
1072    /**
1073     * Register a callback and when IME sends delete right event with length,
1074     * the callback will be invoked.
1075     *
1076     * @param { 'deleteRight' } type - event type, fixed as 'deleteRight'.
1077     * @param { function } callback - processes deleteRight command. The length of
1078     *     delete is provided for this callback. Subscribers are expected to delete specified length of text
1079     *     to the right of the cursor and update changes in editor by changeSelection and updateCursor as needed.
1080     * @throws { BusinessError } 401 - parameter error. Possible causes:
1081     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1082     * @throws { BusinessError } 12800009 - input method client detached.
1083     * @syscap SystemCapability.MiscServices.InputMethodFramework
1084     * @since 10
1085     */
1086    on(type: 'deleteRight', callback: (length: number) => void): void;
1087
1088    /**
1089     * Unregister the callback of deleteRight.
1090     *
1091     * @param { 'deleteRight' } type - event type, fixed as 'deleteRight'.
1092     * @param { function } [callback] - the callback of 'deleteRight',
1093     *        when subscriber unsubscribes all callback functions of event 'deleteRight', this parameter can be left blank.
1094     * @syscap SystemCapability.MiscServices.InputMethodFramework
1095     * @since 10
1096     */
1097    off(type: 'deleteRight', callback?: (length: number) => void): void;
1098
1099    /**
1100     * Register a callback and when IME sends keyboard status, the callback will be invoked.
1101     *
1102     * @param { 'sendKeyboardStatus' } type - event type, fixed as 'sendKeyboardStatus'.
1103     * @param { function } callback - processes sendKeyboardStatus command.
1104     *     The keyboardStatus is provided for this callback.
1105     * @throws { BusinessError } 401 - parameter error. Possible causes:
1106     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1107     * @throws { BusinessError } 12800009 - input method client detached.
1108     * @syscap SystemCapability.MiscServices.InputMethodFramework
1109     * @since 10
1110     */
1111    on(type: 'sendKeyboardStatus', callback: (keyboardStatus: KeyboardStatus) => void): void;
1112
1113    /**
1114     * Unregister the callback of sendKeyboardStatus.
1115     *
1116     * @param { 'sendKeyboardStatus' } type - event type, fixed as 'sendKeyboardStatus'.
1117     * @param { function } [callback] - the callback of 'sendKeyboardStatus',
1118     *        when subscriber unsubscribes all callback functions of event 'sendKeyboardStatus', this parameter can be left blank.
1119     * @syscap SystemCapability.MiscServices.InputMethodFramework
1120     * @since 10
1121     */
1122    off(type: 'sendKeyboardStatus', callback?: (keyboardStatus: KeyboardStatus) => void): void;
1123
1124    /**
1125     * Register a callback and when IME sends functionKey, the callback will be invoked.
1126     *
1127     * @param { 'sendFunctionKey' } type - event type, fixed as 'sendFunctionKey'.
1128     * @param { function } callback - processes sendFunctionKey command.
1129     *     The functionKey is provided for this callback.Subscribers are expected to complete the
1130     *     corresponding task based on the value of functionKey.
1131     * @throws { BusinessError } 401 - parameter error. Possible causes:
1132     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1133     * @throws { BusinessError } 12800009 - input method client detached.
1134     * @syscap SystemCapability.MiscServices.InputMethodFramework
1135     * @since 10
1136     */
1137    on(type: 'sendFunctionKey', callback: (functionKey: FunctionKey) => void): void;
1138
1139    /**
1140     * Unregister the callback of sendFunctionKey.
1141     *
1142     * @param { 'sendFunctionKey' } type - event type, fixed as 'sendFunctionKey'.
1143     * @param { function } [callback] - the callback of 'sendFunctionKey',
1144     *        when subscriber unsubscribes all callback functions of event 'sendFunctionKey', this parameter can be left blank.
1145     * @syscap SystemCapability.MiscServices.InputMethodFramework
1146     * @since 10
1147     */
1148    off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void;
1149
1150    /**
1151     * Register a callback and when IME sends move cursor, the callback will be invoked.
1152     *
1153     * @param { 'moveCursor' } type - event type, fixed as 'moveCursor'.
1154     * @param { function } callback - processes moveCursor command. The direction of
1155     *     cursor is provided for this callback. Subscribers are expected to move the cursor and update changes
1156     *     in editor by changeSelection and updateCursor.
1157     * @throws { BusinessError } 401 - parameter error. Possible causes:
1158     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1159     * @throws { BusinessError } 12800009 - input method client detached.
1160     * @syscap SystemCapability.MiscServices.InputMethodFramework
1161     * @since 10
1162     */
1163    on(type: 'moveCursor', callback: (direction: Direction) => void): void;
1164
1165    /**
1166     * Unregister the callback of moveCursor.
1167     *
1168     * @param { 'moveCursor' } type - event type, fixed as 'moveCursor'.
1169     * @param { function } [callback] - the callback of 'moveCursor',
1170     *        when subscriber unsubscribes all callback functions of event 'moveCursor', this parameter can be left blank.
1171     * @syscap SystemCapability.MiscServices.InputMethodFramework
1172     * @since 10
1173     */
1174    off(type: 'moveCursor', callback?: (direction: Direction) => void): void;
1175
1176    /**
1177     * Register a callback and when IME sends extend action code, the callback will be invoked.
1178     *
1179     * @param { 'handleExtendAction' } type - event type, fixed as 'handleExtendAction'.
1180     * @param { function } callback - processes handleExtendAction command. The action code
1181     *     is provided for this callback.
1182     * @throws { BusinessError } 401 - parameter error. Possible causes:
1183     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1184     * @throws { BusinessError } 12800009 - input method client detached.
1185     * @syscap SystemCapability.MiscServices.InputMethodFramework
1186     * @since 10
1187     */
1188    on(type: 'handleExtendAction', callback: (action: ExtendAction) => void): void;
1189
1190    /**
1191     * Unregister the callback of handleExtendAction.
1192     *
1193     * @param { 'handleExtendAction' } type - event type, fixed as 'handleExtendAction'.
1194     * @param { function } [callback] - the callback of 'handleExtendAction',
1195     *        when subscriber unsubscribes all callback functions of event 'handleExtendAction', this parameter can be left blank.
1196     * @syscap SystemCapability.MiscServices.InputMethodFramework
1197     * @since 10
1198     */
1199    off(type: 'handleExtendAction', callback?: (action: ExtendAction) => void): void;
1200
1201    /**
1202     * Register a callback and when input method ability gets left text of cursor, the callback will be invoked.
1203     *
1204     * @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'.
1205     * @param { function } callback - processes getLeftTextOfCursor command. The callback
1206     *     must be a synchronization method and will block the input method application.
1207     * @throws { BusinessError } 401 - parameter error. Possible causes:
1208     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1209     * @throws { BusinessError } 12800009 - input method client detached.
1210     * @syscap SystemCapability.MiscServices.InputMethodFramework
1211     * @since 10
1212     */
1213    on(type: 'getLeftTextOfCursor', callback: (length: number) => string): void;
1214
1215    /**
1216     * Unregister the callback of getLeftTextOfCursor event.
1217     *
1218     * @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'.
1219     * @param { function } [callback] - the callback of 'getLeftTextOfCursor',
1220     *     when subscriber unsubscribes all callback functions of event 'getLeftTextOfCursor', this parameter can be left blank.
1221     * @syscap SystemCapability.MiscServices.InputMethodFramework
1222     * @since 10
1223     */
1224    off(type: 'getLeftTextOfCursor', callback?: (length: number) => string): void;
1225
1226    /**
1227     * Register a callback and when input method ability gets right text of cursor, the callback will be invoked.
1228     *
1229     * @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'.
1230     * @param { function } callback - processes getRightTextOfCursor command. The callback
1231     *     must be a synchronization method and will block the input method application.
1232     * @throws { BusinessError } 401 - parameter error. Possible causes:
1233     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1234     * @throws { BusinessError } 12800009 - input method client detached.
1235     * @syscap SystemCapability.MiscServices.InputMethodFramework
1236     * @since 10
1237     */
1238    on(type: 'getRightTextOfCursor', callback: (length: number) => string): void;
1239
1240    /**
1241     * Unregister the callback of getRightTextOfCursor event.
1242     *
1243     * @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'.
1244     * @param { function } [callback] - the callback of 'getRightTextOfCursor',
1245     *     when subscriber unsubscribes all callback functions of event 'getRightTextOfCursor', this parameter can be left blank.
1246     * @syscap SystemCapability.MiscServices.InputMethodFramework
1247     * @since 10
1248     */
1249    off(type: 'getRightTextOfCursor', callback?: (length: number) => string): void;
1250
1251    /**
1252     * Register a callback and when input method ability gets the text index at cursor, the callback will be invoked.
1253     *
1254     * @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'.
1255     * @param { function } callback - processes getTextIndexAtCursor command. The callback
1256     *     must be a synchronization method, and should return the text index at the cursor.
1257     * @throws { BusinessError } 401 - parameter error. Possible causes:
1258     *     1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
1259     * @throws { BusinessError } 12800009 - input method client detached.
1260     * @syscap SystemCapability.MiscServices.InputMethodFramework
1261     * @since 10
1262     */
1263    on(type: 'getTextIndexAtCursor', callback: () => number): void;
1264
1265    /**
1266     * Unregister the callback of getTextIndexAtCursor.
1267     *
1268     * @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'.
1269     * @param { function } [callback] - the callback of 'getTextIndexAtCursor',
1270     *     when subscriber unsubscribes all callback functions of event 'getTextIndexAtCursor', this parameter can be left blank.
1271     * @syscap SystemCapability.MiscServices.InputMethodFramework
1272     * @since 10
1273     */
1274    off(type: 'getTextIndexAtCursor', callback?: () => number): void;
1275  }
1276
1277  /**
1278   * input method property
1279   *
1280   * @interface InputMethodProperty
1281   * @syscap SystemCapability.MiscServices.InputMethodFramework
1282   * @since 8
1283   */
1284  interface InputMethodProperty {
1285    /**
1286     * The name of input method
1287     *
1288     * @type { string }
1289     * @syscap SystemCapability.MiscServices.InputMethodFramework
1290     * @since 8
1291     * @deprecated since 9
1292     * @useinstead inputMethod.InputMethodProperty#name
1293     */
1294    readonly packageName: string;
1295
1296    /**
1297     * The id of input method
1298     *
1299     * @type { string }
1300     * @syscap SystemCapability.MiscServices.InputMethodFramework
1301     * @since 8
1302     * @deprecated since 9
1303     * @useinstead inputMethod.InputMethodProperty#id
1304     */
1305    readonly methodId: string;
1306
1307    /**
1308     * The name of input method
1309     *
1310     * @type { string }
1311     * @readonly
1312     * @syscap SystemCapability.MiscServices.InputMethodFramework
1313     * @since 9
1314     */
1315    readonly name: string;
1316
1317    /**
1318     * The id of input method
1319     *
1320     * @type { string }
1321     * @readonly
1322     * @syscap SystemCapability.MiscServices.InputMethodFramework
1323     * @since 9
1324     */
1325    readonly id: string;
1326
1327    /**
1328     * The label of input method
1329     *
1330     * @type { ?string }
1331     * @readonly
1332     * @syscap SystemCapability.MiscServices.InputMethodFramework
1333     * @since 9
1334     */
1335    readonly label?: string;
1336
1337    /**
1338     * The label id of input method
1339     *
1340     * @type { ?number }
1341     * @readonly
1342     * @syscap SystemCapability.MiscServices.InputMethodFramework
1343     * @since 10
1344     */
1345    readonly labelId?: number;
1346
1347    /**
1348     * The icon of input method
1349     *
1350     * @type { ?string }
1351     * @readonly
1352     * @syscap SystemCapability.MiscServices.InputMethodFramework
1353     * @since 9
1354     */
1355    readonly icon?: string;
1356
1357    /**
1358     * The icon id of input method
1359     *
1360     * @type { ?number }
1361     * @readonly
1362     * @syscap SystemCapability.MiscServices.InputMethodFramework
1363     * @since 9
1364     */
1365    readonly iconId?: number;
1366
1367    /**
1368     * The extra info of input method
1369     *
1370     * @type { object }
1371     * @syscap SystemCapability.MiscServices.InputMethodFramework
1372     * @since 9
1373     */
1374    /**
1375     * The extra info of input method
1376     *
1377     * @type { ?object }
1378     * @syscap SystemCapability.MiscServices.InputMethodFramework
1379     * @since 10
1380     */
1381    extra?: object;
1382  }
1383
1384  /**
1385   * Enumerates the moving direction of cursor
1386   *
1387   * @enum { number }
1388   * @syscap SystemCapability.MiscServices.InputMethodFramework
1389   * @since 10
1390   */
1391  export enum Direction {
1392    /**
1393     * Cursor moves up
1394     *
1395     * @syscap SystemCapability.MiscServices.InputMethodFramework
1396     * @since 10
1397     */
1398    CURSOR_UP = 1,
1399
1400    /**
1401     * Cursor moves down
1402     *
1403     * @syscap SystemCapability.MiscServices.InputMethodFramework
1404     * @since 10
1405     */
1406    CURSOR_DOWN,
1407
1408    /**
1409     * Cursor moves left
1410     *
1411     * @syscap SystemCapability.MiscServices.InputMethodFramework
1412     * @since 10
1413     */
1414    CURSOR_LEFT,
1415
1416    /**
1417     * Cursor moves right
1418     *
1419     * @syscap SystemCapability.MiscServices.InputMethodFramework
1420     * @since 10
1421     */
1422    CURSOR_RIGHT
1423  }
1424
1425  /**
1426   * Range of selected text.
1427   *
1428   * @typedef Range
1429   * @syscap SystemCapability.MiscServices.InputMethodFramework
1430   * @since 10
1431   */
1432  export interface Range {
1433    /**
1434     * Indicates the index of the first character of the selected text.
1435     *
1436     * @type { number }
1437     * @syscap SystemCapability.MiscServices.InputMethodFramework
1438     * @since 10
1439     */
1440    start: number;
1441
1442    /**
1443     * Indicates the index of the last character of the selected text.
1444     *
1445     * @type { number }
1446     * @syscap SystemCapability.MiscServices.InputMethodFramework
1447     * @since 10
1448     */
1449    end: number;
1450  }
1451
1452  /**
1453   * Movement of cursor.
1454   *
1455   * @typedef Movement
1456   * @syscap SystemCapability.MiscServices.InputMethodFramework
1457   * @since 10
1458   */
1459  export interface Movement {
1460    /**
1461     * Indicates the direction of cursor movement
1462     *
1463     * @type { Direction }
1464     * @syscap SystemCapability.MiscServices.InputMethodFramework
1465     * @since 10
1466     */
1467    direction: Direction;
1468  }
1469
1470  /**
1471   * Enumerates the text input type.
1472   *
1473   * @enum { number }
1474   * @syscap SystemCapability.MiscServices.InputMethodFramework
1475   * @since 10
1476   */
1477  export enum TextInputType {
1478    /**
1479     * The text input type is NONE.
1480     *
1481     * @syscap SystemCapability.MiscServices.InputMethodFramework
1482     * @since 10
1483     */
1484    NONE = -1,
1485
1486    /**
1487     * The text input type is TEXT.
1488     *
1489     * @syscap SystemCapability.MiscServices.InputMethodFramework
1490     * @since 10
1491     */
1492    TEXT = 0,
1493
1494    /**
1495     * The text input type is MULTILINE.
1496     *
1497     * @syscap SystemCapability.MiscServices.InputMethodFramework
1498     * @since 10
1499     */
1500    MULTILINE,
1501
1502    /**
1503     * The text input type is NUMBER.
1504     *
1505     * @syscap SystemCapability.MiscServices.InputMethodFramework
1506     * @since 10
1507     */
1508    NUMBER,
1509
1510    /**
1511     * The text input type is PHONE.
1512     *
1513     * @syscap SystemCapability.MiscServices.InputMethodFramework
1514     * @since 10
1515     */
1516    PHONE,
1517
1518    /**
1519     * The text input type is DATETIME.
1520     *
1521     * @syscap SystemCapability.MiscServices.InputMethodFramework
1522     * @since 10
1523     */
1524    DATETIME,
1525
1526    /**
1527     * The text input type is EMAIL_ADDRESS.
1528     *
1529     * @syscap SystemCapability.MiscServices.InputMethodFramework
1530     * @since 10
1531     */
1532    EMAIL_ADDRESS,
1533
1534    /**
1535     * The text input type is URL.
1536     *
1537     * @syscap SystemCapability.MiscServices.InputMethodFramework
1538     * @since 10
1539     */
1540    URL,
1541
1542    /**
1543     * The text input type is VISIBLE_PASSWORD.
1544     *
1545     * @syscap SystemCapability.MiscServices.InputMethodFramework
1546     * @since 10
1547     */
1548    VISIBLE_PASSWORD,
1549
1550    /**
1551     * The text input type is NUMBER_PASSWORD.
1552     *
1553     * @syscap SystemCapability.MiscServices.InputMethodFramework
1554     * @since 11
1555     */
1556    NUMBER_PASSWORD
1557  }
1558
1559  /**
1560   * Enumerates the enter key type.
1561   *
1562   * @enum { number }
1563   * @syscap SystemCapability.MiscServices.InputMethodFramework
1564   * @since 10
1565   */
1566  export enum EnterKeyType {
1567    /**
1568     * The enter key type is UNSPECIFIED.
1569     *
1570     * @syscap SystemCapability.MiscServices.InputMethodFramework
1571     * @since 10
1572     */
1573    UNSPECIFIED = 0,
1574
1575    /**
1576     * The enter key type is NONE.
1577     *
1578     * @syscap SystemCapability.MiscServices.InputMethodFramework
1579     * @since 10
1580     */
1581    NONE,
1582
1583    /**
1584     * The enter key type is GO.
1585     *
1586     * @syscap SystemCapability.MiscServices.InputMethodFramework
1587     * @since 10
1588     */
1589    GO,
1590
1591    /**
1592     * The enter key type is SEARCH.
1593     *
1594     * @syscap SystemCapability.MiscServices.InputMethodFramework
1595     * @since 10
1596     */
1597    SEARCH,
1598
1599    /**
1600     * The enter key type is SEND.
1601     *
1602     * @syscap SystemCapability.MiscServices.InputMethodFramework
1603     * @since 10
1604     */
1605    SEND,
1606
1607    /**
1608     * The enter key type is NEXT.
1609     *
1610     * @syscap SystemCapability.MiscServices.InputMethodFramework
1611     * @since 10
1612     */
1613    NEXT,
1614
1615    /**
1616     * The enter key type is DONE.
1617     *
1618     * @syscap SystemCapability.MiscServices.InputMethodFramework
1619     * @since 10
1620     */
1621    DONE,
1622
1623    /**
1624     * The enter key type is PREVIOUS.
1625     *
1626     * @syscap SystemCapability.MiscServices.InputMethodFramework
1627     * @since 10
1628     */
1629    PREVIOUS,
1630
1631      /**
1632     * The enter key type is NEWLINE.
1633     *
1634     * @syscap SystemCapability.MiscServices.InputMethodFramework
1635     * @since 12
1636     */
1637    NEWLINE
1638  }
1639
1640  /**
1641   * Enumerates the keyboard status.
1642   *
1643   * @enum { number }
1644   * @syscap SystemCapability.MiscServices.InputMethodFramework
1645   * @since 10
1646   */
1647  export enum KeyboardStatus {
1648    /**
1649     * The keyboard status is none.
1650     *
1651     * @syscap SystemCapability.MiscServices.InputMethodFramework
1652     * @since 10
1653     */
1654    NONE = 0,
1655
1656    /**
1657     * The keyboard status is hide.
1658     *
1659     * @syscap SystemCapability.MiscServices.InputMethodFramework
1660     * @since 10
1661     */
1662    HIDE = 1,
1663
1664    /**
1665     * The keyboard status is show.
1666     *
1667     * @syscap SystemCapability.MiscServices.InputMethodFramework
1668     * @since 10
1669     */
1670    SHOW = 2
1671  }
1672
1673  /**
1674   * Attribute of Input.
1675   *
1676   * @typedef InputAttribute
1677   * @syscap SystemCapability.MiscServices.InputMethodFramework
1678   * @since 10
1679   */
1680  export interface InputAttribute {
1681    /**
1682     * Indicates the text input type of the input method.
1683     *
1684     * @type { TextInputType }
1685     * @syscap SystemCapability.MiscServices.InputMethodFramework
1686     * @since 10
1687     */
1688    textInputType: TextInputType;
1689
1690    /**
1691     * Indicates the enter key type of the input method.
1692     *
1693     * @type { EnterKeyType }
1694     * @syscap SystemCapability.MiscServices.InputMethodFramework
1695     * @since 10
1696     */
1697    enterKeyType: EnterKeyType;
1698  }
1699
1700  /**
1701   * FunctionKey of Input.
1702   *
1703   * @typedef FunctionKey
1704   * @syscap SystemCapability.MiscServices.InputMethodFramework
1705   * @since 10
1706   */
1707  export interface FunctionKey {
1708    /**
1709     * Indicates the enter key type of the input method.
1710     *
1711     * @type { EnterKeyType }
1712     * @syscap SystemCapability.MiscServices.InputMethodFramework
1713     * @since 10
1714     */
1715    enterKeyType: EnterKeyType;
1716  }
1717
1718  /**
1719   * Information of Cursor.
1720   *
1721   * @typedef CursorInfo
1722   * @syscap SystemCapability.MiscServices.InputMethodFramework
1723   * @since 10
1724   */
1725  export interface CursorInfo {
1726    /**
1727     * Indicates the left point of the cursor info and must be absolute coordinate of the physical screen.
1728     *
1729     * @type { number }
1730     * @syscap SystemCapability.MiscServices.InputMethodFramework
1731     * @since 10
1732     */
1733    left: number;
1734
1735    /**
1736     * Indicates the top point of the cursor info and must be absolute coordinate of the physical screen.
1737     *
1738     * @type { number }
1739     * @syscap SystemCapability.MiscServices.InputMethodFramework
1740     * @since 10
1741     */
1742    top: number;
1743
1744    /**
1745     * Indicates the width point of the cursor info.
1746     *
1747     * @type { number }
1748     * @syscap SystemCapability.MiscServices.InputMethodFramework
1749     * @since 10
1750     */
1751    width: number;
1752
1753    /**
1754     * Indicates the height point of the cursor info.
1755     *
1756     * @type { number }
1757     * @syscap SystemCapability.MiscServices.InputMethodFramework
1758     * @since 10
1759     */
1760    height: number;
1761  }
1762
1763  /**
1764   * Config of editor.
1765   *
1766   * @typedef TextConfig
1767   * @syscap SystemCapability.MiscServices.InputMethodFramework
1768   * @since 10
1769   */
1770  export interface TextConfig {
1771    /**
1772     * Attribute of Input.
1773     *
1774     * @type { InputAttribute }
1775     * @syscap SystemCapability.MiscServices.InputMethodFramework
1776     * @since 10
1777     */
1778    inputAttribute: InputAttribute;
1779
1780    /**
1781     * Cursor information.
1782     *
1783     * @type { ?CursorInfo }
1784     * @syscap SystemCapability.MiscServices.InputMethodFramework
1785     * @since 10
1786     */
1787    cursorInfo?: CursorInfo;
1788
1789    /**
1790     * Selection information.
1791     *
1792     * @type { ?Range }
1793     * @syscap SystemCapability.MiscServices.InputMethodFramework
1794     * @since 10
1795     */
1796    selection?: Range;
1797
1798    /**
1799     * The window ID of the application currently bound to the input method.
1800     *
1801     * @type { ?number }
1802     * @syscap SystemCapability.MiscServices.InputMethodFramework
1803     * @since 10
1804     */
1805    windowId?: number;
1806  }
1807
1808  /**
1809   * Enumerates the extend action.
1810   *
1811   * @enum { number }
1812   * @syscap SystemCapability.MiscServices.InputMethodFramework
1813   * @since 10
1814   */
1815  export enum ExtendAction {
1816    /**
1817     * Select all text.
1818     *
1819     * @syscap SystemCapability.MiscServices.InputMethodFramework
1820     * @since 10
1821     */
1822    SELECT_ALL = 0,
1823
1824    /**
1825     * Cut selecting text.
1826     *
1827     * @syscap SystemCapability.MiscServices.InputMethodFramework
1828     * @since 10
1829     */
1830    CUT = 3,
1831
1832    /**
1833     * Copy selecting text.
1834     *
1835     * @syscap SystemCapability.MiscServices.InputMethodFramework
1836     * @since 10
1837     */
1838    COPY = 4,
1839
1840    /**
1841     * Paste from paste board.
1842     *
1843     * @syscap SystemCapability.MiscServices.InputMethodFramework
1844     * @since 10
1845     */
1846    PASTE = 5
1847  }
1848
1849  /**
1850   * Information of input window.
1851   *
1852   * @typedef InputWindowInfo
1853   * @syscap SystemCapability.MiscServices.InputMethodFramework
1854   * @since 10
1855   */
1856  export interface InputWindowInfo {
1857    /**
1858     * Indicates name of the input window.
1859     *
1860     * @type { string }
1861     * @syscap SystemCapability.MiscServices.InputMethodFramework
1862     * @since 10
1863     */
1864    name: string;
1865
1866    /**
1867     * Indicates the abscissa of the upper-left vertex of input window.
1868     *
1869     * @type { number }
1870     * @syscap SystemCapability.MiscServices.InputMethodFramework
1871     * @since 10
1872     */
1873    left: number;
1874
1875    /**
1876     * Indicates the ordinate of the upper-left vertex of input window.
1877     *
1878     * @type { number }
1879     * @syscap SystemCapability.MiscServices.InputMethodFramework
1880     * @since 10
1881     */
1882    top: number;
1883
1884    /**
1885     * Indicates the width of the input window.
1886     *
1887     * @type { number }
1888     * @syscap SystemCapability.MiscServices.InputMethodFramework
1889     * @since 10
1890     */
1891    width: number;
1892
1893    /**
1894     * Indicates the height of the input window.
1895     *
1896     * @type { number }
1897     * @syscap SystemCapability.MiscServices.InputMethodFramework
1898     * @since 10
1899     */
1900    height: number;
1901  }
1902}
1903
1904export default inputMethod;