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/// <reference path='./import.ts' /> 17class SpanFontSizeModifier extends ModifierWithKey<Length> { 18 constructor(value: Length) { 19 super(value); 20 } 21 static identity: Symbol = Symbol('spanFontSize'); 22 applyPeer(node: KNode, reset: boolean): void { 23 if (reset) { 24 getUINativeModule().span.resetFontSize(node); 25 } else { 26 getUINativeModule().span.setFontSize(node, this.value!); 27 } 28 } 29 30 checkObjectDiff(): boolean { 31 return !isBaseOrResourceEqual(this.stageValue, this.value); 32 } 33} 34class SpanFontFamilyModifier extends ModifierWithKey<string | Resource> { 35 constructor(value: string | Resource) { 36 super(value); 37 } 38 static identity: Symbol = Symbol('spanFontFamily'); 39 applyPeer(node: KNode, reset: boolean): void { 40 if (reset) { 41 getUINativeModule().span.resetFontFamily(node); 42 } else { 43 getUINativeModule().span.setFontFamily(node, this.value!); 44 } 45 } 46 47 checkObjectDiff(): boolean { 48 return !isBaseOrResourceEqual(this.stageValue, this.value); 49 } 50} 51class SpanLineHeightModifier extends ModifierWithKey<Length> { 52 constructor(value: Length) { 53 super(value); 54 } 55 static identity: Symbol = Symbol('spanLineHeight'); 56 applyPeer(node: KNode, reset: boolean): void { 57 if (reset) { 58 getUINativeModule().span.resetLineHeight(node); 59 } else { 60 getUINativeModule().span.setLineHeight(node, this.value!); 61 } 62 } 63 64 checkObjectDiff(): boolean { 65 return !isBaseOrResourceEqual(this.stageValue, this.value); 66 } 67} 68class SpanFontStyleModifier extends ModifierWithKey<number> { 69 constructor(value: number) { 70 super(value); 71 } 72 static identity: Symbol = Symbol('spanFontStyle'); 73 applyPeer(node: KNode, reset: boolean): void { 74 if (reset) { 75 getUINativeModule().span.resetFontStyle(node); 76 } else { 77 getUINativeModule().span.setFontStyle(node, this.value!); 78 } 79 } 80 checkObjectDiff(): boolean { 81 return !isBaseOrResourceEqual(this.stageValue, this.value); 82 } 83} 84class SpanTextCaseModifier extends ModifierWithKey<number> { 85 constructor(value: number) { 86 super(value); 87 } 88 static identity: Symbol = Symbol('spanTextCase'); 89 applyPeer(node: KNode, reset: boolean): void { 90 if (reset) { 91 getUINativeModule().span.resetTextCase(node); 92 } else { 93 getUINativeModule().span.setTextCase(node, this.value!); 94 } 95 } 96 checkObjectDiff(): boolean { 97 return !isBaseOrResourceEqual(this.stageValue, this.value); 98 } 99} 100class SpanFontColorModifier extends ModifierWithKey<ResourceColor> { 101 constructor(value: ResourceColor) { 102 super(value); 103 } 104 static identity = Symbol('spanFontColor'); 105 applyPeer(node: KNode, reset: boolean): void { 106 if (reset) { 107 getUINativeModule().span.resetFontColor(node); 108 } else { 109 getUINativeModule().span.setFontColor(node, this.value!); 110 } 111 } 112 checkObjectDiff(): boolean { 113 return !isBaseOrResourceEqual(this.stageValue, this.value); 114 } 115} 116class SpanLetterSpacingModifier extends ModifierWithKey<string> { 117 constructor(value: string) { 118 super(value); 119 } 120 static identity = Symbol('spanLetterSpacing'); 121 applyPeer(node: KNode, reset: boolean): void { 122 if (reset) { 123 getUINativeModule().span.resetLetterSpacing(node); 124 } else { 125 getUINativeModule().span.setLetterSpacing(node, this.value!); 126 } 127 } 128} 129class SpanFontModifier extends ModifierWithKey<Font> { 130 constructor(value: Font) { 131 super(value); 132 } 133 static identity = Symbol('spanFont'); 134 applyPeer(node: KNode, reset: boolean): void { 135 if (reset) { 136 getUINativeModule().span.resetFont(node); 137 } else { 138 getUINativeModule().span.setFont(node, this.value.size, this.value.weight, this.value.family, this.value.style); 139 } 140 } 141 142 checkObjectDiff(): boolean { 143 if (this.stageValue.weight !== this.value.weight || this.stageValue.style !== this.value.style) { 144 return true; 145 } 146 if (((isResource(this.stageValue.size) && isResource(this.value.size) && 147 isResourceEqual(this.stageValue.size, this.value.size)) || 148 (!isResource(this.stageValue.size) && !isResource(this.value.size) && 149 this.stageValue.size === this.value.size)) && 150 ((isResource(this.stageValue.family) && isResource(this.value.family) && 151 isResourceEqual(this.stageValue.family, this.value.family)) || 152 (!isResource(this.stageValue.family) && !isResource(this.value.family) && 153 this.stageValue.family === this.value.family))) { 154 return false; 155 } else { 156 return true; 157 } 158 } 159} 160class SpanDecorationModifier extends ModifierWithKey<{ type: TextDecorationType, color?: ResourceColor }> { 161 constructor(value: { type: TextDecorationType, color?: ResourceColor }) { 162 super(value); 163 } 164 static identity = Symbol('spanDecoration'); 165 applyPeer(node: KNode, reset: boolean): void { 166 if (reset) { 167 getUINativeModule().span.resetDecoration(node); 168 } else { 169 getUINativeModule().span.setDecoration(node, this.value.type, this.value.color); 170 } 171 } 172 173 checkObjectDiff(): boolean { 174 if (this.stageValue.type !== this.value.type) { 175 return true; 176 } 177 if (isResource(this.stageValue.color) && isResource(this.value.color)) { 178 return !isResourceEqual(this.stageValue.color, this.value.color); 179 } else if (!isResource(this.stageValue.color) && !isResource(this.value.color)) { 180 return !(this.stageValue.color === this.value.color); 181 } else { 182 return true; 183 } 184 } 185} 186class SpanFontWeightModifier extends ModifierWithKey<string> { 187 constructor(value: string) { 188 super(value); 189 } 190 static identity = Symbol('spanfontweight'); 191 applyPeer(node: KNode, reset: boolean): void { 192 if (reset) { 193 getUINativeModule().span.resetFontWeight(node); 194 } else { 195 getUINativeModule().span.setFontWeight(node, this.value!); 196 } 197 } 198} 199 200class ArkSpanComponent implements CommonMethod<SpanAttribute> { 201 _modifiersWithKeys: Map<Symbol, ModifierWithKey<number | string | boolean | object>>; 202 nativePtr: KNode; 203 204 constructor(nativePtr: KNode) { 205 this._modifiersWithKeys = new Map(); 206 this.nativePtr = nativePtr; 207 } 208 applyModifierPatch(): void { 209 let expiringItemsWithKeys = []; 210 this._modifiersWithKeys.forEach((value, key) => { 211 if (value.applyStage(this.nativePtr)) { 212 expiringItemsWithKeys.push(key); 213 } 214 }); 215 expiringItemsWithKeys.forEach(key => { 216 this._modifiersWithKeys.delete(key); 217 }); 218 } 219 onGestureJudgeBegin(callback: (gestureInfo: GestureInfo, event: BaseGestureEvent) => GestureJudgeResult): this { 220 throw new Error('Method not implemented.'); 221 } 222 outline(value: OutlineOptions): this { 223 throw new Error('Method not implemented.'); 224 } 225 outlineColor(value: ResourceColor | EdgeColors): this { 226 throw new Error('Method not implemented.'); 227 } 228 outlineRadius(value: Dimension | OutlineRadiuses): this { 229 throw new Error('Method not implemented.'); 230 } 231 outlineStyle(value: OutlineStyle | EdgeOutlineStyles): this { 232 throw new Error('Method not implemented.'); 233 } 234 outlineWidth(value: Dimension | EdgeOutlineWidths): this { 235 throw new Error('Method not implemented.'); 236 } 237 width(value: Length): this { 238 throw new Error('Method not implemented.'); 239 } 240 241 height(value: Length): this { 242 throw new Error('Method not implemented.'); 243 } 244 245 expandSafeArea(types?: Array<SafeAreaType>, edges?: Array<SafeAreaEdge>): this { 246 throw new Error('Method not implemented.'); 247 } 248 249 responseRegion(value: Array<Rectangle> | Rectangle): this { 250 throw new Error('Method not implemented.'); 251 } 252 253 mouseResponseRegion(value: Array<Rectangle> | Rectangle): this { 254 throw new Error('Method not implemented.'); 255 } 256 257 size(value: SizeOptions): this { 258 throw new Error('Method not implemented.'); 259 } 260 261 constraintSize(value: ConstraintSizeOptions): this { 262 throw new Error('Method not implemented.'); 263 } 264 265 touchable(value: boolean): this { 266 throw new Error('Method not implemented.'); 267 } 268 269 hitTestBehavior(value: HitTestMode): this { 270 throw new Error('Method not implemented.'); 271 } 272 273 layoutWeight(value: number | string): this { 274 throw new Error('Method not implemented.'); 275 } 276 277 padding(value: Padding | Length): this { 278 throw new Error('Method not implemented.'); 279 } 280 281 margin(value: Margin | Length): this { 282 throw new Error('Method not implemented.'); 283 } 284 285 background(builder: CustomBuilder, options?: { align?: Alignment }): this { 286 throw new Error('Method not implemented.'); 287 } 288 289 backgroundColor(value: ResourceColor): this { 290 throw new Error('Method not implemented.'); 291 } 292 293 backgroundImage(src: ResourceStr, repeat?: ImageRepeat): this { 294 throw new Error('Method not implemented.'); 295 } 296 297 backgroundImageSize(value: SizeOptions | ImageSize): this { 298 throw new Error('Method not implemented.'); 299 } 300 301 backgroundImagePosition(value: Position | Alignment): this { 302 throw new Error('Method not implemented.'); 303 } 304 305 backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): this { 306 throw new Error('Method not implemented.'); 307 } 308 309 foregroundBlurStyle(value: BlurStyle, options?: ForegroundBlurStyleOptions): this { 310 throw new Error('Method not implemented.'); 311 } 312 313 opacity(value: number | Resource): this { 314 throw new Error('Method not implemented.'); 315 } 316 317 border(value: BorderOptions): this { 318 throw new Error('Method not implemented.'); 319 } 320 321 borderStyle(value: BorderStyle | EdgeStyles): this { 322 throw new Error('Method not implemented.'); 323 } 324 325 borderWidth(value: Length | EdgeWidths): this { 326 throw new Error('Method not implemented.'); 327 } 328 329 borderColor(value: ResourceColor | EdgeColors): this { 330 throw new Error('Method not implemented.'); 331 } 332 333 borderRadius(value: Length | BorderRadiuses): this { 334 throw new Error('Method not implemented.'); 335 } 336 337 338 borderImage(value: BorderImageOption): this { 339 throw new Error('Method not implemented.'); 340 } 341 342 foregroundColor(value: ResourceColor | ColoringStrategy): this { 343 throw new Error('Method not implemented.'); 344 } 345 346 onClick(event: (event?: ClickEvent) => void): this { 347 throw new Error('Method not implemented.'); 348 } 349 350 onHover(event: (isHover?: boolean, event?: HoverEvent) => void): this { 351 throw new Error('Method not implemented.'); 352 } 353 354 hoverEffect(value: HoverEffect): this { 355 throw new Error('Method not implemented.'); 356 } 357 358 onMouse(event: (event?: MouseEvent) => void): this { 359 throw new Error('Method not implemented.'); 360 } 361 362 onTouch(event: (event?: TouchEvent) => void): this { 363 throw new Error('Method not implemented.'); 364 } 365 366 onKeyEvent(event: (event?: KeyEvent) => void): this { 367 throw new Error('Method not implemented.'); 368 } 369 370 focusable(value: boolean): this { 371 throw new Error('Method not implemented.'); 372 } 373 374 onFocus(event: () => void): this { 375 throw new Error('Method not implemented.'); 376 } 377 378 onBlur(event: () => void): this { 379 throw new Error('Method not implemented.'); 380 } 381 382 tabIndex(index: number): this { 383 throw new Error('Method not implemented.'); 384 } 385 386 defaultFocus(value: boolean): this { 387 throw new Error('Method not implemented.'); 388 } 389 390 groupDefaultFocus(value: boolean): this { 391 throw new Error('Method not implemented.'); 392 } 393 394 focusOnTouch(value: boolean): this { 395 throw new Error('Method not implemented.'); 396 } 397 398 animation(value: AnimateParam): this { 399 throw new Error('Method not implemented.'); 400 } 401 402 transition(value: TransitionOptions | TransitionEffect): this { 403 throw new Error('Method not implemented.'); 404 } 405 406 gesture(gesture: GestureType, mask?: GestureMask): this { 407 throw new Error('Method not implemented.'); 408 } 409 410 priorityGesture(gesture: GestureType, mask?: GestureMask): this { 411 throw new Error('Method not implemented.'); 412 } 413 414 parallelGesture(gesture: GestureType, mask?: GestureMask): this { 415 throw new Error('Method not implemented.'); 416 } 417 418 blur(value: number): this { 419 throw new Error('Method not implemented.'); 420 } 421 422 linearGradientBlur(value: number, options: LinearGradientBlurOptions): this { 423 throw new Error('Method not implemented.'); 424 } 425 426 brightness(value: number): this { 427 throw new Error('Method not implemented.'); 428 } 429 430 contrast(value: number): this { 431 throw new Error('Method not implemented.'); 432 } 433 434 grayscale(value: number): this { 435 throw new Error('Method not implemented.'); 436 } 437 438 colorBlend(value: Color | string | Resource): this { 439 throw new Error('Method not implemented.'); 440 } 441 442 saturate(value: number): this { 443 throw new Error('Method not implemented.'); 444 } 445 446 sepia(value: number): this { 447 throw new Error('Method not implemented.'); 448 } 449 450 invert(value: number): this { 451 throw new Error('Method not implemented.'); 452 } 453 454 hueRotate(value: number | string): this { 455 throw new Error('Method not implemented.'); 456 } 457 458 useEffect(value: boolean): this { 459 throw new Error('Method not implemented.'); 460 } 461 462 backdropBlur(value: number): this { 463 throw new Error('Method not implemented.'); 464 } 465 466 renderGroup(value: boolean): this { 467 throw new Error('Method not implemented.'); 468 } 469 470 translate(value: TranslateOptions): this { 471 throw new Error('Method not implemented.'); 472 } 473 474 scale(value: ScaleOptions): this { 475 throw new Error('Method not implemented.'); 476 } 477 gridSpan(value: number): this { 478 throw new Error('Method not implemented.'); 479 } 480 481 gridOffset(value: number): this { 482 throw new Error('Method not implemented.'); 483 } 484 485 rotate(value: RotateOptions): this { 486 throw new Error('Method not implemented.'); 487 } 488 489 transform(value: object): this { 490 throw new Error('Method not implemented.'); 491 } 492 493 onAppear(event: () => void): this { 494 throw new Error('Method not implemented.'); 495 } 496 497 onDisAppear(event: () => void): this { 498 throw new Error('Method not implemented.'); 499 } 500 501 onAreaChange(event: (oldValue: Area, newValue: Area) => void): this { 502 throw new Error('Method not implemented.'); 503 } 504 505 visibility(value: Visibility): this { 506 throw new Error('Method not implemented.'); 507 } 508 509 flexGrow(value: number): this { 510 throw new Error('Method not implemented.'); 511 } 512 513 flexShrink(value: number): this { 514 throw new Error('Method not implemented.'); 515 } 516 517 flexBasis(value: number | string): this { 518 throw new Error('Method not implemented.'); 519 } 520 521 alignSelf(value: ItemAlign): this { 522 throw new Error('Method not implemented.'); 523 } 524 525 displayPriority(value: number): this { 526 throw new Error('Method not implemented.'); 527 } 528 529 zIndex(value: number): this { 530 throw new Error('Method not implemented.'); 531 } 532 533 sharedTransition(id: string, options?: sharedTransitionOptions): this { 534 throw new Error('Method not implemented.'); 535 } 536 537 direction(value: Direction): this { 538 throw new Error('Method not implemented.'); 539 } 540 541 align(value: Alignment): this { 542 throw new Error('Method not implemented.'); 543 } 544 545 position(value: Position): this { 546 throw new Error('Method not implemented.'); 547 } 548 549 markAnchor(value: Position): this { 550 throw new Error('Method not implemented.'); 551 } 552 553 offset(value: Position): this { 554 throw new Error('Method not implemented.'); 555 } 556 557 enabled(value: boolean): this { 558 throw new Error('Method not implemented.'); 559 } 560 561 useSizeType(value: { 562 xs?: number | { span: number; offset: number }; 563 sm?: number | { span: number; offset: number }; 564 md?: number | { span: number; offset: number }; 565 lg?: number | { span: number; offset: number }; 566 }): this { 567 throw new Error('Method not implemented.'); 568 } 569 570 alignRules(value: AlignRuleOption): this { 571 throw new Error('Method not implemented.'); 572 } 573 574 aspectRatio(value: number): this { 575 throw new Error('Method not implemented.'); 576 } 577 578 clickEffect(value: ClickEffect | null): this { 579 throw new Error('Method not implemented.'); 580 } 581 582 onDragStart(event: (event?: DragEvent, extraParams?: string) => CustomBuilder | DragItemInfo): this { 583 throw new Error('Method not implemented.'); 584 } 585 586 onDragEnter(event: (event?: DragEvent, extraParams?: string) => void): this { 587 throw new Error('Method not implemented.'); 588 } 589 590 onDragMove(event: (event?: DragEvent, extraParams?: string) => void): this { 591 throw new Error('Method not implemented.'); 592 } 593 594 onDragLeave(event: (event?: DragEvent, extraParams?: string) => void): this { 595 throw new Error('Method not implemented.'); 596 } 597 598 onDrop(event: (event?: DragEvent, extraParams?: string) => void): this { 599 throw new Error('Method not implemented.'); 600 } 601 602 onDragEnd(event: (event: DragEvent, extraParams?: string) => void): this { 603 throw new Error('Method not implemented.'); 604 } 605 606 allowDrop(value: Array<UniformDataType>): this { 607 throw new Error('Method not implemented.'); 608 } 609 610 draggable(value: boolean): this { 611 throw new Error('Method not implemented.'); 612 } 613 614 overlay(value: string | CustomBuilder, options?: { align?: Alignment; offset?: { x?: number; y?: number } }): this { 615 throw new Error('Method not implemented.'); 616 } 617 618 linearGradient(value: { 619 angle?: number | string; 620 direction?: GradientDirection; 621 colors: Array<any>; 622 repeating?: boolean; 623 }): this { 624 throw new Error('Method not implemented.'); 625 } 626 627 sweepGradient(value: { 628 center: Array<any>; 629 start?: number | string; 630 end?: number | string; 631 rotation?: number | string; 632 colors: Array<any>; 633 repeating?: boolean; 634 }): this { 635 throw new Error('Method not implemented.'); 636 } 637 638 radialGradient(value: { center: Array<any>; radius: number | string; colors: Array<any>; repeating?: boolean }): this { 639 throw new Error('Method not implemented.'); 640 } 641 642 motionPath(value: MotionPathOptions): this { 643 throw new Error('Method not implemented.'); 644 } 645 646 shadow(value: ShadowOptions | ShadowStyle): this { 647 throw new Error('Method not implemented.'); 648 } 649 650 mask(value: CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask): this { 651 throw new Error('Method not implemented.'); 652 } 653 654 key(value: string): this { 655 throw new Error('Method not implemented.'); 656 } 657 658 id(value: string): this { 659 throw new Error('Method not implemented.'); 660 } 661 662 geometryTransition(id: string): this { 663 throw new Error('Method not implemented.'); 664 } 665 666 bindPopup(show: boolean, popup: PopupOptions | CustomPopupOptions): this { 667 throw new Error('Method not implemented.'); 668 } 669 670 bindMenu(content: Array<MenuElement> | CustomBuilder, options?: MenuOptions): this { 671 throw new Error('Method not implemented.'); 672 } 673 674 bindContextMenu(content: CustomBuilder, responseType: ResponseType, options?: ContextMenuOptions): this { 675 throw new Error('Method not implemented.'); 676 } 677 678 bindContentCover(isShow: boolean, builder: CustomBuilder, type?: ModalTransition | ContentCoverOptions): this { 679 throw new Error('Method not implemented.'); 680 } 681 682 blendMode(value: BlendMode): this { 683 throw new Error('Method not implemented.'); 684 } 685 686 clip(value: boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): this { 687 throw new Error('Method not implemented.'); 688 } 689 690 bindSheet(isShow: boolean, builder: CustomBuilder, options?: SheetOptions): this { 691 throw new Error('Method not implemented.'); 692 } 693 694 stateStyles(value: StateStyles): this { 695 throw new Error('Method not implemented.'); 696 } 697 698 restoreId(value: number): this { 699 throw new Error('Method not implemented.'); 700 } 701 702 onVisibleAreaChange(ratios: Array<number>, event: (isVisible: boolean, currentRatio: number) => void): this { 703 throw new Error('Method not implemented.'); 704 } 705 706 sphericalEffect(value: number): this { 707 throw new Error('Method not implemented.'); 708 } 709 710 lightUpEffect(value: number): this { 711 throw new Error('Method not implemented.'); 712 } 713 714 pixelStretchEffect(options: PixelStretchEffectOptions): this { 715 throw new Error('Method not implemented.'); 716 } 717 718 keyboardShortcut(value: string | FunctionKey, keys: Array<ModifierKey>, action?: () => void): this { 719 throw new Error('Method not implemented.'); 720 } 721 722 accessibilityGroup(value: boolean): this { 723 throw new Error('Method not implemented.'); 724 } 725 726 accessibilityText(value: string): this { 727 throw new Error('Method not implemented.'); 728 } 729 730 accessibilityDescription(value: string): this { 731 throw new Error('Method not implemented.'); 732 } 733 734 accessibilityLevel(value: string): this { 735 throw new Error('Method not implemented.'); 736 } 737 738 obscured(reasons: Array<ObscuredReasons>): this { 739 throw new Error('Method not implemented.'); 740 } 741 742 reuseId(id: string): this { 743 throw new Error('Method not implemented.'); 744 } 745 746 renderFit(fitMode: RenderFit): this { 747 throw new Error('Method not implemented.'); 748 } 749 750 attributeModifier(modifier: AttributeModifier<CommonAttribute>): this { 751 return this; 752 } 753 decoration(value: { type: TextDecorationType, color?: ResourceColor }): SpanAttribute { 754 modifierWithKey(this._modifiersWithKeys, SpanDecorationModifier.identity, SpanDecorationModifier, value); 755 return this; 756 } 757 font(value: Font): SpanAttribute { 758 modifierWithKey(this._modifiersWithKeys, SpanFontModifier.identity, SpanFontModifier, value); 759 return this; 760 } 761 lineHeight(value: Length): SpanAttribute { 762 modifierWithKey(this._modifiersWithKeys, SpanLineHeightModifier.identity, SpanLineHeightModifier, value); 763 return this; 764 } 765 fontSize(value: Length): SpanAttribute { 766 modifierWithKey(this._modifiersWithKeys, SpanFontSizeModifier.identity, SpanFontSizeModifier, value); 767 return this; 768 } 769 fontColor(value: ResourceColor): SpanAttribute { 770 modifierWithKey(this._modifiersWithKeys, SpanFontColorModifier.identity, SpanFontColorModifier, value); 771 return this; 772 } 773 fontStyle(value: FontStyle): SpanAttribute { 774 modifierWithKey(this._modifiersWithKeys, SpanFontStyleModifier.identity, SpanFontStyleModifier, value); 775 return this; 776 } 777 fontWeight(value: number | FontWeight | string): SpanAttribute { 778 modifierWithKey(this._modifiersWithKeys, SpanFontWeightModifier.identity, SpanFontWeightModifier, value); 779 return this; 780 } 781 fontFamily(value: string | Resource): SpanAttribute { 782 modifierWithKey(this._modifiersWithKeys, SpanFontFamilyModifier.identity, SpanFontFamilyModifier, value); 783 return this; 784 } 785 letterSpacing(value: number | string): SpanAttribute { 786 modifierWithKey(this._modifiersWithKeys, SpanLetterSpacingModifier.identity, SpanLetterSpacingModifier, value); 787 return this; 788 } 789 textCase(value: TextCase): SpanAttribute { 790 modifierWithKey(this._modifiersWithKeys, SpanTextCaseModifier.identity, SpanTextCaseModifier, value); 791 return this; 792 } 793} 794// @ts-ignore 795globalThis.Span.attributeModifier = function (modifier) { 796 const elmtId = ViewStackProcessor.GetElmtIdToAccountFor(); 797 let nativeNode = getUINativeModule().getFrameNodeById(elmtId); 798 799 let component = this.createOrGetNode(elmtId, () => { 800 return new ArkSpanComponent(nativeNode); 801 }); 802 modifier.applyNormalAttribute(component); 803 component.applyModifierPatch(); 804};