From 05d9ddd43e680bca852ad057d701df024f81a7f3 Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Tue, 5 Aug 2025 16:12:55 +0800 Subject: [PATCH] connectOptions method to property Signed-off-by: zhangzezhong --- api/ability/connectOptions.d.ts | 40 ++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/api/ability/connectOptions.d.ts b/api/ability/connectOptions.d.ts index ba55aa9e5d..585efa7efc 100644 --- a/api/ability/connectOptions.d.ts +++ b/api/ability/connectOptions.d.ts @@ -45,11 +45,21 @@ export interface ConnectOptions { * @param { ElementName } elementName - The ohos.bundleManager.ElementName object of the service ability * @param { rpc.IRemoteObject } remote - The remote object instance * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onConnect(elementName: ElementName, remote: rpc.IRemoteObject): void; + /** + * The callback interface was connect successfully. + * + * @param { ElementName } elementName - The ohos.bundleManager.ElementName object of the service ability + * @param { rpc.IRemoteObject } remote - The remote object instance + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 20 + * @arkts 1.2 + */ + onConnect: (elementName: ElementName, remote: rpc.IRemoteObject) => void; + /** * The callback interface was disconnect successfully. * @@ -62,18 +72,36 @@ export interface ConnectOptions { * * @param { ElementName } elementName - The ohos.bundleManager.ElementName object of the service ability * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onDisconnect(elementName: ElementName): void; + /** + * The callback interface was disconnect successfully. + * + * @param { ElementName } elementName - The ohos.bundleManager.ElementName object of the service ability + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 20 + * @arkts 1.2 + */ + onDisconnect: (elementName: ElementName) => void; + /** * The callback interface was connect failed. * * @param { int } code - The error code of the failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since arkts {'1.1':'7', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 7 */ onFailed(code: int): void; + + /** + * The callback interface was connect failed. + * + * @param { int } code - The error code of the failed. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 20 + * @arkts 1.2 + */ + onFailed: (code: int) => void; } -- Gitee