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 * Counter component, which provides corresponding increment or decrement counting operations. 18 * 19 * @interface CounterInterface 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23/** 24 * Counter component, which provides corresponding increment or decrement counting operations. 25 * 26 * @interface CounterInterface 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @since 9 29 * @form 30 */ 31/** 32 * Counter component, which provides corresponding increment or decrement counting operations. 33 * 34 * @interface CounterInterface 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @crossplatform 37 * @since 10 38 * @form 39 */ 40interface CounterInterface { 41 /** 42 * Return Counter. 43 * 44 * @returns { CounterAttribute } 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @since 7 47 */ 48 /** 49 * Return Counter. 50 * 51 * @returns { CounterAttribute } 52 * @syscap SystemCapability.ArkUI.ArkUI.Full 53 * @since 9 54 * @form 55 */ 56 /** 57 * Return Counter. 58 * 59 * @returns { CounterAttribute } 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 * @form 64 */ 65 (): CounterAttribute; 66} 67 68/** 69 * Defines the Counter attribute functions. 70 * 71 * @extends CommonMethod 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75/** 76 * Defines the Counter attribute functions. 77 * 78 * @extends CommonMethod 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @since 9 81 * @form 82 */ 83/** 84 * Defines the Counter attribute functions. 85 * 86 * @extends CommonMethod 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @crossplatform 89 * @since 10 90 * @form 91 */ 92declare class CounterAttribute extends CommonMethod<CounterAttribute> { 93 /** 94 * Listen to the event that the value increases. 95 * 96 * @param { function } event 97 * @returns { CounterAttribute } 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @since 7 100 */ 101 /** 102 * Listen to the event that the value increases. 103 * 104 * @param { function } event 105 * @returns { CounterAttribute } 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @since 9 108 * @form 109 */ 110 /** 111 * Listen to the event that the value increases. 112 * 113 * @param { function } event 114 * @returns { CounterAttribute } 115 * @syscap SystemCapability.ArkUI.ArkUI.Full 116 * @crossplatform 117 * @since 10 118 * @form 119 */ 120 onInc(event: () => void): CounterAttribute; 121 122 /** 123 * Listens to the number decrease event. 124 * 125 * @param { function } event 126 * @returns { CounterAttribute } 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @since 7 129 */ 130 /** 131 * Listens to the number decrease event. 132 * 133 * @param { function } event 134 * @returns { CounterAttribute } 135 * @syscap SystemCapability.ArkUI.ArkUI.Full 136 * @since 9 137 * @form 138 */ 139 /** 140 * Listens to the number decrease event. 141 * 142 * @param { function } event 143 * @returns { CounterAttribute } 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @crossplatform 146 * @since 10 147 * @form 148 */ 149 onDec(event: () => void): CounterAttribute; 150 151 /** 152 * Indicates whether the decrease button of counter component is available or not. 153 * 154 * @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. 155 * @returns { CounterAttribute } The attribute of the counter. 156 * @syscap SystemCapability.ArkUI.ArkUI.Full 157 * @crossplatform 158 * @since 10 159 */ 160 enableDec(value: boolean): CounterAttribute; 161 162 /** 163 * Indicates whether the increase button of counter component is available or not. 164 * 165 * @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. 166 * @returns { CounterAttribute } The attribute of the counter. 167 * @syscap SystemCapability.ArkUI.ArkUI.Full 168 * @crossplatform 169 * @since 10 170 */ 171 enableInc(value: boolean): CounterAttribute; 172} 173 174/** 175 * Defines Counter Component instance. 176 * 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @since 7 179 */ 180/** 181 * Defines Counter Component instance. 182 * 183 * @syscap SystemCapability.ArkUI.ArkUI.Full 184 * @since 9 185 * @form 186 */ 187/** 188 * Defines Counter Component instance. 189 * 190 * @syscap SystemCapability.ArkUI.ArkUI.Full 191 * @crossplatform 192 * @since 10 193 * @form 194 */ 195declare const CounterInstance: CounterAttribute; 196 197/** 198 * Defines Counter Component. 199 * 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @since 7 202 */ 203/** 204 * Defines Counter Component. 205 * 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @since 9 208 * @form 209 */ 210/** 211 * Defines Counter Component. 212 * 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @crossplatform 215 * @since 10 216 * @form 217 */ 218declare const Counter: CounterInterface; 219