1/* 2 * Copyright (c) 2022 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 * @namespace abilityDelegatorRegistry 25 * @syscap SystemCapability.Ability.AbilityRuntime.Core 26 * @since 9 27 */ 28declare namespace abilityDelegatorRegistry { 29 /** 30 * Get the AbilityDelegator object of the application. 31 * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. 32 * @syscap SystemCapability.Ability.AbilityRuntime.Core 33 * @since 9 34 */ 35 function getAbilityDelegator(): AbilityDelegator; 36 37 /** 38 * Get unit test arguments stored in the AbilityDelegatorArgs object. 39 * @returns { AbilityDelegator } Return the previously registered AbilityDelegatorArgs object. 40 * @syscap SystemCapability.Ability.AbilityRuntime.Core 41 * @since 9 42 */ 43 function getArguments(): AbilityDelegatorArgs; 44 45 /** 46 * Describes all lifecycle states of an ability. 47 * @enum { number } 48 * @syscap SystemCapability.Ability.AbilityRuntime.Core 49 * @since 9 50 */ 51 export enum AbilityLifecycleState { 52 UNINITIALIZED, 53 CREATE, 54 FOREGROUND, 55 BACKGROUND, 56 DESTROY, 57 } 58 59 /** 60 * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. 61 * @syscap SystemCapability.Ability.AbilityRuntime.Core 62 * @since 9 63 */ 64 export type AbilityDelegator = _AbilityDelegator 65 66 /** 67 * Store unit testing-related parameters, including test case names, and test runner name. 68 * @syscap SystemCapability.Ability.AbilityRuntime.Core 69 * @since 9 70 */ 71 export type AbilityDelegatorArgs = _AbilityDelegatorArgs 72 73 /** 74 * Provide methods for matching monitored Ability objects that meet specified conditions. 75 * The most recently matched Ability objects will be saved in the AbilityMonitor object. 76 * @syscap SystemCapability.Ability.AbilityRuntime.Core 77 * @since 9 78 */ 79 export type AbilityMonitor = _AbilityMonitor 80 81 /** 82 * A object that records the result of shell command executes. 83 * @syscap SystemCapability.Ability.AbilityRuntime.Core 84 * @since 9 85 */ 86 export type ShellCmdResult = _ShellCmdResult 87 88 /** 89 * Indicates the type of daltonization color filter. 90 * 91 * @systemapi 92 */ 93 type DaltonizationColorFilter = 'Normal' | 'Protanomaly' | 'Deuteranomaly' | 'Tritanomaly'; 94} 95 96export default abilityDelegatorRegistry;