• 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 * @file
18 * @kit ArkUI
19 */
20
21/**
22 * Enumerates the layout direction of the icon and text.
23 *
24 * @enum { number }
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @since 10
27 */
28/**
29 * Enumerates the layout direction of the icon and text.
30 *
31 * @enum { number }
32 * @syscap SystemCapability.ArkUI.ArkUI.Full
33 * @atomicservice
34 * @since 11
35 */
36declare enum SecurityComponentLayoutDirection {
37  /**
38   * Horizontal layout.
39   *
40   * @syscap SystemCapability.ArkUI.ArkUI.Full
41   * @since 10
42   */
43  /**
44   * Horizontal layout.
45   *
46   * @syscap SystemCapability.ArkUI.ArkUI.Full
47   * @atomicservice
48   * @since 11
49   */
50  HORIZONTAL = 0,
51
52  /**
53   * Vertical layout.
54   *
55   * @syscap SystemCapability.ArkUI.ArkUI.Full
56   * @since 10
57   */
58  /**
59   * Vertical layout.
60   *
61   * @syscap SystemCapability.ArkUI.ArkUI.Full
62   * @atomicservice
63   * @since 11
64   */
65  VERTICAL = 1
66}
67
68/**
69 * Defines the method of a security component.
70 *
71 * @syscap SystemCapability.ArkUI.ArkUI.Full
72 * @since 10
73 */
74/**
75 * Defines the method of a security component.
76 *
77 * @syscap SystemCapability.ArkUI.ArkUI.Full
78 * @atomicservice
79 * @since 11
80 */
81declare class SecurityComponentMethod<T> {
82  /**
83   * Icon size.
84   *
85   * @param { Dimension } value - Indicates the size of the icon.
86   * @returns { T } Returns the attribute of the security component.
87   * @syscap SystemCapability.ArkUI.ArkUI.Full
88   * @since 10
89   */
90  /**
91   * Icon size.
92   *
93   * @param { Dimension } value - Indicates the size of the icon.
94   * @returns { T } Returns the attribute of the security component.
95   * @syscap SystemCapability.ArkUI.ArkUI.Full
96   * @atomicservice
97   * @since 11
98   */
99  iconSize(value: Dimension): T;
100
101  /**
102   * Layout direction of the icon and text.
103   *
104   * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text.
105   * @returns { T } Returns the attribute of the security component.
106   * @syscap SystemCapability.ArkUI.ArkUI.Full
107   * @since 10
108   */
109  /**
110   * Layout direction of the icon and text.
111   *
112   * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text.
113   * @returns { T } Returns the attribute of the security component.
114   * @syscap SystemCapability.ArkUI.ArkUI.Full
115   * @atomicservice
116   * @since 11
117   */
118  layoutDirection(value: SecurityComponentLayoutDirection): T;
119
120  /**
121   * Position of the security component.
122   *
123   * @param { Position } value - Indicates the position of the security component.
124   * @returns { T } Returns the attribute of the security component.
125   * @syscap SystemCapability.ArkUI.ArkUI.Full
126   * @since 10
127   */
128  /**
129   * Position of the security component.
130   *
131   * @param { Position } value - Indicates the position of the security component.
132   * @returns { T } Returns the attribute of the security component.
133   * @syscap SystemCapability.ArkUI.ArkUI.Full
134   * @atomicservice
135   * @since 11
136   */
137  position(value: Position): T;
138
139  /**
140   * Anchor of the security component for positioning. The top start edge of the component is used as
141   * the reference point for offset.
142   *
143   * @param { Position } value - Indicates the anchor of the component when it is positioned.
144   * @returns { T } Returns the attribute of the security component.
145   * @syscap SystemCapability.ArkUI.ArkUI.Full
146   * @since 10
147   */
148  /**
149   * Anchor of the security component for positioning. The top start edge of the component is used as
150   * the reference point for offset.
151   *
152   * @param { Position } value - Indicates the anchor of the component when it is positioned.
153   * @returns { T } Returns the attribute of the security component.
154   * @syscap SystemCapability.ArkUI.ArkUI.Full
155   * @atomicservice
156   * @since 11
157   */
158  markAnchor(value: Position): T;
159
160  /**
161   * Coordinate offset relative to the layout position.
162   * Setting this attribute does not affect the layout of the parent container.
163   * The position is adjusted only during drawing.
164   *
165   * @param { Position } value - Indicates the offset value.
166   * @returns { T } Returns the attribute of the security component.
167   * @syscap SystemCapability.ArkUI.ArkUI.Full
168   * @since 10
169   */
170  /**
171   * Coordinate offset relative to the layout position.
172   * Setting this attribute does not affect the layout of the parent container.
173   * The position is adjusted only during drawing.
174   *
175   * @param { Position } value - Indicates the offset value.
176   * @returns { T } Returns the attribute of the security component.
177   * @syscap SystemCapability.ArkUI.ArkUI.Full
178   * @atomicservice
179   * @since 11
180   */
181  /**
182   * Coordinate offset relative to the layout completion position.
183   * Setting this attribute does not affect the layout of the parent container.
184   * The position is adjusted only during drawing.
185   *
186   * @param { Position | Edges | LocalizedEdges } value
187   * @returns { T }
188   * @syscap SystemCapability.ArkUI.ArkUI.Full
189   * @atomicservice
190   * @since 12
191   */
192  offset(value: Position | Edges | LocalizedEdges): T;
193
194  /**
195   * Font size of the inner text.
196   *
197   * @param { Dimension } value - Indicates the font size of the text in the security component.
198   * @returns { T } Returns the attribute of the security component.
199   * @syscap SystemCapability.ArkUI.ArkUI.Full
200   * @since 10
201   */
202  /**
203   * Font size of the inner text.
204   *
205   * @param { Dimension } value - Indicates the font size of the text in the security component.
206   * @returns { T } Returns the attribute of the security component.
207   * @syscap SystemCapability.ArkUI.ArkUI.Full
208   * @atomicservice
209   * @since 11
210   */
211  fontSize(value: Dimension): T;
212
213  /**
214   * Font style of the inner text.
215   *
216   * @param { FontStyle } value - Indicates the font style of the text in the security component.
217   * @returns { T } Returns the attribute of the security component.
218   * @syscap SystemCapability.ArkUI.ArkUI.Full
219   * @since 10
220   */
221  /**
222   * Font style of the inner text.
223   *
224   * @param { FontStyle } value - Indicates the font style of the text in the security component.
225   * @returns { T } Returns the attribute of the security component.
226   * @syscap SystemCapability.ArkUI.ArkUI.Full
227   * @atomicservice
228   * @since 11
229   */
230  fontStyle(value: FontStyle): T;
231
232  /**
233   * Font weight of the inner text.
234   *
235   * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component.
236   * @returns { T } Returns the attribute of the security component.
237   * @syscap SystemCapability.ArkUI.ArkUI.Full
238   * @since 10
239   */
240  /**
241   * Font weight of the inner text.
242   *
243   * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component.
244   * @returns { T } Returns the attribute of the security component.
245   * @syscap SystemCapability.ArkUI.ArkUI.Full
246   * @atomicservice
247   * @since 11
248   */
249  fontWeight(value: number | FontWeight | string): T;
250
251  /**
252   * Font family of the inner text.
253   *
254   * @param { string | Resource } value - Indicates the font family of the text in the security component.
255   * @returns { T } Returns the attribute of the security component.
256   * @syscap SystemCapability.ArkUI.ArkUI.Full
257   * @since 10
258   */
259  /**
260   * Font family of the inner text.
261   *
262   * @param { string | Resource } value - Indicates the font family of the text in the security component.
263   * @returns { T } Returns the attribute of the security component.
264   * @syscap SystemCapability.ArkUI.ArkUI.Full
265   * @atomicservice
266   * @since 11
267   */
268  fontFamily(value: string | Resource): T;
269
270  /**
271   * Font color of the inner text.
272   *
273   * @param { ResourceColor } value - Indicates the font color of the text in the security component.
274   * @returns { T } Returns the attribute of the security component.
275   * @syscap SystemCapability.ArkUI.ArkUI.Full
276   * @since 10
277   */
278  /**
279   * Font color of the inner text.
280   *
281   * @param { ResourceColor } value - Indicates the font color of the text in the security component.
282   * @returns { T } Returns the attribute of the security component.
283   * @syscap SystemCapability.ArkUI.ArkUI.Full
284   * @atomicservice
285   * @since 11
286   */
287  fontColor(value: ResourceColor): T;
288
289  /**
290   * Color of the icon.
291   *
292   * @param { ResourceColor } value - Indicates the icon color in the security component.
293   * @returns { T } Returns the attribute of the security component.
294   * @syscap SystemCapability.ArkUI.ArkUI.Full
295   * @since 10
296   */
297  /**
298   * Color of the icon.
299   *
300   * @param { ResourceColor } value - Indicates the icon color in the security component.
301   * @returns { T } Returns the attribute of the security component.
302   * @syscap SystemCapability.ArkUI.ArkUI.Full
303   * @atomicservice
304   * @since 11
305   */
306  iconColor(value: ResourceColor): T;
307
308  /**
309   * Background color.
310   *
311   * @param { ResourceColor } value - Indicates the background color of the security component.
312   * @returns { T } Returns the attribute of the security component.
313   * @syscap SystemCapability.ArkUI.ArkUI.Full
314   * @since 10
315   */
316  /**
317   * Background color.
318   *
319   * @param { ResourceColor } value - Indicates the background color of the security component.
320   * @returns { T } Returns the attribute of the security component.
321   * @syscap SystemCapability.ArkUI.ArkUI.Full
322   * @atomicservice
323   * @since 11
324   */
325  backgroundColor(value: ResourceColor): T;
326
327  /**
328   * Style of the border.
329   *
330   * @param { BorderStyle } value - Indicates the border style of the security component.
331   * @returns { T } Returns the attribute of the security component.
332   * @syscap SystemCapability.ArkUI.ArkUI.Full
333   * @since 10
334   */
335  /**
336   * Style of the border.
337   *
338   * @param { BorderStyle } value - Indicates the border style of the security component.
339   * @returns { T } Returns the attribute of the security component.
340   * @syscap SystemCapability.ArkUI.ArkUI.Full
341   * @atomicservice
342   * @since 11
343   */
344  borderStyle(value: BorderStyle): T;
345
346  /**
347   * Width of the border.
348   *
349   * @param { Dimension } value - Indicates the border width of the security component.
350   * @returns { T } Returns the attribute of the security component.
351   * @syscap SystemCapability.ArkUI.ArkUI.Full
352   * @since 10
353   */
354  /**
355   * Width of the border.
356   *
357   * @param { Dimension } value - Indicates the border width of the security component.
358   * @returns { T } Returns the attribute of the security component.
359   * @syscap SystemCapability.ArkUI.ArkUI.Full
360   * @atomicservice
361   * @since 11
362   */
363  borderWidth(value: Dimension): T;
364
365  /**
366   * Color of the border.
367   *
368   * @param { ResourceColor } value - Indicates the border color of the security component.
369   * @returns { T } Returns the attribute of the security component.
370   * @syscap SystemCapability.ArkUI.ArkUI.Full
371   * @since 10
372   */
373  /**
374   * Color of the border.
375   *
376   * @param { ResourceColor } value - Indicates the border color of the security component.
377   * @returns { T } Returns the attribute of the security component.
378   * @syscap SystemCapability.ArkUI.ArkUI.Full
379   * @atomicservice
380   * @since 11
381   */
382  borderColor(value: ResourceColor): T;
383
384  /**
385   * Radius of the border.
386   *
387   * @param { Dimension } value - Indicates the border radius of the security component.
388   * @returns { T } Returns the attribute of the security component.
389   * @syscap SystemCapability.ArkUI.ArkUI.Full
390   * @since 10
391   */
392  /**
393   * Radius of the border.
394   *
395   * @param { Dimension } value - Indicates the border radius of the security component.
396   * @returns { T } Returns the attribute of the security component.
397   * @syscap SystemCapability.ArkUI.ArkUI.Full
398   * @atomicservice
399   * @since 11
400   */
401  borderRadius(value: Dimension): T;
402
403  /**
404   * Radius of the border.
405   *
406   * @param { Dimension | BorderRadiuses } radius - Indicates the border radius of the security component.
407   * @returns { T } Returns the attribute of the security component.
408   * @syscap SystemCapability.ArkUI.ArkUI.Full
409   * @atomicservice
410   * @since 15
411   */
412  borderRadius(radius: Dimension | BorderRadiuses): T;
413
414  /**
415   * Padding between the background border and icon/inner text.
416   *
417   * @param { Padding | Dimension } value - Indicates the padding of the security component.
418   * @returns { T } Returns the attribute of the security component.
419   * @syscap SystemCapability.ArkUI.ArkUI.Full
420   * @since 10
421   */
422  /**
423   * Padding between the background border and icon/inner text.
424   *
425   * @param { Padding | Dimension } value - Indicates the padding of the security component.
426   * @returns { T } Returns the attribute of the security component.
427   * @syscap SystemCapability.ArkUI.ArkUI.Full
428   * @atomicservice
429   * @since 11
430   */
431  padding(value: Padding | Dimension): T;
432
433  /**
434   * Space between the inner text and icon.
435   *
436   * @param { Dimension } value - Indicates the space between the inner text and icon.
437   * @returns { T } Returns the attribute of the security component.
438   * @syscap SystemCapability.ArkUI.ArkUI.Full
439   * @since 10
440   */
441  /**
442   * Space between the inner text and icon.
443   *
444   * @param { Dimension } value - Indicates the space between the inner text and icon.
445   * @returns { T } Returns the attribute of the security component.
446   * @syscap SystemCapability.ArkUI.ArkUI.Full
447   * @atomicservice
448   * @since 11
449   */
450  textIconSpace(value: Dimension): T;
451
452  /**
453   * Key. User can set an key to the component to identify it.
454   *
455   * @param { string } value - identify the key of the component.
456   * @returns { T } Returns the attribute of the security component.
457   * @syscap SystemCapability.ArkUI.ArkUI.Full
458   * @systemapi
459   * @since 10
460   * @test
461   */
462  key(value: string): T;
463
464  /**
465   * Sets the width of the component.
466   *
467   * @param { Length } value - Indicates the width of the security component.
468   * @returns { T } Returns the attribute of the security component.
469   * @syscap SystemCapability.ArkUI.ArkUI.Full
470   * @since 11
471   */
472  /**
473   * Sets the width of the component.
474   *
475   * @param { Length } value - Indicates the width of the security component.
476   * @returns { T } Returns the attribute of the security component.
477   * @syscap SystemCapability.ArkUI.ArkUI.Full
478   * @atomicservice
479   * @since 12
480   */
481  width(value: Length): T;
482
483  /**
484   * Sets the height of the component.
485   *
486   * @param { Length } value - Indicates the height of the security component.
487   * @returns { T } Returns the attribute of the security component.
488   * @syscap SystemCapability.ArkUI.ArkUI.Full
489   * @since 11
490   */
491  /**
492   * Sets the height of the component.
493   *
494   * @param { Length } value - Indicates the height of the security component.
495   * @returns { T } Returns the attribute of the security component.
496   * @syscap SystemCapability.ArkUI.ArkUI.Full
497   * @atomicservice
498   * @since 12
499   */
500  height(value: Length): T;
501
502  /**
503   * The size of the component.
504   *
505   * @param { SizeOptions } value - Indicates the size of the security component.
506   * @returns { T } Returns the attribute of the security component.
507   * @syscap SystemCapability.ArkUI.ArkUI.Full
508   * @since 11
509   */
510  /**
511   * The size of the component.
512   *
513   * @param { SizeOptions } value - Indicates the size of the security component.
514   * @returns { T } Returns the attribute of the security component.
515   * @syscap SystemCapability.ArkUI.ArkUI.Full
516   * @atomicservice
517   * @since 12
518   */
519  size(value: SizeOptions): T;
520
521  /**
522   * constraint Size:
523   * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height.
524   *
525   * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component.
526   * @returns { T } Returns the attribute of the security component.
527   * @syscap SystemCapability.ArkUI.ArkUI.Full
528   * @since 11
529   */
530  /**
531   * constraint Size:
532   * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height.
533   *
534   * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component.
535   * @returns { T } Returns the attribute of the security component.
536   * @syscap SystemCapability.ArkUI.ArkUI.Full
537   * @atomicservice
538   * @since 12
539   */
540  constraintSize(value: ConstraintSizeOptions): T;
541
542  /**
543   * align
544   *
545   * @param { Alignment } alignType - Indicates the align type of the security component.
546   * @returns { T } Returns the attribute of the security component.
547   * @syscap SystemCapability.ArkUI.ArkUI.Full
548   * @atomicservice
549   * @since 15
550   */
551  align(alignType: Alignment): T;
552
553  /**
554   * Specifies the alignRules of relative container
555   *
556   * @param { AlignRuleOption } alignRule
557   * @returns { T } Returns the attribute of the security component.
558   * @syscap SystemCapability.ArkUI.ArkUI.Full
559   * @atomicservice
560   * @since 15
561   */
562  alignRules(alignRule: AlignRuleOption): T;
563
564  /**
565   * Specifies the localized alignRules of relative container
566   *
567   * @param { LocalizedAlignRuleOptions } alignRule
568   * @returns { T } Returns the attribute of the security component.
569   * @syscap SystemCapability.ArkUI.ArkUI.Full
570   * @atomicservice
571   * @since 15
572   */
573  alignRules(alignRule: LocalizedAlignRuleOptions): T;
574
575  /**
576   * Id. User can set an id to the component to identify it.
577   *
578   * @param { string } description
579   * @returns { T } Returns the attribute of the security component.
580   * @syscap SystemCapability.ArkUI.ArkUI.Full
581   * @atomicservice
582   * @since 15
583   */
584  id(description: string): T;
585
586  /**
587   * Specifies the direction and style of chain in relative container
588   *
589   * @param { Axis } direction - Indicates direction of the chain
590   * @param { ChainStyle } style - Indicates style of the chain
591   * @returns { T } Returns the attribute of the security component.
592   * @syscap SystemCapability.ArkUI.ArkUI.Full
593   * @atomicservice
594   * @since 15
595   */
596  chainMode(direction: Axis, style: ChainStyle): T;
597
598  /**
599   * Sets the minimum font scale factor for text.
600   *
601   * @param { number | Resource } scale Minimum font scale factor to set.
602   * @returns { T } Returns the attributes of the security component.
603   * @syscap SystemCapability.ArkUI.ArkUI.Full
604   * @atomicservice
605   * @since 18
606   */
607  minFontScale(scale: number | Resource): T;
608
609  /**
610   * Sets the maximum font scale factor for text.
611   *
612   * @param { number | Resource  } scale Maximum font scale factor to set.
613   * @returns { T } Returns the attributes of the security component.
614   * @syscap SystemCapability.ArkUI.ArkUI.Full
615   * @atomicservice
616   * @since 18
617   */
618  maxFontScale(scale: number | Resource): T;
619
620  /**
621   * Called when the maximum number of lines of text is set.
622   *
623   * @param { number } line
624   * @returns { T } Returns the attribute of the security component.
625   * @syscap SystemCapability.ArkUI.ArkUI.Full
626   * @atomicservice
627   * @since 18
628   */
629  maxLines(line: number): T;
630
631  /**
632   * Called when the minimum font size of the font is set.
633   *
634   * @param { number | string | Resource } minSize
635   * @returns { T } Returns the attribute of the security component.
636   * @syscap SystemCapability.ArkUI.ArkUI.Full
637   * @atomicservice
638   * @since 18
639   */
640  minFontSize(minSize: number | string | Resource): T;
641
642  /**
643   * Called when the maximum font size of the font is set.
644   *
645   * @param { number | string | Resource } maxSize
646   * @returns { T } Returns the attribute of the security component.
647   * @syscap SystemCapability.ArkUI.ArkUI.Full
648   * @atomicservice
649   * @since 18
650   */
651  maxFontSize(maxSize: number | string | Resource): T;
652
653  /**
654   * Called when the height adaptive policy is set.
655   *
656   * @param { TextHeightAdaptivePolicy } policy - The height adaptive policy.
657   * @returns { T } Returns the attribute of the security component.
658   * @syscap SystemCapability.ArkUI.ArkUI.Full
659   * @atomicservice
660   * @since 18
661   */
662  heightAdaptivePolicy(policy: TextHeightAdaptivePolicy): T;
663
664  /**
665   * If the value is true, the component is available and can respond to operations such as clicking.
666   *  If it is set to false, click operations are not responded.
667   *
668   * @param { boolean } respond - Indicates whether the button is responded to.
669   * @returns { T } Returns the attribute of the security component.
670   * @syscap SystemCapability.ArkUI.ArkUI.Full
671   * @atomicservice
672   * @since 18
673   */
674  enabled(respond: boolean): T;
675}
676