1e41f4b71Sopenharmony_ci# @ohos.InputMethodExtensionAbility (InputMethodExtensionAbility)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe **InputMethodExtensionAbility** module provides APIs for developing input methods and managing their lifecycles.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci> **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci> The APIs of this module can be used only in the stage model.
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci## Modules to Import
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci```ts
13e41f4b71Sopenharmony_ciimport { InputMethodExtensionAbility } from '@kit.IMEKit';
14e41f4b71Sopenharmony_ci```
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci## Attributes
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MiscServices.InputMethodFramework
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci| Name | Type | Read-Only | Optional | Description |
21e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
22e41f4b71Sopenharmony_ci| context | [InputMethodExtensionContext](js-apis-inputmethod-extension-context.md) | Yes | No | Context of the **InputMethodExtension**, which is inherited from **ExtensionContext**. |
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci## InputMethodExtensionAbility.onCreate
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_cionCreate(want: Want): void
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ciCalled when the **InputMethodExtension** ability is started to implement initialization.
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MiscServices.InputMethodFramework
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci**Parameters**
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci| Name | Type         | Mandatory | Description                            |
35e41f4b71Sopenharmony_ci| ------ | ----------- | ---- | ------------------------------- |
36e41f4b71Sopenharmony_ci| want   | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes  | Information related to the **InputMethodExtension** ability, including the ability name and bundle name. |
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ci**Example**
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci```ts
41e41f4b71Sopenharmony_ciimport { InputMethodExtensionAbility } from '@kit.IMEKit';
42e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
43e41f4b71Sopenharmony_ciclass InputMethodExt extends InputMethodExtensionAbility {
44e41f4b71Sopenharmony_ci  onCreate(want: Want): void {
45e41f4b71Sopenharmony_ci    console.log('onCreate, want:' + want.abilityName);
46e41f4b71Sopenharmony_ci  }
47e41f4b71Sopenharmony_ci}
48e41f4b71Sopenharmony_ci```
49e41f4b71Sopenharmony_ci
50e41f4b71Sopenharmony_ci## InputMethodExtensionAbility.onDestroy
51e41f4b71Sopenharmony_ci
52e41f4b71Sopenharmony_cionDestroy(): void
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ciCalled when this **InputMethodExtension** ability is destroyed to clear resources.
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MiscServices.InputMethodFramework
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci**Example**
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci```ts
61e41f4b71Sopenharmony_ciimport { InputMethodExtensionAbility } from '@kit.IMEKit';
62e41f4b71Sopenharmony_ciclass InputMethodExt extends InputMethodExtensionAbility {
63e41f4b71Sopenharmony_ci  onDestroy(): void {
64e41f4b71Sopenharmony_ci    console.log('onDestroy');
65e41f4b71Sopenharmony_ci  }
66e41f4b71Sopenharmony_ci}
67e41f4b71Sopenharmony_ci```
68