1/* 2 * Copyright (c) 2022-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 * Defines the option in length unit of grid-row component. 18 * 19 * @interface GridRowSizeOption 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 9 22 * @form 23 */ 24/** 25 * Defines the option in length unit of grid-row component. 26 * 27 * @interface GridRowSizeOption 28 * @syscap SystemCapability.ArkUI.ArkUI.Full 29 * @crossplatform 30 * @since 10 31 * @form 32 */ 33declare interface GridRowSizeOption { 34 /** 35 * Grid Row Size Option xs 36 * 37 * @type { ?Length } 38 * @syscap SystemCapability.ArkUI.ArkUI.Full 39 * @since 9 40 * @form 41 */ 42 /** 43 * Grid Row Size Option xs 44 * 45 * @type { ?Length } 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @crossplatform 48 * @since 10 49 * @form 50 */ 51 xs?: Length, 52 53 /** 54 * Grid Row Size Option sm 55 * 56 * @type { ?Length } 57 * @syscap SystemCapability.ArkUI.ArkUI.Full 58 * @since 9 59 * @form 60 */ 61 /** 62 * Grid Row Size Option sm 63 * 64 * @type { ?Length } 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @crossplatform 67 * @since 10 68 * @form 69 */ 70 sm?: Length, 71 72 /** 73 * Grid Row Size Option md 74 * 75 * @type { ?Length } 76 * @syscap SystemCapability.ArkUI.ArkUI.Full 77 * @since 9 78 * @form 79 */ 80 /** 81 * Grid Row Size Option md 82 * 83 * @type { ?Length } 84 * @syscap SystemCapability.ArkUI.ArkUI.Full 85 * @crossplatform 86 * @since 10 87 * @form 88 */ 89 md?: Length, 90 91 /** 92 * Grid Row Size Option lg 93 * 94 * @type { ?Length } 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 9 97 * @form 98 */ 99 /** 100 * Grid Row Size Option lg 101 * 102 * @type { ?Length } 103 * @syscap SystemCapability.ArkUI.ArkUI.Full 104 * @crossplatform 105 * @since 10 106 * @form 107 */ 108 lg?: Length, 109 110 /** 111 * Grid Row Size Option xl 112 * 113 * @type { ?Length } 114 * @syscap SystemCapability.ArkUI.ArkUI.Full 115 * @since 9 116 * @form 117 */ 118 /** 119 * Grid Row Size Option xl 120 * 121 * @type { ?Length } 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @crossplatform 124 * @since 10 125 * @form 126 */ 127 xl?: Length, 128 129 /** 130 * Grid Row Size Option xxl 131 * 132 * @syscap SystemCapability.ArkUI.ArkUI.Full 133 * @since 9 134 * @form 135 */ 136 /** 137 * Grid Row Size Option xxl 138 * 139 * @syscap SystemCapability.ArkUI.ArkUI.Full 140 * @crossplatform 141 * @since 10 142 * @form 143 */ 144 xxl?: Length, 145} 146 147/** 148 * Defines the option in number unit of grid-container component. 149 * 150 * @interface GridRowColumnOption 151 * @syscap SystemCapability.ArkUI.ArkUI.Full 152 * @since 9 153 * @form 154 */ 155/** 156 * Defines the option in number unit of grid-container component. 157 * 158 * @interface GridRowColumnOption 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @crossplatform 161 * @since 10 162 * @form 163 */ 164declare interface GridRowColumnOption { 165 /** 166 * Grid Row Column Option xs 167 * 168 * @type { ?number } 169 * @syscap SystemCapability.ArkUI.ArkUI.Full 170 * @since 9 171 * @form 172 */ 173 /** 174 * Grid Row Column Option xs 175 * 176 * @type { ?number } 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @crossplatform 179 * @since 10 180 * @form 181 */ 182 xs?: number, 183 184 /** 185 * Grid Row Column Option sm 186 * 187 * @type { ?number } 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @since 9 190 * @form 191 */ 192 /** 193 * Grid Row Column Option sm 194 * 195 * @type { ?number } 196 * @syscap SystemCapability.ArkUI.ArkUI.Full 197 * @crossplatform 198 * @since 10 199 * @form 200 */ 201 sm?: number, 202 203 /** 204 * Grid Row Column Option md 205 * 206 * @type { ?number } 207 * @syscap SystemCapability.ArkUI.ArkUI.Full 208 * @since 9 209 * @form 210 */ 211 /** 212 * Grid Row Column Option md 213 * 214 * @type { ?number } 215 * @syscap SystemCapability.ArkUI.ArkUI.Full 216 * @crossplatform 217 * @since 10 218 * @form 219 */ 220 md?: number, 221 222 /** 223 * Grid Row Column Option lg 224 * 225 * @type { ?number } 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @since 9 228 * @form 229 */ 230 /** 231 * Grid Row Column Option lg 232 * 233 * @type { ?number } 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @crossplatform 236 * @since 10 237 * @form 238 */ 239 lg?: number, 240 241 /** 242 * Grid Row Column Option xl 243 * 244 * @type { ?number } 245 * @syscap SystemCapability.ArkUI.ArkUI.Full 246 * @since 9 247 * @form 248 */ 249 /** 250 * Grid Row Column Option xl 251 * 252 * @type { ?number } 253 * @syscap SystemCapability.ArkUI.ArkUI.Full 254 * @crossplatform 255 * @since 10 256 * @form 257 */ 258 xl?: number, 259 260 /** 261 * Grid Row Column Option xxl 262 * 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @since 9 265 * @form 266 */ 267 /** 268 * Grid Row Column Option xxl 269 * 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @since 10 273 * @form 274 */ 275 xxl?: number, 276} 277 278/** 279 * Defines the gutter of grid-row component. 280 * 281 * @interface GutterOption 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @since 9 284 * @form 285 */ 286/** 287 * Defines the gutter of grid-row component. 288 * 289 * @interface GutterOption 290 * @syscap SystemCapability.ArkUI.ArkUI.Full 291 * @crossplatform 292 * @since 10 293 * @form 294 */ 295declare interface GutterOption { 296 /** 297 * Define x in GutterOption 298 * 299 * @type { ?(Length | GridRowSizeOption) } 300 * @syscap SystemCapability.ArkUI.ArkUI.Full 301 * @since 9 302 * @form 303 */ 304 /** 305 * Define x in GutterOption 306 * 307 * @type { ?(Length | GridRowSizeOption) } 308 * @syscap SystemCapability.ArkUI.ArkUI.Full 309 * @crossplatform 310 * @since 10 311 * @form 312 */ 313 x?: Length | GridRowSizeOption, 314 315 /** 316 * Define y in GutterOption 317 * 318 * @type { ?(Length | GridRowSizeOption) } 319 * @syscap SystemCapability.ArkUI.ArkUI.Full 320 * @since 9 321 * @form 322 */ 323 /** 324 * Define y in GutterOption 325 * 326 * @type { ?(Length | GridRowSizeOption) } 327 * @syscap SystemCapability.ArkUI.ArkUI.Full 328 * @crossplatform 329 * @since 10 330 * @form 331 */ 332 y?: Length | GridRowSizeOption 333} 334 335/** 336 * Defines the breakpoint reference of grid-container component. 337 * 338 * @enum { number } 339 * @syscap SystemCapability.ArkUI.ArkUI.Full 340 * @since 9 341 * @form 342 */ 343/** 344 * Defines the breakpoint reference of grid-container component. 345 * 346 * @enum { number } 347 * @syscap SystemCapability.ArkUI.ArkUI.Full 348 * @crossplatform 349 * @since 10 350 * @form 351 */ 352declare enum BreakpointsReference { 353 /** 354 * Respond to breakpoint changes according to window width 355 * 356 * @syscap SystemCapability.ArkUI.ArkUI.Full 357 * @since 9 358 * @form 359 */ 360 /** 361 * Respond to breakpoint changes according to window width 362 * 363 * @syscap SystemCapability.ArkUI.ArkUI.Full 364 * @crossplatform 365 * @since 10 366 * @form 367 */ 368 WindowSize, 369 370 /** 371 * Respond to breakpoint changes according to component width 372 * 373 * @syscap SystemCapability.ArkUI.ArkUI.Full 374 * @since 9 375 * @form 376 */ 377 /** 378 * Respond to breakpoint changes according to component width 379 * 380 * @syscap SystemCapability.ArkUI.ArkUI.Full 381 * @crossplatform 382 * @since 10 383 * @form 384 */ 385 ComponentSize, 386} 387 388/** 389 * Defines the direction of grid-container component. 390 * 391 * @enum { number } 392 * @syscap SystemCapability.ArkUI.ArkUI.Full 393 * @since 9 394 * @form 395 */ 396/** 397 * Defines the direction of grid-container component. 398 * 399 * @enum { number } 400 * @syscap SystemCapability.ArkUI.ArkUI.Full 401 * @crossplatform 402 * @since 10 403 * @form 404 */ 405declare enum GridRowDirection { 406 /** 407 * The elements in the grid component are arranged in rows 408 * 409 * @syscap SystemCapability.ArkUI.ArkUI.Full 410 * @since 9 411 * @form 412 */ 413 /** 414 * The elements in the grid component are arranged in rows 415 * 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @crossplatform 418 * @since 10 419 * @form 420 */ 421 Row, 422 423 /** 424 * The elements in the grid component are arranged in reverse order of rows 425 * 426 * @syscap SystemCapability.ArkUI.ArkUI.Full 427 * @since 9 428 * @form 429 */ 430 /** 431 * The elements in the grid component are arranged in reverse order of rows 432 * 433 * @syscap SystemCapability.ArkUI.ArkUI.Full 434 * @crossplatform 435 * @since 10 436 * @form 437 */ 438 RowReverse, 439} 440 441/** 442 * Defines the breakpoints of grid-row component. 443 * 444 * @interface BreakPoints 445 * @syscap SystemCapability.ArkUI.ArkUI.Full 446 * @since 9 447 * @form 448 */ 449/** 450 * Defines the breakpoints of grid-row component. 451 * 452 * @interface BreakPoints 453 * @syscap SystemCapability.ArkUI.ArkUI.Full 454 * @crossplatform 455 * @since 10 456 * @form 457 */ 458declare interface BreakPoints { 459 /** 460 * Breakpoint array 461 * 462 * @type { ?Array<string> } 463 * @syscap SystemCapability.ArkUI.ArkUI.Full 464 * @since 9 465 * @form 466 */ 467 /** 468 * Breakpoint array 469 * 470 * @type { ?Array<string> } 471 * @syscap SystemCapability.ArkUI.ArkUI.Full 472 * @crossplatform 473 * @since 10 474 * @form 475 */ 476 value?: Array<string>, 477 478 /** 479 * Set breakpoint reference 480 * 481 * @type { ?BreakpointsReference } 482 * @syscap SystemCapability.ArkUI.ArkUI.Full 483 * @since 9 484 * @form 485 */ 486 /** 487 * Set breakpoint reference 488 * 489 * @type { ?BreakpointsReference } 490 * @syscap SystemCapability.ArkUI.ArkUI.Full 491 * @crossplatform 492 * @since 10 493 * @form 494 */ 495 reference?: BreakpointsReference, 496} 497 498/** 499 * Defines the options of grid-row component. 500 * 501 * @interface GridRowOptions 502 * @syscap SystemCapability.ArkUI.ArkUI.Full 503 * @since 9 504 * @form 505 */ 506/** 507 * Defines the options of grid-row component. 508 * 509 * @interface GridRowOptions 510 * @syscap SystemCapability.ArkUI.ArkUI.Full 511 * @crossplatform 512 * @since 10 513 * @form 514 */ 515declare interface GridRowOptions { 516 /** 517 * layout spacing between sub-components 518 * 519 * @type { ?(Length | GutterOption) } 520 * @syscap SystemCapability.ArkUI.ArkUI.Full 521 * @since 9 522 * @form 523 */ 524 /** 525 * layout spacing between sub-components 526 * 527 * @type { ?(Length | GutterOption) } 528 * @syscap SystemCapability.ArkUI.ArkUI.Full 529 * @crossplatform 530 * @since 10 531 * @form 532 */ 533 gutter?: Length | GutterOption; 534 535 /** 536 * Sets the total number of columns in the current layout. 537 * 538 * @type { ?(number | GridRowColumnOption) } 539 * @syscap SystemCapability.ArkUI.ArkUI.Full 540 * @since 9 541 * @form 542 */ 543 /** 544 * Sets the total number of columns in the current layout. 545 * 546 * @type { ?(number | GridRowColumnOption) } 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @crossplatform 549 * @since 10 550 * @form 551 */ 552 columns?: number | GridRowColumnOption; 553 554 /** 555 * grid-row layout breakpoints. 556 * 557 * @type { ?BreakPoints } 558 * @syscap SystemCapability.ArkUI.ArkUI.Full 559 * @since 9 560 * @form 561 */ 562 /** 563 * grid-row layout breakpoints. 564 * 565 * @type { ?BreakPoints } 566 * @syscap SystemCapability.ArkUI.ArkUI.Full 567 * @crossplatform 568 * @since 10 569 * @form 570 */ 571 breakpoints?: BreakPoints; 572 573 /** 574 * grid-row layout direction. 575 * 576 * @type { ?GridRowDirection } 577 * @syscap SystemCapability.ArkUI.ArkUI.Full 578 * @since 9 579 * @form 580 */ 581 /** 582 * grid-row layout direction. 583 * 584 * @type { ?GridRowDirection } 585 * @syscap SystemCapability.ArkUI.ArkUI.Full 586 * @crossplatform 587 * @since 10 588 * @form 589 */ 590 direction?: GridRowDirection; 591} 592 593/** 594 * Defines the the new version of grid-container component. 595 * 596 * @interface GridRowInterface 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @since 9 599 * @form 600 */ 601/** 602 * Defines the the new version of grid-container component. 603 * 604 * @interface GridRowInterface 605 * @syscap SystemCapability.ArkUI.ArkUI.Full 606 * @crossplatform 607 * @since 10 608 * @form 609 */ 610interface GridRowInterface { 611 /** 612 * Defines the constructor of GridRow. 613 * 614 * @param { GridRowOptions } option 615 * @returns { GridRowAttribute } 616 * @syscap SystemCapability.ArkUI.ArkUI.Full 617 * @since 9 618 * @form 619 */ 620 /** 621 * Defines the constructor of GridRow. 622 * 623 * @param { GridRowOptions } option 624 * @returns { GridRowAttribute } 625 * @syscap SystemCapability.ArkUI.ArkUI.Full 626 * @crossplatform 627 * @since 10 628 * @form 629 */ 630 (option?: GridRowOptions): GridRowAttribute; 631} 632 633declare class GridRowAttribute extends CommonMethod<GridRowAttribute> { 634 /** 635 * Callback triggered when the breakpoint changes 636 * 637 * @param { function } callback 638 * @returns { GridRowAttribute } 639 * @syscap SystemCapability.ArkUI.ArkUI.Full 640 * @since 9 641 * @form 642 */ 643 /** 644 * Callback triggered when the breakpoint changes 645 * 646 * @param { function } callback 647 * @returns { GridRowAttribute } 648 * @syscap SystemCapability.ArkUI.ArkUI.Full 649 * @crossplatform 650 * @since 10 651 * @form 652 */ 653 onBreakpointChange(callback: (breakpoints: string) => void): GridRowAttribute; 654 655 /** 656 * Cross axis alignment of each line in GridRow. 657 * 658 * @param { ItemAlign } value - element alignment 659 * @returns { GridRowAttribute } 660 * @syscap SystemCapability.ArkUI.ArkUI.Full 661 * @crossplatform 662 * @since 10 663 * @form 664 */ 665 alignItems(value: ItemAlign): GridRowAttribute; 666} 667 668/** 669 * Defines GridRow Component. 670 * 671 * @syscap SystemCapability.ArkUI.ArkUI.Full 672 * @since 9 673 * @form 674 */ 675/** 676 * Defines GridRow Component. 677 * 678 * @syscap SystemCapability.ArkUI.ArkUI.Full 679 * @crossplatform 680 * @since 10 681 * @form 682 */ 683declare const GridRow: GridRowInterface; 684 685/** 686 * Defines GridRow Component instance. 687 * 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @since 9 690 * @form 691 */ 692/** 693 * Defines GridRow Component instance. 694 * 695 * @syscap SystemCapability.ArkUI.ArkUI.Full 696 * @crossplatform 697 * @since 10 698 * @form 699 */ 700declare const GridRowInstance: GridRowAttribute; 701