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