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 * Defines the option of Progress. 18 * @since 7 19 */ 20 declare interface ProgressOptions { 21 /** 22 * Sets the value of Progress. 23 * @since 7 24 */ 25 value: number; 26 27 /** 28 * Sets the total of Progress. 29 * @since 7 30 */ 31 total?: number; 32 33 /** 34 * Sets the style of Progress. 35 * @since 7 36 * @deprecated since 8 37 */ 38 style?: ProgressStyle 39 40 /** 41 * Sets the type of Progress. 42 * @since 8 43 */ 44 type?: ProgressType 45} 46 47/** 48 * Type of progress bar 49 * @since 8 50 */ 51declare enum ProgressType { 52 /** 53 * Linear progress bar style. 54 * @since 8 55 */ 56 Linear, 57 58 /** 59 * Ring progress bar. 60 * @since 8 61 */ 62 Ring, 63 64 /** 65 * Eclipse progress bar. 66 * @since 8 67 */ 68 Eclipse, 69 70 /** 71 * ScaleRing progress bar. 72 * @since 8 73 */ 74 ScaleRing, 75 76 /** 77 * Capsule progress bar. 78 * @since 8 79 */ 80 Capsule, 81} 82 83/** 84 * Defines style options for progress component. 85 * @since 8 86 */ 87declare interface ProgressStyleOptions { 88 /** 89 * Defines the strokeWidth property. 90 * @since 8 91 */ 92 strokeWidth?: Length; 93 94 /** 95 * Defines the scaleCoun property. 96 * @since 8 97 */ 98 scaleCount?: number; 99 100 /** 101 * Defines the scaleWidth property. 102 * @since 8 103 */ 104 scaleWidth?: Length; 105} 106 107/** 108 * Type of progress bar 109 * @since 7 110 */ 111declare enum ProgressStyle { 112 /** 113 * Linear progress bar style. 114 * @since 7 115 */ 116 Linear, 117 118 /** 119 * Ring progress bar. 120 * @since 8 121 */ 122 Ring, 123 124 /** 125 * Eclipse progress bar. 126 * @since 7 127 */ 128 Eclipse, 129 130 /** 131 * ScaleRing progress bar. 132 * @since 8 133 */ 134 ScaleRing, 135 136 /** 137 * Capsule progress bar. 138 * @since 8 139 */ 140 Capsule, 141} 142 143/** 144 * Provides the progress bar interface. 145 * @since 7 146 */ 147interface ProgressInterface { 148 /** 149 * Called when the progress bar is set. 150 * @since 7 151 */ 152 (options: ProgressOptions): ProgressAttribute; 153} 154 155/** 156 * Defines the progress attibute functions. 157 * @since 7 158 */ 159declare class ProgressAttribute extends CommonMethod<ProgressAttribute> { 160 /** 161 * Called when the current progress value is set. 162 * @since 7 163 */ 164 value(value: number): ProgressAttribute; 165 166 /** 167 * Called when the progress bar foreground is set. 168 * @since 7 169 */ 170 color(value: ResourceColor): ProgressAttribute; 171 172 /** 173 * Called when the style of progress bar is set. 174 * @since 8 175 */ 176 style(value: ProgressStyleOptions): ProgressAttribute; 177} 178 179declare const Progress: ProgressInterface; 180declare const ProgressInstance: ProgressAttribute; 181