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