1/* 2 * Copyright (c) 2022-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 16import { AbilityDelegator as _AbilityDelegator } from './application/AbilityDelegator'; 17import { AbilityDelegatorArgs as _AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; 18import { AbilityMonitor as _AbilityMonitor } from './application/AbilityMonitor'; 19import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult'; 20 21/** 22 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 23 * during application startup. 24 * 25 * @namespace abilityDelegatorRegistry 26 * @syscap SystemCapability.Ability.AbilityRuntime.Core 27 * @since 9 28 */ 29/** 30 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 31 * during application startup. 32 * 33 * @namespace abilityDelegatorRegistry 34 * @syscap SystemCapability.Ability.AbilityRuntime.Core 35 * @crossplatform 36 * @since 10 37 */ 38declare namespace abilityDelegatorRegistry { 39 /** 40 * Get the AbilityDelegator object of the application. 41 * 42 * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. 43 * @syscap SystemCapability.Ability.AbilityRuntime.Core 44 * @since 9 45 */ 46 /** 47 * Get the AbilityDelegator object of the application. 48 * 49 * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. 50 * @syscap SystemCapability.Ability.AbilityRuntime.Core 51 * @crossplatform 52 * @since 10 53 */ 54 function getAbilityDelegator(): AbilityDelegator; 55 56 /** 57 * Get unit test arguments stored in the AbilityDelegatorArgs object. 58 * 59 * @returns { AbilityDelegatorArgs } Return the previously registered AbilityDelegatorArgs object. 60 * @syscap SystemCapability.Ability.AbilityRuntime.Core 61 * @since 9 62 */ 63 /** 64 * Get unit test arguments stored in the AbilityDelegatorArgs object. 65 * 66 * @returns { AbilityDelegatorArgs } Return the previously registered AbilityDelegatorArgs object. 67 * @syscap SystemCapability.Ability.AbilityRuntime.Core 68 * @crossplatform 69 * @since 10 70 */ 71 function getArguments(): AbilityDelegatorArgs; 72 73 /** 74 * Describes all lifecycle states of an ability. 75 * 76 * @enum { number } 77 * @syscap SystemCapability.Ability.AbilityRuntime.Core 78 * @since 9 79 */ 80 /** 81 * Describes all lifecycle states of an ability. 82 * 83 * @enum { number } 84 * @syscap SystemCapability.Ability.AbilityRuntime.Core 85 * @crossplatform 86 * @since 10 87 */ 88 export enum AbilityLifecycleState { 89 /** 90 * Ability is in invalid state. 91 * 92 * @syscap SystemCapability.Ability.AbilityRuntime.Core 93 * @since 9 94 */ 95 /** 96 * Ability is in invalid state. 97 * 98 * @syscap SystemCapability.Ability.AbilityRuntime.Core 99 * @crossplatform 100 * @since 10 101 */ 102 UNINITIALIZED, 103 104 /** 105 * Ability is in the created state. 106 * 107 * @syscap SystemCapability.Ability.AbilityRuntime.Core 108 * @since 9 109 */ 110 /** 111 * Ability is in the created state. 112 * 113 * @syscap SystemCapability.Ability.AbilityRuntime.Core 114 * @crossplatform 115 * @since 10 116 */ 117 CREATE, 118 119 /** 120 * Ability is in the foreground state. 121 * 122 * @syscap SystemCapability.Ability.AbilityRuntime.Core 123 * @since 9 124 */ 125 /** 126 * Ability is in the foreground state. 127 * 128 * @syscap SystemCapability.Ability.AbilityRuntime.Core 129 * @crossplatform 130 * @since 10 131 */ 132 FOREGROUND, 133 134 /** 135 * Ability is in the background state. 136 * 137 * @syscap SystemCapability.Ability.AbilityRuntime.Core 138 * @since 9 139 */ 140 /** 141 * Ability is in the background state. 142 * 143 * @syscap SystemCapability.Ability.AbilityRuntime.Core 144 * @crossplatform 145 * @since 10 146 */ 147 BACKGROUND, 148 149 /** 150 * Ability is in a destroyed state. 151 * 152 * @syscap SystemCapability.Ability.AbilityRuntime.Core 153 * @since 9 154 */ 155 /** 156 * Ability is in a destroyed state. 157 * 158 * @syscap SystemCapability.Ability.AbilityRuntime.Core 159 * @crossplatform 160 * @since 10 161 */ 162 DESTROY 163 } 164 165 /** 166 * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. 167 * 168 * @syscap SystemCapability.Ability.AbilityRuntime.Core 169 * @since 9 170 */ 171 /** 172 * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. 173 * 174 * @syscap SystemCapability.Ability.AbilityRuntime.Core 175 * @crossplatform 176 * @since 10 177 */ 178 export type AbilityDelegator = _AbilityDelegator; 179 180 /** 181 * Store unit testing-related parameters, including test case names, and test runner name. 182 * 183 * @syscap SystemCapability.Ability.AbilityRuntime.Core 184 * @since 9 185 */ 186 /** 187 * Store unit testing-related parameters, including test case names, and test runner name. 188 * 189 * @syscap SystemCapability.Ability.AbilityRuntime.Core 190 * @crossplatform 191 * @since 10 192 */ 193 export type AbilityDelegatorArgs = _AbilityDelegatorArgs; 194 195 /** 196 * Provide methods for matching monitored Ability objects that meet specified conditions. 197 * The most recently matched Ability objects will be saved in the AbilityMonitor object. 198 * 199 * @syscap SystemCapability.Ability.AbilityRuntime.Core 200 * @since 9 201 */ 202 /** 203 * Provide methods for matching monitored Ability objects that meet specified conditions. 204 * The most recently matched Ability objects will be saved in the AbilityMonitor object. 205 * 206 * @syscap SystemCapability.Ability.AbilityRuntime.Core 207 * @crossplatform 208 * @since 10 209 */ 210 export type AbilityMonitor = _AbilityMonitor; 211 212 /** 213 * A object that records the result of shell command executes. 214 * 215 * @syscap SystemCapability.Ability.AbilityRuntime.Core 216 * @since 9 217 */ 218 export type ShellCmdResult = _ShellCmdResult; 219} 220 221export default abilityDelegatorRegistry; 222