1/* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit TestKit 19 */ 20 21import { AbilityDelegator } from './application/AbilityDelegator'; 22import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; 23import { AbilityMonitor } from './application/AbilityMonitor'; 24import { ShellCmdResult } from './application/shellCmdResult'; 25 26/** 27 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 28 * during application startup. 29 * 30 * @namespace abilityDelegatorRegistry 31 * @syscap SystemCapability.Ability.AbilityRuntime.Core 32 * @since 8 33 * @deprecated since 9 34 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry 35 */ 36declare namespace abilityDelegatorRegistry { 37 /** 38 * Get the AbilityDelegator object of the application. 39 * 40 * @returns { AbilityDelegator } the AbilityDelegator object initialized when the application is started. 41 * @syscap SystemCapability.Ability.AbilityRuntime.Core 42 * @since 8 43 * @deprecated since 9 44 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry#getAbilityDelegator 45 */ 46 function getAbilityDelegator(): AbilityDelegator; 47 48 /** 49 * Get unit test parameters stored in the AbilityDelegatorArgs object. 50 * 51 * @returns { AbilityDelegatorArgs } the previously registered AbilityDelegatorArgs object. 52 * @syscap SystemCapability.Ability.AbilityRuntime.Core 53 * @since 8 54 * @deprecated since 9 55 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry#getArguments 56 */ 57 function getArguments(): AbilityDelegatorArgs; 58 59 /** 60 * Describes all lifecycle states of an ability. 61 * 62 * @enum { string } 63 * @syscap SystemCapability.Ability.AbilityRuntime.Core 64 * @since 8 65 * @deprecated since 9 66 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry#AbilityLifecycleState 67 */ 68 export enum AbilityLifecycleState { 69 /** 70 * Indicates an invalid state. 71 * 72 * @syscap SystemCapability.Ability.AbilityRuntime.Core 73 * @since 8 74 * @deprecated since 9 75 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState 76 * #UNINITIALIZED 77 */ 78 UNINITIALIZED, 79 80 /** 81 * Indicates that the Ability is in the created state. 82 * 83 * @syscap SystemCapability.Ability.AbilityRuntime.Core 84 * @since 8 85 * @deprecated since 9 86 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#CREATE 87 */ 88 CREATE, 89 90 /** 91 * Indicates that Ability is in the foreground state. 92 * 93 * @syscap SystemCapability.Ability.AbilityRuntime.Core 94 * @since 8 95 * @deprecated since 9 96 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#FOREGROUND 97 */ 98 FOREGROUND, 99 100 /** 101 * Indicates that the Ability is in the background state. 102 * 103 * @syscap SystemCapability.Ability.AbilityRuntime.Core 104 * @since 8 105 * @deprecated since 9 106 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#BACKGROUND 107 */ 108 BACKGROUND, 109 110 /** 111 * Indicates that the Ability is in a destroyed state. 112 * 113 * @syscap SystemCapability.Ability.AbilityRuntime.Core 114 * @since 8 115 * @deprecated since 9 116 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#DESTROY 117 */ 118 DESTROY 119 } 120} 121 122export default abilityDelegatorRegistry; 123