1/* 2 * Copyright (c) 2021-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 * Defines the options of CustomDialogController. 18 * 19 * @interface CustomDialogControllerOptions 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23/** 24 * Defines the options of CustomDialogController. 25 * 26 * @interface CustomDialogControllerOptions 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31declare interface CustomDialogControllerOptions { 32 /** 33 * Custom builder function. 34 * 35 * @type { any } 36 * @syscap SystemCapability.ArkUI.ArkUI.Full 37 * @since 7 38 */ 39 /** 40 * Custom builder function. 41 * 42 * @type { any } 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 10 46 */ 47 builder: any; 48 49 /** 50 * Defines the cancel function. 51 * 52 * @type { ?function } 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @since 7 55 */ 56 /** 57 * Defines the cancel function. 58 * 59 * @type { ?function } 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 */ 64 cancel?: () => void; 65 66 /** 67 * Defines if use auto cancel when click on the outside of the dialog. 68 * 69 * @type { ?boolean } 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @since 7 72 */ 73 /** 74 * Defines if use auto cancel when click on the outside of the dialog. 75 * 76 * @type { ?boolean } 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @crossplatform 79 * @since 10 80 */ 81 autoCancel?: boolean; 82 83 /** 84 * Defines the dialog alignment of the screen. 85 * 86 * @type { ?DialogAlignment } 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @since 7 89 */ 90 /** 91 * Defines the dialog alignment of the screen. 92 * 93 * @type { ?DialogAlignment } 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @crossplatform 96 * @since 10 97 */ 98 alignment?: DialogAlignment; 99 100 /** 101 * Defines the dialog offset. 102 * 103 * @type { ?Offset } 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @since 7 106 */ 107 /** 108 * Defines the dialog offset. 109 * 110 * @type { ?Offset } 111 * @syscap SystemCapability.ArkUI.ArkUI.Full 112 * @crossplatform 113 * @since 10 114 */ 115 offset?: Offset; 116 117 /** 118 * Defines if use custom style. 119 * 120 * @type { ?boolean } 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @since 7 123 */ 124 /** 125 * Defines if use custom style. 126 * 127 * @type { ?boolean } 128 * @syscap SystemCapability.ArkUI.ArkUI.Full 129 * @crossplatform 130 * @since 10 131 */ 132 customStyle?: boolean; 133 134 /** 135 * Grid count of dialog. 136 * 137 * @type { ?number } 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @since 8 140 */ 141 /** 142 * Grid count of dialog. 143 * 144 * @type { ?number } 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @crossplatform 147 * @since 10 148 */ 149 gridCount?: number; 150 151 /** 152 * Mask color of dialog. 153 * 154 * @type { ?ResourceColor } 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @since 10 158 */ 159 maskColor?: ResourceColor; 160 161 /** 162 * Mask Region of dialog. The size cannot exceed the main window. 163 * 164 * @type { ?Rectangle } 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @crossplatform 167 * @since 10 168 */ 169 maskRect?: Rectangle; 170 171 /** 172 * Animation parameters of dialog opening. 173 * 174 * @type { ?AnimateParam } 175 * @syscap SystemCapability.ArkUI.ArkUI.Full 176 * @crossplatform 177 * @since 10 178 */ 179 openAnimation?: AnimateParam; 180 181 /** 182 * Animation parameters of dialog closing. 183 * 184 * @type { ?AnimateParam } 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @crossplatform 187 * @since 10 188 */ 189 closeAnimation?: AnimateParam; 190 191 /** 192 * Whether to display in the sub window. 193 * 194 * @type { ?boolean } 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @since 10 198 */ 199 showInSubWindow?: boolean; 200 201 /** 202 * Background color of dialog. 203 * 204 * @type { ?ResourceColor } 205 * @syscap SystemCapability.ArkUI.ArkUI.Full 206 * @crossplatform 207 * @since 10 208 */ 209 backgroundColor?: ResourceColor; 210 211 /** 212 * Corner radius of dialog. 213 * 214 * @type { ?(Dimension | BorderRadiuses) } 215 * @syscap SystemCapability.ArkUI.ArkUI.Full 216 * @crossplatform 217 * @since 10 218 */ 219 cornerRadius?: Dimension | BorderRadiuses; 220 221} 222 223/** 224 * Use the CustomDialogController class to display the custom pop-up window. 225 * 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @since 7 228 */ 229/** 230 * Use the CustomDialogController class to display the custom pop-up window. 231 * 232 * @syscap SystemCapability.ArkUI.ArkUI.Full 233 * @crossplatform 234 * @since 10 235 */ 236declare class CustomDialogController { 237 /** 238 * The constructor transfers parameter settings. 239 * 240 * @param { CustomDialogControllerOptions } value 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @since 7 243 */ 244 /** 245 * The constructor transfers parameter settings. 246 * 247 * @param { CustomDialogControllerOptions } value 248 * @syscap SystemCapability.ArkUI.ArkUI.Full 249 * @crossplatform 250 * @since 10 251 */ 252 constructor(value: CustomDialogControllerOptions); 253 254 /** 255 * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. 256 * 257 * @syscap SystemCapability.ArkUI.ArkUI.Full 258 * @since 7 259 */ 260 /** 261 * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. 262 * 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @crossplatform 265 * @since 10 266 */ 267 open(); 268 269 /** 270 * Closes the custom pop-up window. If the window is closed, the window does not take effect. 271 * 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @since 7 274 */ 275 /** 276 * Closes the custom pop-up window. If the window is closed, the window does not take effect. 277 * 278 * @syscap SystemCapability.ArkUI.ArkUI.Full 279 * @crossplatform 280 * @since 10 281 */ 282 close(); 283} 284