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 * SymbolGlyphModifier of PromptOptions. 103 * @type { ?SymbolGlyphModifier } 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @atomicservice 106 * @since 18 107 */ 108 symbolStyle?: SymbolGlyphModifier; 109 110 /** 111 * Tip text of PromptOptions. 112 * @type { ?ResourceStr } 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @crossplatform 115 * @since 11 116 */ 117 /** 118 * Tip text of PromptOptions. 119 * @type { ?ResourceStr } 120 * @syscap SystemCapability.ArkUI.ArkUI.Full 121 * @crossplatform 122 * @atomicservice 123 * @since 12 124 */ 125 tip?: ResourceStr; 126 127 /** 128 * Margin Type of ExceptionPrompt. 129 * @type { MarginType } 130 * @syscap SystemCapability.ArkUI.ArkUI.Full 131 * @crossplatform 132 * @since 11 133 */ 134 /** 135 * Margin Type of ExceptionPrompt. 136 * @type { MarginType } 137 * @syscap SystemCapability.ArkUI.ArkUI.Full 138 * @crossplatform 139 * @atomicservice 140 * @since 12 141 */ 142 marginType: MarginType; 143 144 /** 145 * Right icon button text of PromptOptions. 146 * @type { ?ResourceStr } 147 * @syscap SystemCapability.ArkUI.ArkUI.Full 148 * @crossplatform 149 * @since 11 150 */ 151 /** 152 * Right icon button text of PromptOptions. 153 * @type { ?ResourceStr } 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @crossplatform 156 * @atomicservice 157 * @since 12 158 */ 159 actionText?: ResourceStr; 160 161 /** 162 * Distance from the top of PromptOptions. 163 * @type { Dimension } 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @since 11 167 */ 168 /** 169 * Distance from the top of PromptOptions. 170 * @type { Dimension } 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @crossplatform 173 * @atomicservice 174 * @since 12 175 */ 176 marginTop: Dimension 177 178 /** 179 * Control concealment of PromptOptions. 180 * @type { boolean } 181 * @syscap SystemCapability.ArkUI.ArkUI.Full 182 * @crossplatform 183 * @since 11 184 */ 185 /** 186 * Control concealment of PromptOptions. 187 * @type { boolean } 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @crossplatform 190 * @atomicservice 191 * @since 12 192 */ 193 isShown?: boolean 194} 195 196/** 197 * Declare struct ExceptionPrompt higher-order component. 198 * @syscap SystemCapability.ArkUI.ArkUI.Full 199 * @crossplatform 200 * @since 11 201 */ 202 /** 203 * Declare struct ExceptionPrompt higher-order component. 204 * @syscap SystemCapability.ArkUI.ArkUI.Full 205 * @crossplatform 206 * @atomicservice 207 * @since 12 208 */ 209@Component 210export declare struct ExceptionPrompt { 211 212 /** 213 * Configuration information of ExceptionPrompt. 214 * @type { PromptOptions } 215 * @syscap SystemCapability.ArkUI.ArkUI.Full 216 * @crossplatform 217 * @since 11 218 */ 219 /** 220 * Configuration information of ExceptionPrompt. 221 * @type { PromptOptions } 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @atomicservice 225 * @since 12 226 */ 227 @Prop options: PromptOptions; 228 229 /** 230 * Callback when clicking the text on the left. 231 * @type { ?function } 232 * @syscap SystemCapability.ArkUI.ArkUI.Full 233 * @crossplatform 234 * @since 11 235 */ 236 /** 237 * Callback when clicking the text on the left. 238 * @type { ?function } 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @crossplatform 241 * @atomicservice 242 * @since 12 243 */ 244 onTipClick?: () => void; 245 246 /** 247 * Callback when click the icon button. 248 * @type { ?function } 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @crossplatform 251 * @since 11 252 */ 253 /** 254 * Callback when click the icon button. 255 * @type { ?function } 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @crossplatform 258 * @atomicservice 259 * @since 12 260 */ 261 onActionTextClick?: () => void; 262 263 /** 264 * 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. 265 * @type { function } 266 * @syscap SystemCapability.ArkUI.ArkUI.Full 267 * @crossplatform 268 * @since 11 269 */ 270 /** 271 * 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. 272 * @type { function } 273 * @syscap SystemCapability.ArkUI.ArkUI.Full 274 * @crossplatform 275 * @atomicservice 276 * @since 12 277 */ 278 build(): void; 279} 280