1/* 2 * Copyright (c) 2022 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' /> 17 18class ArkBorderStyle { 19 type: boolean | undefined; 20 style: BorderStyle | undefined; 21 top: BorderStyle | undefined; 22 right: BorderStyle | undefined; 23 bottom: BorderStyle | undefined; 24 left: BorderStyle | undefined; 25 26 constructor() { 27 this.type = undefined; 28 this.style = undefined; 29 this.top = undefined; 30 this.right = undefined; 31 this.bottom = undefined; 32 this.left = undefined; 33 } 34 isEqual(another: ArkBorderStyle): boolean { 35 return ( 36 this.type === another.type && 37 this.style === another.style && 38 this.top === another.top && 39 this.right === another.right && 40 this.bottom === another.bottom && 41 this.left === another.left 42 ); 43 } 44 parseBorderStyle(value: BorderStyle | EdgeStyles): boolean { 45 if (typeof value === 'number') { 46 this.style = value; 47 this.type = true; 48 return true; 49 } else if (typeof value === 'object') { 50 return this.parseEdgeStyles(value as EdgeStyles); 51 } 52 return false; 53 } 54 parseEdgeStyles(options: EdgeStyles): boolean { 55 this.top = options.top; 56 this.right = options.right; 57 this.bottom = options.bottom; 58 this.left = options.left; 59 this.type = true; 60 return true; 61 } 62} 63 64class ArkBorderColor { 65 leftColor: EdgeColors | ResourceColor; 66 rightColor: EdgeColors | ResourceColor; 67 topColor: EdgeColors | ResourceColor; 68 bottomColor: EdgeColors | ResourceColor; 69 70 constructor() { 71 this.leftColor = undefined; 72 this.rightColor = undefined; 73 this.topColor = undefined; 74 this.bottomColor = undefined; 75 } 76 77 isEqual(another: ArkBorderColor): boolean { 78 return ( 79 this.leftColor === another.leftColor && 80 this.rightColor === another.rightColor && 81 this.topColor === another.topColor && 82 this.bottomColor === another.bottomColor 83 ); 84 } 85} 86 87class ArkPosition { 88 x: Length; 89 y: Length; 90 91 constructor() { 92 this.x = undefined; 93 this.y = undefined; 94 } 95 96 isEqual(another: ArkPosition): boolean { 97 return this.x === another.x && this.y === another.y; 98 } 99} 100 101class ArkBorderWidth { 102 left: EdgeWidths | Length; 103 right: EdgeWidths | Length; 104 top: EdgeWidths | Length; 105 bottom: EdgeWidths | Length; 106 107 constructor() { 108 this.left = undefined; 109 this.right = undefined; 110 this.top = undefined; 111 this.bottom = undefined; 112 } 113 114 isEqual(another: ArkBorderWidth): boolean { 115 return ( 116 this.left === another.left && 117 this.right === another.right && 118 this.top === another.top && 119 this.bottom === another.bottom 120 ); 121 } 122} 123 124class ArkBorderRadius { 125 topLeft: BorderRadiuses | Length; 126 topRight: BorderRadiuses | Length; 127 bottomLeft: BorderRadiuses | Length; 128 bottomRight: BorderRadiuses | Length; 129 130 constructor() { 131 this.topLeft = undefined; 132 this.topRight = undefined; 133 this.bottomLeft = undefined; 134 this.bottomRight = undefined; 135 } 136 137 isEqual(another: ArkBorderRadius): boolean { 138 return ( 139 this.topLeft === another.topLeft && 140 this.topRight === another.topRight && 141 this.bottomLeft === another.bottomLeft && 142 this.bottomRight === another.bottomRight 143 ); 144 } 145} 146 147class ArkLabelFont { 148 size: number | string | undefined | Resource; 149 weight: FontWeight | number | string | undefined; 150 family: string | undefined | Resource; 151 style: FontStyle | number | undefined; 152 constructor() { 153 this.size = undefined; 154 this.weight = undefined; 155 this.family = undefined; 156 this.style = undefined; 157 } 158 159 isEqual(another: ArkLabelFont): boolean { 160 return ( 161 this.size === another.size && 162 this.weight === another.weight && 163 this.family === another.family && 164 this.style === another.style 165 ); 166 } 167} 168 169function deepCompareArrays(arr1: Array<any>, arr2: Array<any>): boolean { 170 return ( 171 Array.isArray(arr1) && 172 Array.isArray(arr2) && 173 arr1.length === arr2.length && 174 arr1.every((value, index) => { 175 if (Array.isArray(value) && Array.isArray(arr2[index])) { 176 return deepCompareArrays(value, arr2[index]); 177 } else { 178 return value === arr2[index]; 179 } 180 }) 181 ); 182} 183 184class ArkLinearGradient { 185 angle: number | string | undefined; 186 direction: number | undefined; 187 colors: Array<any>; 188 repeating: boolean | undefined; 189 190 constructor(angle: number | string | undefined, 191 direction: number | undefined, 192 colors: Array<any>, 193 repeating: boolean | undefined) { 194 this.angle = angle; 195 this.direction = direction; 196 this.colors = colors; 197 this.repeating = repeating; 198 } 199 200 isEqual(another: ArkLinearGradient): boolean { 201 return ( 202 this.angle === another.angle && 203 this.direction === another.direction && 204 deepCompareArrays(this.colors, another.colors) && 205 this.repeating === another.repeating 206 ); 207 } 208} 209 210class ArkSweepGradient { 211 center: Array<any>; 212 start: number | string | undefined; 213 end: number | string | undefined; 214 rotation: number | string | undefined; 215 colors: Array<any>; 216 repeating: boolean | undefined; 217 218 constructor(center: Array<any>, 219 start: number | string | undefined, 220 end: number | string | undefined, 221 rotation: number | string | undefined, 222 colors: Array<any>, 223 repeating: boolean | undefined) { 224 this.center = center; 225 this.start = start; 226 this.end = end; 227 this.rotation = rotation; 228 this.colors = colors; 229 this.repeating = repeating; 230 } 231 232 isEqual(another: ArkSweepGradient): boolean { 233 return ( 234 deepCompareArrays(this.center, another.center) && 235 this.start === another.start && 236 this.end === another.end && 237 this.rotation === another.rotation && 238 deepCompareArrays(this.colors, another.colors) && 239 this.repeating === another.repeating 240 ); 241 } 242} 243 244class ArkForegroundBlurStyle { 245 blurStyle: number | undefined; 246 colorMode: number | undefined; 247 adaptiveColor: number | undefined; 248 scale: number | undefined; 249 250 constructor() { 251 this.blurStyle = undefined; 252 this.colorMode = undefined; 253 this.adaptiveColor = undefined; 254 this.scale = undefined; 255 } 256 257 isEqual(another: ArkForegroundBlurStyle): boolean { 258 return ( 259 this.blurStyle === another.blurStyle && 260 this.colorMode === another.colorMode && 261 this.adaptiveColor === another.adaptiveColor && 262 this.scale === another.scale 263 ); 264 } 265} 266 267class ArkLinearGradientBlur { 268 blurRadius: number | undefined; 269 fractionStops: FractionStop[] | undefined; 270 direction: number | undefined; 271 272 constructor() { 273 this.blurRadius = undefined; 274 this.fractionStops = undefined; 275 this.direction = undefined; 276 } 277 278 isEqual(another: ArkLinearGradientBlur): boolean { 279 return ( 280 this.blurRadius === another.blurRadius && 281 deepCompareArrays(this.fractionStops, another.fractionStops) && 282 this.direction === another.direction 283 ); 284 } 285} 286 287class ArkOverlay { 288 value: string | CustomBuilder | undefined; 289 align: number | undefined; 290 offsetX: number | undefined; 291 offsetY: number | undefined; 292 hasOptions: boolean | undefined; 293 hasOffset: boolean | undefined; 294 295 constructor() { 296 this.value = undefined; 297 this.align = undefined; 298 this.offsetX = undefined; 299 this.offsetY = undefined; 300 this.hasOptions = undefined; 301 this.hasOffset = undefined; 302 } 303 304 private splitOption(options?: { align?: Alignment; offset?: { x?: number; y?: number } }): boolean { 305 if (isUndefined(options)) { 306 return true; 307 } 308 this.hasOptions = true; 309 this.align = options.align; 310 if (isUndefined(options.offset)) { 311 return true; 312 } 313 this.hasOffset = true; 314 this.offsetX = options.offset.x; 315 this.offsetY = options.offset.y; 316 return true; 317 } 318 319 splitOverlayValue(value: string | CustomBuilder, 320 options?: { align?: Alignment; offset?: { x?: number; y?: number } }): boolean { 321 if (typeof value === 'string') { 322 this.value = value; 323 return this.splitOption(options); 324 } 325 return false; 326 } 327 328 private isEqual(another: ArkOverlay): boolean { 329 return ((this.value === another.value) && (this.align === another.align) && 330 (this.offsetX === another.offsetX) && (this.offsetY === another.offsetY) && 331 (this.hasOptions === another.hasOptions) && (this.hasOffset === another.hasOffset)); 332 } 333 334 checkObjectDiff(another: ArkOverlay): boolean { 335 return !this.isEqual(another); 336 } 337} 338 339class ArkSharedTransition { 340 id: string | undefined; 341 options: sharedTransitionOptions | undefined; 342 constructor() { 343 this.id = undefined; 344 this.options = undefined; 345 } 346 isEqual(another: ArkSharedTransition): boolean { 347 return (this.id === another.id) && (this.options === another.options); 348 } 349} 350 351class ArkListEdgeEffect { 352 value: EdgeEffect; 353 options?: EdgeEffectOptions | undefined; 354 constructor() { 355 this.value = undefined; 356 this.options = undefined; 357 } 358 isEqual(another: ArkListEdgeEffect): boolean { 359 return (this.value === another.value) && 360 (this.options === another.options); 361 } 362} 363 364class ArkScrollEdgeEffect { 365 value: EdgeEffect; 366 options?: EdgeEffectOptions | undefined; 367 constructor() { 368 this.value = undefined; 369 this.options = undefined; 370 } 371 isEqual(another: ArkScrollEdgeEffect): boolean { 372 return (this.value === another.value) && 373 (this.options === another.options); 374 } 375} 376 377class ArkMenuAlignType { 378 alignType: number | MenuAlignType; 379 dx: Length; 380 dy: Length; 381 382 constructor(alignType: MenuAlignType, offset?: Offset) { 383 this.alignType = alignType; 384 if (!isUndefined(offset) && isObject(offset)) { 385 this.dx = offset.dx; 386 this.dy = offset.dy; 387 } 388 } 389 390 isEqual(another: ArkMenuAlignType): boolean { 391 return this.alignType === another.alignType && this.dx === another.dx && this.dy === another.dy; 392 } 393} 394 395class ArkSliderTips { 396 showTip: boolean; 397 tipText: string | ResourceStr; 398 399 constructor(value: boolean, content?: string | ResourceStr) { 400 this.showTip = value; 401 this.tipText = content; 402 } 403 404 isEqual(another: ArkSliderTips): boolean { 405 return this.showTip === another.showTip && this.tipText === another.tipText; 406 } 407} 408 409class ArkStarStyle { 410 backgroundUri: string | undefined; 411 foregroundUri: string | undefined; 412 secondaryUri: string | undefined; 413 414 constructor() { 415 this.backgroundUri = undefined; 416 this.foregroundUri = undefined; 417 this.secondaryUri = undefined; 418 } 419 420 isEqual(another: ArkStarStyle): boolean { 421 return ( 422 this.backgroundUri === another.backgroundUri && 423 this.foregroundUri === another.foregroundUri && 424 this.secondaryUri === another.secondaryUri 425 ); 426 } 427} 428 429class ArkBackgroundBlurStyle { 430 blurStyle: number | undefined; 431 colorMode: number | undefined; 432 adaptiveColor: number | undefined; 433 scale: number | undefined; 434 435 constructor() { 436 this.blurStyle = undefined; 437 this.colorMode = undefined; 438 this.adaptiveColor = undefined; 439 this.scale = undefined; 440 } 441 442 isEqual(another: ArkBackgroundBlurStyle): boolean { 443 return ( 444 this.blurStyle === another.blurStyle && 445 this.colorMode === another.colorMode && 446 this.adaptiveColor === another.adaptiveColor && 447 this.scale === another.scale 448 ); 449 } 450} 451 452class ArkBorder { 453 arkWidth: ArkBorderWidth; 454 arkColor: ArkBorderColor; 455 arkRadius: ArkBorderRadius; 456 arkStyle: ArkBorderStyle; 457 458 constructor() { 459 this.arkWidth = new ArkBorderWidth(); 460 this.arkColor = new ArkBorderColor(); 461 this.arkRadius = new ArkBorderRadius(); 462 this.arkStyle = new ArkBorderStyle(); 463 } 464 isEqual(another: ArkBorder): boolean { 465 return ( 466 this.arkWidth.isEqual(another.arkWidth) && 467 this.arkColor.isEqual(another.arkColor) && 468 this.arkRadius.isEqual(another.arkRadius) && 469 this.arkStyle.isEqual(another.arkStyle) 470 ); 471 } 472 473 checkObjectDiff(another: ArkBorder): boolean { 474 return !this.isEqual(another); 475 } 476} 477 478class ArkBackgroundImageSize { 479 imageSize: ImageSize | undefined | SizeOptions; 480 width: number | string | undefined | Resource; 481 height: number | string | undefined | Resource; 482 constructor() { 483 this.imageSize = undefined; 484 this.width = undefined; 485 this.height = undefined; 486 } 487 isEqual(another: ArkBackgroundImageSize): boolean { 488 return this.imageSize === another.imageSize && this.width === another.width && this.height === another.height; 489 } 490} 491 492class ArkBackgroundImage { 493 src: string | undefined | Resource; 494 repeat: number | undefined; 495 constructor() { 496 this.src = undefined; 497 this.repeat = undefined; 498 } 499 isEqual(another: ArkBackgroundImage): boolean { 500 return this.src === another.src && this.repeat === another.repeat; 501 } 502} 503 504class ArkGridColColumnOption implements Equable { 505 xs?: number; 506 sm?: number; 507 md?: number; 508 lg?: number; 509 xl?: number; 510 xxl?: number; 511 constructor() { 512 this.xs = undefined; 513 this.sm = undefined; 514 this.md = undefined; 515 this.lg = undefined; 516 this.xl = undefined; 517 this.xxl = undefined; 518 } 519 isEqual(another: ArkGridColColumnOption): boolean { 520 return (this.xs === another.xs && 521 this.sm === another.sm && 522 this.md === another.md && 523 this.lg === another.lg && 524 this.xl === another.xl && 525 this.xxl === another.xxl); 526 } 527} 528 529class ArkPadding { 530 top: Length | undefined; 531 right: Length | undefined; 532 bottom: Length | undefined; 533 left: Length | undefined; 534 constructor() { 535 this.top = undefined; 536 this.right = undefined; 537 this.bottom = undefined; 538 this.left = undefined; 539 } 540 isEqual(another: ArkPadding) { 541 return ( 542 this.top === another.top && 543 this.right === another.right && 544 this.bottom === another.bottom && 545 this.left === another.left 546 ); 547 } 548} 549 550class ArkBarMode { 551 barMode: number; 552 options?: ScrollableBarModeOptions | undefined; 553 554 isEqual(another: ArkBarMode): boolean { 555 return (this.barMode === another.barMode) && (this.options === another.options); 556 } 557} 558 559class ArkDivider { 560 divider: DividerStyle; 561 562 isEqual(another: ArkDivider): boolean { 563 return (this.divider === another.divider); 564 } 565} 566 567class ArkBarGridAlign { 568 barGridAlign: BarGridColumnOptions; 569 570 isEqual(another: ArkBarGridAlign): boolean { 571 return (this.barGridAlign === another.barGridAlign); 572 } 573} 574 575 576class ArkScrollableBarModeOptions { 577 value: ScrollableBarModeOptions; 578 579 isEqual(another: ArkScrollableBarModeOptions): boolean { 580 return (this.value === another.value); 581 } 582} 583 584class ArkAlignRules { 585 left: string | undefined; 586 middle: string | undefined; 587 right: string | undefined; 588 top: string | undefined; 589 center: string | undefined; 590 bottom: string | undefined; 591 constructor() { 592 this.left = undefined; 593 this.middle = undefined; 594 this.right = undefined; 595 this.top = undefined; 596 this.center = undefined; 597 this.bottom = undefined; 598 } 599 isEqual(another: ArkAlignRules) { 600 return ( 601 this.left === another.left && 602 this.middle === another.middle && 603 this.right === another.right && 604 this.top === another.top && 605 this.center === another.center && 606 this.bottom === another.bottom 607 ); 608 } 609} 610 611class ArkSafeAreaExpandOpts { 612 type: string | number | undefined = undefined; 613 edges: string | number | undefined = undefined; 614 isEqual(another: ArkSafeAreaExpandOpts): boolean { 615 return (this.type === another.type) && (this.edges === another.edges); 616 } 617} 618 619class ArkButtonStyle { 620 left?: number; 621 top?: number; 622 width?: number; 623 height?: number; 624 icons?: { 625 shown?: string; 626 hidden?: string; 627 switching?: string; 628 }; 629 constructor() { 630 this.left = 16; 631 this.top = 48; 632 this.width = 24; 633 this.height = 24; 634 this.icons = { 635 shown: undefined, 636 hidden: undefined, 637 switching: undefined 638 }; 639 } 640 isEqual(another: ArkButtonStyle): boolean { 641 return ( 642 this.left === another.left && 643 this.top === another.top && 644 this.width === another.width && 645 this.height === another.height && 646 this.icons === another.icons 647 ); 648 } 649} 650 651class ArkShadowInfoToArray { 652 radius: (number | string)[]; 653 type: ShadowType[]; 654 color: (Color | string | Resource | ColoringStrategy)[]; 655 offsetX: (number | string)[]; 656 offsetY: (number | string)[]; 657 fill: boolean[]; 658 constructor() { 659 this.radius = []; 660 this.type = []; 661 this.color = []; 662 this.offsetX = []; 663 this.offsetX = []; 664 this.offsetY = []; 665 this.fill = []; 666 } 667 isEqual(another: ArkShadowInfoToArray): boolean { 668 return (this.radius === another.radius) && 669 (this.color === another.color) && 670 (this.offsetX === another.offsetX) && 671 (this.offsetY === another.offsetY) && 672 (this.fill === another.fill); 673 } 674 675 convertShadowOptions(value: ShadowOptions | Array<ShadowOptions>): boolean { 676 if (Object.getPrototypeOf(value).constructor === Object) { 677 if ((<ShadowOptions>value).radius === null || (<ShadowOptions>value).radius === undefined) { 678 return false; 679 } else { 680 this.radius.push(<number | string>(<ShadowOptions>value).radius); 681 this.type.push((<ShadowOptions>value).type); 682 this.color.push((<ShadowOptions>value).color); 683 this.offsetX.push(((<ShadowOptions>value).offsetX === undefined || 684 (<ShadowOptions>value).offsetX === null) ? 0 : <number | string>(<ShadowOptions>value).offsetX); 685 this.offsetY.push(((<ShadowOptions>value).offsetY === undefined || 686 (<ShadowOptions>value).offsetY === null) ? 0 : <number | string>(<ShadowOptions>value).offsetY); 687 this.fill.push(((<ShadowOptions>value).fill === undefined || 688 (<ShadowOptions>value).fill === null) ? false : (<ShadowOptions>value).fill); 689 return true; 690 } 691 } else if (Object.getPrototypeOf(value).constructor === Array) { 692 let isFlag: boolean = true; 693 for (let item of (value as Array<ShadowOptions>)) { 694 if (item.radius === undefined || item.radius === null) { 695 isFlag = false; 696 break; 697 } 698 } 699 if (isFlag) { 700 for (let objValue of (value as Array<ShadowOptions>)) { 701 this.radius.push(<number | string>objValue.radius); 702 this.type.push(objValue.type); 703 this.color.push(objValue.color); 704 this.offsetX.push((objValue.offsetX === undefined || objValue.offsetX === null) ? 0 : <number | string>objValue.offsetX); 705 this.offsetY.push((objValue.offsetY === undefined || objValue.offsetY === null) ? 0 : <number | string>objValue.offsetY); 706 this.fill.push((objValue.fill === undefined || objValue.fill === null) ? false : objValue.fill); 707 } 708 return true; 709 } else { 710 return false; 711 } 712 } 713 } 714 715 checkDiff(value: ShadowOptions, stageValue: ShadowOptions): boolean { 716 if (!value || !stageValue || !value.radius || !stageValue.radius) { 717 return true; 718 } 719 if (!((isResource(stageValue.radius) && isResource(value.radius) && 720 isResourceEqual(stageValue.radius, value.radius)) || 721 (isNumber(stageValue.radius) && isNumber(value.radius) && 722 stageValue.radius === value.radius))) { 723 return true; 724 } 725 if (!(isNumber(stageValue.type) && isNumber(value.type) && 726 stageValue.type === value.type)) { 727 return true; 728 } 729 if (!((isResource(stageValue.color) && isResource(value.color) && 730 isResourceEqual(stageValue.color, value.color)) || 731 (!isResource(stageValue.color) && !isResource(value.color) && 732 stageValue.color === value.color))) { 733 return true; 734 } 735 if (!((isResource(stageValue.offsetX) && isResource(value.offsetX) && 736 isResourceEqual(stageValue.offsetX, value.offsetX)) || 737 (isNumber(stageValue.offsetX) && isNumber(value.offsetX) && 738 stageValue.offsetX === value.offsetX))) { 739 return true; 740 } 741 if (!((isResource(stageValue.offsetY) && isResource(value.offsetY) && 742 isResourceEqual(stageValue.offsetY, value.offsetY)) || 743 (isNumber(stageValue.offsetY) && isNumber(value.offsetY) && 744 stageValue.offsetY === value.offsetY))) { 745 return true; 746 } 747 if (!(isBoolean(stageValue.fill) && isBoolean(value.fill) && 748 stageValue.fill === value.fill)) { 749 return true; 750 } 751 return false; 752 } 753} 754 755class ArkSearchButton { 756 value: string | undefined; 757 fontSize: Length | undefined; 758 fontColor: ResourceColor | undefined; 759 constructor() { 760 this.value = undefined; 761 this.fontSize = undefined; 762 this.fontColor = undefined; 763 } 764 isEqual(another: ArkSearchButton): boolean { 765 return (this.value === another.value) && 766 (this.fontSize === another.fontSize) && 767 (this.fontColor === another.fontColor); 768 } 769} 770class ArkImageFrameInfoToArray { 771 arrSrc: Array<string> | undefined; 772 arrWidth: Array<number | string> | undefined; 773 arrHeight: Array<number | string> | undefined; 774 arrTop: Array<number | string> | undefined; 775 arrLeft: Array<number | string> | undefined; 776 arrDuration: Array<number> | undefined; 777 constructor() { 778 this.arrSrc = []; 779 this.arrWidth = []; 780 this.arrHeight = []; 781 this.arrTop = []; 782 this.arrLeft = []; 783 this.arrDuration = []; 784 } 785 isEqual(another: ArkImageFrameInfoToArray): boolean { 786 return (this.arrSrc.toString() === another.arrSrc.toString()) && 787 (this.arrWidth.toString() === another.arrWidth.toString()) && 788 (this.arrHeight.toString() === another.arrHeight.toString()) && 789 (this.arrTop.toString() === another.arrTop.toString()) && 790 (this.arrLeft.toString() === another.arrLeft.toString()) && 791 (this.arrDuration.toString() === another.arrDuration.toString()); 792 } 793} 794 795class ArkEdgeAlign { 796 alignType: number; 797 offset?: Offset | undefined; 798 799 constructor() { 800 this.alignType = undefined; 801 this.offset = undefined; 802 } 803 804 isEqual(another: ArkEdgeAlign): boolean { 805 return (this.alignType === another.alignType && this.offset === another.offset); 806 } 807} 808 809class ArkKeyBoardShortCut { 810 value: string | number; 811 keys: Array<ModifierKey>; 812 action: () => void | undefined; 813 814 constructor() { 815 this.value = undefined; 816 this.keys = undefined; 817 this.action = undefined; 818 } 819 820 isEqual(another: ArkKeyBoardShortCut): boolean { 821 return (this.value === another.value) && (this.keys === another.keys) && 822 (this.action === another.action); 823 } 824} 825 826class ArkBlendMode { 827 blendMode: number; 828 blendApplyType: number; 829 constructor() { 830 this.blendMode = undefined; 831 this.blendApplyType = undefined; 832 } 833 isEqual(another: ArkBlendMode): boolean { 834 return (this.blendMode === another.blendMode) && (this.blendApplyType === another.blendApplyType); 835 } 836} 837 838class ArkAlignStyle { 839 indexerAlign: number; 840 offset?: number | string | undefined | Resource; 841 842 constructor() { 843 this.indexerAlign = undefined; 844 this.offset = undefined; 845 } 846 847 isEqual(another: ArkAlignStyle): boolean { 848 return (this.indexerAlign === another.indexerAlign && this.offset === another.offset); 849 } 850} 851 852class ArkNestedScrollOptions { 853 scrollForward: NestedScrollMode | undefined; 854 scrollBackward: NestedScrollMode | undefined; 855 constructor() { 856 this.scrollForward = undefined; 857 this.scrollBackward = undefined; 858 } 859 isEqual(another: ArkNestedScrollOptions): boolean { 860 return ((this.scrollForward === another.scrollForward) && (this.scrollBackward === another.scrollBackward)); 861 } 862} 863 864class ArkConstraintSizeOptions { 865 minWidth?: Length | undefined; 866 maxWidth?: Length | undefined; 867 minHeight?: Length | undefined; 868 maxHeight?: Length | undefined; 869 870 constructor() { 871 this.minWidth = undefined; 872 this.maxWidth = undefined; 873 this.minHeight = undefined; 874 this.maxHeight = undefined; 875 } 876 877 isEqual(another: ArkConstraintSizeOptions): boolean { 878 return ( 879 this.minWidth === another.minWidth && 880 this.maxWidth === another.maxWidth && 881 this.minHeight === another.minHeight && 882 this.maxHeight === another.maxHeight 883 ); 884 } 885} 886 887class ArkTextAreaShowCounter { 888 value: boolean; 889 options?: any; 890 constructor() { 891 this.value = undefined; 892 this.options = undefined; 893 } 894 isEqual(another: ArkTextAreaShowCounter): boolean { 895 return (this.value === another.value) && 896 (this.options === another.options); 897 } 898} 899 900class ArkDotIndicator extends DotIndicator { 901 type: string | undefined; 902 leftValue: Length | undefined; 903 topValue: Length | undefined; 904 rightValue: Length | undefined; 905 bottomValue: Length | undefined; 906 itemWidthValue: Length | undefined; 907 itemHeightValue: Length | undefined; 908 selectedItemWidthValue: Length | undefined; 909 selectedItemHeightValue: Length | undefined; 910 maskValue: boolean | undefined; 911 colorValue: ResourceColor | undefined; 912 selectedColorValue: ResourceColor | undefined; 913 914 constructor() { 915 super(); 916 this.type = undefined; 917 this.leftValue = undefined; 918 this.topValue = undefined; 919 this.rightValue = undefined; 920 this.bottomValue = undefined; 921 this.itemWidthValue = undefined; 922 this.itemHeightValue = undefined; 923 this.selectedItemWidthValue = undefined; 924 this.selectedItemHeightValue = undefined; 925 this.maskValue = undefined; 926 this.colorValue = undefined; 927 this.selectedColorValue = undefined; 928 } 929 930 isEqual(another: ArkDotIndicator): boolean { 931 return ( 932 this.type === another.type && 933 this.leftValue === another.leftValue && 934 this.topValue === another.topValue && 935 this.rightValue === another.rightValue && 936 this.bottomValue === another.bottomValue && 937 this.itemWidthValue === another.itemWidthValue && 938 this.itemHeightValue === another.itemHeightValue && 939 this.selectedItemWidthValue === another.selectedItemWidthValue && 940 this.selectedItemHeightValue === another.selectedItemHeightValue && 941 this.maskValue === another.maskValue && 942 this.colorValue === another.colorValue && 943 this.selectedColorValue === another.selectedColorValue 944 ); 945 } 946} 947 948class ArkDigitIndicator extends DigitIndicator { 949 type: string | undefined; 950 leftValue: Length | undefined; 951 topValue: Length | undefined; 952 rightValue: Length | undefined; 953 bottomValue: Length | undefined; 954 fontColorValue: ResourceColor | undefined; 955 selectedFontColorValue: ResourceColor | undefined; 956 digitFontValue: ArkDigitFont | undefined; 957 selectedDigitFontValue: ArkDigitFont | undefined; 958 959 constructor() { 960 super(); 961 this.type = undefined; 962 this.leftValue = undefined; 963 this.topValue = undefined; 964 this.rightValue = undefined; 965 this.bottomValue = undefined; 966 this.fontColorValue = undefined; 967 this.selectedFontColorValue = undefined; 968 this.digitFontValue = undefined; 969 this.selectedDigitFontValue = undefined; 970 } 971 972 isEqual(another: ArkDigitIndicator): boolean { 973 return ( 974 this.type === another.type && 975 this.leftValue === another.leftValue && 976 this.topValue === another.topValue && 977 this.rightValue === another.rightValue && 978 this.bottomValue === another.bottomValue && 979 this.digitFontValue === another.digitFontValue && 980 this.selectedDigitFontValue === another.selectedDigitFontValue 981 ); 982 } 983} 984 985class ArkDigitFont { 986 size: Length | undefined; 987 weight: number | FontWeight | string | undefined; 988 989 constructor() { 990 this.size = undefined; 991 this.weight = undefined; 992 } 993 994 isEqual(another: ArkDigitFont): boolean { 995 return this.size === another.size && this.weight === another.weight; 996 } 997 998 parseFontWeight(value: string | number | undefined) { 999 const valueWeightMap = { 1000 [0]: 'lighter', 1001 [1]: 'normal', 1002 [2]: 'regular', 1003 [3]: 'medium', 1004 [4]: 'bold', 1005 [5]: 'bolder' 1006 }; 1007 if (isUndefined(value)) { 1008 this.weight = '-'; 1009 } else if (value in valueWeightMap) { 1010 this.weight = valueWeightMap[value]; 1011 } else { 1012 this.weight = value.toString(); 1013 } 1014 return this.weight; 1015 } 1016} 1017 1018class ArkDisplayArrow { 1019 value: boolean | ArrowStyle; 1020 isHoverShow: boolean | undefined; 1021 1022 constructor() { 1023 this.value = undefined; 1024 this.isHoverShow = undefined; 1025 } 1026 1027 isEqual(another: ArkDisplayArrow): boolean { 1028 return this.value === another.value && this.isHoverShow === another.isHoverShow; 1029 } 1030} 1031 1032class ArkGridEdgeEffect { 1033 value: EdgeEffect; 1034 options?: EdgeEffectOptions | undefined; 1035 constructor() { 1036 this.value = undefined; 1037 this.options = undefined; 1038 } 1039 isEqual(another: ArkGridEdgeEffect): boolean { 1040 return (this.value === another.value) && 1041 (this.options === another.options); 1042 } 1043} 1044 1045class ArkMesh { 1046 value: Array<any> | undefined; 1047 column: number | undefined; 1048 row: number | undefined; 1049 1050 constructor() { 1051 this.value = undefined; 1052 this.column = undefined; 1053 this.row = undefined; 1054 } 1055 isEqual(another: ArkMesh): boolean { 1056 return ( 1057 deepCompareArrays(this.value, another.value) && 1058 this.column === another.column && 1059 this.row === another.row 1060 ); 1061 } 1062} 1063 1064class ArkLanesOpt { 1065 lanesNum: number | undefined; 1066 minLength: Length | undefined; 1067 maxLength: Length | undefined; 1068 gutter?: undefined; 1069 constructor() { 1070 this.lanesNum = undefined; 1071 this.minLength = undefined; 1072 this.maxLength = undefined; 1073 this.gutter = undefined; 1074 } 1075 1076 isEqual(another: ArkLanesOpt): boolean { 1077 return (this.lanesNum === another.lanesNum && this.minLength === another.minLength 1078 && this.maxLength === another.maxLength && this.gutter === another.gutter); 1079 } 1080} 1081 1082class ArkScrollSnapOptions { 1083 snapAlign: ScrollSnapAlign; 1084 snapPagination: Dimension | Array<Dimension>; 1085 enableSnapToStart: boolean; 1086 enableSnapToEnd: boolean; 1087 constructor() { 1088 this.snapAlign = undefined; 1089 this.snapPagination = undefined; 1090 this.enableSnapToStart = undefined; 1091 this.enableSnapToEnd = undefined; 1092 } 1093 isEqual(another: ArkScrollSnapOptions): boolean { 1094 return ((this.snapAlign === another.snapAlign) 1095 && (this.snapPagination === another.snapPagination) 1096 && (this.enableSnapToStart === another.enableSnapToStart) 1097 && (this.enableSnapToEnd === another.enableSnapToEnd)); 1098 } 1099} 1100