From c849dcbeca5cc2d29b70408ecbddb871c78ec177 Mon Sep 17 00:00:00 2001 From: adelelimi Date: Mon, 8 Sep 2025 11:25:13 +0800 Subject: [PATCH] =?UTF-8?q?on=E3=80=81off=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: adelelimi --- api/@ohos.userIAM.userAuth.d.ts | 101 ++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 11 deletions(-) diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index 76be2628d1..7237d6baca 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -1795,11 +1795,24 @@ declare namespace userAuth { * @throws { BusinessError } 12500002 - General operation error. * @syscap SystemCapability.UserIAM.UserAuth.Core * @atomicservice - * @since arkts {'1.1':'12','1.2':'22'} - * @arkts 1.1&1.2 + * @since 12 dynamic */ on(type: 'result', callback: IAuthCallback): void; + /** + * Subscribes to the user authentication result. + * + * @param { IAuthCallback } callback - Callback used to return the user authentication result. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 22 static + */ + onResult(callback: IAuthCallback): void; + /** * Turn off widget authentication result event listening. * @@ -1829,11 +1842,28 @@ declare namespace userAuth { * @throws { BusinessError } 12500002 - General operation error. * @syscap SystemCapability.UserIAM.UserAuth.Core * @atomicservice - * @since arkts {'1.1':'12','1.2':'22'} - * @arkts 1.1&1.2 + * @since 12 dynamic */ off(type: 'result', callback?: IAuthCallback): void; + /** + * Unsubscribes from the user authentication result. + * + *

NOTE: + *
The UserAuthInstance instance used to invoke this API must be the one used to subscribe to the event. + *

+ * + * @param { IAuthCallback } callback - Callback to unregister. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 22 static + */ + offResult(callback?: IAuthCallback): void; + /** * Start this authentication, an instance can only perform authentication once. * @@ -1944,10 +1974,20 @@ declare namespace userAuth { * @throws { BusinessError } 12500002 - General operation error. * @syscap SystemCapability.UserIAM.UserAuth.Core * @atomicservice - * @since 20 + * @since 20 dynamic */ on(type: 'authTip', callback: AuthTipCallback): void; + /** + * Turn on authentication tip event listening. + * + * @param { AuthTipCallback } callback - Indicates the listener. + * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 22 static + */ + onAuthTip(callback: AuthTipCallback): void; + /** * Turn off authentication tip event listening. * @@ -1956,9 +1996,19 @@ declare namespace userAuth { * @throws { BusinessError } 12500002 - General operation error. * @syscap SystemCapability.UserIAM.UserAuth.Core * @atomicservice - * @since 20 + * @since 20 dynamic */ off(type: 'authTip', callback?: AuthTipCallback): void; + + /** + * Turn off authentication tip event listening. + * + * @param { AuthTipCallback } [callback] - Indicates the listener. + * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 22 static + */ + offAuthTip(callback?: AuthTipCallback): void; } /** @@ -2313,11 +2363,26 @@ declare namespace userAuth { * @throws { BusinessError } 12500002 - General operation error. * @syscap SystemCapability.UserIAM.UserAuth.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'10','1.2':'22'} - * @arkts 1.1&1.2 + * @since 10 dynamic */ on(type: 'command', callback: IAuthWidgetCallback): void; + /** + * Subscribes to commands from the user authentication framework for the user authentication widget. + * + * @param { IAuthWidgetCallback } callback - Callback used to return the command from the user authentication + * framework to the user authentication widget. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + onCommand(type: 'command', callback: IAuthWidgetCallback): void; + /** * Unsubscribes from commands sent from the user authentication framework. * @@ -2331,10 +2396,24 @@ declare namespace userAuth { * @throws { BusinessError } 12500002 - General operation error. * @syscap SystemCapability.UserIAM.UserAuth.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'10','1.2':'22'} - * @arkts 1.1&1.2 + * @since 10 dynamic + */ + off(callback?: IAuthWidgetCallback): void; + + /** + * Unsubscribes from commands sent from the user authentication framework. + * + * @param { IAuthWidgetCallback } callback - Callback to unregister. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @systemapi Hide this for inner system use. + * @since 22 static */ - off(type: 'command', callback?: IAuthWidgetCallback): void; + offCommand(callback?: IAuthWidgetCallback): void; } /** -- Gitee