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 * The information of sheet. 18 * 19 * @interface SheetInfo 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 8 22 */ 23/** 24 * The information of sheet. 25 * 26 * @interface SheetInfo 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31interface SheetInfo { 32 /** 33 * Title Properties 34 * 35 * @type { string | Resource } 36 * @syscap SystemCapability.ArkUI.ArkUI.Full 37 * @since 8 38 */ 39 /** 40 * Title Properties 41 * 42 * @type { string | Resource } 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 10 46 */ 47 title: string | Resource; 48 49 /** 50 * Icon Properties. 51 * 52 * @type { ?(string | Resource) } 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @since 8 55 */ 56 /** 57 * Icon Properties. 58 * 59 * @type { ?(string | Resource) } 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 */ 64 icon?: string | Resource; 65 66 /** 67 * Callback method after the operation. 68 * 69 * @type { function } 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @since 8 72 */ 73 /** 74 * Callback method after the operation. 75 * 76 * @type { function } 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @crossplatform 79 * @since 10 80 */ 81 action: () => void; 82} 83 84/** 85 * The options of ActionSheet. 86 * 87 * @interface ActionSheetOptions 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @since 8 90 */ 91/** 92 * The options of ActionSheet. 93 * 94 * @interface ActionSheetOptions 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @crossplatform 97 * @since 10 98 */ 99interface ActionSheetOptions 100{ 101 /** 102 * Title Properties 103 * 104 * @type { string | Resource } 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 8 107 */ 108 /** 109 * Title Properties 110 * 111 * @type { string | Resource } 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @crossplatform 114 * @since 10 115 */ 116 title: string | Resource; 117 118 /** 119 * Subtitle Properties 120 * @type { ?ResourceStr } 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @crossplatform 123 * @since 10 124 */ 125 subtitle?: ResourceStr; 126 127 /** 128 * message Properties 129 * 130 * @type { string | Resource } 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @since 8 133 */ 134 /** 135 * message Properties 136 * 137 * @type { string | Resource } 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @crossplatform 140 * @since 10 141 */ 142 message: string | Resource; 143 144 /** 145 * Invoke the commit function. 146 * 147 * @type { ?object } 148 * @syscap SystemCapability.ArkUI.ArkUI.Full 149 * @since 8 150 */ 151 /** 152 * Invoke the commit function. 153 * 154 * @type { ?object } 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @since 10 158 */ 159 confirm?: { 160 /** 161 * Enable switch of confirmation button 162 * @type { ?boolean } 163 * @default true 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @since 10 167 */ 168 enabled?: boolean; 169 170 /** 171 * Default focus switch of confirmation button 172 * @type { ?boolean } 173 * @default false 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @crossplatform 176 * @since 10 177 */ 178 defaultFocus?: boolean; 179 180 /** 181 * Style of confirmation button. 182 * @type { ?DialogButtonStyle } 183 * @default DialogButtonStyle.DEFAULT 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @crossplatform 186 * @since 10 187 */ 188 style?: DialogButtonStyle; 189 190 /** 191 * Text content of the confirmation button. 192 * 193 * @type { string | Resource } 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @since 8 196 */ 197 /** 198 * Text content of the confirmation button. 199 * 200 * @type { string | Resource } 201 * @syscap SystemCapability.ArkUI.ArkUI.Full 202 * @crossplatform 203 * @since 10 204 */ 205 value: string | Resource; 206 207 /** 208 * Method executed by the callback. 209 * 210 * @type { function } 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @since 8 213 */ 214 /** 215 * Method executed by the callback. 216 * 217 * @type { function } 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @crossplatform 220 * @since 10 221 */ 222 action: () => void; 223 }; 224 225 /** 226 * Execute Cancel Function. 227 * 228 * @type { ?function } 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @since 8 231 */ 232 /** 233 * Execute Cancel Function. 234 * 235 * @type { ?function } 236 * @syscap SystemCapability.ArkUI.ArkUI.Full 237 * @crossplatform 238 * @since 10 239 */ 240 cancel?: () => void; 241 242 /** 243 * The Array of sheets 244 * 245 * @type { Array<SheetInfo> } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @since 8 248 */ 249 /** 250 * The Array of sheets 251 * 252 * @type { Array<SheetInfo> } 253 * @syscap SystemCapability.ArkUI.ArkUI.Full 254 * @crossplatform 255 * @since 10 256 */ 257 sheets: Array<SheetInfo>; 258 259 /** 260 * Allows users to click the mask layer to exit. 261 * 262 * @type { ?boolean } 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @since 8 265 */ 266 /** 267 * Allows users to click the mask layer to exit. 268 * 269 * @type { ?boolean } 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @since 10 273 */ 274 autoCancel?: boolean; 275 276 /** 277 * Alignment in the vertical direction. 278 * 279 * @type { ?DialogAlignment } 280 * @syscap SystemCapability.ArkUI.ArkUI.Full 281 * @since 8 282 */ 283 /** 284 * Alignment in the vertical direction. 285 * 286 * @type { ?DialogAlignment } 287 * @syscap SystemCapability.ArkUI.ArkUI.Full 288 * @crossplatform 289 * @since 10 290 */ 291 alignment?: DialogAlignment; 292 293 /** 294 * Offset of the pop-up window relative to the alignment position. 295 * 296 * @type { ?object } 297 * @syscap SystemCapability.ArkUI.ArkUI.Full 298 * @since 8 299 */ 300 /** 301 * Offset of the pop-up window relative to the alignment position. 302 * 303 * @type { ?object } 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @crossplatform 306 * @since 10 307 */ 308 offset?: { dx: number | string | Resource; dy: number | string | Resource }; 309 310 /** 311 * Mask Region of dialog. The size cannot exceed the main window. 312 * 313 * @type { ?Rectangle } 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @since 10 317 */ 318 maskRect?: Rectangle; 319} 320 321/** 322 * Declare the ActionSheet 323 * 324 * @syscap SystemCapability.ArkUI.ArkUI.Full 325 * @since 8 326 */ 327/** 328 * Declare the ActionSheet 329 * 330 * @syscap SystemCapability.ArkUI.ArkUI.Full 331 * @crossplatform 332 * @since 10 333 */ 334declare class ActionSheet { 335 /** 336 * Invoking method display. 337 * 338 * @param { ActionSheetOptions } value 339 * @syscap SystemCapability.ArkUI.ArkUI.Full 340 * @since 8 341 */ 342 /** 343 * Invoking method display. 344 * 345 * @param { ActionSheetOptions } value 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @crossplatform 348 * @since 10 349 */ 350 static show(value: ActionSheetOptions); 351} 352 353declare module "actionSheetParam" { 354 module "actionSheetParam" { 355 // @ts-ignore 356 export { ActionSheetOptions }; 357 } 358} 359