1/* 2 * Copyright (c) 2025 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 { ElementName } from './bundleManager/ElementName'; 22 23/** 24 * CompletionHandler is a handler to handle the completion events of start ability. 25 * 26 * @syscap SystemCapability.Ability.AbilityRuntime.Core 27 * @stagemodelonly 28 * @atomicservice 29 * @since 20 30 */ 31export default class CompletionHandler { 32 /** 33 * Notify the success result of startAbility. 34 * 35 * @param { ElementName } elementName - Indicates the component to start. 36 * @param { string } message - Indicates the message of the request result. 37 * @syscap SystemCapability.Ability.AbilityRuntime.Core 38 * @stagemodelonly 39 * @atomicservice 40 * @since 20 41 */ 42 onRequestSuccess(elementName: ElementName, message: string): void; 43 44 /** 45 * Notify the failure result of startAbility. 46 * 47 * @param { ElementName } elementName - Indicates the component to start. 48 * @param { string } message - Indicates the message of the request result. 49 * @syscap SystemCapability.Ability.AbilityRuntime.Core 50 * @stagemodelonly 51 * @atomicservice 52 * @since 20 53 */ 54 onRequestFailure(elementName: ElementName, message: string): void; 55}