未验证 提交 d37d67ba 编写于 作者: O openharmony_ci 提交者: Gitee

!21310 输入法框架,接口变更changelog中少了一个off('handleExtendAction')的接口

Merge pull request !21310 from guojin31/master
...@@ -1821,7 +1821,7 @@ inputMethodController.off('deleteRight'); ...@@ -1821,7 +1821,7 @@ inputMethodController.off('deleteRight');
### on('sendKeyboardStatus')<sup>10+</sup> ### on('sendKeyboardStatus')<sup>10+</sup>
on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => void): void on(type: 'sendKeyboardStatus', callback: (keyboardStatus: KeyboardStatus) => void): void
订阅输入法应用发送键盘状态事件。使用callback异步回调。 订阅输入法应用发送键盘状态事件。使用callback异步回调。
...@@ -1832,7 +1832,7 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi ...@@ -1832,7 +1832,7 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------ | ---- | ---- | | -------- | ------ | ---- | ---- |
| type | string | 是 | 设置监听类型。<br/>- type为‘sendKeyboardStatus’时表示订阅输入法应用发送键盘状态事件监听。 | | type | string | 是 | 设置监听类型。<br/>- type为‘sendKeyboardStatus’时表示订阅输入法应用发送键盘状态事件监听。 |
| callback | (keyBoardStatus: [KeyboardStatus](#keyboardstatus10)) => void | 是 | 回调函数,返回键盘状态。<br/>开发者需要在回调函数中根据传入的键盘状态做相应动作。 | | callback | (keyboardStatus: [KeyboardStatus](#keyboardstatus10)) => void | 是 | 回调函数,返回键盘状态。<br/>开发者需要在回调函数中根据传入的键盘状态做相应动作。 |
**错误码:** **错误码:**
...@@ -1846,8 +1846,8 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi ...@@ -1846,8 +1846,8 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
```js ```js
try { try {
inputMethodController.on('sendKeyboardStatus', (keyBoardStatus) => { inputMethodController.on('sendKeyboardStatus', (keyboardStatus) => {
console.log(`Succeeded in subscribing sendKeyboardStatus, keyBoardStatus: ${keyBoardStatus}`); console.log(`Succeeded in subscribing sendKeyboardStatus, keyboardStatus: ${keyboardStatus}`);
}); });
} catch(err) { } catch(err) {
console.error(`Failed to subscribe sendKeyboardStatus: ${JSON.stringify(err)}`); console.error(`Failed to subscribe sendKeyboardStatus: ${JSON.stringify(err)}`);
...@@ -1856,7 +1856,7 @@ try { ...@@ -1856,7 +1856,7 @@ try {
### off('sendKeyboardStatus')<sup>10+</sup> ### off('sendKeyboardStatus')<sup>10+</sup>
off(type: 'sendKeyboardStatus', callback?: (keyBoardStatus: KeyboardStatus) => void): void off(type: 'sendKeyboardStatus', callback?: (keyboardStatus: KeyboardStatus) => void): void
取消订阅输入法应用发送键盘状态事件。 取消订阅输入法应用发送键盘状态事件。
...@@ -1867,13 +1867,13 @@ off(type: 'sendKeyboardStatus', callback?: (keyBoardStatus: KeyboardStatus) => v ...@@ -1867,13 +1867,13 @@ off(type: 'sendKeyboardStatus', callback?: (keyBoardStatus: KeyboardStatus) => v
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 设置监听类型。<br/>- type为‘sendKeyboardStatus’时表示取消订阅输入法应用发送键盘状态事件监听。 | | type | string | 是 | 设置监听类型。<br/>- type为‘sendKeyboardStatus’时表示取消订阅输入法应用发送键盘状态事件监听。 |
| callback | (keyBoardStatus: [KeyboardStatus](#keyboardstatus10)) => void | 否 | 取消订阅的回调函数,需要与on接口传入的保持一致。当该参数不填写时,取消订阅type对应的所有回调事件。 | | callback | (keyboardStatus: [KeyboardStatus](#keyboardstatus10)) => void | 否 | 取消订阅的回调函数,需要与on接口传入的保持一致。当该参数不填写时,取消订阅type对应的所有回调事件。 |
**示例:** **示例:**
```js ```js
let onSendKeyboardStatus = (keyBoardStatus: KeyboardStatus) => { let onSendKeyboardStatus = (keyboardStatus: KeyboardStatus) => {
console.log(`Succeeded in subscribing sendKeyboardStatus, keyBoardStatus: ${keyBoardStatus}`); console.log(`Succeeded in subscribing sendKeyboardStatus, keyboardStatus: ${keyboardStatus}`);
}; };
inputMethodController.off('sendKeyboardStatus', onSendKeyboardStatus); inputMethodController.off('sendKeyboardStatus', onSendKeyboardStatus);
inputMethodController.off('sendKeyboardStatus'); inputMethodController.off('sendKeyboardStatus');
...@@ -2935,4 +2935,4 @@ inputMethodSetting.displayOptionalInputMethod().then(() => { ...@@ -2935,4 +2935,4 @@ inputMethodSetting.displayOptionalInputMethod().then(() => {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to displayOptionalInputMethod: ${JSON.stringify(err)}`); console.error(`Failed to displayOptionalInputMethod: ${JSON.stringify(err)}`);
}) })
``` ```
\ No newline at end of file
...@@ -21,9 +21,10 @@ off接口新增需要取消订阅的回调函数作为可选参数,需要与on ...@@ -21,9 +21,10 @@ off接口新增需要取消订阅的回调函数作为可选参数,需要与on
| off('insertText') | off(type: 'insertText'): void | off(type: 'insertText', callback?: (text: string) => void): void | | off('insertText') | off(type: 'insertText'): void | off(type: 'insertText', callback?: (text: string) => void): void |
| off('deleteLeft') | off(type: 'deleteLeft'): void | off(type: 'deleteLeft', callback?: (length: number) => void): void | | off('deleteLeft') | off(type: 'deleteLeft'): void | off(type: 'deleteLeft', callback?: (length: number) => void): void |
| off('deleteRight') | off(type: 'deleteRight'): void | off(type: 'deleteRight', callback?: (length: number) => void): void | | off('deleteRight') | off(type: 'deleteRight'): void | off(type: 'deleteRight', callback?: (length: number) => void): void |
| off('sendKeyboardStatus') | off(type: 'sendKeyboardStatus'): void | off(type: 'sendKeyboardStatus', callback?: (keyBoardStatus: KeyboardStatus) => void): void | | off('sendKeyboardStatus') | off(type: 'sendKeyboardStatus'): void | off(type: 'sendKeyboardStatus', callback?: (keyboardStatus: KeyboardStatus) => void): void |
| off('sendFunctionKey') | off(type: 'sendFunctionKey'): void | off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void | | off('sendFunctionKey') | off(type: 'sendFunctionKey'): void | off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void |
| off('moveCursor') | off(type: 'moveCursor'): void | off(type: 'moveCursor', callback?: (direction: Direction) => void): void | | off('moveCursor') | off(type: 'moveCursor'): void | off(type: 'moveCursor', callback?: (direction: Direction) => void): void |
| off('handleExtendAction') | off(type: 'handleExtendAction'): void | off(type: 'handleExtendAction', callback?: (action: ExtendAction) => void): void |
| off('selectByRange') | off(type: 'selectByRange'): void | off(type: 'selectByRange', callback?: Callback\<Range\>): void | | off('selectByRange') | off(type: 'selectByRange'): void | off(type: 'selectByRange', callback?: Callback\<Range\>): void |
| off('selectByMovement') | off(type: 'selectByMovement'): void | off(type: 'selectByMovement', callback?: Callback\<Movement\>): void | | off('selectByMovement') | off(type: 'selectByMovement'): void | off(type: 'selectByMovement', callback?: Callback\<Movement\>): void |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册