mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-23 15:20:17 +00:00
!6097 【sdk】【需求】imf_文本编辑一致性实现
Merge pull request !6097 from cy7717/master
This commit is contained in:
commit
58ade63967
72
api/@ohos.inputMethod.d.ts
vendored
72
api/@ohos.inputMethod.d.ts
vendored
@ -958,6 +958,78 @@ declare namespace inputMethod {
|
||||
* @since 10
|
||||
*/
|
||||
off(type: 'handleExtendAction'): void;
|
||||
|
||||
/**
|
||||
* Register a callback and when input method ability gets left text of cursor, the callback will be invoked.
|
||||
*
|
||||
* @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'.
|
||||
* @param { function } callback - processes getLeftTextOfCursor command. The callback
|
||||
* must be a synchronization method and will block the input method application.
|
||||
* @throws { BusinessError } 401 - parameter error.
|
||||
* @throws { BusinessError } 12800009 - input method client is detached.
|
||||
* @syscap SystemCapability.MiscServices.InputMethodFramework
|
||||
* @since 10
|
||||
*/
|
||||
on(type: 'getLeftTextOfCursor', callback: (length: number) => string): void;
|
||||
|
||||
/**
|
||||
* Unregister the callback of getLeftTextOfCursor event.
|
||||
*
|
||||
* @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'.
|
||||
* @param { function } [callback] - the callback of 'getLeftTextOfCursor',
|
||||
* when subscriber unsubscribes all callback functions of event 'getLeftTextOfCursor', this parameter can be left blank.
|
||||
* @syscap SystemCapability.MiscServices.InputMethodFramework
|
||||
* @since 10
|
||||
*/
|
||||
off(type: 'getLeftTextOfCursor', callback?: (length: number) => string): void;
|
||||
|
||||
/**
|
||||
* Register a callback and when input method ability gets right text of cursor, the callback will be invoked.
|
||||
*
|
||||
* @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'.
|
||||
* @param { function } callback - processes getRightTextOfCursor command. The callback
|
||||
* must be a synchronization method and will block the input method application.
|
||||
* @throws { BusinessError } 401 - parameter error.
|
||||
* @throws { BusinessError } 12800009 - input method client is detached.
|
||||
* @syscap SystemCapability.MiscServices.InputMethodFramework
|
||||
* @since 10
|
||||
*/
|
||||
on(type: 'getRightTextOfCursor', callback: (length: number) => string): void;
|
||||
|
||||
/**
|
||||
* Unregister the callback of getRightTextOfCursor event.
|
||||
*
|
||||
* @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'.
|
||||
* @param { function } [callback] - the callback of 'getRightTextOfCursor',
|
||||
* when subscriber unsubscribes all callback functions of event 'getRightTextOfCursor', this parameter can be left blank.
|
||||
* @syscap SystemCapability.MiscServices.InputMethodFramework
|
||||
* @since 10
|
||||
*/
|
||||
off(type: 'getRightTextOfCursor', callback?: (length: number) => string): void;
|
||||
|
||||
/**
|
||||
* Register a callback and when input method ability gets the text index at cursor, the callback will be invoked.
|
||||
*
|
||||
* @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'.
|
||||
* @param { function } callback - processes getTextIndexAtCursor command. The callback
|
||||
* must be a synchronization method, and should return the text index at the cursor.
|
||||
* @throws { BusinessError } 401 - parameter error.
|
||||
* @throws { BusinessError } 12800009 - input method client is detached.
|
||||
* @syscap SystemCapability.MiscServices.InputMethodFramework
|
||||
* @since 10
|
||||
*/
|
||||
on(type: 'getTextIndexAtCursor', callback: () => number): void;
|
||||
|
||||
/**
|
||||
* Unregister the callback of getTextIndexAtCursor.
|
||||
*
|
||||
* @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'.
|
||||
* @param { function } [callback] - the callback of 'getTextIndexAtCursor',
|
||||
* when subscriber unsubscribes all callback functions of event 'getTextIndexAtCursor', this parameter can be left blank.
|
||||
* @syscap SystemCapability.MiscServices.InputMethodFramework
|
||||
* @since 10
|
||||
*/
|
||||
off(type: 'getTextIndexAtCursor', callback?: () => number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user