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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Counter component, which provides corresponding increment or decrement counting operations. 23 * 24 * @interface CounterInterface 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Counter component, which provides corresponding increment or decrement counting operations. 30 * 31 * @interface CounterInterface 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @form 34 * @since 9 35 */ 36/** 37 * Counter component, which provides corresponding increment or decrement counting operations. 38 * 39 * @interface CounterInterface 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @form 43 * @since 10 44 */ 45/** 46 * Counter component, which provides corresponding increment or decrement counting operations. 47 * 48 * @interface CounterInterface 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @crossplatform 51 * @form 52 * @atomicservice 53 * @since 11 54 */ 55interface CounterInterface { 56 /** 57 * Return Counter. 58 * 59 * @returns { CounterAttribute } 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @since 7 62 */ 63 /** 64 * Return Counter. 65 * 66 * @returns { CounterAttribute } 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @form 69 * @since 9 70 */ 71 /** 72 * Return Counter. 73 * 74 * @returns { CounterAttribute } 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @crossplatform 77 * @form 78 * @since 10 79 */ 80 /** 81 * Return Counter. 82 * 83 * @returns { CounterAttribute } 84 * @syscap SystemCapability.ArkUI.ArkUI.Full 85 * @crossplatform 86 * @form 87 * @atomicservice 88 * @since 11 89 */ 90 (): CounterAttribute; 91} 92 93/** 94 * Defines the Counter attribute functions. 95 * 96 * @extends CommonMethod<CounterAttribute> 97 * @syscap SystemCapability.ArkUI.ArkUI.Full 98 * @since 7 99 */ 100/** 101 * Defines the Counter attribute functions. 102 * 103 * @extends CommonMethod<CounterAttribute> 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @form 106 * @since 9 107 */ 108/** 109 * Defines the Counter attribute functions. 110 * 111 * @extends CommonMethod<CounterAttribute> 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @crossplatform 114 * @form 115 * @since 10 116 */ 117/** 118 * Defines the Counter attribute functions. 119 * 120 * @extends CommonMethod<CounterAttribute> 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @crossplatform 123 * @form 124 * @atomicservice 125 * @since 11 126 */ 127declare class CounterAttribute extends CommonMethod<CounterAttribute> { 128 /** 129 * Listen to the event that the value increases. 130 * 131 * @param { function } event 132 * @returns { CounterAttribute } 133 * @syscap SystemCapability.ArkUI.ArkUI.Full 134 * @since 7 135 */ 136 /** 137 * Listen to the event that the value increases. 138 * 139 * @param { function } event 140 * @returns { CounterAttribute } 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @form 143 * @since 9 144 */ 145 /** 146 * Listen to the event that the value increases. 147 * 148 * @param { function } event 149 * @returns { CounterAttribute } 150 * @syscap SystemCapability.ArkUI.ArkUI.Full 151 * @crossplatform 152 * @form 153 * @since 10 154 */ 155 /** 156 * Listen to the event that the value increases. 157 * 158 * @param { function } event 159 * @returns { CounterAttribute } 160 * @syscap SystemCapability.ArkUI.ArkUI.Full 161 * @crossplatform 162 * @form 163 * @atomicservice 164 * @since 11 165 */ 166 /** 167 * Listen to the event that the value increases. 168 * 169 * @param { VoidCallback } event 170 * @returns { CounterAttribute } 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @crossplatform 173 * @form 174 * @atomicservice 175 * @since 14 176 */ 177 onInc(event: VoidCallback): CounterAttribute; 178 179 /** 180 * Listens to the number decrease event. 181 * 182 * @param { function } event 183 * @returns { CounterAttribute } 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @since 7 186 */ 187 /** 188 * Listens to the number decrease event. 189 * 190 * @param { function } event 191 * @returns { CounterAttribute } 192 * @syscap SystemCapability.ArkUI.ArkUI.Full 193 * @form 194 * @since 9 195 */ 196 /** 197 * Listens to the number decrease event. 198 * 199 * @param { function } event 200 * @returns { CounterAttribute } 201 * @syscap SystemCapability.ArkUI.ArkUI.Full 202 * @crossplatform 203 * @form 204 * @since 10 205 */ 206 /** 207 * Listens to the number decrease event. 208 * 209 * @param { function } event 210 * @returns { CounterAttribute } 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @crossplatform 213 * @form 214 * @atomicservice 215 * @since 11 216 */ 217 /** 218 * Listens to the number decrease event. 219 * 220 * @param { VoidCallback } event 221 * @returns { CounterAttribute } 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @form 225 * @atomicservice 226 * @since 14 227 */ 228 onDec(event: VoidCallback): CounterAttribute; 229 230 /** 231 * Indicates whether the decrease button of counter component is available or not. 232 * 233 * @param { boolean } value - If true, the decrease button is available and can respond to operations such as clicking. If false, click operations are not responded. 234 * @returns { CounterAttribute } The attribute of the counter. 235 * @syscap SystemCapability.ArkUI.ArkUI.Full 236 * @crossplatform 237 * @since 10 238 */ 239 /** 240 * Indicates whether the decrease button of counter component is available or not. 241 * 242 * @param { boolean } value - If true, the decrease button is available and can respond to operations such as clicking. If false, click operations are not responded. 243 * @returns { CounterAttribute } The attribute of the counter. 244 * @syscap SystemCapability.ArkUI.ArkUI.Full 245 * @crossplatform 246 * @atomicservice 247 * @since 11 248 */ 249 enableDec(value: boolean): CounterAttribute; 250 251 /** 252 * Indicates whether the increase button of counter component is available or not. 253 * 254 * @param { boolean } value - If true, the increase button is available and can respond to operations such as clicking. If false, click operations are not responded. 255 * @returns { CounterAttribute } The attribute of the counter. 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @crossplatform 258 * @since 10 259 */ 260 /** 261 * Indicates whether the increase button of counter component is available or not. 262 * 263 * @param { boolean } value - If true, the increase button is available and can respond to operations such as clicking. If false, click operations are not responded. 264 * @returns { CounterAttribute } The attribute of the counter. 265 * @syscap SystemCapability.ArkUI.ArkUI.Full 266 * @crossplatform 267 * @atomicservice 268 * @since 11 269 */ 270 enableInc(value: boolean): CounterAttribute; 271} 272 273/** 274 * Defines Counter Component instance. 275 * 276 * @syscap SystemCapability.ArkUI.ArkUI.Full 277 * @since 7 278 */ 279/** 280 * Defines Counter Component instance. 281 * 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @form 284 * @since 9 285 */ 286/** 287 * Defines Counter Component instance. 288 * 289 * @syscap SystemCapability.ArkUI.ArkUI.Full 290 * @crossplatform 291 * @form 292 * @since 10 293 */ 294/** 295 * Defines Counter Component instance. 296 * 297 * @syscap SystemCapability.ArkUI.ArkUI.Full 298 * @crossplatform 299 * @form 300 * @atomicservice 301 * @since 11 302 */ 303declare const CounterInstance: CounterAttribute; 304 305/** 306 * Defines Counter Component. 307 * 308 * @syscap SystemCapability.ArkUI.ArkUI.Full 309 * @since 7 310 */ 311/** 312 * Defines Counter Component. 313 * 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @form 316 * @since 9 317 */ 318/** 319 * Defines Counter Component. 320 * 321 * @syscap SystemCapability.ArkUI.ArkUI.Full 322 * @crossplatform 323 * @form 324 * @since 10 325 */ 326/** 327 * Defines Counter Component. 328 * 329 * @syscap SystemCapability.ArkUI.ArkUI.Full 330 * @crossplatform 331 * @form 332 * @atomicservice 333 * @since 11 334 */ 335declare const Counter: CounterInterface; 336