1/* 2 * Copyright (c) 2021 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/** 18 * The information of sheet. 19 * @since 8 20 */ 21interface SheetInfo { 22 /** 23 * Title Properties 24 * @since 8 25 */ 26 title: string | Resource; 27 28 /** 29 * Icon Properties. 30 * @since 8 31 */ 32 icon?: string | Resource; 33 34 /** 35 * Callback method after the operation. 36 * @since 8 37 */ 38 action: () => void; 39} 40 41/** 42 * Declare the ActionSheet 43 * @since 8 44 */ 45declare class ActionSheet { 46 /** 47 * Invoking method display. 48 * @since 8 49 */ 50 static show(value: { 51 /** 52 * Title Properties 53 * @since 8 54 */ 55 title: string | Resource; 56 57 /** 58 * message Properties 59 * @since 8 60 */ 61 message: string | Resource; 62 63 /** 64 * Invoke the commit function. 65 * @since 8 66 */ 67 confirm?: { 68 /** 69 * Text content of the confirmation button. 70 * @since 8 71 */ 72 value: string | Resource; 73 74 /** 75 * Method executed by the callback. 76 * @since 8 77 */ 78 action: () => void; 79 }; 80 81 /** 82 * Execute Cancel Function. 83 * @since 8 84 */ 85 cancel?: () => void; 86 87 /** 88 * The Array of sheets 89 * @since 8 90 */ 91 sheets: Array<SheetInfo>; 92 93 /** 94 * Allows users to click the mask layer to exit. 95 * @since 8 96 */ 97 autoCancel?: boolean; 98 99 /** 100 * Alignment in the vertical direction. 101 * @since 8 102 */ 103 alignment?: DialogAlignment; 104 105 /** 106 * Offset of the pop-up window relative to the alignment position. 107 * @since 8 108 */ 109 offset?: { dx: number | string | Resource; dy: number | string | Resource }; 110 }); 111} 112