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 16/** 17 * @file 18 * @kit TestKit 19 */ 20 21import { AbilityDelegator as _AbilityDelegator } from './application/AbilityDelegator'; 22import { AbilityDelegatorArgs as _AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; 23import { AbilityMonitor as _AbilityMonitor } from './application/AbilityMonitor'; 24import { AbilityStageMonitor as _AbilityStageMonitor } from './application/AbilityStageMonitor'; 25import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult'; 26 27/** 28 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 29 * during application startup. 30 * 31 * @namespace abilityDelegatorRegistry 32 * @syscap SystemCapability.Ability.AbilityRuntime.Core 33 * @since 9 34 */ 35/** 36 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 37 * during application startup. 38 * 39 * @namespace abilityDelegatorRegistry 40 * @syscap SystemCapability.Ability.AbilityRuntime.Core 41 * @crossplatform 42 * @since 10 43 */ 44/** 45 * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered 46 * during application startup. 47 * 48 * @namespace abilityDelegatorRegistry 49 * @syscap SystemCapability.Ability.AbilityRuntime.Core 50 * @crossplatform 51 * @atomicservice 52 * @since 11 53 */ 54declare namespace abilityDelegatorRegistry { 55 /** 56 * Get the AbilityDelegator object of the application. 57 * 58 * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. 59 * @syscap SystemCapability.Ability.AbilityRuntime.Core 60 * @since 9 61 */ 62 /** 63 * Get the AbilityDelegator object of the application. 64 * 65 * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. 66 * @syscap SystemCapability.Ability.AbilityRuntime.Core 67 * @crossplatform 68 * @since 10 69 */ 70 /** 71 * Get the AbilityDelegator object of the application. 72 * 73 * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. 74 * @syscap SystemCapability.Ability.AbilityRuntime.Core 75 * @crossplatform 76 * @atomicservice 77 * @since 11 78 */ 79 function getAbilityDelegator(): AbilityDelegator; 80 81 /** 82 * Get unit test arguments stored in the AbilityDelegatorArgs object. 83 * 84 * @returns { AbilityDelegatorArgs } Return the previously registered AbilityDelegatorArgs object. 85 * @syscap SystemCapability.Ability.AbilityRuntime.Core 86 * @since 9 87 */ 88 /** 89 * Get unit test arguments stored in the AbilityDelegatorArgs object. 90 * 91 * @returns { AbilityDelegatorArgs } Return the previously registered AbilityDelegatorArgs object. 92 * @syscap SystemCapability.Ability.AbilityRuntime.Core 93 * @crossplatform 94 * @since 10 95 */ 96 /** 97 * Get unit test arguments stored in the AbilityDelegatorArgs object. 98 * 99 * @returns { AbilityDelegatorArgs } Return the previously registered AbilityDelegatorArgs object. 100 * @syscap SystemCapability.Ability.AbilityRuntime.Core 101 * @crossplatform 102 * @atomicservice 103 * @since 11 104 */ 105 function getArguments(): AbilityDelegatorArgs; 106 107 /** 108 * Describes all lifecycle states of an ability. 109 * 110 * @enum { number } 111 * @syscap SystemCapability.Ability.AbilityRuntime.Core 112 * @since 9 113 */ 114 /** 115 * Describes all lifecycle states of an ability. 116 * 117 * @enum { number } 118 * @syscap SystemCapability.Ability.AbilityRuntime.Core 119 * @crossplatform 120 * @since 10 121 */ 122 /** 123 * Describes all lifecycle states of an ability. 124 * 125 * @enum { number } 126 * @syscap SystemCapability.Ability.AbilityRuntime.Core 127 * @crossplatform 128 * @atomicservice 129 * @since 11 130 */ 131 export enum AbilityLifecycleState { 132 /** 133 * Ability is in invalid state. 134 * 135 * @syscap SystemCapability.Ability.AbilityRuntime.Core 136 * @since 9 137 */ 138 /** 139 * Ability is in invalid state. 140 * 141 * @syscap SystemCapability.Ability.AbilityRuntime.Core 142 * @crossplatform 143 * @since 10 144 */ 145 /** 146 * Ability is in invalid state. 147 * 148 * @syscap SystemCapability.Ability.AbilityRuntime.Core 149 * @crossplatform 150 * @atomicservice 151 * @since 11 152 */ 153 UNINITIALIZED, 154 155 /** 156 * Ability is in the created state. 157 * 158 * @syscap SystemCapability.Ability.AbilityRuntime.Core 159 * @since 9 160 */ 161 /** 162 * Ability is in the created state. 163 * 164 * @syscap SystemCapability.Ability.AbilityRuntime.Core 165 * @crossplatform 166 * @since 10 167 */ 168 /** 169 * Ability is in the created state. 170 * 171 * @syscap SystemCapability.Ability.AbilityRuntime.Core 172 * @crossplatform 173 * @atomicservice 174 * @since 11 175 */ 176 CREATE, 177 178 /** 179 * Ability is in the foreground state. 180 * 181 * @syscap SystemCapability.Ability.AbilityRuntime.Core 182 * @since 9 183 */ 184 /** 185 * Ability is in the foreground state. 186 * 187 * @syscap SystemCapability.Ability.AbilityRuntime.Core 188 * @crossplatform 189 * @since 10 190 */ 191 /** 192 * Ability is in the foreground state. 193 * 194 * @syscap SystemCapability.Ability.AbilityRuntime.Core 195 * @crossplatform 196 * @atomicservice 197 * @since 11 198 */ 199 FOREGROUND, 200 201 /** 202 * Ability is in the background state. 203 * 204 * @syscap SystemCapability.Ability.AbilityRuntime.Core 205 * @since 9 206 */ 207 /** 208 * Ability is in the background state. 209 * 210 * @syscap SystemCapability.Ability.AbilityRuntime.Core 211 * @crossplatform 212 * @since 10 213 */ 214 /** 215 * Ability is in the background state. 216 * 217 * @syscap SystemCapability.Ability.AbilityRuntime.Core 218 * @crossplatform 219 * @atomicservice 220 * @since 11 221 */ 222 BACKGROUND, 223 224 /** 225 * Ability is in a destroyed state. 226 * 227 * @syscap SystemCapability.Ability.AbilityRuntime.Core 228 * @since 9 229 */ 230 /** 231 * Ability is in a destroyed state. 232 * 233 * @syscap SystemCapability.Ability.AbilityRuntime.Core 234 * @crossplatform 235 * @since 10 236 */ 237 /** 238 * Ability is in a destroyed state. 239 * 240 * @syscap SystemCapability.Ability.AbilityRuntime.Core 241 * @crossplatform 242 * @atomicservice 243 * @since 11 244 */ 245 DESTROY 246 } 247 248 /** 249 * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. 250 * 251 * @syscap SystemCapability.Ability.AbilityRuntime.Core 252 * @since 9 253 */ 254 /** 255 * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. 256 * 257 * @syscap SystemCapability.Ability.AbilityRuntime.Core 258 * @crossplatform 259 * @since 10 260 */ 261 /** 262 * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. 263 * 264 * @typedef { _AbilityDelegator } 265 * @syscap SystemCapability.Ability.AbilityRuntime.Core 266 * @crossplatform 267 * @atomicservice 268 * @since 11 269 */ 270 export type AbilityDelegator = _AbilityDelegator; 271 272 /** 273 * Store unit testing-related parameters, including test case names, and test runner name. 274 * 275 * @syscap SystemCapability.Ability.AbilityRuntime.Core 276 * @since 9 277 */ 278 /** 279 * Store unit testing-related parameters, including test case names, and test runner name. 280 * 281 * @syscap SystemCapability.Ability.AbilityRuntime.Core 282 * @crossplatform 283 * @since 10 284 */ 285 /** 286 * Store unit testing-related parameters, including test case names, and test runner name. 287 * 288 * @typedef { _AbilityDelegatorArgs } 289 * @syscap SystemCapability.Ability.AbilityRuntime.Core 290 * @crossplatform 291 * @atomicservice 292 * @since 11 293 */ 294 export type AbilityDelegatorArgs = _AbilityDelegatorArgs; 295 296 /** 297 * Provide methods for matching monitored Ability objects that meet specified conditions. 298 * The most recently matched Ability objects will be saved in the AbilityMonitor object. 299 * 300 * @syscap SystemCapability.Ability.AbilityRuntime.Core 301 * @since 9 302 */ 303 /** 304 * Provide methods for matching monitored Ability objects that meet specified conditions. 305 * The most recently matched Ability objects will be saved in the AbilityMonitor object. 306 * 307 * @syscap SystemCapability.Ability.AbilityRuntime.Core 308 * @crossplatform 309 * @since 10 310 */ 311 /** 312 * Provide methods for matching monitored Ability objects that meet specified conditions. 313 * The most recently matched Ability objects will be saved in the AbilityMonitor object. 314 * 315 * @typedef { _AbilityMonitor } 316 * @syscap SystemCapability.Ability.AbilityRuntime.Core 317 * @crossplatform 318 * @atomicservice 319 * @since 11 320 */ 321 export type AbilityMonitor = _AbilityMonitor; 322 323 /** 324 * A object that records the result of shell command executes. 325 * 326 * @syscap SystemCapability.Ability.AbilityRuntime.Core 327 * @since 9 328 */ 329 /** 330 * A object that records the result of shell command executes. 331 * 332 * @typedef { _ShellCmdResult } 333 * @syscap SystemCapability.Ability.AbilityRuntime.Core 334 * @atomicservice 335 * @since 11 336 */ 337 export type ShellCmdResult = _ShellCmdResult; 338 339 /** 340 * Provide methods for matching monitored AbilityStage objects that meet specified conditions. 341 * The most recently matched AbilityStage objects will be saved in the AbilityStageMonitor object. 342 * 343 * @typedef { _AbilityStageMonitor } 344 * @syscap SystemCapability.Ability.AbilityRuntime.Core 345 * @crossplatform 346 * @atomicservice 347 * @since 14 348 */ 349 export type AbilityStageMonitor = _AbilityStageMonitor; 350} 351 352export default abilityDelegatorRegistry; 353