diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 65963be527b5e0901076ed6d413728e4407f4a79..7849829fcb6889e30852277f01bbf2e2bdc92de6 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -20,21 +20,51 @@ 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 + * @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 + * @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 - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @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 +73,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 +85,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 +95,43 @@ 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 - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @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; @@ -104,7 +141,7 @@ import rpc from '/@ohos.rpc'; * The class of an ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ @@ -113,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; @@ -122,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; @@ -131,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; @@ -140,7 +177,7 @@ export default class Ability { * Call Service Stub Object. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ callee: Callee; @@ -149,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 */ @@ -159,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 */ @@ -169,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 */ @@ -179,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 */ @@ -189,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 */ @@ -199,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 */ @@ -209,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 */ @@ -219,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 AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -230,9 +266,8 @@ export default class Ability { /** * Called when the system configuration is updated. * - * @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 442c46a5d07d4cb904e775c2375a2ff8223c8c7b..8dbcd71363bf51a7cf11e6cbfaa10b394ce31608 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 AAFwk + * @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,20 +77,19 @@ export default class AbilityContext extends Context { /** * Get the caller object of the startup capability * - * @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. * * @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 */