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 badge position property. 18 * @since 7 19 */ 20/** 21 * Defines the badge position property. 22 * @form 23 * @since 9 24 */ 25declare enum BadgePosition { 26 /** 27 * The dot is displayed vertically centered on the right. 28 * @since 7 29 */ 30 /** 31 * The dot is displayed vertically centered on the right. 32 * @form 33 * @since 9 34 */ 35 RightTop, 36 37 /** 38 * Dots are displayed in the upper right corner. 39 * @since 7 40 */ 41 /** 42 * Dots are displayed in the upper right corner. 43 * @form 44 * @since 9 45 */ 46 Right, 47 48 /** 49 * The dot is displayed in the left vertical center. 50 * @since 7 51 */ 52 /** 53 * The dot is displayed in the left vertical center. 54 * @form 55 * @since 9 56 */ 57 Left, 58} 59 60/** 61 * BadgeStyle object 62 * @since 7 63 */ 64/** 65 * BadgeStyle object 66 * @form 67 * @since 9 68 */ 69declare interface BadgeStyle { 70 /** 71 * Text Color 72 * @since 7 73 */ 74 /** 75 * Text Color 76 * @form 77 * @since 9 78 */ 79 color?: ResourceColor; 80 81 /** 82 * Text size. 83 * @since 7 84 */ 85 /** 86 * Text size. 87 * @form 88 * @since 9 89 */ 90 fontSize?: number | string; 91 92 /** 93 * Size of a badge. 94 * @since 7 95 */ 96 /** 97 * Size of a badge. 98 * @form 99 * @since 9 100 */ 101 badgeSize?: number | string; 102 103 /** 104 * Color of the badge. 105 * @since 7 106 */ 107 /** 108 * Color of the badge. 109 * @form 110 * @since 9 111 */ 112 badgeColor?: ResourceColor; 113} 114 115/** 116 * Defines the base param of badge. 117 * @since 7 118 */ 119/** 120 * Defines the base param of badge. 121 * @form 122 * @since 9 123 */ 124declare interface BadgeParam { 125 /** 126 * Set the display position of the prompt point. 127 * @since 7 128 */ 129 /** 130 * Set the display position of the prompt point. 131 * @form 132 * @since 9 133 */ 134 position?: BadgePosition; 135 136 /** 137 * Defines the style of the Badge component, including the text color, size, dot color, and size. 138 * @since 7 139 */ 140 /** 141 * Defines the style of the Badge component, including the text color, size, dot color, and size. 142 * @form 143 * @since 9 144 */ 145 style: BadgeStyle; 146} 147 148/** 149 * Defines the badge param with count and maxCount. 150 * @since 7 151 */ 152/** 153 * Defines the badge param with count and maxCount. 154 * @form 155 * @since 9 156 */ 157declare interface BadgeParamWithNumber extends BadgeParam { 158 /** 159 * Set the number of reminder messages. 160 * @since 7 161 */ 162 /** 163 * Set the number of reminder messages. 164 * @form 165 * @since 9 166 */ 167 count: number; 168 169 /** 170 * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. 171 * @since 7 172 */ 173 /** 174 * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. 175 * @form 176 * @since 9 177 */ 178 maxCount?: number; 179} 180 181/** 182 * Defines the badge param with string value. 183 * @since 7 184 */ 185/** 186 * Defines the badge param with string value. 187 * @form 188 * @since 9 189 */ 190declare interface BadgeParamWithString extends BadgeParam { 191 /** 192 * Text string of the prompt content. 193 * @since 7 194 */ 195 /** 196 * Text string of the prompt content. 197 * @form 198 * @since 9 199 */ 200 value: string; 201} 202 203/** 204 * Defines Badge Component. 205 * @since 7 206 */ 207/** 208 * Defines Badge Component. 209 * @form 210 * @since 9 211 */ 212interface BadgeInterface { 213 /** 214 * position: Set the display position of the prompt point. 215 * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. 216 * count: Set the number of reminder messages. 217 * style: You can set the style of the Badge component, including the text color, size, dot color, and size. 218 * @since 7 219 */ 220 /** 221 * position: Set the display position of the prompt point. 222 * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. 223 * count: Set the number of reminder messages. 224 * style: You can set the style of the Badge component, including the text color, size, dot color, and size. 225 * @form 226 * @since 9 227 */ 228 (value: BadgeParamWithNumber): BadgeAttribute; 229 230 /** 231 * value: Text string of the prompt content. 232 * position: Set the display position of the prompt point. 233 * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. 234 * style: You can set the style of the Badge component, including the text color, size, dot color, and size. 235 * @since 7 236 */ 237 /** 238 * value: Text string of the prompt content. 239 * position: Set the display position of the prompt point. 240 * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. 241 * style: You can set the style of the Badge component, including the text color, size, dot color, and size. 242 * @form 243 * @since 9 244 */ 245 (value: BadgeParamWithString): BadgeAttribute; 246} 247 248/** 249 * Defines Badge Component attribute. 250 * @since 7 251 */ 252/** 253 * Defines Badge Component attribute. 254 * @form 255 * @since 9 256 */ 257declare class BadgeAttribute extends CommonMethod<BadgeAttribute> {} 258 259/** 260 * Defines Badge Component. 261 * @since 7 262 */ 263/** 264 * Defines Badge Component. 265 * @form 266 * @since 9 267 */ 268declare const Badge: BadgeInterface; 269 270/** 271 * Defines Badge Component instance. 272 * @since 7 273 */ 274/** 275 * Defines Badge Component instance. 276 * @form 277 * @since 9 278 */ 279declare const BadgeInstance: BadgeAttribute; 280