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 */ 19 20import { AbilityDelegator } from './application/AbilityDelegator'; 21import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; 22import { AbilityMonitor } from './application/AbilityMonitor'; 23import { ShellCmdResult } from './application/shellCmdResult'; 24 25/** 26 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 27 * during application startup. 28 * 29 * @namespace abilityDelegatorRegistry 30 * @syscap SystemCapability.Ability.AbilityRuntime.Core 31 * @since 8 32 * @deprecated since 9 33 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry 34 */ 35declare namespace abilityDelegatorRegistry { 36 /** 37 * Get the AbilityDelegator object of the application. 38 * 39 * @returns { AbilityDelegator } the AbilityDelegator object initialized when the application is started. 40 * @syscap SystemCapability.Ability.AbilityRuntime.Core 41 * @since 8 42 * @deprecated since 9 43 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry#getAbilityDelegator 44 */ 45 function getAbilityDelegator(): AbilityDelegator; 46 47 /** 48 * Get unit test parameters stored in the AbilityDelegatorArgs object. 49 * 50 * @returns { AbilityDelegatorArgs } the previously registered AbilityDelegatorArgs object. 51 * @syscap SystemCapability.Ability.AbilityRuntime.Core 52 * @since 8 53 * @deprecated since 9 54 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry#getArguments 55 */ 56 function getArguments(): AbilityDelegatorArgs; 57 58 /** 59 * Describes all lifecycle states of an ability. 60 * 61 * @enum { string } 62 * @syscap SystemCapability.Ability.AbilityRuntime.Core 63 * @since 8 64 * @deprecated since 9 65 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry#AbilityLifecycleState 66 */ 67 export enum AbilityLifecycleState { 68 /** 69 * Indicates an invalid state. 70 * 71 * @syscap SystemCapability.Ability.AbilityRuntime.Core 72 * @since 8 73 * @deprecated since 9 74 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState 75 * #UNINITIALIZED 76 */ 77 UNINITIALIZED, 78 79 /** 80 * Indicates that the Ability is in the created state. 81 * 82 * @syscap SystemCapability.Ability.AbilityRuntime.Core 83 * @since 8 84 * @deprecated since 9 85 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#CREATE 86 */ 87 CREATE, 88 89 /** 90 * Indicates that Ability is in the foreground state. 91 * 92 * @syscap SystemCapability.Ability.AbilityRuntime.Core 93 * @since 8 94 * @deprecated since 9 95 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#FOREGROUND 96 */ 97 FOREGROUND, 98 99 /** 100 * Indicates that the Ability is in the background state. 101 * 102 * @syscap SystemCapability.Ability.AbilityRuntime.Core 103 * @since 8 104 * @deprecated since 9 105 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#BACKGROUND 106 */ 107 BACKGROUND, 108 109 /** 110 * Indicates that the Ability is in a destroyed state. 111 * 112 * @syscap SystemCapability.Ability.AbilityRuntime.Core 113 * @since 8 114 * @deprecated since 9 115 * @useinstead ohos.app.ability.abilityDelegatorRegistry/abilityDelegatorRegistry.AbilityLifecycleState#DESTROY 116 */ 117 DESTROY 118 } 119} 120 121export default abilityDelegatorRegistry; 122