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