From 6538ca5f261ae70f32f6660aff2df96ff388d576 Mon Sep 17 00:00:00 2001 From: Hollokin Date: Mon, 28 Nov 2022 11:25:56 +0800 Subject: [PATCH] =?UTF-8?q?fixed=2054d544a=20from=20https://gitee.com/holl?= =?UTF-8?q?okin/interface=5Fsdk-js/pulls/3554=20=E3=80=90=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=B3=95=E6=A1=86=E6=9E=B6=E3=80=91API9=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hollokin --- api/@ohos.inputmethod.d.ts | 70 +++++++++------------- api/@ohos.inputmethodengine.d.ts | 28 ++++----- api/@ohos.inputmethodextensionability.d.ts | 2 - api/@ohos.inputmethodextensioncontext.d.ts | 3 +- 4 files changed, 40 insertions(+), 63 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 55afa0702a..889302a66d 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -48,7 +48,7 @@ declare namespace inputMethod { /** * Input method setting * @since 9 - * @return :- + * @returns { InputMethodSetting } the object of InputMethodSetting. * @throws {BusinessError} 12800007 - settings extension error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -57,7 +57,7 @@ declare namespace inputMethod { /** * Input method controller * @since 9 - * @return :- + * @returns { InputMethodController } the object of InputMethodController. * @throws {BusinessError} 12800006 - input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -65,15 +65,15 @@ declare namespace inputMethod { /** * Switch input method - * @since 9 - * @param target Indicates the input method which will replace the current one - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY + * @param { InputMethodProperty } [target] - indicates the input method which will replace the current one. + * @param { AsyncCallback } [callback] - the callback of switchInputMethod. * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 9 */ function switchInputMethod(target: InputMethodProperty, callback: AsyncCallback): void; @@ -81,7 +81,7 @@ declare namespace inputMethod { * Switch input method * @since 9 * @param target Indicates the input method which will replace the current one - * @return :- + * @returns { Promise } the promise returned by the function. * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. @@ -94,7 +94,7 @@ declare namespace inputMethod { /** * Get current input method * @since 9 - * @return The InputMethodProperty object of the current input method + * @returns { InputMethodProperty } the property of current inputmethod. * @syscap SystemCapability.MiscServices.InputMethodFramework */ function getCurrentInputMethod(): InputMethodProperty; @@ -103,7 +103,6 @@ declare namespace inputMethod { * Switch current input method subtype * @since 9 * @param target Indicates the input method subtype which will replace the current one - * @return success or fail * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. @@ -117,7 +116,7 @@ declare namespace inputMethod { * Switch current input method subtype * @since 9 * @param target Indicates the input method subtype which will replace the current one - * @return success or fail + * @returns { Promise } the promise returned by the function. * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. @@ -130,7 +129,7 @@ declare namespace inputMethod { /** * Get the current input method subtype * @since 9 - * @return The InputMethodSubtype object of the current input method + * @returns { InputMethodSubtype } the subtype of the current input method. * @syscap SystemCapability.MiscServices.InputMethodFramework */ function getCurrentInputMethodSubtype(): InputMethodSubtype; @@ -140,7 +139,6 @@ declare namespace inputMethod { * @since 9 * @param inputMethodProperty Indicates the target input method * @param inputMethodSubtype Indicates the target input method subtype - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. @@ -151,11 +149,11 @@ declare namespace inputMethod { function switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback): void; /** - * Switch input method and subtype + * Switch input method and subtype. * @since 9 - * @param inputMethodProperty Indicates the target input method - * @param inputMethodSubtype Indicates the target input method subtype - * @return :- + * @param inputMethodProperty Indicates the target input method. + * @param inputMethodSubtype Indicates the target input method subtype. + * @returns { Promise } the promise returned by the function. * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. @@ -170,28 +168,25 @@ declare namespace inputMethod { */ interface InputMethodSetting { /** - * Subscribe input method or subtype change + * Subscribe input method or subtype change. * @since 9 - * @param type Indicates the event type - * @return :- + * @param type Indicates the event type. * @syscap SystemCapability.MiscServices.InputMethodFramework */ on(type: 'imeChange', callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void; /** - * Unsubscribe input method or subtype change + * Unsubscribe input method or subtype change. * @since 9 - * @param type Indicates the event type - * @return :- + * @param type Indicates the event type. * @syscap SystemCapability.MiscServices.InputMethodFramework */ off(type: 'imeChange', callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void; /** - * List subtype of the specified input method + * List subtype of the specified input method. * @since 9 - * @param inputMethodProperty Indicates the specified input method - * @return :- + * @param inputMethodProperty Indicates the specified input method. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -200,10 +195,10 @@ declare namespace inputMethod { listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback>): void; /** - * List subtype of the specified input method + * List subtype of the specified input method. * @since 9 - * @param inputMethodProperty Indicates the specified input method - * @return :- + * @param inputMethodProperty Indicates the specified input method. + * @returns { Promise> } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -214,7 +209,6 @@ declare namespace inputMethod { /** * List subtype of current input method * @since 9 - * @return :- * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -224,7 +218,7 @@ declare namespace inputMethod { /** * List subtype of current input method * @since 9 - * @return :- + * @returns { Promise> } the promise returned by the function. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -237,7 +231,6 @@ declare namespace inputMethod { * @param enable : * If true, collect enabled input methods. * If false, collect disabled input methods. - * @return :- * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -251,7 +244,7 @@ declare namespace inputMethod { * @param enable : * If true, collect enabled input methods. * If false, collect disabled input methods. - * @return :- + * @returns { Promise> } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -275,7 +268,6 @@ declare namespace inputMethod { /** * Show input method setting extension dialog * @since 9 - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800008 - input method manager service error. @@ -286,8 +278,8 @@ declare namespace inputMethod { /** * Show input method setting extension dialog * @since 9 - * @return - * @permission ohos.permission.CONNECT_IME_ABILITY + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -316,7 +308,6 @@ declare namespace inputMethod { /** * Stop input * @since 9 - * @return :- * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -327,7 +318,7 @@ declare namespace inputMethod { /** * Stop input * @since 9 - * @return :- + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -340,7 +331,6 @@ declare namespace inputMethod { * @since 6 * @deprecated since 9 * @useinstead ohos.inputmethod.InputMethodController.stopInputSession - * @return :- * @syscap SystemCapability.MiscServices.InputMethodFramework */ stopInput(callback: AsyncCallback): void; @@ -348,9 +338,9 @@ declare namespace inputMethod { /** * Stop input * @since 6 + * @returns { Promise } the promise returned by the function. * @deprecated since 9 * @useinstead ohos.inputmethod.InputMethodController.stopInputSession - * @return :- * @syscap SystemCapability.MiscServices.InputMethodFramework */ stopInput(): Promise; @@ -358,7 +348,6 @@ declare namespace inputMethod { /** * Show soft keyboard * @since 9 - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800003 - input method client error. @@ -370,8 +359,8 @@ declare namespace inputMethod { /** * Show soft keyboard * @since 9 - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -382,7 +371,6 @@ declare namespace inputMethod { /** * Hide soft keyboard * @since 9 - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800003 - input method client error. @@ -394,8 +382,8 @@ declare namespace inputMethod { /** * Hide soft keyboard * @since 9 - * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 00f2ac215d..8862cb7401 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -216,7 +216,7 @@ declare namespace inputMethodEngine { /** * @since 9 - * @return InputMethodAbility object of the current input method + * @returns { InputMethodAbility } the object of the InputMethodAbility. * @syscap SystemCapability.MiscServices.InputMethodFramework */ function getInputMethodAbility(): InputMethodAbility; @@ -230,7 +230,7 @@ declare namespace inputMethodEngine { /** * @since 9 - * @return KeyboardDelegate object of the current input method + * @returns { KeyboardDelegate } the object of KeyboardDelegate. * @syscap SystemCapability.MiscServices.InputMethodFramework */ function getKeyboardDelegate(): KeyboardDelegate; @@ -284,7 +284,6 @@ declare namespace inputMethodEngine { * @since 8 * @param type inputStart * @param callback give keyboard controller and text input client - * @return :- */ on(type: 'inputStart', callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; @@ -293,7 +292,6 @@ declare namespace inputMethodEngine { * @since 8 * @param type inputStart * @param callback optional, give keyboard controller and text input client - * @return :- */ off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; @@ -301,7 +299,6 @@ declare namespace inputMethodEngine { * Subscribe 'keyboardShow'|'keyboardHide' * @since 8 * @param type keyboardShow|keyboardHide - * @return :- */ on(type: 'keyboardShow'|'keyboardHide', callback: () => void): void; @@ -309,7 +306,6 @@ declare namespace inputMethodEngine { * Unsubscribe 'keyboardShow'|'keyboardHide' * @since 8 * @param type keyboardShow|keyboardHide - * @return :- */ off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void; } @@ -324,7 +320,6 @@ declare namespace inputMethodEngine { * @since 9 * @param type inputStart * @param callback give keyboard controller and text input client - * @return :- */ on(type: 'inputStart', callback: (kbController: KeyboardController, inputClient: InputClient) => void): void; @@ -333,7 +328,6 @@ declare namespace inputMethodEngine { * @since 9 * @param type inputStart * @param callback optional, give keyboard controller and text input client - * @return :- */ off(type: 'inputStart', callback?: (kbController: KeyboardController, inputClient: InputClient) => void): void; @@ -342,7 +336,6 @@ declare namespace inputMethodEngine { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param type inputStop - * @return :- */ on(type: 'inputStop', callback: () => void): void; @@ -351,7 +344,6 @@ declare namespace inputMethodEngine { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param type inputStop - * @return :- */ off(type: 'inputStop', callback: () => void): void; @@ -360,7 +352,6 @@ declare namespace inputMethodEngine { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param type setCallingWindow - * @return :- */ on(type: 'setCallingWindow', callback: (wid:number) => void): void; @@ -369,7 +360,6 @@ declare namespace inputMethodEngine { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param type setCallingWindow - * @return :- */ off(type: 'setCallingWindow', callback: (wid:number) => void): void; @@ -377,7 +367,6 @@ declare namespace inputMethodEngine { * Subscribe 'keyboardShow'|'keyboardHide' * @since 9 * @param type keyboardShow|keyboardHide - * @return :- */ on(type: 'keyboardShow'|'keyboardHide', callback: () => void): void; @@ -385,14 +374,12 @@ declare namespace inputMethodEngine { * Unsubscribe 'keyboardShow'|'keyboardHide' * @since 9 * @param type keyboardShow|keyboardHide - * @return :- */ off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void; /** * Subscribe 'setSubtype' * @since 9 - * @return :- * @syscap SystemCapability.MiscServices.InputMethodFramework */ on(type: 'setSubtype', callback: (inputMethodSubtype: InputMethodSubtype) => void): void; @@ -400,7 +387,6 @@ declare namespace inputMethodEngine { /** * Unsubscribe 'setSubtype' * @since 9 - * @return :- * @syscap SystemCapability.MiscServices.InputMethodFramework */ off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void; @@ -526,6 +512,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -543,6 +530,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. @@ -561,6 +549,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. @@ -579,6 +568,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. @@ -597,6 +587,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800006 - Input method controller error. @@ -615,6 +606,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800006 - Input method controller error. @@ -631,6 +623,7 @@ declare namespace inputMethodEngine { /** * @since 9 + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -642,7 +635,6 @@ declare namespace inputMethodEngine { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param direction Indicates the distance of cursor to be moved. - * @return - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. */ @@ -654,7 +646,7 @@ declare namespace inputMethodEngine { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param direction Indicates the distance of cursor to be moved. - * @return - + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. */ diff --git a/api/@ohos.inputmethodextensionability.d.ts b/api/@ohos.inputmethodextensionability.d.ts index 5961f6e39d..4b5833f896 100644 --- a/api/@ohos.inputmethodextensionability.d.ts +++ b/api/@ohos.inputmethodextensionability.d.ts @@ -37,7 +37,6 @@ export default class InputMethodExtensionAbility { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @param want Indicates the want of created service extension. - * @return - * @throws {BusinessError} 401 - parameter error. */ onCreate(want: Want): void; @@ -47,7 +46,6 @@ export default class InputMethodExtensionAbility { * * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework - * @return - * @throws {BusinessError} 401 - parameter error. */ onDestroy(): void; diff --git a/api/@ohos.inputmethodextensioncontext.d.ts b/api/@ohos.inputmethodextensioncontext.d.ts index c6521740a9..3c6c488624 100644 --- a/api/@ohos.inputmethodextensioncontext.d.ts +++ b/api/@ohos.inputmethodextensioncontext.d.ts @@ -30,7 +30,6 @@ export default class InputMethodExtensionContext extends ExtensionContext { * * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework - * @return - */ destroy(callback: AsyncCallback): void; @@ -39,7 +38,7 @@ export default class InputMethodExtensionContext extends ExtensionContext { * * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework - * @return - + * @returns { Promise } the promise returned by the function. */ destroy(): Promise; } \ No newline at end of file -- Gitee