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 21import { UIContext } from '../@ohos.arkui.UIContext'; 22import { RenderNode } from './RenderNode'; 23import { Size, Position, Edges, LengthMetrics, SizeT } from './Graphics'; 24import { DrawContext } from './Graphics'; 25import { ComponentContent } from './ComponentContent'; 26import { BusinessError } from '../@ohos.base'; 27 28/** 29 * Layout constraint, include the max size, the min size and the reference size for children to calculate percent. 30 * 31 * @interface LayoutConstraint 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @atomicservice 35 * @since 12 36 */ 37declare interface LayoutConstraint { 38 /** 39 * MaxSize 40 * 41 * @type { Size } 42 * @syscap SystemCapability.ArkUI.ArkUI.Full 43 * @crossplatform 44 * @atomicservice 45 * @since 12 46 */ 47 maxSize: Size; 48 49 /** 50 * MinSize 51 * 52 * @type { Size } 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @crossplatform 55 * @atomicservice 56 * @since 12 57 */ 58 minSize: Size; 59 60 /** 61 * PercentReference, if the size unit of the child nodes is percentage, then they use PercentReference to calculate 62 * the px size. 63 * 64 * @type { Size } 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @crossplatform 67 * @atomicservice 68 * @since 12 69 */ 70 percentReference: Size; 71} 72 73/** 74 * Defines the cross-language options. 75 * 76 * @interface CrossLanguageOptions 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @crossplatform 79 * @atomicservice 80 * @since 15 81 */ 82declare interface CrossLanguageOptions { 83 /** 84 * Defines if it enables setting attributes cross-language. Default value is false. 85 * 86 * @type { boolean } 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @crossplatform 89 * @atomicservice 90 * @since 15 91 */ 92 attributeSetting?: boolean 93} 94 95/** 96 * Enum for the expand mode. 97 * 98 * @enum { number } 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @crossplatform 101 * @atomicservice 102 * @since 15 103 */ 104export enum ExpandMode { 105 /** 106 * Do not expand the children of node. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @crossplatform 110 * @atomicservice 111 * @since 15 112 */ 113 NOT_EXPAND = 0, 114 115 /** 116 * Expand the children of node. 117 * 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @crossplatform 120 * @atomicservice 121 * @since 15 122 */ 123 EXPAND = 1, 124 125 /** 126 * Expand the children of node if needed. 127 * 128 * @syscap SystemCapability.ArkUI.ArkUI.Full 129 * @crossplatform 130 * @atomicservice 131 * @since 15 132 */ 133 LAZY_EXPAND = 2, 134} 135 136/** 137 * Defines FrameNode. 138 * 139 * @syscap SystemCapability.ArkUI.ArkUI.Full 140 * @crossplatform 141 * @since 11 142 */ 143/** 144 * Defines FrameNode. 145 * 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @crossplatform 148 * @atomicservice 149 * @since 12 150 */ 151export class FrameNode { 152 /** 153 * Constructor. 154 * 155 * @param { UIContext } uiContext - uiContext used to create the FrameNode 156 * @syscap SystemCapability.ArkUI.ArkUI.Full 157 * @crossplatform 158 * @since 11 159 */ 160 /** 161 * Constructor. 162 * 163 * @param { UIContext } uiContext - uiContext used to create the FrameNode 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @atomicservice 167 * @since 12 168 */ 169 constructor(uiContext: UIContext); 170 171 /** 172 * Get the RenderNode in FrameNode. 173 * 174 * @returns { RenderNode | null } - Returns a RenderNode inside the FrameNode, or null if not contained. 175 * @syscap SystemCapability.ArkUI.ArkUI.Full 176 * @crossplatform 177 * @since 11 178 */ 179 /** 180 * Get the RenderNode in FrameNode. 181 * 182 * @returns { RenderNode | null } - Returns a RenderNode inside the FrameNode, or null if not contained. 183 * @syscap SystemCapability.ArkUI.ArkUI.Full 184 * @crossplatform 185 * @atomicservice 186 * @since 12 187 */ 188 getRenderNode(): RenderNode | null; 189 190 /** 191 * Return a flag to indicate whether the current FrameNode can be modified. Indicates whether the FrameNode supports appendChild, insertChildAfter, removeChild, clearChildren. 192 * 193 * @returns { boolean } - Returns true if the FrameNode can be modified, otherwise return false. 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @crossplatform 196 * @atomicservice 197 * @since 12 198 */ 199 isModifiable(): boolean; 200 201 /** 202 * Add child to the end of the FrameNode's children. 203 * 204 * @param { FrameNode } node - The node will be added. 205 * @throws { BusinessError } 100021 - The FrameNode is not modifiable. 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @atomicservice 209 * @since 12 210 */ 211 appendChild(node: FrameNode): void; 212 213 /** 214 * Add child to the current FrameNode. 215 * 216 * @param { FrameNode } child - The node will be added. 217 * @param { FrameNode | null } sibling - The new node is added after this node. When sibling is null, insert node as the first children of the node. 218 * @throws { BusinessError } 100021 - The FrameNode is not modifiable. 219 * @syscap SystemCapability.ArkUI.ArkUI.Full 220 * @crossplatform 221 * @atomicservice 222 * @since 12 223 */ 224 insertChildAfter(child: FrameNode, sibling: FrameNode | null): void; 225 226 /** 227 * Remove child from the current FrameNode. 228 * 229 * @param { FrameNode } node - The node will be removed. 230 * @throws { BusinessError } 100021 - The FrameNode is not modifiable. 231 * @syscap SystemCapability.ArkUI.ArkUI.Full 232 * @crossplatform 233 * @atomicservice 234 * @since 12 235 */ 236 removeChild(node: FrameNode): void; 237 238 /** 239 * Clear children of the current FrameNode. 240 * 241 * @throws { BusinessError } 100021 - The FrameNode is not modifiable. 242 * @syscap SystemCapability.ArkUI.ArkUI.Full 243 * @crossplatform 244 * @atomicservice 245 * @since 12 246 */ 247 clearChildren(): void; 248 249 /** 250 * Get a child of the current FrameNode by index. 251 * 252 * @param { number } index - The index of the desired node in the children of FrameNode. 253 * @returns { FrameNode | null } - Returns a FrameNode. When the required node does not exist, returns null. 254 * @syscap SystemCapability.ArkUI.ArkUI.Full 255 * @crossplatform 256 * @atomicservice 257 * @since 12 258 */ 259 getChild(index: number): FrameNode | null; 260 261 /** 262 * Get a child of the current FrameNode by index. 263 * 264 * @param { number } index - The index of the desired node in the children of FrameNode. 265 * @param { ExpandMode } expandMode - The expand mode. Default value is ExpandMode.EXPAND. 266 * @returns { FrameNode | null } - Returns a FrameNode. When the required node does not exist, returns null. 267 * @syscap SystemCapability.ArkUI.ArkUI.Full 268 * @crossplatform 269 * @atomicservice 270 * @since 15 271 */ 272 getChild(index: number, expandMode?: ExpandMode): FrameNode | null; 273 274 /** 275 * Get the index of the current FrameNode's first child node which is on the tree. 276 * 277 * @returns { number } - Returns the index of the current FrameNode's first child node which is on the tree. 278 * @syscap SystemCapability.ArkUI.ArkUI.Full 279 * @crossplatform 280 * @atomicservice 281 * @since 15 282 */ 283 getFirstChildIndexWithoutExpand(): number; 284 285 /** 286 * Get the index of the current FrameNode's last child node which is on the tree. 287 * 288 * @returns { number } - Returns the index of the current FrameNode's last child node which is on the tree. 289 * @syscap SystemCapability.ArkUI.ArkUI.Full 290 * @crossplatform 291 * @atomicservice 292 * @since 15 293 */ 294 getLastChildIndexWithoutExpand(): number; 295 296 /** 297 * Get the first child of the current FrameNode. 298 * 299 * @returns { FrameNode | null } - Returns a FrameNode, which is first child of the current FrameNode. If current FrameNode does not have child node, returns null. 300 * If current FrameNode does not have child node, returns null. 301 * @syscap SystemCapability.ArkUI.ArkUI.Full 302 * @crossplatform 303 * @atomicservice 304 * @since 12 305 */ 306 getFirstChild(): FrameNode | null; 307 308 /** 309 * Get the next sibling node of the current FrameNode. 310 * 311 * @returns { FrameNode | null } - Returns a FrameNode. If current FrameNode does not have next sibling node, returns null. 312 * @syscap SystemCapability.ArkUI.ArkUI.Full 313 * @crossplatform 314 * @atomicservice 315 * @since 12 316 */ 317 getNextSibling(): FrameNode | null; 318 319 /** 320 * Get the previous sibling node of the current FrameNode. 321 * 322 * @returns { FrameNode | null } - Returns a FrameNode. If current FrameNode does not have previous sibling node, returns null. 323 * @syscap SystemCapability.ArkUI.ArkUI.Full 324 * @crossplatform 325 * @atomicservice 326 * @since 12 327 */ 328 getPreviousSibling(): FrameNode | null; 329 330 /** 331 * Get the parent node of the current FrameNode. 332 * 333 * @returns { FrameNode | null } - Returns a FrameNode. If current FrameNode does not have parent node, returns null. 334 * @syscap SystemCapability.ArkUI.ArkUI.Full 335 * @crossplatform 336 * @atomicservice 337 * @since 12 338 */ 339 getParent(): FrameNode | null; 340 341 /** 342 * Get the children count of the current FrameNode. 343 * 344 * @returns { number } - Returns the number of the children of the current FrameNode. 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @crossplatform 347 * @atomicservice 348 * @since 12 349 */ 350 getChildrenCount(): number; 351 352 /** 353 * Dispose the FrameNode immediately. 354 * 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @atomicservice 358 * @since 12 359 */ 360 dispose(): void; 361 362 /** 363 * Get the position of the node relative to window. 364 * 365 * @returns { Position } - Returns position of the node relative to window. 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @crossplatform 368 * @atomicservice 369 * @since 12 370 */ 371 getPositionToWindow(): Position; 372 373 /** 374 * Get the position of the node relative to its parent. 375 * 376 * @returns { Position } - Returns position of the node relative to its parent. 377 * @syscap SystemCapability.ArkUI.ArkUI.Full 378 * @crossplatform 379 * @atomicservice 380 * @since 12 381 */ 382 getPositionToParent(): Position; 383 384 /** 385 * Get the size of the FrameNode after measure, with unit PX. 386 * 387 * @returns { Size } - Returns the size of the FrameNode after measure, with unit PX. 388 * @syscap SystemCapability.ArkUI.ArkUI.Full 389 * @crossplatform 390 * @atomicservice 391 * @since 12 392 */ 393 getMeasuredSize(): Size; 394 395 /** 396 * Get the offset to the parent of the FrameNode after layout, with unit PX. 397 * 398 * @returns { Position } - Returns the offset to the parent of the FrameNode after layout, with unit PX. 399 * @syscap SystemCapability.ArkUI.ArkUI.Full 400 * @crossplatform 401 * @atomicservice 402 * @since 12 403 */ 404 getLayoutPosition(): Position; 405 406 /** 407 * Get the user config border width of the FrameNode. 408 * 409 * @returns { Edges<LengthMetrics> } - Returns the user config border width of the FrameNode. 410 * @syscap SystemCapability.ArkUI.ArkUI.Full 411 * @crossplatform 412 * @atomicservice 413 * @since 12 414 */ 415 getUserConfigBorderWidth(): Edges<LengthMetrics>; 416 417 /** 418 * Get the user config padding of the FrameNode. 419 * 420 * @returns { Edges<LengthMetrics> } - Returns the user config padding of the FrameNode. 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @atomicservice 424 * @since 12 425 */ 426 getUserConfigPadding(): Edges<LengthMetrics>; 427 428 /** 429 * Get the user config margin of the FrameNode. 430 * 431 * @returns { Edges<LengthMetrics> } - Returns the user config margin of the FrameNode. 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @atomicservice 435 * @since 12 436 */ 437 getUserConfigMargin(): Edges<LengthMetrics>; 438 439 /** 440 * Get the user config size of the FrameNode. 441 * 442 * @returns { SizeT<LengthMetrics> } - Returns the user config size of the FrameNode. 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @crossplatform 445 * @atomicservice 446 * @since 12 447 */ 448 getUserConfigSize(): SizeT<LengthMetrics>; 449 450 /** 451 * Get the id of the FrameNode. 452 * 453 * @returns { string } - Returns the id of the FrameNode. 454 * @syscap SystemCapability.ArkUI.ArkUI.Full 455 * @crossplatform 456 * @atomicservice 457 * @since 12 458 */ 459 getId(): string; 460 461 /** 462 * Get the unique id of the FrameNode. 463 * 464 * @returns { number } - Returns the unique id of the FrameNode. 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @crossplatform 467 * @atomicservice 468 * @since 12 469 */ 470 getUniqueId(): number; 471 472 /** 473 * Get the type of the FrameNode. The type is the name of component, for example, the nodeType of Button is "Button", 474 * and the nodeType of custom component is "__Common__". 475 * 476 * @returns { string } - Returns the type of the FrameNode. 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @atomicservice 480 * @since 12 481 */ 482 getNodeType(): string; 483 484 /** 485 * Get the opacity of the FrameNode. 486 * 487 * @returns { number } - Returns the opacity of the FrameNode. 488 * @syscap SystemCapability.ArkUI.ArkUI.Full 489 * @crossplatform 490 * @atomicservice 491 * @since 12 492 */ 493 getOpacity(): number; 494 495 /** 496 * Get if the FrameNode is visible. 497 * 498 * @returns { boolean } - Returns if the FrameNode is visible. 499 * @syscap SystemCapability.ArkUI.ArkUI.Full 500 * @crossplatform 501 * @atomicservice 502 * @since 12 503 */ 504 isVisible(): boolean; 505 506 /** 507 * Get if the FrameNode is clip to frame. 508 * 509 * @returns { boolean } - Returns if the FrameNode is clip to frame. 510 * @syscap SystemCapability.ArkUI.ArkUI.Full 511 * @crossplatform 512 * @atomicservice 513 * @since 12 514 */ 515 isClipToFrame(): boolean; 516 517 /** 518 * Get if the FrameNode is attached. 519 * 520 * @returns { boolean } - Returns if the FrameNode is attached. 521 * @syscap SystemCapability.ArkUI.ArkUI.Full 522 * @crossplatform 523 * @atomicservice 524 * @since 12 525 */ 526 isAttached(): boolean; 527 528 /** 529 * Get the inspector information of the FrameNode. 530 * 531 * @returns { Object } - Returns the inspector information of the FrameNode. 532 * @syscap SystemCapability.ArkUI.ArkUI.Full 533 * @crossplatform 534 * @atomicservice 535 * @since 12 536 */ 537 getInspectorInfo(): Object; 538 539 /** 540 * * Get the custom property of the component corresponding to this FrameNode. 541 * 542 * @param { string } name - the name of the custom property. 543 * @returns { Object | undefined } - Returns the value of the custom property. 544 * @syscap SystemCapability.ArkUI.ArkUI.Full 545 * @crossplatform 546 * @atomicservice 547 * @since 12 548 */ 549 getCustomProperty(name: string): Object | undefined; 550 551 /** 552 * Set commonEvent response to the current FrameNode. 553 * 554 * @returns { UICommonEvent } - Returns a Object inside the FrameNode, which is used to set callbacks about different events. 555 * @syscap SystemCapability.ArkUI.ArkUI.Full 556 * @crossplatform 557 * @atomicservice 558 * @since 12 559 */ 560 get commonEvent(): UICommonEvent; 561 562 /** 563 * Get gestureEvent of the current FrameNode. 564 * 565 * @returns { UIGestureEvent } - Returns a Object inside the FrameNode, which is used to set callbacks about different gesture events. 566 * @syscap SystemCapability.ArkUI.ArkUI.Full 567 * @crossplatform 568 * @atomicservice 569 * @since 14 570 */ 571 get gestureEvent(): UIGestureEvent; 572 573 /** 574 * Get the CommonAttribute of the current FrameNode. 575 * 576 * @returns { CommonAttribute } - Returns the CommonAttribute which is used to modify the common attributes of the FrameNode. 577 * @syscap SystemCapability.ArkUI.ArkUI.Full 578 * @crossplatform 579 * @atomicservice 580 * @since 12 581 */ 582 get commonAttribute(): CommonAttribute; 583 584 /** 585 * Draw Method. Executed when the current FrameNode is rendering its content. 586 * 587 * @param { DrawContext } context - The DrawContext will be used when executed draw method. 588 * @syscap SystemCapability.ArkUI.ArkUI.Full 589 * @crossplatform 590 * @atomicservice 591 * @since 12 592 */ 593 onDraw?(context: DrawContext): void; 594 595 /** 596 * Method to measure the FrameNode and its content to determine the measured size. Use this method to override the 597 * default measure method when measuring the FrameNode. 598 * 599 * @param { LayoutConstraint } constraint - The layout constraint of the node, will be used when executed measure 600 * method. 601 * @syscap SystemCapability.ArkUI.ArkUI.Full 602 * @crossplatform 603 * @atomicservice 604 * @since 12 605 */ 606 onMeasure(constraint: LayoutConstraint): void; 607 608 /** 609 * Method to assign a position to the FrameNode and each of its children. Use this method to override the 610 * default layout method. 611 * 612 * @param { Position } position - The position of the node, will be used when executed layout method. 613 * @syscap SystemCapability.ArkUI.ArkUI.Full 614 * @crossplatform 615 * @atomicservice 616 * @since 12 617 */ 618 onLayout(position: Position): void; 619 620 /** 621 * Set the size of the FrameNode after measure, with unit PX. 622 * 623 * @param { Size } size - The size of the FrameNode after measure. 624 * @syscap SystemCapability.ArkUI.ArkUI.Full 625 * @crossplatform 626 * @atomicservice 627 * @since 12 628 */ 629 setMeasuredSize(size: Size): void; 630 631 /** 632 * Set the position to the parent of the FrameNode after layout, with unit PX. 633 * 634 * @param { Position } position - The position to the parent of the FrameNode after layout. 635 * @syscap SystemCapability.ArkUI.ArkUI.Full 636 * @crossplatform 637 * @atomicservice 638 * @since 12 639 */ 640 setLayoutPosition(position: Position): void; 641 642 /** 643 * This is called to find out how big the FrameNode should be. The parent node supplies constraint information. The 644 * actual measurement work of the FrameNode is performed in onMeasure or the default measure method. 645 * 646 * @param { LayoutConstraint } constraint - The layout constraint of the node, supplied by the parent node. 647 * @syscap SystemCapability.ArkUI.ArkUI.Full 648 * @crossplatform 649 * @atomicservice 650 * @since 12 651 */ 652 measure(constraint: LayoutConstraint): void; 653 654 /** 655 * This is called to assign position to the FrameNode and all of its descendants. The position is used to init 656 * the position of the frameNode, and the actual layout work of FrameNode is performed in onLayout or the default 657 * layout method. 658 * 659 * @param { Position } position - The position of the node, will be used when executed the layout method. 660 * @syscap SystemCapability.ArkUI.ArkUI.Full 661 * @crossplatform 662 * @atomicservice 663 * @since 12 664 */ 665 layout(position: Position): void; 666 667 /** 668 * Mark the frame node as need layout. 669 * 670 * @syscap SystemCapability.ArkUI.ArkUI.Full 671 * @crossplatform 672 * @atomicservice 673 * @since 12 674 */ 675 setNeedsLayout(): void; 676 677 /** 678 * Invalidate the RenderNode in the FrameNode, which will cause a re-render of the RenderNode. 679 * 680 * @syscap SystemCapability.ArkUI.ArkUI.Full 681 * @crossplatform 682 * @atomicservice 683 * @since 12 684 */ 685 invalidate(): void; 686 687 /** 688 * Get the position of the node relative to screen. 689 * 690 * @returns { Position } - Returns position of the node relative to screen. 691 * @syscap SystemCapability.ArkUI.ArkUI.Full 692 * @crossplatform 693 * @atomicservice 694 * @since 12 695 */ 696 getPositionToScreen(): Position; 697 698 /** 699 * Get the position of the node relative to window with transform. 700 * 701 * @returns { Position } - Returns position of the node relative to window with transform. 702 * @syscap SystemCapability.ArkUI.ArkUI.Full 703 * @crossplatform 704 * @atomicservice 705 * @since 12 706 */ 707 getPositionToWindowWithTransform(): Position; 708 709 /** 710 * Get the position of the node relative to its parent with transform. 711 * 712 * @returns { Position } - Returns position of the node relative to its parent with transform. 713 * @syscap SystemCapability.ArkUI.ArkUI.Full 714 * @crossplatform 715 * @atomicservice 716 * @since 12 717 */ 718 getPositionToParentWithTransform(): Position; 719 720 /** 721 * Get the position of the node relative to screen with transform. 722 * 723 * @returns { Position } - Returns position of the node relative to screen with transform. 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @atomicservice 727 * @since 12 728 */ 729 getPositionToScreenWithTransform(): Position; 730 731 /** 732 * Detach from parent and dispose all child recursively. 733 * 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @crossplatform 736 * @atomicservice 737 * @since 12 738 */ 739 disposeTree(): void; 740 741 /** 742 * Mount ComponentContent to FrameNode. 743 * 744 * @param { ComponentContent<T> } content - Newly added ComponentContent. 745 * @throws { BusinessError } 100021 - The FrameNode is not modifiable. 746 * @syscap SystemCapability.ArkUI.ArkUI.Full 747 * @crossplatform 748 * @atomicservice 749 * @since 12 750 */ 751 addComponentContent<T>(content: ComponentContent<T>): void; 752 753 /** 754 * Set the cross-language options of the target FrameNode. 755 * 756 * @param { CrossLanguageOptions } options - The cross-language options. 757 * @throws { BusinessError } 100022 - The FrameNode cannot be set whether to support cross-language common attribute setting. 758 * @syscap SystemCapability.ArkUI.ArkUI.Full 759 * @crossplatform 760 * @atomicservice 761 * @since 15 762 */ 763 setCrossLanguageOptions(options: CrossLanguageOptions): void; 764 765 /** 766 * Get the cross-language options of the target FrameNode. 767 * 768 * @returns { CrossLanguageOptions } - Returns the cross-language options of the target FrameNode. 769 * @syscap SystemCapability.ArkUI.ArkUI.Full 770 * @crossplatform 771 * @atomicservice 772 * @since 15 773 */ 774 getCrossLanguageOptions(): CrossLanguageOptions; 775} 776 777/** 778 * Used to define the FrameNode type. 779 * 780 * @extends FrameNode 781 * @interface TypedFrameNode 782 * @syscap SystemCapability.ArkUI.ArkUI.Full 783 * @crossplatform 784 * @atomicservice 785 * @since 12 786 */ 787export interface TypedFrameNode<C, T> extends FrameNode { 788 /** 789 * Initialize FrameNode. 790 * 791 * @type { C } 792 * @syscap SystemCapability.ArkUI.ArkUI.Full 793 * @crossplatform 794 * @atomicservice 795 * @since 12 796 */ 797 initialize: C; 798 /** 799 * Get attribute instance of FrameNode to set attributes. 800 * 801 * @type { T } 802 * @readonly 803 * @syscap SystemCapability.ArkUI.ArkUI.Full 804 * @crossplatform 805 * @atomicservice 806 * @since 12 807 */ 808 readonly attribute: T; 809} 810 811/** 812 * Provides methods to implement FrameNode. 813 * 814 * @namespace typeNode 815 * @syscap SystemCapability.ArkUI.ArkUI.Full 816 * @crossplatform 817 * @atomicservice 818 * @since 12 819 */ 820export namespace typeNode { 821 /** 822 * Define the FrameNode type for Text. 823 * 824 * @typedef { TypedFrameNode<TextInterface, TextAttribute> } Text 825 * @syscap SystemCapability.ArkUI.ArkUI.Full 826 * @crossplatform 827 * @atomicservice 828 * @since 12 829 */ 830 type Text = TypedFrameNode<TextInterface, TextAttribute>; 831 832 /** 833 * Create a FrameNode of Text type. 834 * 835 * @param { UIContext } context - uiContext used to create the FrameNode. 836 * @param { 'Text' } nodeType - node type. 837 * @returns { Text } - Return Text type FrameNode. 838 * @syscap SystemCapability.ArkUI.ArkUI.Full 839 * @atomicservice 840 * @since 12 841 */ 842 function createNode(context: UIContext, nodeType: 'Text'): Text; 843 844 /** 845 * Define the FrameNode type for Column. 846 * 847 * @typedef { TypedFrameNode<ColumnInterface, ColumnAttribute> } Column 848 * @syscap SystemCapability.ArkUI.ArkUI.Full 849 * @crossplatform 850 * @atomicservice 851 * @since 12 852 */ 853 type Column = TypedFrameNode<ColumnInterface, ColumnAttribute>; 854 855 /** 856 * Create a FrameNode of Column type. 857 * 858 * @param { UIContext } context - uiContext used to create the FrameNode. 859 * @param { 'Column' } nodeType - node type. 860 * @returns { Column } - Return Column type FrameNode. 861 * @syscap SystemCapability.ArkUI.ArkUI.Full 862 * @atomicservice 863 * @since 12 864 */ 865 function createNode(context: UIContext, nodeType: 'Column'): Column; 866 867 /** 868 * Define the FrameNode type for Row. 869 * 870 * @typedef { TypedFrameNode<RowInterface, RowAttribute> } Row 871 * @syscap SystemCapability.ArkUI.ArkUI.Full 872 * @crossplatform 873 * @atomicservice 874 * @since 12 875 */ 876 type Row = TypedFrameNode<RowInterface, RowAttribute>; 877 878 /** 879 * Create a FrameNode of Row type. 880 * 881 * @param { UIContext } context - uiContext used to create the FrameNode. 882 * @param { 'Row' } nodeType - node type. 883 * @returns { Row } - Return Row type FrameNode. 884 * @syscap SystemCapability.ArkUI.ArkUI.Full 885 * @atomicservice 886 * @since 12 887 */ 888 function createNode(context: UIContext, nodeType: 'Row'): Row; 889 890 /** 891 * Define the FrameNode type for Stack. 892 * 893 * @typedef { TypedFrameNode<StackInterface, StackAttribute> } Stack 894 * @syscap SystemCapability.ArkUI.ArkUI.Full 895 * @crossplatform 896 * @atomicservice 897 * @since 12 898 */ 899 type Stack = TypedFrameNode<StackInterface, StackAttribute>; 900 901 /** 902 * Create a FrameNode of Stack type. 903 * 904 * @param { UIContext } context - uiContext used to create the FrameNode. 905 * @param { 'Stack' } nodeType - node type. 906 * @returns { Stack } - Return Stack type FrameNode. 907 * @syscap SystemCapability.ArkUI.ArkUI.Full 908 * @atomicservice 909 * @since 12 910 */ 911 function createNode(context: UIContext, nodeType: 'Stack'): Stack; 912 913 /** 914 * Define the FrameNode type for GridRow. 915 * 916 * @typedef { TypedFrameNode<GridRowInterface, GridRowAttribute> } GridRow 917 * @syscap SystemCapability.ArkUI.ArkUI.Full 918 * @crossplatform 919 * @atomicservice 920 * @since 12 921 */ 922 type GridRow = TypedFrameNode<GridRowInterface, GridRowAttribute>; 923 924 /** 925 * Create a FrameNode of GridRow type. 926 * 927 * @param { UIContext } context - uiContext used to create the FrameNode. 928 * @param { 'GridRow' } nodeType - node type. 929 * @returns { GridRow } - Return GridRow type FrameNode. 930 * @syscap SystemCapability.ArkUI.ArkUI.Full 931 * @atomicservice 932 * @since 12 933 */ 934 function createNode(context: UIContext, nodeType: 'GridRow'): GridRow; 935 936 /** 937 * Define the FrameNode type for GridCol. 938 * 939 * @typedef { TypedFrameNode<GridColInterface, GridColAttribute> } GridCol 940 * @syscap SystemCapability.ArkUI.ArkUI.Full 941 * @crossplatform 942 * @atomicservice 943 * @since 12 944 */ 945 type GridCol = TypedFrameNode<GridColInterface, GridColAttribute>; 946 947 /** 948 * Create a FrameNode of GridCol type. 949 * 950 * @param { UIContext } context - uiContext used to create the FrameNode. 951 * @param { 'GridCol' } nodeType - node type. 952 * @returns { GridCol } - Return GridCol type FrameNode. 953 * @syscap SystemCapability.ArkUI.ArkUI.Full 954 * @atomicservice 955 * @since 12 956 */ 957 function createNode(context: UIContext, nodeType: 'GridCol'): GridCol; 958 959 /** 960 * Define the FrameNode type for Flex. 961 * 962 * @typedef { TypedFrameNode<FlexInterface, FlexAttribute> } Flex 963 * @syscap SystemCapability.ArkUI.ArkUI.Full 964 * @crossplatform 965 * @atomicservice 966 * @since 12 967 */ 968 type Flex = TypedFrameNode<FlexInterface, FlexAttribute>; 969 970 /** 971 * Create a FrameNode of Flex type. 972 * 973 * @param { UIContext } context - uiContext used to create the FrameNode. 974 * @param { 'Flex' } nodeType - node type. 975 * @returns { Flex } - Return Flex type FrameNode. 976 * @syscap SystemCapability.ArkUI.ArkUI.Full 977 * @atomicservice 978 * @since 12 979 */ 980 function createNode(context: UIContext, nodeType: 'Flex'): Flex; 981 982 /** 983 * Define the FrameNode type for Swiper. 984 * 985 * @typedef { TypedFrameNode<SwiperInterface, SwiperAttribute> } Swiper 986 * @syscap SystemCapability.ArkUI.ArkUI.Full 987 * @crossplatform 988 * @atomicservice 989 * @since 12 990 */ 991 type Swiper = TypedFrameNode<SwiperInterface, SwiperAttribute>; 992 993 /** 994 * Create a FrameNode of Swiper type. 995 * 996 * @param { UIContext } context - uiContext used to create the FrameNode. 997 * @param { 'Swiper' } nodeType - node type. 998 * @returns { Swiper } - Return Swiper type FrameNode. 999 * @syscap SystemCapability.ArkUI.ArkUI.Full 1000 * @atomicservice 1001 * @since 12 1002 */ 1003 function createNode(context: UIContext, nodeType: 'Swiper'): Swiper; 1004 1005 /** 1006 * Define the FrameNode type for Progress. 1007 * 1008 * @typedef { TypedFrameNode<ProgressInterface, ProgressAttribute> } Progress 1009 * @syscap SystemCapability.ArkUI.ArkUI.Full 1010 * @crossplatform 1011 * @atomicservice 1012 * @since 12 1013 */ 1014 type Progress = TypedFrameNode<ProgressInterface, ProgressAttribute>; 1015 1016 /** 1017 * Create a FrameNode of Progress type. 1018 * 1019 * @param { UIContext } context - uiContext used to create the FrameNode. 1020 * @param { 'Progress' } nodeType - node type. 1021 * @returns { Progress } - Return Progress type FrameNode. 1022 * @syscap SystemCapability.ArkUI.ArkUI.Full 1023 * @atomicservice 1024 * @since 12 1025 */ 1026 function createNode(context: UIContext, nodeType: 'Progress'): Progress; 1027 1028 /** 1029 * Define the FrameNode type for Scroll. 1030 * 1031 * @typedef { TypedFrameNode<ScrollInterface, ScrollAttribute> } Scroll 1032 * @syscap SystemCapability.ArkUI.ArkUI.Full 1033 * @crossplatform 1034 * @atomicservice 1035 * @since 12 1036 */ 1037 type Scroll = TypedFrameNode<ScrollInterface, ScrollAttribute>; 1038 1039 /** 1040 * Create a FrameNode of Scroll type. 1041 * 1042 * @param { UIContext } context - uiContext used to create the FrameNode. 1043 * @param { 'Scroll' } nodeType - node type. 1044 * @returns { Scroll } - Return Scroll type FrameNode. 1045 * @syscap SystemCapability.ArkUI.ArkUI.Full 1046 * @atomicservice 1047 * @since 12 1048 */ 1049 function createNode(context: UIContext, nodeType: 'Scroll'): Scroll; 1050 1051 /** 1052 * Get the attribute instance of FrameNode to set attributes. 1053 * 1054 * @param { FrameNode } node - the target FrameNode. 1055 * @param { 'Scroll' } nodeType - node type. 1056 * @returns { ScrollAttribute | undefined } - Return the attribute instance of FrameNode, and return undefined if it 1057 * does not exist. 1058 * @syscap SystemCapability.ArkUI.ArkUI.Full 1059 * @atomicservice 1060 * @since 15 1061 */ 1062 function getAttribute(node: FrameNode, nodeType: 'Scroll'): ScrollAttribute | undefined; 1063 1064 /** 1065 * Bind the controller of FrameNode. 1066 * 1067 * @param { FrameNode } node - the target FrameNode. 1068 * @param { Scroller } controller - the controller which is bind to the target FrameNode. 1069 * @param { 'Scroll' } nodeType - node type. 1070 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. the type of the node is error. 1071 * 2. the node is null or undefined. 1072 * @throws { BusinessError } 100021 - The FrameNode is not modifiable. 1073 * @syscap SystemCapability.ArkUI.ArkUI.Full 1074 * @atomicservice 1075 * @since 15 1076 */ 1077 function bindController(node: FrameNode, controller: Scroller, nodeType: 'Scroll'): void; 1078 1079 /** 1080 * Define the FrameNode type for RelativeContainer. 1081 * 1082 * @typedef { TypedFrameNode<RelativeContainerInterface, RelativeContainerAttribute> } RelativeContainer 1083 * @syscap SystemCapability.ArkUI.ArkUI.Full 1084 * @crossplatform 1085 * @atomicservice 1086 * @since 12 1087 */ 1088 type RelativeContainer = TypedFrameNode<RelativeContainerInterface, RelativeContainerAttribute>; 1089 1090 /** 1091 * Create a FrameNode of RelativeContainer type. 1092 * 1093 * @param { UIContext } context - uiContext used to create the FrameNode. 1094 * @param { 'RelativeContainer' } nodeType - node type. 1095 * @returns { RelativeContainer } - Return RelativeContainer type FrameNode. 1096 * @syscap SystemCapability.ArkUI.ArkUI.Full 1097 * @atomicservice 1098 * @since 12 1099 */ 1100 function createNode(context: UIContext, nodeType: 'RelativeContainer'): RelativeContainer; 1101 1102 /** 1103 * Define the FrameNode type for Divider. 1104 * 1105 * @typedef { TypedFrameNode<DividerInterface, DividerAttribute> } Divider 1106 * @syscap SystemCapability.ArkUI.ArkUI.Full 1107 * @crossplatform 1108 * @atomicservice 1109 * @since 12 1110 */ 1111 type Divider = TypedFrameNode<DividerInterface, DividerAttribute>; 1112 1113 /** 1114 * Create a FrameNode of Divider type. 1115 * 1116 * @param { UIContext } context - uiContext used to create the FrameNode. 1117 * @param { 'Divider' } nodeType - node type. 1118 * @returns { Divider } - Return Divider type FrameNode. 1119 * @syscap SystemCapability.ArkUI.ArkUI.Full 1120 * @atomicservice 1121 * @since 12 1122 */ 1123 function createNode(context: UIContext, nodeType: 'Divider'): Divider; 1124 1125 /** 1126 * Define the FrameNode type for LoadingProgress. 1127 * 1128 * @typedef { TypedFrameNode<LoadingProgressInterface, LoadingProgressAttribute> } LoadingProgress 1129 * @syscap SystemCapability.ArkUI.ArkUI.Full 1130 * @crossplatform 1131 * @atomicservice 1132 * @since 12 1133 */ 1134 type LoadingProgress = TypedFrameNode<LoadingProgressInterface, LoadingProgressAttribute>; 1135 1136 /** 1137 * Create a FrameNode of LoadingProgress type. 1138 * 1139 * @param { UIContext } context - uiContext used to create the FrameNode. 1140 * @param { 'LoadingProgress' } nodeType - node type. 1141 * @returns { LoadingProgress } - Return LoadingProgress type FrameNode. 1142 * @syscap SystemCapability.ArkUI.ArkUI.Full 1143 * @atomicservice 1144 * @since 12 1145 */ 1146 function createNode(context: UIContext, nodeType: 'LoadingProgress'): LoadingProgress; 1147 1148 /** 1149 * Define the FrameNode type for Search. 1150 * 1151 * @typedef { TypedFrameNode<SearchInterface, SearchAttribute> } Search 1152 * @syscap SystemCapability.ArkUI.ArkUI.Full 1153 * @crossplatform 1154 * @atomicservice 1155 * @since 12 1156 */ 1157 type Search = TypedFrameNode<SearchInterface, SearchAttribute>; 1158 1159 /** 1160 * Create a FrameNode of Search type. 1161 * 1162 * @param { UIContext } context - uiContext used to create the FrameNode. 1163 * @param { 'Search' } nodeType - node type. 1164 * @returns { Search } - Return Search type FrameNode. 1165 * @syscap SystemCapability.ArkUI.ArkUI.Full 1166 * @atomicservice 1167 * @since 12 1168 */ 1169 function createNode(context: UIContext, nodeType: 'Search'): Search; 1170 1171 /** 1172 * Define the FrameNode type for Blank. 1173 * 1174 * @typedef { TypedFrameNode<BlankInterface, BlankAttribute> } Blank 1175 * @syscap SystemCapability.ArkUI.ArkUI.Full 1176 * @crossplatform 1177 * @atomicservice 1178 * @since 12 1179 */ 1180 type Blank = TypedFrameNode<BlankInterface, BlankAttribute>; 1181 1182 /** 1183 * Create a FrameNode of Blank type. 1184 * 1185 * @param { UIContext } context - uiContext used to create the FrameNode. 1186 * @param { 'Blank' } nodeType - node type. 1187 * @returns { Blank } - Return Blank type FrameNode. 1188 * @syscap SystemCapability.ArkUI.ArkUI.Full 1189 * @atomicservice 1190 * @since 12 1191 */ 1192 function createNode(context: UIContext, nodeType: 'Blank'): Blank; 1193 1194 /** 1195 * Define the FrameNode type for Image. 1196 * 1197 * @typedef { TypedFrameNode<ImageInterface, ImageAttribute> } Image 1198 * @syscap SystemCapability.ArkUI.ArkUI.Full 1199 * @crossplatform 1200 * @atomicservice 1201 * @since 12 1202 */ 1203 type Image = TypedFrameNode<ImageInterface, ImageAttribute>; 1204 1205 /** 1206 * Create a FrameNode of Image type. 1207 * 1208 * @param { UIContext } context - uiContext used to create the FrameNode. 1209 * @param { 'Image' } nodeType - node type. 1210 * @returns { Image } - Return Image type FrameNode. 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @atomicservice 1213 * @since 12 1214 */ 1215 function createNode(context: UIContext, nodeType: 'Image'): Image; 1216 1217 /** 1218 * Define the FrameNode type for List. 1219 * 1220 * @typedef { TypedFrameNode<ListInterface, ListAttribute> } List 1221 * @syscap SystemCapability.ArkUI.ArkUI.Full 1222 * @crossplatform 1223 * @atomicservice 1224 * @since 12 1225 */ 1226 type List = TypedFrameNode<ListInterface, ListAttribute>; 1227 1228 /** 1229 * Create a FrameNode of List type. 1230 * 1231 * @param { UIContext } context - uiContext used to create the FrameNode. 1232 * @param { 'List' } nodeType - node type. 1233 * @returns { List } - Return List type FrameNode. 1234 * @syscap SystemCapability.ArkUI.ArkUI.Full 1235 * @atomicservice 1236 * @since 12 1237 */ 1238 function createNode(context: UIContext, nodeType: 'List'): List; 1239 1240 /** 1241 * Define the FrameNode type for ListItem. 1242 * 1243 * @typedef { TypedFrameNode<ListItemInterface, ListItemAttribute> } ListItem 1244 * @syscap SystemCapability.ArkUI.ArkUI.Full 1245 * @crossplatform 1246 * @atomicservice 1247 * @since 12 1248 */ 1249 type ListItem = TypedFrameNode<ListItemInterface, ListItemAttribute>; 1250 1251 /** 1252 * Create a FrameNode of ListItem type. 1253 * 1254 * @param { UIContext } context - uiContext used to create the FrameNode. 1255 * @param { 'ListItem' } nodeType - node type. 1256 * @returns { ListItem } - Return ListItem type FrameNode. 1257 * @syscap SystemCapability.ArkUI.ArkUI.Full 1258 * @atomicservice 1259 * @since 12 1260 */ 1261 function createNode(context: UIContext, nodeType: 'ListItem'): ListItem; 1262 1263 /** 1264 * Define the FrameNode type for TextInput. 1265 * 1266 * @typedef { TypedFrameNode<TextInputInterface, TextInputAttribute> } TextInput 1267 * @syscap SystemCapability.ArkUI.ArkUI.Full 1268 * @crossplatform 1269 * @atomicservice 1270 * @since 12 1271 */ 1272 type TextInput = TypedFrameNode<TextInputInterface, TextInputAttribute>; 1273 1274 /** 1275 * Create a FrameNode of TextInput type. 1276 * 1277 * @param { UIContext } context - uiContext used to create the FrameNode. 1278 * @param { 'TextInput' } nodeType - node type. 1279 * @returns { TextInput } - Return TextInput type FrameNode. 1280 * @syscap SystemCapability.ArkUI.ArkUI.Full 1281 * @atomicservice 1282 * @since 12 1283 */ 1284 function createNode(context: UIContext, nodeType: 'TextInput'): TextInput; 1285 1286 /** 1287 * Define the FrameNode type for Button. 1288 * 1289 * @typedef { TypedFrameNode<ButtonInterface, ButtonAttribute> } Button 1290 * @syscap SystemCapability.ArkUI.ArkUI.Full 1291 * @crossplatform 1292 * @atomicservice 1293 * @since 12 1294 */ 1295 type Button = TypedFrameNode<ButtonInterface, ButtonAttribute>; 1296 1297 /** 1298 * Create a FrameNode of Button type. 1299 * 1300 * @param { UIContext } context - uiContext used to create the FrameNode. 1301 * @param { 'Button' } nodeType - node type. 1302 * @returns { Button } - Return Button type FrameNode. 1303 * @syscap SystemCapability.ArkUI.ArkUI.Full 1304 * @atomicservice 1305 * @since 12 1306 */ 1307 function createNode(context: UIContext, nodeType: 'Button'): Button; 1308 1309 /** 1310 * Define the FrameNode type for ListItemGroup. 1311 * 1312 * @typedef { TypedFrameNode<ListItemGroupInterface, ListItemGroupAttribute> } ListItemGroup 1313 * @syscap SystemCapability.ArkUI.ArkUI.Full 1314 * @crossplatform 1315 * @atomicservice 1316 * @since 12 1317 */ 1318 type ListItemGroup = TypedFrameNode<ListItemGroupInterface, ListItemGroupAttribute>; 1319 1320 /** 1321 * Create a FrameNode of ListItemGroup type. 1322 * 1323 * @param { UIContext } context - uiContext used to create the FrameNode. 1324 * @param { 'ListItemGroup' } nodeType - node type. 1325 * @returns { ListItemGroup } - Return ListItemGroup type FrameNode. 1326 * @syscap SystemCapability.ArkUI.ArkUI.Full 1327 * @atomicservice 1328 * @since 12 1329 */ 1330 function createNode(context: UIContext, nodeType: 'ListItemGroup'): ListItemGroup; 1331 1332 /** 1333 * Define the FrameNode type for WaterFlow. 1334 * 1335 * @typedef { TypedFrameNode<WaterFlowInterface, WaterFlowAttribute> } WaterFlow 1336 * @syscap SystemCapability.ArkUI.ArkUI.Full 1337 * @crossplatform 1338 * @atomicservice 1339 * @since 12 1340 */ 1341 type WaterFlow = TypedFrameNode<WaterFlowInterface, WaterFlowAttribute>; 1342 1343 /** 1344 * Create a FrameNode of WaterFlow type. 1345 * 1346 * @param { UIContext } context - uiContext used to create the FrameNode. 1347 * @param { 'WaterFlow' } nodeType - node type. 1348 * @returns { WaterFlow } - Return WaterFlow type FrameNode. 1349 * @syscap SystemCapability.ArkUI.ArkUI.Full 1350 * @atomicservice 1351 * @since 12 1352 */ 1353 function createNode(context: UIContext, nodeType: 'WaterFlow'): WaterFlow; 1354 1355 /** 1356 * Define the FrameNode type for FlowItem. 1357 * 1358 * @typedef { TypedFrameNode<FlowItemInterface, FlowItemAttribute> } FlowItem 1359 * @syscap SystemCapability.ArkUI.ArkUI.Full 1360 * @crossplatform 1361 * @atomicservice 1362 * @since 12 1363 */ 1364 type FlowItem = TypedFrameNode<FlowItemInterface, FlowItemAttribute>; 1365 1366 /** 1367 * Create a FrameNode of FlowItem type. 1368 * 1369 * @param { UIContext } context - uiContext used to create the FrameNode. 1370 * @param { 'FlowItem' } nodeType - node type. 1371 * @returns { FlowItem } - Return FlowItem type FrameNode. 1372 * @syscap SystemCapability.ArkUI.ArkUI.Full 1373 * @atomicservice 1374 * @since 12 1375 */ 1376 function createNode(context: UIContext, nodeType: 'FlowItem'): FlowItem; 1377 1378 /** 1379 * Define the FrameNode type for XComponent. 1380 * 1381 * @typedef { TypedFrameNode<XComponentInterface, XComponentAttribute> } XComponent 1382 * @syscap SystemCapability.ArkUI.ArkUI.Full 1383 * @crossplatform 1384 * @atomicservice 1385 * @since 12 1386 */ 1387 type XComponent = TypedFrameNode<XComponentInterface, XComponentAttribute>; 1388 1389 /** 1390 * Create a FrameNode of XComponent type. 1391 * 1392 * @param { UIContext } context - uiContext used to create the FrameNode. 1393 * @param { 'XComponent' } nodeType - node type. 1394 * @returns { XComponent } - Return XComponent type FrameNode. 1395 * @syscap SystemCapability.ArkUI.ArkUI.Full 1396 * @atomicservice 1397 * @since 12 1398 */ 1399 function createNode(context: UIContext, nodeType: 'XComponent'): XComponent; 1400 1401 /** 1402 * Create a FrameNode of XComponent type with options. 1403 * 1404 * @param { UIContext } context - uiContext used to create the FrameNode. 1405 * @param { 'XComponent' } nodeType - node type. 1406 * @param { XComponentOptions } options - initialization parameters. 1407 * @returns { XComponent } - Return XComponent type FrameNode. 1408 * @syscap SystemCapability.ArkUI.ArkUI.Full 1409 * @atomicservice 1410 * @since 12 1411 */ 1412 function createNode(context: UIContext, nodeType: 'XComponent', options: XComponentOptions): XComponent; 1413 1414 /** 1415 * Define the FrameNode type for Marquee. 1416 * 1417 * @typedef { TypedFrameNode<MarqueeInterface, MarqueeAttribute> } Marquee 1418 * @syscap SystemCapability.ArkUI.ArkUI.Full 1419 * @crossplatform 1420 * @atomicservice 1421 * @since 14 1422 */ 1423 type Marquee = TypedFrameNode<MarqueeInterface, MarqueeAttribute>; 1424 1425 /** 1426 * Create a FrameNode of Marquee type. 1427 * 1428 * @param { UIContext } context - uiContext used to create the FrameNode. 1429 * @param { 'Marquee' } nodeType - node type. 1430 * @returns { Marquee } - Return Marquee type FrameNode. 1431 * @syscap SystemCapability.ArkUI.ArkUI.Full 1432 * @atomicservice 1433 * @since 14 1434 */ 1435 function createNode(context: UIContext, nodeType: 'Marquee'): Marquee; 1436 1437 /** 1438 * Define the FrameNode type for TextArea. 1439 * 1440 * @typedef { TypedFrameNode<TextAreaInterface, TextAreaAttribute> } TextArea 1441 * @syscap SystemCapability.ArkUI.ArkUI.Full 1442 * @crossplatform 1443 * @atomicservice 1444 * @since 14 1445 */ 1446 type TextArea = TypedFrameNode<TextAreaInterface, TextAreaAttribute>; 1447 1448 /** 1449 * Create a FrameNode of TextArea type. 1450 * 1451 * @param { UIContext } context - uiContext used to create the FrameNode. 1452 * @param { 'TextArea' } nodeType - node type. 1453 * @returns { TextArea } - Return TextArea type FrameNode. 1454 * @syscap SystemCapability.ArkUI.ArkUI.Full 1455 * @atomicservice 1456 * @since 14 1457 */ 1458 function createNode(context: UIContext, nodeType: 'TextArea'): TextArea; 1459 1460 /** 1461 * Define the FrameNode type for SymbolGlyph. 1462 * 1463 * @typedef { TypedFrameNode<SymbolGlyphInterface, SymbolGlyphAttribute> } SymbolGlyph 1464 * @syscap SystemCapability.ArkUI.ArkUI.Full 1465 * @crossplatform 1466 * @atomicservice 1467 * @since 14 1468 */ 1469 type SymbolGlyph = TypedFrameNode<SymbolGlyphInterface, SymbolGlyphAttribute>; 1470 1471 /** 1472 * Create a FrameNode of SymbolGlyph type. 1473 * 1474 * @param { UIContext } context - uiContext used to create the FrameNode. 1475 * @param { 'SymbolGlyph' } nodeType - node type. 1476 * @returns { SymbolGlyph } - Return SymbolGlyph type FrameNode. 1477 * @syscap SystemCapability.ArkUI.ArkUI.Full 1478 * @atomicservice 1479 * @since 14 1480 */ 1481 function createNode(context: UIContext, nodeType: 'SymbolGlyph'): SymbolGlyph; 1482 1483 /** 1484 * Define the FrameNode type for QRCode. 1485 * 1486 * @typedef { TypedFrameNode<QRCodeInterface, QRCodeAttribute> } QRCode 1487 * @syscap SystemCapability.ArkUI.ArkUI.Full 1488 * @crossplatform 1489 * @atomicservice 1490 * @since 14 1491 */ 1492 type QRCode = TypedFrameNode<QRCodeInterface, QRCodeAttribute>; 1493 1494 /** 1495 * Create a FrameNode of QRCode type. 1496 * 1497 * @param { UIContext } context - uiContext used to create the FrameNode. 1498 * @param { 'QRCode' } nodeType - node type. 1499 * @returns { QRCode } - Return QRCode type FrameNode. 1500 * @syscap SystemCapability.ArkUI.ArkUI.Full 1501 * @atomicservice 1502 * @since 14 1503 */ 1504 function createNode(context: UIContext, nodeType: 'QRCode'): QRCode; 1505 1506 /** 1507 * Define the FrameNode type for Badge. 1508 * 1509 * @typedef { TypedFrameNode<BadgeInterface, BadgeAttribute> } Badge 1510 * @syscap SystemCapability.ArkUI.ArkUI.Full 1511 * @crossplatform 1512 * @atomicservice 1513 * @since 14 1514 */ 1515 type Badge = TypedFrameNode<BadgeInterface, BadgeAttribute>; 1516 1517 /** 1518 * Create a FrameNode of Badge type. 1519 * 1520 * @param { UIContext } context - uiContext used to create the FrameNode. 1521 * @param { 'Badge' } nodeType - node type. 1522 * @returns { Badge } - Return Badge type FrameNode. 1523 * @syscap SystemCapability.ArkUI.ArkUI.Full 1524 * @atomicservice 1525 * @since 14 1526 */ 1527 function createNode(context: UIContext, nodeType: 'Badge'): Badge; 1528 1529 /** 1530 * Define the FrameNode type for TextClock. 1531 * 1532 * @typedef { TypedFrameNode<TextClockInterface, TextClockAttribute> } TextClock 1533 * @syscap SystemCapability.ArkUI.ArkUI.Full 1534 * @crossplatform 1535 * @atomicservice 1536 * @since 14 1537 */ 1538 type TextClock = TypedFrameNode<TextClockInterface, TextClockAttribute>; 1539 1540 /** 1541 * Create a FrameNode of TextClock type. 1542 * 1543 * @param { UIContext } context - uiContext used to create the FrameNode. 1544 * @param { 'TextClock' } nodeType - node type. 1545 * @returns { TextClock } - Return TextClock type FrameNode. 1546 * @syscap SystemCapability.ArkUI.ArkUI.Full 1547 * @atomicservice 1548 * @since 14 1549 */ 1550 function createNode(context: UIContext, nodeType: 'TextClock'): TextClock; 1551 1552 /** 1553 * Define the FrameNode type for TextTimer. 1554 * 1555 * @typedef { TypedFrameNode<TextTimerInterface, TextTimerAttribute> } TextTimer 1556 * @syscap SystemCapability.ArkUI.ArkUI.Full 1557 * @crossplatform 1558 * @atomicservice 1559 * @since 14 1560 */ 1561 type TextTimer = TypedFrameNode<TextTimerInterface, TextTimerAttribute>; 1562 1563 /** 1564 * Create a FrameNode of TextTimer type. 1565 * 1566 * @param { UIContext } context - uiContext used to create the FrameNode. 1567 * @param { 'TextTimer' } nodeType - node type. 1568 * @returns { TextTimer } - Return TextTimer type FrameNode. 1569 * @syscap SystemCapability.ArkUI.ArkUI.Full 1570 * @atomicservice 1571 * @since 14 1572 */ 1573 function createNode(context: UIContext, nodeType: 'TextTimer'): TextTimer; 1574 1575 /** 1576 * Define the FrameNode type for Grid. 1577 * 1578 * @typedef { TypedFrameNode<GridInterface, GridAttribute> } Grid 1579 * @syscap SystemCapability.ArkUI.ArkUI.Full 1580 * @crossplatform 1581 * @atomicservice 1582 * @since 14 1583 */ 1584 type Grid = TypedFrameNode<GridInterface, GridAttribute>; 1585 1586 /** 1587 * Create a FrameNode of Grid type. 1588 * 1589 * @param { UIContext } context - uiContext used to create the FrameNode. 1590 * @param { 'Grid' } nodeType - node type. 1591 * @returns { Grid } - Return Grid type FrameNode. 1592 * @syscap SystemCapability.ArkUI.ArkUI.Full 1593 * @atomicservice 1594 * @since 14 1595 */ 1596 function createNode(context: UIContext, nodeType: 'Grid'): Grid; 1597 1598 /** 1599 * Define the FrameNode type for GridItem. 1600 * 1601 * @typedef { TypedFrameNode<GridItemInterface, GridItemAttribute> } GridItem 1602 * @syscap SystemCapability.ArkUI.ArkUI.Full 1603 * @crossplatform 1604 * @atomicservice 1605 * @since 14 1606 */ 1607 type GridItem = TypedFrameNode<GridItemInterface, GridItemAttribute>; 1608 1609 /** 1610 * Create a FrameNode of GridItem type. 1611 * 1612 * @param { UIContext } context - uiContext used to create the FrameNode. 1613 * @param { 'GridItem' } nodeType - node type. 1614 * @returns { GridItem } - Return GridItem type FrameNode. 1615 * @syscap SystemCapability.ArkUI.ArkUI.Full 1616 * @atomicservice 1617 * @since 14 1618 */ 1619 function createNode(context: UIContext, nodeType: 'GridItem'): GridItem; 1620} 1621 1622/** 1623 * Used for lazy loading of typeNode. 1624 * 1625 * @syscap SystemCapability.ArkUI.ArkUI.Full 1626 * @crossplatform 1627 * @atomicservice 1628 * @since 12 1629 */ 1630declare class NodeAdapter { 1631 /** 1632 * Constructor. 1633 * 1634 * @syscap SystemCapability.ArkUI.ArkUI.Full 1635 * @crossplatform 1636 * @atomicservice 1637 * @since 12 1638 */ 1639 constructor(); 1640 /** 1641 * Dispose the NodeAdapter immediately. 1642 * 1643 * @syscap SystemCapability.ArkUI.ArkUI.Full 1644 * @crossplatform 1645 * @atomicservice 1646 * @since 12 1647 */ 1648 dispose(): void; 1649 /** 1650 * Set the total number of node count. 1651 * 1652 * @param { number } count - The total number of node count. 1653 * @syscap SystemCapability.ArkUI.ArkUI.Full 1654 * @crossplatform 1655 * @atomicservice 1656 * @since 12 1657 */ 1658 set totalNodeCount(count: number); 1659 /** 1660 * Get the total number of node count. 1661 * 1662 * @returns { number } - Return the total number of node count. 1663 * @syscap SystemCapability.ArkUI.ArkUI.Full 1664 * @crossplatform 1665 * @atomicservice 1666 * @since 12 1667 */ 1668 get totalNodeCount(): number; 1669 /** 1670 * Define the operation of reloading all data. 1671 * 1672 * @syscap SystemCapability.ArkUI.ArkUI.Full 1673 * @crossplatform 1674 * @atomicservice 1675 * @since 12 1676 */ 1677 reloadAllItems(): void; 1678 /** 1679 * Define the data reload operation.Reload a specified amount of data starting from the index value. 1680 * 1681 * @param { number } start - Start loading index values for data. 1682 * @param { number } count - Load the number of data. 1683 * @syscap SystemCapability.ArkUI.ArkUI.Full 1684 * @crossplatform 1685 * @atomicservice 1686 * @since 12 1687 */ 1688 reloadItem(start: number, count: number): void; 1689 /** 1690 * Define data deletion operations.Delete a specified amount of data starting from the index value. 1691 * 1692 * @param { number } start - Start deleting index values for data. 1693 * @param { number } count - Delete the number of data. 1694 * @syscap SystemCapability.ArkUI.ArkUI.Full 1695 * @crossplatform 1696 * @atomicservice 1697 * @since 12 1698 */ 1699 removeItem(start: number, count: number): void; 1700 /** 1701 * Define data insertion operations.Insert a specified amount of data starting from the index value. 1702 * 1703 * @param { number } start - Start Insert index values for data. 1704 * @param { number } count - Insert the number of data. 1705 * @syscap SystemCapability.ArkUI.ArkUI.Full 1706 * @crossplatform 1707 * @atomicservice 1708 * @since 12 1709 */ 1710 insertItem(start: number, count: number): void; 1711 /** 1712 * Define data movement operations. Move data from the starting index to the ending index. 1713 * 1714 * @param { number } from - Starting index value. 1715 * @param { number } to - End index value. 1716 * @syscap SystemCapability.ArkUI.ArkUI.Full 1717 * @crossplatform 1718 * @atomicservice 1719 * @since 12 1720 */ 1721 moveItem(from: number, to: number): void; 1722 /** 1723 * Obtain all data results. 1724 * 1725 * @returns { Array<FrameNode> } - Return all valid FrameNode collections. 1726 * @syscap SystemCapability.ArkUI.ArkUI.Full 1727 * @crossplatform 1728 * @atomicservice 1729 * @since 12 1730 */ 1731 getAllAvailableItems(): Array<FrameNode>; 1732 /** 1733 * This callback will be triggered when a FrameNode is bound. 1734 * 1735 * @param { FrameNode } target - The bound FrameNode node. 1736 * @syscap SystemCapability.ArkUI.ArkUI.Full 1737 * @crossplatform 1738 * @atomicservice 1739 * @since 12 1740 */ 1741 onAttachToNode?(target: FrameNode): void; 1742 /** 1743 * This callback will be triggered when the binding is released. 1744 * 1745 * @syscap SystemCapability.ArkUI.ArkUI.Full 1746 * @crossplatform 1747 * @atomicservice 1748 * @since 12 1749 */ 1750 onDetachFromNode?(): void; 1751 /** 1752 * Call this callback when loading for the first time or when a new node slides in.Used to generate custom IDs, developers need to ensure the uniqueness of the IDs themselves. 1753 * 1754 * @param { number } index - Load the index value of the data. 1755 * @returns { number } - Returning the developer's custom ID requires the developer to ensure its uniqueness. 1756 * @syscap SystemCapability.ArkUI.ArkUI.Full 1757 * @crossplatform 1758 * @atomicservice 1759 * @since 12 1760 */ 1761 onGetChildId?(index: number): number; 1762 /** 1763 * Call this callback when loading for the first time or when a new node slides in. 1764 * 1765 * @param { number } index - Load the index value of the data. 1766 * @returns { FrameNode } - Returns the FrameNode node that loads the node. 1767 * @syscap SystemCapability.ArkUI.ArkUI.Full 1768 * @crossplatform 1769 * @atomicservice 1770 * @since 12 1771 */ 1772 onCreateChild?(index: number): FrameNode; 1773 /** 1774 * Called when the child node is about to be destroyed. 1775 * 1776 * @param { number } id - The child node ID that is about to be destroyed. 1777 * @param { FrameNode } node - The FrameNode node that is about to be destroyed. 1778 * @syscap SystemCapability.ArkUI.ArkUI.Full 1779 * @crossplatform 1780 * @atomicservice 1781 * @since 12 1782 */ 1783 onDisposeChild?(id: number, node: FrameNode): void; 1784 /** 1785 * Call this callback when reloading or reusing. 1786 * 1787 * @param { number } id - The index value of the reloaded data. 1788 * @param { FrameNode } node - Reused FrameNode nodes. 1789 * @syscap SystemCapability.ArkUI.ArkUI.Full 1790 * @crossplatform 1791 * @atomicservice 1792 * @since 12 1793 */ 1794 onUpdateChild?(id: number, node: FrameNode): void; 1795 /** 1796 * Add a NodeAdapter to bind to the node.A node can only be bound to one NodeAdapter. Binding failure returns false. 1797 * 1798 * @param { NodeAdapter } adapter - Define lazy loading classes. 1799 * @param { FrameNode } node - The bound FrameNode node. 1800 * @returns { boolean } Return the binding result. 1801 * @syscap SystemCapability.ArkUI.ArkUI.Full 1802 * @crossplatform 1803 * @atomicservice 1804 * @since 12 1805 */ 1806 static attachNodeAdapter(adapter: NodeAdapter, node: FrameNode): boolean; 1807 /** 1808 * Remove the bound NodeAdapter from the node.A node can only be bound to one NodeAdapter. 1809 * 1810 * @param { FrameNode } node - Unbind the FrameNode node. 1811 * @syscap SystemCapability.ArkUI.ArkUI.Full 1812 * @crossplatform 1813 * @atomicservice 1814 * @since 12 1815 */ 1816 static detachNodeAdapter(node: FrameNode): void; 1817}