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 * Padding between the background border and icon/inner text. 405 * 406 * @param { Padding | Dimension } value - Indicates the padding of the security component. 407 * @returns { T } Returns the attribute of the security component. 408 * @syscap SystemCapability.ArkUI.ArkUI.Full 409 * @since 10 410 */ 411 /** 412 * Padding between the background border and icon/inner text. 413 * 414 * @param { Padding | Dimension } value - Indicates the padding of the security component. 415 * @returns { T } Returns the attribute of the security component. 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @atomicservice 418 * @since 11 419 */ 420 padding(value: Padding | Dimension): T; 421 422 /** 423 * Space between the inner text and icon. 424 * 425 * @param { Dimension } value - Indicates the space between the inner text and icon. 426 * @returns { T } Returns the attribute of the security component. 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @since 10 429 */ 430 /** 431 * Space between the inner text and icon. 432 * 433 * @param { Dimension } value - Indicates the space between the inner text and icon. 434 * @returns { T } Returns the attribute of the security component. 435 * @syscap SystemCapability.ArkUI.ArkUI.Full 436 * @atomicservice 437 * @since 11 438 */ 439 textIconSpace(value: Dimension): T; 440 441 /** 442 * Key. User can set an key to the component to identify it. 443 * 444 * @param { string } value - identify the key of the component. 445 * @returns { T } Returns the attribute of the security component. 446 * @syscap SystemCapability.ArkUI.ArkUI.Full 447 * @systemapi 448 * @since 10 449 * @test 450 */ 451 key(value: string): T; 452 453 /** 454 * Sets the width of the component. 455 * 456 * @param { Length } value - Indicates the width of the security component. 457 * @returns { T } Returns the attribute of the security component. 458 * @syscap SystemCapability.ArkUI.ArkUI.Full 459 * @since 11 460 */ 461 /** 462 * Sets the width of the component. 463 * 464 * @param { Length } value - Indicates the width of the security component. 465 * @returns { T } Returns the attribute of the security component. 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @atomicservice 468 * @since 12 469 */ 470 width(value: Length): T; 471 472 /** 473 * Sets the height of the component. 474 * 475 * @param { Length } value - Indicates the height of the security component. 476 * @returns { T } Returns the attribute of the security component. 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @since 11 479 */ 480 /** 481 * Sets the height of the component. 482 * 483 * @param { Length } value - Indicates the height of the security component. 484 * @returns { T } Returns the attribute of the security component. 485 * @syscap SystemCapability.ArkUI.ArkUI.Full 486 * @atomicservice 487 * @since 12 488 */ 489 height(value: Length): T; 490 491 /** 492 * The size of the component. 493 * 494 * @param { SizeOptions } value - Indicates the size of the security component. 495 * @returns { T } Returns the attribute of the security component. 496 * @syscap SystemCapability.ArkUI.ArkUI.Full 497 * @since 11 498 */ 499 /** 500 * The size of the component. 501 * 502 * @param { SizeOptions } value - Indicates the size of the security component. 503 * @returns { T } Returns the attribute of the security component. 504 * @syscap SystemCapability.ArkUI.ArkUI.Full 505 * @atomicservice 506 * @since 12 507 */ 508 size(value: SizeOptions): T; 509 510 /** 511 * constraint Size: 512 * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. 513 * 514 * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component. 515 * @returns { T } Returns the attribute of the security component. 516 * @syscap SystemCapability.ArkUI.ArkUI.Full 517 * @since 11 518 */ 519 /** 520 * constraint Size: 521 * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. 522 * 523 * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component. 524 * @returns { T } Returns the attribute of the security component. 525 * @syscap SystemCapability.ArkUI.ArkUI.Full 526 * @atomicservice 527 * @since 12 528 */ 529 constraintSize(value: ConstraintSizeOptions): T; 530} 531