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 ArkUI 19 */ 20 21/** 22 * Control margin status of ExceptionPrompt. 23 * @enum { number } 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @crossplatform 26 * @since 11 27 */ 28 /** 29 * Control margin status of ExceptionPrompt. 30 * @enum { number } 31 * @syscap SystemCapability.ArkUI.ArkUI.Full 32 * @crossplatform 33 * @atomicservice 34 * @since 12 35 */ 36export declare enum MarginType { 37 /** 38 * Default margin of MarginType,Margin 1: references ohos_id_card_margin_start, margin 2: references ohos_id_card_margin_end. 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @crossplatform 41 * @since 11 42 */ 43 /** 44 * Default margin of MarginType,Margin 1: references ohos_id_card_margin_start, margin 2: references ohos_id_card_margin_end. 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @crossplatform 47 * @atomicservice 48 * @since 12 49 */ 50 DEFAULT_MARGIN = 0, 51 52 /** 53 * Margins can be adapted of MarginType,Margin 1: references ohos_id_max_padding_start, margin 2: references ohos_id_max_padding_end. 54 * @syscap SystemCapability.ArkUI.ArkUI.Full 55 * @crossplatform 56 * @since 11 57 */ 58 /** 59 * Margins can be adapted of MarginType,Margin 1: references ohos_id_max_padding_start, margin 2: references ohos_id_max_padding_end. 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @atomicservice 63 * @since 12 64 */ 65 FIT_MARGIN = 1, 66} 67 68/** 69 * Configuration parameter of ExceptionPrompt. 70 * @interface PromptOptions 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @crossplatform 73 * @since 11 74 */ 75 /** 76 * Configuration parameter of ExceptionPrompt. 77 * @interface PromptOptions 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @atomicservice 81 * @since 12 82 */ 83export interface PromptOptions { 84 /** 85 * Icon of PromptOptions. 86 * @type { ?ResourceStr } 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @crossplatform 89 * @since 11 90 */ 91 /** 92 * Icon of PromptOptions. 93 * @type { ?ResourceStr } 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @crossplatform 96 * @atomicservice 97 * @since 12 98 */ 99 icon?: ResourceStr; 100 101 /** 102 * Tip text of PromptOptions. 103 * @type { ?ResourceStr } 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @crossplatform 106 * @since 11 107 */ 108 /** 109 * Tip text of PromptOptions. 110 * @type { ?ResourceStr } 111 * @syscap SystemCapability.ArkUI.ArkUI.Full 112 * @crossplatform 113 * @atomicservice 114 * @since 12 115 */ 116 tip?: ResourceStr; 117 118 /** 119 * Margin Type of ExceptionPrompt. 120 * @type { MarginType } 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @crossplatform 123 * @since 11 124 */ 125 /** 126 * Margin Type of ExceptionPrompt. 127 * @type { MarginType } 128 * @syscap SystemCapability.ArkUI.ArkUI.Full 129 * @crossplatform 130 * @atomicservice 131 * @since 12 132 */ 133 marginType: MarginType; 134 135 /** 136 * Right icon button text of PromptOptions. 137 * @type { ?ResourceStr } 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @crossplatform 140 * @since 11 141 */ 142 /** 143 * Right icon button text of PromptOptions. 144 * @type { ?ResourceStr } 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @crossplatform 147 * @atomicservice 148 * @since 12 149 */ 150 actionText?: ResourceStr; 151 152 /** 153 * Distance from the top of PromptOptions. 154 * @type { Dimension } 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @since 11 158 */ 159 /** 160 * Distance from the top of PromptOptions. 161 * @type { Dimension } 162 * @syscap SystemCapability.ArkUI.ArkUI.Full 163 * @crossplatform 164 * @atomicservice 165 * @since 12 166 */ 167 marginTop: Dimension 168 169 /** 170 * Control concealment of PromptOptions. 171 * @type { boolean } 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @crossplatform 174 * @since 11 175 */ 176 /** 177 * Control concealment of PromptOptions. 178 * @type { boolean } 179 * @syscap SystemCapability.ArkUI.ArkUI.Full 180 * @crossplatform 181 * @atomicservice 182 * @since 12 183 */ 184 isShown?: boolean 185} 186 187/** 188 * Declare struct ExceptionPrompt higher-order component. 189 * @syscap SystemCapability.ArkUI.ArkUI.Full 190 * @crossplatform 191 * @since 11 192 */ 193 /** 194 * Declare struct ExceptionPrompt higher-order component. 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @atomicservice 198 * @since 12 199 */ 200@Component 201export declare struct ExceptionPrompt { 202 203 /** 204 * Configuration information of ExceptionPrompt. 205 * @type { PromptOptions } 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @since 11 209 */ 210 /** 211 * Configuration information of ExceptionPrompt. 212 * @type { PromptOptions } 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @crossplatform 215 * @atomicservice 216 * @since 12 217 */ 218 @Prop options: PromptOptions; 219 220 /** 221 * Callback when clicking the text on the left. 222 * @type { ?function } 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @crossplatform 225 * @since 11 226 */ 227 /** 228 * Callback when clicking the text on the left. 229 * @type { ?function } 230 * @syscap SystemCapability.ArkUI.ArkUI.Full 231 * @crossplatform 232 * @atomicservice 233 * @since 12 234 */ 235 onTipClick?: () => void; 236 237 /** 238 * Callback when click the icon button. 239 * @type { ?function } 240 * @syscap SystemCapability.ArkUI.ArkUI.Full 241 * @crossplatform 242 * @since 11 243 */ 244 /** 245 * Callback when click the icon button. 246 * @type { ?function } 247 * @syscap SystemCapability.ArkUI.ArkUI.Full 248 * @crossplatform 249 * @atomicservice 250 * @since 12 251 */ 252 onActionTextClick?: () => void; 253 254 /** 255 * The build function is a member function that must return an ArkTS component type (Element) to represent the component to be rendered as a user interface. 256 * @type { function } 257 * @syscap SystemCapability.ArkUI.ArkUI.Full 258 * @crossplatform 259 * @since 11 260 */ 261 /** 262 * The build function is a member function that must return an ArkTS component type (Element) to represent the component to be rendered as a user interface. 263 * @type { function } 264 * @syscap SystemCapability.ArkUI.ArkUI.Full 265 * @crossplatform 266 * @atomicservice 267 * @since 12 268 */ 269 build(): void; 270} 271