• 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 * @since 7
19 */
20/**
21 * Provides the interface for scoring bars.
22 * @form
23 * @since 9
24 */
25interface RatingInterface {
26  /**
27   * Called when a score bar is created.
28   * @since 7
29   */
30  /**
31   * Called when a score bar is created.
32   * @form
33   * @since 9
34   */
35  (options?: { rating: number; indicator?: boolean }): RatingAttribute;
36}
37
38/**
39 * Defines the rating attribute functions.
40 * @since 7
41 */
42/**
43 * Defines the rating attribute functions.
44 * @form
45 * @since 9
46 */
47declare class RatingAttribute extends CommonMethod<RatingAttribute> {
48  /**
49   * Called when the total number of stars is set.
50   * @since 7
51   */
52  /**
53   * Called when the total number of stars is set.
54   * @form
55   * @since 9
56   */
57  stars(value: number): RatingAttribute;
58
59  /**
60   * Called when the step size of the operation rating.
61   * @since 7
62   */
63  /**
64   * Called when the step size of the operation rating.
65   * @form
66   * @since 9
67   */
68  stepSize(value: number): RatingAttribute;
69
70  /**
71   * Called when a picture is set.
72   * @since 7
73   */
74  /**
75   * Called when a picture is set.
76   * @form
77   * @since 9
78   */
79  starStyle(value: { backgroundUri: string; foregroundUri: string; secondaryUri?: string }): RatingAttribute;
80
81  /**
82   * Called when the star rating of the operation scoring bar changes.
83   * @since 7
84   */
85  /**
86   * Called when the star rating of the operation scoring bar changes.
87   * @form
88   * @since 9
89   */
90  onChange(callback: (value: number) => void): RatingAttribute;
91}
92
93/**
94 * Defines Rating Component.
95 * @since 7
96 */
97/**
98 * Defines Rating Component.
99 * @form
100 * @since 9
101 */
102declare const Rating: RatingInterface;
103
104/**
105 * Defines Rating Component instance.
106 * @since 7
107 */
108/**
109 * Defines Rating Component instance.
110 * @form
111 * @since 9
112 */
113declare const RatingInstance: RatingAttribute;
114