• 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 { Scroller } from './scroll'
23import { BarState } from './enums'
24import { Optional, CommonMethod } from './common'
25/*** endif */
26
27/**
28 * Content scroll direction.
29 *
30 * @enum { number }
31 * @syscap SystemCapability.ArkUI.ArkUI.Full
32 * @since 8
33 */
34/**
35 * Content scroll direction.
36 *
37 * @enum { number }
38 * @syscap SystemCapability.ArkUI.ArkUI.Full
39 * @crossplatform
40 * @since 10
41 */
42/**
43 * Content scroll direction.
44 *
45 * @enum { number }
46 * @syscap SystemCapability.ArkUI.ArkUI.Full
47 * @crossplatform
48 * @atomicservice
49 * @since arkts {'1.1':'11','1.2':'20'}
50 * @arkts 1.1&1.2
51 */
52declare enum ScrollBarDirection {
53  /**
54   * Vertical scrolling is supported.
55   *
56   * @syscap SystemCapability.ArkUI.ArkUI.Full
57   * @since 8
58   */
59  /**
60   * Vertical scrolling is supported.
61   *
62   * @syscap SystemCapability.ArkUI.ArkUI.Full
63   * @crossplatform
64   * @since 10
65   */
66  /**
67   * Vertical scrolling is supported.
68   *
69   * @syscap SystemCapability.ArkUI.ArkUI.Full
70   * @crossplatform
71   * @atomicservice
72   * @since arkts {'1.1':'11','1.2':'20'}
73   * @arkts 1.1&1.2
74   */
75  Vertical,
76
77  /**
78   * Horizontal scrolling is supported.
79   *
80   * @syscap SystemCapability.ArkUI.ArkUI.Full
81   * @since 8
82   */
83  /**
84   * Horizontal scrolling is supported.
85   *
86   * @syscap SystemCapability.ArkUI.ArkUI.Full
87   * @crossplatform
88   * @since 10
89   */
90  /**
91   * Horizontal scrolling is supported.
92   *
93   * @syscap SystemCapability.ArkUI.ArkUI.Full
94   * @crossplatform
95   * @atomicservice
96   * @since arkts {'1.1':'11','1.2':'20'}
97   * @arkts 1.1&1.2
98   */
99  Horizontal,
100}
101
102/**
103 * Defines the options of ScrollBar.
104 *
105 * @interface ScrollBarOptions
106 * @syscap SystemCapability.ArkUI.ArkUI.Full
107 * @since 8
108 */
109/**
110 * Defines the options of ScrollBar.
111 *
112 * @interface ScrollBarOptions
113 * @syscap SystemCapability.ArkUI.ArkUI.Full
114 * @crossplatform
115 * @since 10
116 */
117/**
118 * Defines the options of ScrollBar.
119 *
120 * @interface ScrollBarOptions
121 * @syscap SystemCapability.ArkUI.ArkUI.Full
122 * @crossplatform
123 * @atomicservice
124 * @since arkts {'1.1':'11','1.2':'20'}
125 * @arkts 1.1&1.2
126 */
127declare interface ScrollBarOptions {
128  /**
129   * Sets the scroller of scroll bar.
130   *
131   * @type { Scroller }
132   * @syscap SystemCapability.ArkUI.ArkUI.Full
133   * @since 8
134   */
135  /**
136   * Sets the scroller of scroll bar.
137   *
138   * @type { Scroller }
139   * @syscap SystemCapability.ArkUI.ArkUI.Full
140   * @crossplatform
141   * @since 10
142   */
143  /**
144   * Sets the scroller of scroll bar.
145   *
146   * @type { Scroller }
147   * @syscap SystemCapability.ArkUI.ArkUI.Full
148   * @crossplatform
149   * @atomicservice
150   * @since arkts {'1.1':'11','1.2':'20'}
151   * @arkts 1.1&1.2
152   */
153  scroller: Scroller;
154
155  /**
156   * Sets the direction of scroll bar.
157   *
158   * @type { ?ScrollBarDirection }
159   * @syscap SystemCapability.ArkUI.ArkUI.Full
160   * @since 8
161   */
162  /**
163   * Sets the direction of scroll bar.
164   *
165   * @type { ?ScrollBarDirection }
166   * @syscap SystemCapability.ArkUI.ArkUI.Full
167   * @crossplatform
168   * @since 10
169   */
170  /**
171   * Sets the direction of scroll bar.
172   *
173   * @type { ?ScrollBarDirection }
174   * @syscap SystemCapability.ArkUI.ArkUI.Full
175   * @crossplatform
176   * @atomicservice
177   * @since arkts {'1.1':'11','1.2':'20'}
178   * @arkts 1.1&1.2
179   */
180  direction?: ScrollBarDirection;
181
182  /**
183   * Sets the state of scroll bar.
184   *
185   * @type { ?BarState }
186   * @syscap SystemCapability.ArkUI.ArkUI.Full
187   * @since 8
188   */
189  /**
190   * Sets the state of scroll bar.
191   *
192   * @type { ?BarState }
193   * @syscap SystemCapability.ArkUI.ArkUI.Full
194   * @crossplatform
195   * @since 10
196   */
197  /**
198   * Sets the state of scroll bar.
199   *
200   * @type { ?BarState }
201   * @syscap SystemCapability.ArkUI.ArkUI.Full
202   * @crossplatform
203   * @atomicservice
204   * @since arkts {'1.1':'11','1.2':'20'}
205   * @arkts 1.1&1.2
206   */
207  state?: BarState;
208}
209
210/**
211 * Provides interfaces for scroll bar.
212 *
213 * @interface ScrollBarInterface
214 * @syscap SystemCapability.ArkUI.ArkUI.Full
215 * @since 8
216 */
217/**
218 * Provides interfaces for scroll bar.
219 *
220 * @interface ScrollBarInterface
221 * @syscap SystemCapability.ArkUI.ArkUI.Full
222 * @crossplatform
223 * @since 10
224 */
225/**
226 * Provides interfaces for scroll bar.
227 *
228 * @interface ScrollBarInterface
229 * @syscap SystemCapability.ArkUI.ArkUI.Full
230 * @crossplatform
231 * @atomicservice
232 * @since arkts {'1.1':'11','1.2':'20'}
233 * @arkts 1.1&1.2
234 */
235interface ScrollBarInterface {
236  /**
237   * Called when a ScrollBar container is set.
238   *
239   * @param { ScrollBarOptions } value
240   * @returns { ScrollBarAttribute }
241   * @syscap SystemCapability.ArkUI.ArkUI.Full
242   * @since 8
243   */
244  /**
245   * Called when a ScrollBar container is set.
246   *
247   * @param { ScrollBarOptions } value
248   * @returns { ScrollBarAttribute }
249   * @syscap SystemCapability.ArkUI.ArkUI.Full
250   * @crossplatform
251   * @since 10
252   */
253  /**
254   * Called when a ScrollBar container is set.
255   *
256   * @param { ScrollBarOptions } value
257   * @returns { ScrollBarAttribute }
258   * @syscap SystemCapability.ArkUI.ArkUI.Full
259   * @crossplatform
260   * @atomicservice
261   * @since arkts {'1.1':'11','1.2':'20'}
262   * @arkts 1.1&1.2
263   */
264  (value: ScrollBarOptions): ScrollBarAttribute;
265}
266
267/**
268 * Defines the scrollbar attribute functions.
269 *
270 * @extends CommonMethod<ScrollBarAttribute>
271 * @syscap SystemCapability.ArkUI.ArkUI.Full
272 * @since 8
273 */
274/**
275 * Defines the scrollbar attribute functions.
276 *
277 * @extends CommonMethod<ScrollBarAttribute>
278 * @syscap SystemCapability.ArkUI.ArkUI.Full
279 * @crossplatform
280 * @since 10
281 */
282/**
283 * Defines the scrollbar attribute functions.
284 *
285 * @extends CommonMethod<ScrollBarAttribute>
286 * @syscap SystemCapability.ArkUI.ArkUI.Full
287 * @crossplatform
288 * @atomicservice
289 * @since arkts {'1.1':'11','1.2':'20'}
290 * @arkts 1.1&1.2
291 */
292declare class ScrollBarAttribute extends CommonMethod<ScrollBarAttribute> {
293    /**
294     * Called when setting whether to enable nested scroll.
295     * @param { Optional<boolean> } enabled - Whether to enable nested scroll.
296     * @returns { ScrollBarAttribute } The attribute of the scroll bar
297     * @syscap SystemCapability.ArkUI.ArkUI.Full
298     * @crossplatform
299     * @atomicservice
300     * @since arkts {'1.1':'14','1.2':'20'}
301     * @arkts 1.1&1.2
302     */
303    enableNestedScroll(enabled: Optional<boolean>): ScrollBarAttribute;
304
305    /**
306     * Color of the scrollbar.
307     *
308     * @param { Optional<ColorMetrics> } color - Color of the scrollbar.
309     * @returns { ScrollBarAttribute }
310     * @syscap SystemCapability.ArkUI.ArkUI.Full
311     * @crossplatform
312     * @atomicservice
313     * @since 20
314     */
315    scrollBarColor(color: Optional<ColorMetrics>): ScrollBarAttribute;
316}
317
318/**
319 * Defines ScrollBar Component.
320 *
321 * @syscap SystemCapability.ArkUI.ArkUI.Full
322 * @since 8
323 */
324/**
325 * Defines ScrollBar Component.
326 *
327 * @syscap SystemCapability.ArkUI.ArkUI.Full
328 * @crossplatform
329 * @since 10
330 */
331/**
332 * Defines ScrollBar Component.
333 *
334 * @syscap SystemCapability.ArkUI.ArkUI.Full
335 * @crossplatform
336 * @atomicservice
337 * @since 11
338 */
339declare const ScrollBar: ScrollBarInterface;
340
341/**
342 * Defines ScrollBar Component instance.
343 *
344 * @syscap SystemCapability.ArkUI.ArkUI.Full
345 * @since 8
346 */
347/**
348 * Defines ScrollBar Component instance.
349 *
350 * @syscap SystemCapability.ArkUI.ArkUI.Full
351 * @crossplatform
352 * @since 10
353 */
354/**
355 * Defines ScrollBar Component instance.
356 *
357 * @syscap SystemCapability.ArkUI.ArkUI.Full
358 * @crossplatform
359 * @atomicservice
360 * @since 11
361 */
362declare const ScrollBarInstance: ScrollBarAttribute;
363