• 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 * Content scroll direction.
18 *
19 * @enum { number }
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 8
22 */
23/**
24 * Content scroll direction.
25 *
26 * @enum { number }
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @crossplatform
29 * @since 10
30 */
31declare enum ScrollBarDirection {
32  /**
33   * Vertical scrolling is supported.
34   *
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @since 8
37   */
38  /**
39   * Vertical scrolling is supported.
40   *
41   * @syscap SystemCapability.ArkUI.ArkUI.Full
42   * @crossplatform
43   * @since 10
44   */
45  Vertical,
46
47  /**
48   * Horizontal scrolling is supported.
49   *
50   * @syscap SystemCapability.ArkUI.ArkUI.Full
51   * @since 8
52   */
53  /**
54   * Horizontal scrolling is supported.
55   *
56   * @syscap SystemCapability.ArkUI.ArkUI.Full
57   * @crossplatform
58   * @since 10
59   */
60  Horizontal,
61}
62
63/**
64 * Defines the options of ScrollBar.
65 *
66 * @interface ScrollBarOptions
67 * @syscap SystemCapability.ArkUI.ArkUI.Full
68 * @since 8
69 */
70/**
71 * Defines the options of ScrollBar.
72 *
73 * @interface ScrollBarOptions
74 * @syscap SystemCapability.ArkUI.ArkUI.Full
75 * @crossplatform
76 * @since 10
77 */
78declare interface ScrollBarOptions {
79  /**
80   * Sets the scroller of scroll bar.
81   *
82   * @type { Scroller }
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @since 8
85   */
86  /**
87   * Sets the scroller of scroll bar.
88   *
89   * @type { Scroller }
90   * @syscap SystemCapability.ArkUI.ArkUI.Full
91   * @crossplatform
92   * @since 10
93   */
94  scroller: Scroller;
95
96  /**
97   * Sets the direction of scroll bar.
98   *
99   * @type { ?ScrollBarDirection }
100   * @syscap SystemCapability.ArkUI.ArkUI.Full
101   * @since 8
102   */
103  /**
104   * Sets the direction of scroll bar.
105   *
106   * @type { ?ScrollBarDirection }
107   * @syscap SystemCapability.ArkUI.ArkUI.Full
108   * @crossplatform
109   * @since 10
110   */
111  direction?: ScrollBarDirection;
112
113  /**
114   * Sets the state of scroll bar.
115   *
116   * @type { ?BarState }
117   * @syscap SystemCapability.ArkUI.ArkUI.Full
118   * @since 8
119   */
120  /**
121   * Sets the state of scroll bar.
122   *
123   * @type { ?BarState }
124   * @syscap SystemCapability.ArkUI.ArkUI.Full
125   * @crossplatform
126   * @since 10
127   */
128  state?: BarState;
129}
130
131/**
132 * Provides interfaces for scroll bar.
133 *
134 * @interface ScrollBarInterface
135 * @syscap SystemCapability.ArkUI.ArkUI.Full
136 * @since 8
137 */
138/**
139 * Provides interfaces for scroll bar.
140 *
141 * @interface ScrollBarInterface
142 * @syscap SystemCapability.ArkUI.ArkUI.Full
143 * @crossplatform
144 * @since 10
145 */
146interface ScrollBarInterface {
147  /**
148   * Called when a ScrollBar container is set.
149   *
150   * @param { ScrollBarOptions } value
151   * @returns { ScrollBarAttribute }
152   * @syscap SystemCapability.ArkUI.ArkUI.Full
153   * @since 8
154   */
155  /**
156   * Called when a ScrollBar container is set.
157   *
158   * @param { ScrollBarOptions } value
159   * @returns { ScrollBarAttribute }
160   * @syscap SystemCapability.ArkUI.ArkUI.Full
161   * @crossplatform
162   * @since 10
163   */
164  (value: ScrollBarOptions): ScrollBarAttribute;
165}
166
167/**
168 * Defines the scrollbar attribute functions.
169 *
170 * @extends CommonMethod
171 * @syscap SystemCapability.ArkUI.ArkUI.Full
172 * @since 8
173 */
174/**
175 * Defines the scrollbar attribute functions.
176 *
177 * @extends CommonMethod
178 * @syscap SystemCapability.ArkUI.ArkUI.Full
179 * @crossplatform
180 * @since 10
181 */
182declare class ScrollBarAttribute extends CommonMethod<ScrollBarAttribute> {}
183
184/**
185 * Defines ScrollBar Component.
186 *
187 * @syscap SystemCapability.ArkUI.ArkUI.Full
188 * @since 8
189 */
190/**
191 * Defines ScrollBar Component.
192 *
193 * @syscap SystemCapability.ArkUI.ArkUI.Full
194 * @crossplatform
195 * @since 10
196 */
197declare const ScrollBar: ScrollBarInterface;
198
199/**
200 * Defines ScrollBar Component instance.
201 *
202 * @syscap SystemCapability.ArkUI.ArkUI.Full
203 * @since 8
204 */
205/**
206 * Defines ScrollBar Component instance.
207 *
208 * @syscap SystemCapability.ArkUI.ArkUI.Full
209 * @crossplatform
210 * @since 10
211 */
212declare const ScrollBarInstance: ScrollBarAttribute;
213