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 16/** 17 * The definition of AbilityConstant. 18 * @namespace AbilityConstant 19 * @syscap SystemCapability.Ability.AbilityRuntime.Core 20 * @StageModelOnly 21 * @since 9 22 */ 23declare namespace AbilityConstant { 24 /** 25 * Interface of launch param. 26 * @typedef LaunchParam 27 * @syscap SystemCapability.Ability.AbilityRuntime.Core 28 * @StageModelOnly 29 * @since 9 30 */ 31 export interface LaunchParam { 32 /** 33 * Indicates launch reason. 34 * @syscap SystemCapability.Ability.AbilityRuntime.Core 35 * @StageModelOnly 36 * @since 9 37 */ 38 launchReason: LaunchReason; 39 40 /** 41 * Indicates last exit reason. 42 * @syscap SystemCapability.Ability.AbilityRuntime.Core 43 * @StageModelOnly 44 * @since 9 45 */ 46 lastExitReason: LastExitReason; 47 } 48 49 /** 50 * Type of launch reason. 51 * @enum { number } 52 * @syscap SystemCapability.Ability.AbilityRuntime.Core 53 * @StageModelOnly 54 * @since 9 55 */ 56 export enum LaunchReason { 57 UNKNOWN = 0, 58 START_ABILITY = 1, 59 CALL = 2, 60 CONTINUATION = 3, 61 APP_RECOVERY = 4, 62 } 63 64 /** 65 * Type of last exit reason. 66 * @enum { number } 67 * @syscap SystemCapability.Ability.AbilityRuntime.Core 68 * @StageModelOnly 69 * @since 9 70 */ 71 export enum LastExitReason { 72 UNKNOWN = 0, 73 ABILITY_NOT_RESPONDING = 1, 74 NORMAL = 2, 75 } 76 77 /** 78 * Type of onContinue result. 79 * @enum { number } 80 * @syscap SystemCapability.Ability.AbilityRuntime.Core 81 * @StageModelOnly 82 * @since 9 83 */ 84 export enum OnContinueResult { 85 AGREE = 0, 86 REJECT = 1, 87 MISMATCH = 2, 88 } 89 90 /** 91 * Type of memory level. 92 * @enum { number } 93 * @syscap SystemCapability.Ability.AbilityRuntime.Core 94 * @StageModelOnly 95 * @since 9 96 */ 97 export enum MemoryLevel { 98 MEMORY_LEVEL_MODERATE = 0, 99 MEMORY_LEVEL_LOW = 1, 100 MEMORY_LEVEL_CRITICAL = 2, 101 } 102 103 /** 104 * Type of window mode. 105 * @enum { number } 106 * @syscap SystemCapability.Ability.AbilityRuntime.Core 107 * @systemapi 108 * @StageModelOnly 109 * @since 9 110 */ 111 export enum WindowMode { 112 WINDOW_MODE_UNDEFINED = 0, 113 WINDOW_MODE_FULLSCREEN = 1, 114 WINDOW_MODE_SPLIT_PRIMARY = 100, 115 WINDOW_MODE_SPLIT_SECONDARY = 101, 116 WINDOW_MODE_FLOATING = 102, 117 } 118 119 /** 120 * Type of onSave result. 121 * @enum { number } 122 * @syscap SystemCapability.Ability.AbilityRuntime.Core 123 * @StageModelOnly 124 * @since 9 125 */ 126 export enum OnSaveResult { 127 ALL_AGREE = 0, 128 CONTINUATION_REJECT = 1, 129 CONTINUATION_MISMATCH = 2, 130 RECOVERY_AGREE = 3, 131 RECOVERY_REJECT = 4, 132 ALL_REJECT, 133 } 134 135 /** 136 * Type of save state. 137 * @enum { number } 138 * @syscap SystemCapability.Ability.AbilityRuntime.Core 139 * @StageModelOnly 140 * @since 9 141 */ 142 export enum StateType { 143 CONTINUATION = 0, 144 APP_RECOVERY = 1, 145 } 146} 147 148export default AbilityConstant; 149