• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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 AbilityKit
19 */
20
21/*** if arkts 1.1 */
22import type { AbilityResult } from '../ability/abilityResult';
23/*** endif */
24
25/**
26 * The callback of UIAbility or UIExtensionAbility.
27 * @syscap SystemCapability.Ability.AbilityRuntime.Core
28 * @stagemodelonly
29 * @atomicservice
30 * @since arkts {'1.1':'11', '1.2':'20'}
31 * @arkts 1.1&1.2
32 */
33export default class AbilityStartCallback {
34
35  /**
36   * Called when some error occurred except disconnected from UIAbility or UIExtensionAbility.
37   *
38   * @param { number } code - The code returned if the UIAbility or UIExtensionAbility failed to start.
39   * @param { string } name - The name returned if the UIAbility or UIExtensionAbility failed to start.
40   * @param { string } message - The message returned if the UIAbility or UIExtensionAbility failed to start.
41   * @syscap SystemCapability.Ability.AbilityRuntime.Core
42   * @stagemodelonly
43   * @atomicservice
44   * @since 11
45   */
46  onError(code: number, name: string, message: string): void;
47
48  /**
49   * Called when UIExtensionAbility terminate with result.
50   *
51   * @param { AbilityResult } parameter - The parameter returned if the UIExtensionAbility call terminateSelfWithResult.
52   * @syscap SystemCapability.Ability.AbilityRuntime.Core
53   * @stagemodelonly
54   * @atomicservice
55   * @since 12
56   */
57  onResult?(parameter: AbilityResult): void;
58}
59