• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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 * Enumerates the layout direction of the icon and text.
18 *
19 * @enum { number }
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 10
22 */
23declare enum SecurityComponentLayoutDirection {
24  /**
25   * Horizontal layout.
26   *
27   * @syscap SystemCapability.ArkUI.ArkUI.Full
28   * @since 10
29   */
30  HORIZONTAL = 0,
31
32  /**
33   * Vertical layout.
34   *
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @since 10
37   */
38  VERTICAL = 1
39}
40
41/**
42 * Defines the method of a security component.
43 *
44 * @syscap SystemCapability.ArkUI.ArkUI.Full
45 * @since 10
46 */
47declare class SecurityComponentMethod<T> {
48  /**
49   * Icon size.
50   *
51   * @param { Dimension } value - Indicates the size of the icon.
52   * @returns { T } Returns the attribute of the security component.
53   * @syscap SystemCapability.ArkUI.ArkUI.Full
54   * @since 10
55   */
56  iconSize(value: Dimension): T;
57
58  /**
59   * Layout direction of the icon and text.
60   *
61   * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text.
62   * @returns { T } Returns the attribute of the security component.
63   * @syscap SystemCapability.ArkUI.ArkUI.Full
64   * @since 10
65   */
66  layoutDirection(value: SecurityComponentLayoutDirection): T;
67
68  /**
69   * Position of the security component.
70   *
71   * @param { Position } value - Indicates the position of the security component.
72   * @returns { T } Returns the attribute of the security component.
73   * @syscap SystemCapability.ArkUI.ArkUI.Full
74   * @since 10
75   */
76  position(value: Position): T;
77
78  /**
79   * Anchor of the security component for positioning. The top start edge of the component is used as
80   * the reference point for offset.
81   *
82   * @param { Position } value - Indicates the anchor of the component when it is positioned.
83   * @returns { T } Returns the attribute of the security component.
84   * @syscap SystemCapability.ArkUI.ArkUI.Full
85   * @since 10
86   */
87  markAnchor(value: Position): T;
88
89  /**
90   * Coordinate offset relative to the layout position.
91   * Setting this attribute does not affect the layout of the parent container.
92   * The position is adjusted only during drawing.
93   *
94   * @param { Position } value - Indicates the offset value.
95   * @returns { T } Returns the attribute of the security component.
96   * @syscap SystemCapability.ArkUI.ArkUI.Full
97   * @since 10
98   */
99  offset(value: Position): T;
100
101  /**
102   * Font size of the inner text.
103   *
104   * @param { Dimension } value - Indicates the font size of the text in the security component.
105   * @returns { T } Returns the attribute of the security component.
106   * @syscap SystemCapability.ArkUI.ArkUI.Full
107   * @since 10
108   */
109  fontSize(value: Dimension): T;
110
111  /**
112   * Font style of the inner text.
113   *
114   * @param { FontStyle } value - Indicates the font style of the text in the security component.
115   * @returns { T } Returns the attribute of the security component.
116   * @syscap SystemCapability.ArkUI.ArkUI.Full
117   * @since 10
118   */
119  fontStyle(value: FontStyle): T;
120
121  /**
122   * Font weight of the inner text.
123   *
124   * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component.
125   * @returns { T } Returns the attribute of the security component.
126   * @syscap SystemCapability.ArkUI.ArkUI.Full
127   * @since 10
128   */
129  fontWeight(value: number | FontWeight | string): T;
130
131  /**
132   * Font family of the inner text.
133   *
134   * @param { string | Resource } value - Indicates the font family of the text in the security component.
135   * @returns { T } Returns the attribute of the security component.
136   * @syscap SystemCapability.ArkUI.ArkUI.Full
137   * @since 10
138   */
139  fontFamily(value: string | Resource): T;
140
141  /**
142   * Font color of the inner text.
143   *
144   * @param { ResourceColor } value - Indicates the font color of the text in the security component.
145   * @returns { T } Returns the attribute of the security component.
146   * @syscap SystemCapability.ArkUI.ArkUI.Full
147   * @since 10
148   */
149  fontColor(value: ResourceColor): T;
150
151  /**
152   * Color of the icon.
153   *
154   * @param { ResourceColor } value - Indicates the icon color in the security component.
155   * @returns { T } Returns the attribute of the security component.
156   * @syscap SystemCapability.ArkUI.ArkUI.Full
157   * @since 10
158   */
159  iconColor(value: ResourceColor): T;
160
161  /**
162   * Background color.
163   *
164   * @param { ResourceColor } value - Indicates the background color of the security component.
165   * @returns { T } Returns the attribute of the security component.
166   * @syscap SystemCapability.ArkUI.ArkUI.Full
167   * @since 10
168   */
169  backgroundColor(value: ResourceColor): T;
170
171  /**
172   * Style of the border.
173   *
174   * @param { BorderStyle } value - Indicates the border style of the security component.
175   * @returns { T } Returns the attribute of the security component.
176   * @syscap SystemCapability.ArkUI.ArkUI.Full
177   * @since 10
178   */
179  borderStyle(value: BorderStyle): T;
180
181  /**
182   * Width of the border.
183   *
184   * @param { Dimension } value - Indicates the border width of the security component.
185   * @returns { T } Returns the attribute of the security component.
186   * @syscap SystemCapability.ArkUI.ArkUI.Full
187   * @since 10
188   */
189  borderWidth(value: Dimension): T;
190
191  /**
192   * Color of the border.
193   *
194   * @param { ResourceColor } value - Indicates the border color of the security component.
195   * @returns { T } Returns the attribute of the security component.
196   * @syscap SystemCapability.ArkUI.ArkUI.Full
197   * @since 10
198   */
199  borderColor(value: ResourceColor): T;
200
201  /**
202   * Radius of the border.
203   *
204   * @param { Dimension } value - Indicates the border radius of the security component.
205   * @returns { T } Returns the attribute of the security component.
206   * @syscap SystemCapability.ArkUI.ArkUI.Full
207   * @since 10
208   */
209  borderRadius(value: Dimension): T;
210
211  /**
212   * Padding between the background border and icon/inner text.
213   *
214   * @param { Padding | Dimension } value - Indicates the padding of the security component.
215   * @returns { T } Returns the attribute of the security component.
216   * @syscap SystemCapability.ArkUI.ArkUI.Full
217   * @since 10
218   */
219  padding(value: Padding | Dimension): T;
220
221  /**
222   * Space between the inner text and icon.
223   *
224   * @param { Dimension } value - Indicates the space between the inner text and icon.
225   * @returns { T } Returns the attribute of the security component.
226   * @syscap SystemCapability.ArkUI.ArkUI.Full
227   * @since 10
228   */
229  textIconSpace(value: Dimension): T;
230
231  /**
232   * Key. User can set an key to the component to identify it.
233   *
234   * @param { string } value - identify the key of the component.
235   * @returns { T } Returns the attribute of the security component.
236   * @syscap SystemCapability.ArkUI.ArkUI.Full
237   * @systemapi
238   * @since 10
239   * @test
240   */
241  key(value: string): T;
242}
243