• 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 * Provides the interface for scoring bars.
18 *
19 * @interface RatingInterface
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 7
22 */
23/**
24 * Provides the interface for scoring bars.
25 *
26 * @interface RatingInterface
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @since 9
29 * @form
30 */
31/**
32 * Provides the interface for scoring bars.
33 *
34 * @interface RatingInterface
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @since 10
38 * @form
39 */
40interface RatingInterface {
41  /**
42   * Called when a score bar is created.
43   *
44   * @param { object } options
45   * @returns { RatingAttribute }
46   * @syscap SystemCapability.ArkUI.ArkUI.Full
47   * @since 7
48   */
49  /**
50   * Called when a score bar is created.
51   *
52   * @param { object } options
53   * @returns { RatingAttribute }
54   * @syscap SystemCapability.ArkUI.ArkUI.Full
55   * @since 9
56   * @form
57   */
58  /**
59   * Called when a score bar is created.
60   *
61   * @param { object } options
62   * @returns { RatingAttribute }
63   * @syscap SystemCapability.ArkUI.ArkUI.Full
64   * @crossplatform
65   * @since 10
66   * @form
67   */
68  (options?: { rating: number; indicator?: boolean }): RatingAttribute;
69}
70
71/**
72 * Defines the rating attribute functions.
73 *
74 * @extends CommonMethod
75 * @syscap SystemCapability.ArkUI.ArkUI.Full
76 * @since 7
77 */
78/**
79 * Defines the rating attribute functions.
80 *
81 * @extends CommonMethod
82 * @syscap SystemCapability.ArkUI.ArkUI.Full
83 * @since 9
84 * @form
85 */
86/**
87 * Defines the rating attribute functions.
88 *
89 * @extends CommonMethod
90 * @syscap SystemCapability.ArkUI.ArkUI.Full
91 * @crossplatform
92 * @since 10
93 * @form
94 */
95declare class RatingAttribute extends CommonMethod<RatingAttribute> {
96  /**
97   * Called when the total number of stars is set.
98   *
99   * @param { number } value
100   * @returns { RatingAttribute }
101   * @syscap SystemCapability.ArkUI.ArkUI.Full
102   * @since 7
103   */
104  /**
105   * Called when the total number of stars is set.
106   *
107   * @param { number } value
108   * @returns { RatingAttribute }
109   * @syscap SystemCapability.ArkUI.ArkUI.Full
110   * @since 9
111   * @form
112   */
113  /**
114   * Called when the total number of stars is set.
115   *
116   * @param { number } value
117   * @returns { RatingAttribute }
118   * @syscap SystemCapability.ArkUI.ArkUI.Full
119   * @crossplatform
120   * @since 10
121   * @form
122   */
123  stars(value: number): RatingAttribute;
124
125  /**
126   * Called when the step size of the operation rating.
127   *
128   * @param { number } value
129   * @returns { RatingAttribute }
130   * @syscap SystemCapability.ArkUI.ArkUI.Full
131   * @since 7
132   */
133  /**
134   * Called when the step size of the operation rating.
135   *
136   * @param { number } value
137   * @returns { RatingAttribute }
138   * @syscap SystemCapability.ArkUI.ArkUI.Full
139   * @since 9
140   * @form
141   */
142  /**
143   * Called when the step size of the operation rating.
144   *
145   * @param { number } value
146   * @returns { RatingAttribute }
147   * @syscap SystemCapability.ArkUI.ArkUI.Full
148   * @crossplatform
149   * @since 10
150   * @form
151   */
152  stepSize(value: number): RatingAttribute;
153
154  /**
155   * Called when a picture is set.
156   *
157   * @param { object } value
158   * @returns { RatingAttribute }
159   * @syscap SystemCapability.ArkUI.ArkUI.Full
160   * @since 7
161   */
162  /**
163   * Called when a picture is set.
164   *
165   * @param { object } value
166   * @returns { RatingAttribute }
167   * @syscap SystemCapability.ArkUI.ArkUI.Full
168   * @since 9
169   * @form
170   */
171  /**
172   * Called when a picture is set.
173   *
174   * @param { object } value
175   * @returns { RatingAttribute }
176   * @syscap SystemCapability.ArkUI.ArkUI.Full
177   * @crossplatform
178   * @since 10
179   * @form
180   */
181  starStyle(value: { backgroundUri: string; foregroundUri: string; secondaryUri?: string }): RatingAttribute;
182
183  /**
184   * Called when the star rating of the operation scoring bar changes.
185   *
186   * @param { function } callback
187   * @returns { RatingAttribute }
188   * @syscap SystemCapability.ArkUI.ArkUI.Full
189   * @since 7
190   */
191  /**
192   * Called when the star rating of the operation scoring bar changes.
193   *
194   * @param { function } callback
195   * @returns { RatingAttribute }
196   * @syscap SystemCapability.ArkUI.ArkUI.Full
197   * @since 9
198   * @form
199   */
200  /**
201   * Called when the star rating of the operation scoring bar changes.
202   *
203   * @param { function } callback
204   * @returns { RatingAttribute }
205   * @syscap SystemCapability.ArkUI.ArkUI.Full
206   * @crossplatform
207   * @since 10
208   * @form
209   */
210  onChange(callback: (value: number) => void): RatingAttribute;
211}
212
213/**
214 * Defines Rating Component.
215 *
216 * @syscap SystemCapability.ArkUI.ArkUI.Full
217 * @since 7
218 */
219/**
220 * Defines Rating Component.
221 *
222 * @syscap SystemCapability.ArkUI.ArkUI.Full
223 * @since 9
224 * @form
225 */
226/**
227 * Defines Rating Component.
228 *
229 * @syscap SystemCapability.ArkUI.ArkUI.Full
230 * @crossplatform
231 * @since 10
232 * @form
233 */
234declare const Rating: RatingInterface;
235
236/**
237 * Defines Rating Component instance.
238 *
239 * @syscap SystemCapability.ArkUI.ArkUI.Full
240 * @since 7
241 */
242/**
243 * Defines Rating Component instance.
244 *
245 * @syscap SystemCapability.ArkUI.ArkUI.Full
246 * @since 9
247 * @form
248 */
249/**
250 * Defines Rating Component instance.
251 *
252 * @syscap SystemCapability.ArkUI.ArkUI.Full
253 * @crossplatform
254 * @since 10
255 * @form
256 */
257declare const RatingInstance: RatingAttribute;
258