From e4c6220721708ab8dc1b355ea7487a4ecaaa501c Mon Sep 17 00:00:00 2001 From: njupthan Date: Mon, 28 Feb 2022 20:12:53 +0800 Subject: [PATCH 1/2] update d.ts file Signed-off-by: njupthan --- api/@ohos.application.Ability.d.ts | 77 ++++++++++++++++++++++------- api/application/AbilityContext.d.ts | 10 ++-- 2 files changed, 64 insertions(+), 23 deletions(-) diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 65963be527..9f98343b86 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -20,21 +20,54 @@ import window from './@ohos.window'; import { Configuration } from './@ohos.application.Configuration'; import rpc from '/@ohos.rpc'; +/** + * The prototype of the listener function interface registered by the Caller. + * + * @since 9 + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @param msg Monitor status notification information. + * @return - + * @StageModelOnly + */ +export interface OnReleaseCallBack { + (msg: string): void; +} + +/** + * The prototype of the message listener function interface registered by the Callee. + * + * @since 9 + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @param indata Notification data notified from the caller. + * @return rpc.Sequenceable + * @StageModelOnly + */ +export interface CaleeCallBack { + (indata: rpc.MessageParcel): rpc.Sequenceable; +} + /** * The interface of a Caller. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore * @devices phone, tablet, tv, wearable, car * @permission N/A * @StageModelOnly */ - interface Caller { +export interface Caller { /** * Notify the server of Sequenceable type data. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method The notification event string listened to by the callee. + * @param data Notification data to the callee. + * @return - * @StageModelOnly */ call(method: string, data: rpc.Sequenceable): Promise; @@ -43,8 +76,10 @@ import rpc from '/@ohos.rpc'; * Notify the server of Sequenceable type data and return the notification result. * * @since 9 - * @sysCap AAFwk - * return Sequenceable data + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method The notification event string listened to by the callee. + * @param data Notification data to the callee. + * @return Returns the callee's notification result data on success, and returns undefined on failure. * @StageModelOnly */ callWithResult(method: string, data: rpc.Sequenceable): Promise; @@ -53,8 +88,8 @@ import rpc from '/@ohos.rpc'; * Clear service records. * * @since 9 - * @sysCap AAFwk - * return Sequenceable data + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - * @StageModelOnly */ release(): void; @@ -63,38 +98,44 @@ import rpc from '/@ohos.rpc'; * Register death listener notification callback. * * @since 9 - * @sysCap AAFwk - * return Sequenceable data + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param callback Register a callback function for listening for notifications. + * @return - * @StageModelOnly */ - onRelease(callback: function): void; + onRelease(callback: OnReleaseCallBack): void; } /** * The interface of a Callee. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore * @devices phone, tablet, tv, wearable, car * @permission N/A * @StageModelOnly */ - interface Callee { +export interface Callee { /** * Register data listener callback. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method A string registered to listen for notification events. + * @param callback Register a callback function that listens for notification events. + * @return - * @StageModelOnly */ - on(method: string, callback: function): void; + on(method: string, callback: CaleeCallBack): void; /** * Unregister data listener callback. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method A string registered to listen for notification events. + * @return - * @StageModelOnly */ off(method: string): void; @@ -140,7 +181,7 @@ export default class Ability { * Call Service Stub Object. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ callee: Callee; @@ -221,7 +262,7 @@ export default class Ability { * * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -232,7 +273,7 @@ export default class Ability { * * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 442c46a5d0..df2e6292b9 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -56,7 +56,7 @@ export default class AbilityContext extends Context { * Indicates configuration information. * * @since 9 - * @sysCap AAFwk + * @sysCap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ config: Configuration; @@ -79,12 +79,12 @@ export default class AbilityContext extends Context { * * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk - * @param parameter Indicates the ability to start. - * @return Caller + * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @return Returns to the Caller interface on success Returns empty or undefined on failure * @StageModelOnly */ - startAbilityByCall(want: Want): Promise; + startAbilityByCall(want: Want): Promise; /** * Starts a new ability with account. -- Gitee From 1abcc570a6d3bf6edd76d40610a1a6d68f3af9a0 Mon Sep 17 00:00:00 2001 From: njupthan Date: Tue, 1 Mar 2022 13:36:50 +0800 Subject: [PATCH 2/2] update d.ts file Signed-off-by: njupthan --- api/@ohos.application.Ability.d.ts | 54 +++++++++++++---------------- api/application/AbilityContext.d.ts | 33 +++++++++--------- 2 files changed, 40 insertions(+), 47 deletions(-) diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 9f98343b86..7849829fcb 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -24,8 +24,7 @@ import rpc from '/@ohos.rpc'; * The prototype of the listener function interface registered by the Caller. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @param msg Monitor status notification information. * @return - @@ -39,8 +38,7 @@ export interface OnReleaseCallBack { * The prototype of the message listener function interface registered by the Callee. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @param indata Notification data notified from the caller. * @return rpc.Sequenceable @@ -54,8 +52,7 @@ export interface CaleeCallBack { * The interface of a Caller. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ @@ -64,7 +61,7 @@ export interface Caller { * Notify the server of Sequenceable type data. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @param method The notification event string listened to by the callee. * @param data Notification data to the callee. * @return - @@ -76,7 +73,7 @@ export interface Caller { * Notify the server of Sequenceable type data and return the notification result. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @param method The notification event string listened to by the callee. * @param data Notification data to the callee. * @return Returns the callee's notification result data on success, and returns undefined on failure. @@ -88,7 +85,7 @@ export interface Caller { * Clear service records. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -98,7 +95,7 @@ export interface Caller { * Register death listener notification callback. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @param callback Register a callback function for listening for notifications. * @return - * @StageModelOnly @@ -110,8 +107,7 @@ export interface Caller { * The interface of a Callee. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ @@ -121,7 +117,7 @@ export interface Callee { * Register data listener callback. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @param method A string registered to listen for notification events. * @param callback Register a callback function that listens for notification events. * @return - @@ -133,7 +129,7 @@ export interface Callee { * Unregister data listener callback. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @param method A string registered to listen for notification events. * @return - * @StageModelOnly @@ -145,7 +141,7 @@ export interface Callee { * The class of an ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ @@ -154,7 +150,7 @@ export default class Ability { * Indicates configuration information about an ability context. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ context: AbilityContext; @@ -163,7 +159,7 @@ export default class Ability { * Indicates ability launch want. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ launchWant: Want; @@ -172,7 +168,7 @@ export default class Ability { * Indicates ability last request want. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ lastRequestWant: Want; @@ -181,7 +177,7 @@ export default class Ability { * Call Service Stub Object. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ callee: Callee; @@ -190,7 +186,7 @@ export default class Ability { * Called back when an ability is started for initialization. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -200,7 +196,7 @@ export default class Ability { * Called back when an ability window stage is created. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -210,7 +206,7 @@ export default class Ability { * Called back when an ability window stage is destroyed. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -220,7 +216,7 @@ export default class Ability { * Called back before an ability is destroyed. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -230,7 +226,7 @@ export default class Ability { * Called back when the state of an ability changes to foreground. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -240,7 +236,7 @@ export default class Ability { * Called back when the state of an ability changes to background. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -250,7 +246,7 @@ export default class Ability { * Called back when an ability prepares to migrate. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return true if ability agrees to migrate and saves data successfully, otherwise false. * @StageModelOnly */ @@ -260,9 +256,8 @@ export default class Ability { * Called when the launch mode of an ability is set to singleton. * This happens when you re-launch an ability that has been at the top of the ability stack. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -271,9 +266,8 @@ export default class Ability { /** * Called when the system configuration is updated. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index df2e6292b9..8dbcd71363 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -29,7 +29,7 @@ import Caller from '../@ohos.application.Ability'; * The context of an ability. It allows access to ability-specific resources. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -38,7 +38,7 @@ export default class AbilityContext extends Context { * Indicates configuration information about an ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ abilityInfo: AbilityInfo; @@ -47,7 +47,7 @@ export default class AbilityContext extends Context { * Indicates configuration information about an module. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ currentHapModuleInfo: HapModuleInfo; @@ -56,7 +56,7 @@ export default class AbilityContext extends Context { * Indicates configuration information. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ config: Configuration; @@ -65,7 +65,7 @@ export default class AbilityContext extends Context { * Starts a new ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param parameter Indicates the ability to start. * @return - * @StageModelOnly @@ -77,9 +77,8 @@ export default class AbilityContext extends Context { /** * Get the caller object of the startup capability * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want Indicates the ability to start. * @return Returns to the Caller interface on success Returns empty or undefined on failure * @StageModelOnly @@ -90,7 +89,7 @@ export default class AbilityContext extends Context { * Starts a new ability with account. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want Indicates the want info to start. * @param want Indicates the account to start. * @systemapi hide for inner use. @@ -105,7 +104,7 @@ export default class AbilityContext extends Context { * Starts an ability and returns the execution result when the ability is destroyed. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param parameter Indicates the ability to start. * @return Returns the {@link AbilityResult}. * @StageModelOnly @@ -118,7 +117,7 @@ export default class AbilityContext extends Context { * Starts an ability and returns the execution result when the ability is destroyed with account. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want Indicates the want info to start. * @param want Indicates the account to start. * @systemapi hide for inner use. @@ -133,7 +132,7 @@ export default class AbilityContext extends Context { * Destroys this Page ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return - * @StageModelOnly */ @@ -145,7 +144,7 @@ export default class AbilityContext extends Context { * and destroys this Page ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param parameter Indicates the result to return. * @return - * @StageModelOnly @@ -157,7 +156,7 @@ export default class AbilityContext extends Context { * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want The element name of the service ability * @param options The remote object instance * @hide hide for inner use. @@ -170,7 +169,7 @@ export default class AbilityContext extends Context { * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want The element name of the service ability * @param options The remote object instance * @param accountId The account to connect @@ -184,7 +183,7 @@ export default class AbilityContext extends Context { * The callback interface was connect successfully. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param connection The number code of the ability connected * @hide hide for inner use. * @StageModelOnly @@ -196,7 +195,7 @@ export default class AbilityContext extends Context { * Set mission label of current ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param label The label of ability that showed in recent missions. * @StageModelOnly */ @@ -207,7 +206,7 @@ export default class AbilityContext extends Context { * Requests certain permissions from the system. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null or empty. * @StageModelOnly */ -- Gitee