diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts index c2fa8b68e6bd28f59065e8c2208ac58e34295bf9..cd7a48c6b10060fc550ca180aad6b6e4a93355c0 100644 --- a/api/@ohos.application.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AbilityDelegator } from './application/abilityDelegator' -import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs' +import { AbilityDelegator } from './application/abilityDelegator'; +import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; /** * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index ccd8607a7f0fb4f954951c3cc8e57012e3d85be2..d40f9e07a8e17e93c44dcef10954c41a3ed51d1a 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -14,10 +14,11 @@ */ import { AsyncCallback } from '../basic'; -import { Ability } from '../@ohos.application.Ability' -import { AbilityMonitor } from './abilityMonitor' -import { Context } from '../app/context' -import { ShellCmdResult } from './shellCmdResult' +import Ability from '../@ohos.application.Ability'; +import { AbilityMonitor } from './abilityMonitor'; +import { Context } from '../app/context'; +import Want from "../@ohos.application.Want"; +import { ShellCmdResult } from './shellCmdResult'; /** * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. @@ -90,6 +91,17 @@ export interface AbilityDelegator { getCurrentTopAbility(callback: AsyncCallback): void; getCurrentTopAbility(): Promise + /** + * Start a new ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start + * @return - + */ + startAbility(want: Want, callback: AsyncCallback): void; + startAbility(want: Want): Promise; + /** * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. * @@ -137,12 +149,11 @@ export interface AbilityDelegator { executeShellCommand(cmd: string, timeoutSecs?: number): Promise; /** - * Prints log information to the unit testing console. + * Finish the test and print log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. * - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. * @param msg Log information * @param code Result code */ diff --git a/api/application/abilityMonitor.d.ts b/api/application/abilityMonitor.d.ts index 81806c4369611e8fb3aaefa64ab368a0c452dc68..6af8397d2af4374028708d8c240d8dcc38d3f524 100644 --- a/api/application/abilityMonitor.d.ts +++ b/api/application/abilityMonitor.d.ts @@ -13,6 +13,8 @@ * limitations under the License. */ +import Ability from '../@ohos.application.Ability'; + /** * Provide methods for matching monitored Ability objects that meet specified conditions. * The most recently matched Ability objects will be saved in the AbilityMonitor object. @@ -37,7 +39,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityCreate?:() => void; + onAbilityCreate?:(data: Ability) => void; /** * Called back when the state of the ability changes to foreground. @@ -45,7 +47,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityForeground?:() => void; + onAbilityForeground?:(data: Ability) => void; /** * Called back when the state of the ability changes to background. @@ -53,7 +55,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityBackground?:() => void; + onAbilityBackground?:(data: Ability) => void; /** * Called back before the ability is destroyed. @@ -61,7 +63,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityDestroy?:() => void; + onAbilityDestroy?:(data: Ability) => void; /** * Called back when an ability window stage is created. @@ -69,7 +71,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageCreate?:() => void; + onWindowStageCreate?:(data: Ability) => void; /** * Called back when an ability window stage is restored. @@ -77,7 +79,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageRestore?:() => void; + onWindowStageRestore?:(data: Ability) => void; /** * Called back when an ability window stage is destroyed. @@ -85,7 +87,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageDestroy?:() => void; + onWindowStageDestroy?:(data: Ability) => void; } export default AbilityMonitor; \ No newline at end of file diff --git a/api/application/shellCmdResult.d.ts b/api/application/shellCmdResult.d.ts index 78e64926aba74fcb5ac9ee25788916e4a13b6c02..8ba156f4ad07d84107a206642fda79da850261bc 100644 --- a/api/application/shellCmdResult.d.ts +++ b/api/application/shellCmdResult.d.ts @@ -28,7 +28,7 @@ export interface ShellCmdResult { * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - stdResult: String; + stdResult: string; /** * shell cmd exec result.