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 option of Progress. 18 * @since 7 19 */ 20/** 21 * Defines the option of Progress. 22 * @form 23 * @since 9 24 */ 25 declare interface ProgressOptions { 26 /** 27 * Sets the value of Progress. 28 * @since 7 29 */ 30 /** 31 * Sets the value of Progress. 32 * @form 33 * @since 9 34 */ 35 value: number; 36 37 /** 38 * Sets the total of Progress. 39 * @since 7 40 */ 41 /** 42 * Sets the total of Progress. 43 * @form 44 * @since 9 45 */ 46 total?: number; 47 48 /** 49 * Sets the style of Progress. 50 * @since 7 51 * @deprecated since 8 52 * @useinstead type 53 */ 54 style?: ProgressStyle 55 56 /** 57 * Sets the type of Progress. 58 * @since 8 59 */ 60 /** 61 * Sets the type of Progress. 62 * @form 63 * @since 9 64 */ 65 type?: ProgressType 66} 67 68/** 69 * Type of progress bar 70 * @since 8 71 */ 72/** 73 * Type of progress bar 74 * @form 75 * @since 9 76 */ 77declare enum ProgressType { 78 /** 79 * Linear progress bar style. 80 * @since 8 81 */ 82 /** 83 * Linear progress bar style. 84 * @form 85 * @since 9 86 */ 87 Linear, 88 89 /** 90 * Ring progress bar. 91 * @since 8 92 */ 93 /** 94 * Ring progress bar. 95 * @form 96 * @since 9 97 */ 98 Ring, 99 100 /** 101 * Eclipse progress bar. 102 * @since 8 103 */ 104 /** 105 * Eclipse progress bar. 106 * @form 107 * @since 9 108 */ 109 Eclipse, 110 111 /** 112 * ScaleRing progress bar. 113 * @since 8 114 */ 115 /** 116 * ScaleRing progress bar. 117 * @form 118 * @since 9 119 */ 120 ScaleRing, 121 122 /** 123 * Capsule progress bar. 124 * @since 8 125 */ 126 /** 127 * Capsule progress bar. 128 * @form 129 * @since 9 130 */ 131 Capsule, 132} 133 134/** 135 * Defines style options for progress component. 136 * @since 8 137 */ 138/** 139 * Defines style options for progress component. 140 * @form 141 * @since 9 142 */ 143declare interface ProgressStyleOptions { 144 /** 145 * Defines the strokeWidth property. 146 * @since 8 147 */ 148 /** 149 * Defines the strokeWidth property. 150 * @form 151 * @since 9 152 */ 153 strokeWidth?: Length; 154 155 /** 156 * Defines the scaleCount property. 157 * @since 8 158 */ 159 /** 160 * Defines the scaleCount property. 161 * @form 162 * @since 9 163 */ 164 scaleCount?: number; 165 166 /** 167 * Defines the scaleWidth property. 168 * @since 8 169 */ 170 /** 171 * Defines the scaleWidth property. 172 * @form 173 * @since 9 174 */ 175 scaleWidth?: Length; 176} 177 178/** 179 * Type of progress bar 180 * @since 7 181 */ 182/** 183 * Type of progress bar 184 * @form 185 * @since 9 186 */ 187declare enum ProgressStyle { 188 /** 189 * Linear progress bar style. 190 * @since 7 191 */ 192 /** 193 * Linear progress bar style. 194 * @form 195 * @since 9 196 */ 197 Linear, 198 199 /** 200 * Ring progress bar. 201 * @since 8 202 */ 203 /** 204 * Ring progress bar. 205 * @form 206 * @since 9 207 */ 208 Ring, 209 210 /** 211 * Eclipse progress bar. 212 * @since 7 213 */ 214 /** 215 * Eclipse progress bar. 216 * @form 217 * @since 9 218 */ 219 Eclipse, 220 221 /** 222 * ScaleRing progress bar. 223 * @since 8 224 */ 225 /** 226 * ScaleRing progress bar. 227 * @form 228 * @since 9 229 */ 230 ScaleRing, 231 232 /** 233 * Capsule progress bar. 234 * @since 8 235 */ 236 /** 237 * Capsule progress bar. 238 * @form 239 * @since 9 240 */ 241 Capsule, 242} 243 244/** 245 * Provides the progress bar interface. 246 * @since 7 247 */ 248/** 249 * Provides the progress bar interface. 250 * @form 251 * @since 9 252 */ 253interface ProgressInterface { 254 /** 255 * Called when the progress bar is set. 256 * @since 7 257 */ 258 /** 259 * Called when the progress bar is set. 260 * @form 261 * @since 9 262 */ 263 (options: ProgressOptions): ProgressAttribute; 264} 265 266/** 267 * Defines the progress attribute functions. 268 * @since 7 269 */ 270/** 271 * Defines the progress attribute functions. 272 * @form 273 * @since 9 274 */ 275declare class ProgressAttribute extends CommonMethod<ProgressAttribute> { 276 /** 277 * Called when the current progress value is set. 278 * @since 7 279 */ 280 /** 281 * Called when the current progress value is set. 282 * @form 283 * @since 9 284 */ 285 value(value: number): ProgressAttribute; 286 287 /** 288 * Called when the progress bar foreground is set. 289 * @since 7 290 */ 291 /** 292 * Called when the progress bar foreground is set. 293 * @form 294 * @since 9 295 */ 296 color(value: ResourceColor): ProgressAttribute; 297 298 /** 299 * Called when the style of progress bar is set. 300 * @since 8 301 */ 302 /** 303 * Called when the style of progress bar is set. 304 * @form 305 * @since 9 306 */ 307 style(value: ProgressStyleOptions): ProgressAttribute; 308} 309 310/** 311 * Defines Progress Component. 312 * @since 7 313 */ 314/** 315 * Defines Progress Component. 316 * @form 317 * @since 9 318 */ 319declare const Progress: ProgressInterface; 320 321/** 322 * Defines Progress Component instance. 323 * @since 7 324 */ 325/** 326 * Defines Progress Component instance. 327 * @form 328 * @since 9 329 */ 330declare const ProgressInstance: ProgressAttribute; 331