From 3452c4cb282f26565c97ead7b6e159cbd6a46f03 Mon Sep 17 00:00:00 2001 From: Hollokin Date: Mon, 21 Nov 2022 19:53:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=BE=93=E5=85=A5=E6=B3=95=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E3=80=91=E8=B5=84=E6=96=99=E4=B8=80=E8=87=B4=E6=80=A7?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hollokin --- .../js-apis-inputmethod-extension-ability.md | 16 ++--- .../reference/apis/js-apis-inputmethod.md | 68 +++++++++---------- .../apis/js-apis-inputmethodengine.md | 16 ++--- 3 files changed, 49 insertions(+), 51 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md index 6f381f501a..1bef6711b7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md @@ -4,7 +4,7 @@ > **说明:** > ->本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 @@ -16,12 +16,11 @@ import InputMethodExtensionAbility from '@ohos.inputmethodextensionability'; **系统能力:** SystemCapability.MiscServices.InputMethodFramework -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | context | [InputMethodExtensionContext](js-apis-inputmethod-extension-context.md) | 是 | 否 | InputMethodExtension的上下文环境,继承自ExtensionContext。 | - -## InputMethodExtensionAbility.onCreate() +## InputMethodExtensionAbility.onCreate onCreate(want: Want): void @@ -31,9 +30,9 @@ Extension生命周期回调,在拉起Extension输入法应用时调用,执 **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 是 | 当前Extension相关的Want类型信息,包括ability名称、bundle名称等。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want | [Want](js-apis-application-Want.md) | 是 | 当前Extension相关的Want类型信息,包括ability名称、bundle名称等。 | **示例:** @@ -45,8 +44,7 @@ class InputMethodExt extends InputMethodExtensionAbility { } ``` - -## InputMethodExtensionAbility.onDestroy() +## InputMethodExtensionAbility.onDestroy onDestroy(): void diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md index d810118a35..ed798722aa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md @@ -19,7 +19,7 @@ import inputMethod from '@ohos.inputmethod'; **系统能力:** SystemCapability.MiscServices.InputMethodFramework -| 参数名 | 参数类型 | 常量值 | 说明 | +| 参数名 | 类型 | 常量值 | 说明 | | -------- | -------- | -------- | -------- | | MAX_TYPE_NUM | number | 128 | 可支持的最大输入法个数。 | @@ -29,7 +29,7 @@ import inputMethod from '@ohos.inputmethod'; **系统能力:** SystemCapability.MiscServices.InputMethodFramework -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | packageName(deprecated) | string | 是 | 否 | 输入法包名。
**说明:** 从API8开始支持,从API9开始废弃,建议使用name替代。 | | methodId(deprecated) | string | 是 | 否 | 输入法唯一标识。
**说明:** 从API8开始支持,从API9开始废弃,建议使用id替代。 | @@ -58,14 +58,14 @@ getController(): InputMethodController 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | ------------------------------ | | 12800006 | Input method controller error. | **示例:** ```js -let InputMethodController = inputMethod.getController(); +let inputMethodController = inputMethod.getController(); ``` ## inputMethod.getSetting9+ @@ -86,7 +86,7 @@ getSetting(): InputMethodSetting 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800007 | Input method settings extension error. | @@ -117,7 +117,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolea 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800005 | Configuration persisting error. | | 12800008 | Input method settings extension error. | @@ -154,7 +154,7 @@ switchInputMethod(target: InputMethodProperty): Promise<boolean> | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - |target | [InputmethodProperty](#inputmethodproperty8)| 是 | 传入要切换的目标输入法。 | + |target | [InputMethodProperty](#inputmethodproperty8)| 是 | 传入要切换的目标输入法。 | **返回值:** @@ -166,7 +166,7 @@ switchInputMethod(target: InputMethodProperty): Promise<boolean> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800005 | Configuration persisting error. | | 12800008 | Input method settings extension error. | @@ -201,7 +201,7 @@ getCurrentInputMethod(): InputMethodProperty | 类型 | 说明 | | -------------------------------------------- | ------------------------ | -| [InputmethodProperty](#inputmethodproperty8) | 返回当前输入法属性对象。 | +| [InputMethodProperty](#inputmethodproperty8) | 返回当前输入法属性对象。 | **示例:** @@ -230,7 +230,7 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallb 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800005 | Configuration persisting error. | | 12800008 | Input method settings extension error. | @@ -292,7 +292,7 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean& 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800005 | Configuration persisting error. | | 12800008 | Input method settings extension error. | @@ -368,7 +368,7 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800005 | Configuration persisting error. | | 12800008 | Input method settings extension error. | @@ -436,7 +436,7 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800005 | Configuration persisting error. | | 12800008 | Input method settings extension error. | @@ -496,7 +496,7 @@ getInputMethodController(): InputMethodController **示例:** ```js -let InputMethodController = inputMethod.getInputMethodController(); +let inputMethodController = inputMethod.getInputMethodController(); ``` ## inputMethod.getInputMethodSetting(deprecated) @@ -543,7 +543,7 @@ stopInputSession(callback: AsyncCallback<boolean>): void 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800003 | Input method client error. | | 12800008 | Input method settings extension error. | @@ -586,7 +586,7 @@ stopInputSession(): Promise<boolean> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800003 | Input method client error. | | 12800008 | Input method settings extension error. | @@ -621,7 +621,7 @@ showSoftKeyboard(callback: AsyncCallback<void>): void **参数:** -| 参数名 | 参数类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | | callback | AsyncCallback<void> | 是 | 回调函数。当软键盘显示成功。err为undefined,否则为错误对象。 | @@ -629,7 +629,7 @@ showSoftKeyboard(callback: AsyncCallback<void>): void 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800003 | Input method client error. | | 12800008 | Input method settings extension error. | @@ -666,7 +666,7 @@ showSoftKeyboard(): Promise<void> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800003 | Input method client error. | | 12800008 | Input method settings extension error. | @@ -693,7 +693,7 @@ hideSoftKeyboard(callback: AsyncCallback<void>): void **参数:** -| 参数名 | 参数类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | | callback | AsyncCallback<void> | 是 | 回调函数。当软键盘隐藏成功。err为undefined,否则为错误对象。 | @@ -701,7 +701,7 @@ hideSoftKeyboard(callback: AsyncCallback<void>): void 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800003 | Input method client error. | | 12800008 | Input method settings extension error. | @@ -738,7 +738,7 @@ hideSoftKeyboard(): Promise<void> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800003 | Input method client error. | | 12800008 | Input method settings extension error. | @@ -880,13 +880,13 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: Async | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------- | ---- | ---------------------- | | inputMethodProperty | InputMethodProperty| 是 | 指定获取子类型所属的输入法应用。 | -| callback | Array<[InputMethodSubtype](./js-apis-inputmethod-subtype.md#inputmethodsubtype)> | 是 | 回调函数,返回指定输入法应用的所有子类型。 | +| callback | AsyncCallback<Array<[InputMethodSubtype](./js-apis-inputmethod-subtype.md#inputmethodsubtype)>> | 是 | 回调函数,返回指定输入法应用的所有子类型。 | **错误码:** 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800001 | Package manager error. | | 12800008 | Input method settings extension error. | @@ -936,7 +936,7 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Arr 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800001 | Package manager error. | | 12800008 | Input method settings extension error. | @@ -972,13 +972,13 @@ listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSub | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------- | ---- | ---------------------- | -| callback | Array<[InputMethodSubtype](./js-apis-inputmethod-subtype.md#inputmethodsubtype)> | 是 | 回调函数,返回当前输入法应用的所有子类型。 | +| callback | AsyncCallback<Array<[InputMethodSubtype](./js-apis-inputmethod-subtype.md#inputmethodsubtype)>> | 是 | 回调函数,返回当前输入法应用的所有子类型。 | **错误码:** 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800001 | Package manager error. | | 12800008 | Input method settings extension error. | @@ -1017,7 +1017,7 @@ listCurrentInputMethodSubtype(): Promise<Array<InputMethodSubtype>> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800001 | Package manager error. | | 12800008 | Input method settings extension error. | @@ -1049,13 +1049,13 @@ getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethod | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------------------------- | ---- | ----------------------------- | | enable | boolean | 是 | 指定返回已激活/未激活。 | -| callback | Array<[InputMethodProperty](#inputmethodproperty8)> | 是 | 回调函数,返回已激活/未激活输入法列表。 | +| callback | AsyncCallback<Array<[InputMethodProperty](#inputmethodproperty8)>> | 是 | 回调函数,返回已激活/未激活输入法列表。 | **错误码:** 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800001 | Package manager error. | | 12800008 | Input method settings extension error. | @@ -1094,7 +1094,7 @@ getInputMethods(enable: boolean): Promise<Array<InputMethodProperty>> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800001 | Package manager error. | | 12800008 | Input method settings extension error. | @@ -1139,7 +1139,7 @@ showOptionalInputMethods(callback: AsyncCallback<boolean>): void 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800008 | Input method settings extension error. | @@ -1179,7 +1179,7 @@ showOptionalInputMethods(): Promise<boolean> 以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。 -| 错误码ID | 错误码信息 | +| 错误码ID | 错误信息 | | -------- | -------------------------------------- | | 12800008 | Input method settings extension error. | @@ -1209,7 +1209,7 @@ listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>) | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------- | ---- | ---------------------- | -| callback | Array<[InputMethodProperty](#inputmethodproperty8)> | 是 | 回调函数,返回已安装的输入法列表。 | +| callback | AsyncCallback<Array<[InputMethodProperty](#inputmethodproperty8)>> | 是 | 回调函数,返回已安装的输入法列表。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md index d441dc6801..22162f11ff 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md @@ -18,7 +18,7 @@ import inputMethodEngine from '@ohos.inputmethodengine'; **系统能力:** SystemCapability.MiscServices.InputMethodFramework -| 名称 | 参数类型 | 值 | 说明 | +| 名称 | 类型 | 值 | 说明 | | -------- | -------- | -------- | -------- | | ENTER_KEY_TYPE_UNSPECIFIED | number | 0 | 无功能键。 | | ENTER_KEY_TYPE_GO | number | 2 | “前往”功能键。 | @@ -204,7 +204,7 @@ on(type: 'keyboardShow'|'keyboardHide', callback: () => void): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ------------------------------------------------------------ | | type | string | 是 | 设置监听类型。
- type为'keyboardShow',表示订阅输入法显示。
- type为'keyboardHide',表示订阅输入法隐藏。 | -| callback | void | 否 | 回调函数。 | +| callback | void | 是 | 回调函数。 | **示例:** @@ -463,7 +463,7 @@ inputMethodEngine.getInputMethodAbility().on('setSubtype', (inputMethodSubtype) ### off('setSubtype')9+ -off(ype: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void +off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void 取消订阅输入法子类型事件。使用callback异步回调。 @@ -474,7 +474,7 @@ off(ype: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => vo | 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ------------------------------------------------------------ | | type | string | 是 | 设置监听类型。
- type为'setSubtype',表示取消订阅输入法子类型设置。
- type为'keyboardHide',表示订阅输入法隐藏。 | -| callback | InputMethodSubtype | 是 | 回调函数,返回调用方的输入法子类型。 | +| callback | InputMethodSubtype | 否 | 回调函数,返回调用方的输入法子类型。 | **示例:** @@ -708,7 +708,7 @@ hide(callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | -------- | -| callback | AsyncCallback<void> | 否 | 回调函数。当输入法隐藏成功,err为undefined,否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当输入法隐藏成功,err为undefined,否则为错误对象。 | **错误码:** @@ -778,7 +778,7 @@ hideKeyboard(callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | -------- | -| callback | AsyncCallback<void> | 否 | 回调函数。当输入法隐藏成功,err为undefined,否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当输入法隐藏成功,err为undefined,否则为错误对象。 | **示例:** @@ -1507,7 +1507,7 @@ try { **系统能力:** SystemCapability.MiscServices.InputMethodFramework -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ------------ | -------- | ---- | ---- | ------------------ | | enterKeyType | number | 是 | 否 | 编辑框的功能属性。 | | inputPattern | number | 是 | 否 | 编辑框的文本属性。 | @@ -1518,7 +1518,7 @@ try { **系统能力:** SystemCapability.MiscServices.InputMethodFramework -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | --------- | -------- | ---- | ---- | ------------ | | keyCode | number | 是 | 否 | 按键的键值。 | | keyAction | number | 是 | 否 | 按键的状态。 | -- GitLab