• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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' />
17
18function calArkBorderWidth(value: BorderOptions): ArkBorderWidth {
19  let arkWidth = new ArkBorderWidth();
20  if (!isUndefined(value?.width) && value?.width !== null) {
21    if (isNumber(value.width) || isString(value.width) || isResource(value.width)) {
22      arkWidth.left = value.width;
23      arkWidth.right = value.width;
24      arkWidth.top = value.width;
25      arkWidth.bottom = value.width;
26    } else {
27      arkWidth.left = (value.width as EdgeWidths).left;
28      arkWidth.right = (value.width as EdgeWidths).right;
29      arkWidth.top = (value.width as EdgeWidths).top;
30      arkWidth.bottom = (value.width as EdgeWidths).bottom;
31    }
32  }
33  return arkWidth;
34}
35
36function calArkBorderColor(value: BorderOptions): ArkBorderColor {
37  let arkColor = new ArkBorderColor();
38  if (!isUndefined(value?.color) && value?.color !== null) {
39    if (isNumber(value.color) || isString(value.color) || isResource(value.color)) {
40      arkColor.leftColor = value.color;
41      arkColor.rightColor = value.color;
42      arkColor.topColor = value.color;
43      arkColor.bottomColor = value.color;
44    } else {
45      arkColor.leftColor = (value.color as EdgeColors).left;
46      arkColor.rightColor = (value.color as EdgeColors).right;
47      arkColor.topColor = (value.color as EdgeColors).top;
48      arkColor.bottomColor = (value.color as EdgeColors).bottom;
49    }
50  }
51  return arkColor;
52}
53
54function calArkBorderRadius(value: BorderOptions): ArkBorderRadius {
55  let arkRadius = new ArkBorderRadius();
56  if (!isUndefined(value?.radius) && value?.radius !== null) {
57    if (isNumber(value.radius) || isString(value.radius) || isResource(value.radius)) {
58      arkRadius.topLeft = value.radius;
59      arkRadius.topRight = value.radius;
60      arkRadius.bottomLeft = value.radius;
61      arkRadius.bottomRight = value.radius;
62    } else {
63      arkRadius.topLeft = (value.radius as BorderRadiuses)?.topLeft;
64      arkRadius.topRight = (value.radius as BorderRadiuses)?.topRight;
65      arkRadius.bottomLeft = (value.radius as BorderRadiuses)?.bottomLeft;
66      arkRadius.bottomRight = (value.radius as BorderRadiuses)?.bottomRight;
67    }
68  }
69  return arkRadius;
70}
71
72function calArkBorderStyle(value: BorderOptions): ArkBorderStyle {
73  let arkStyle = new ArkBorderStyle();
74  if (!isUndefined(value?.style) && value?.style !== null) {
75    let arkBorderStyle = new ArkBorderStyle();
76    if (arkBorderStyle.parseBorderStyle(value.style)) {
77      if (!isUndefined(arkBorderStyle.style)) {
78        arkStyle.top = arkBorderStyle.style;
79        arkStyle.left = arkBorderStyle.style;
80        arkStyle.bottom = arkBorderStyle.style;
81        arkStyle.right = arkBorderStyle.style;
82      } else {
83        arkStyle.top = arkBorderStyle.top;
84        arkStyle.left = arkBorderStyle.left;
85        arkStyle.bottom = arkBorderStyle.bottom;
86        arkStyle.right = arkBorderStyle.right;
87      }
88    }
89  }
90  return arkStyle;
91}
92
93function valueToArkBorder(value: BorderOptions): ArkBorder {
94  let borderValue = new ArkBorder();
95  if (isUndefined(value)) {
96    borderValue = undefined;
97  } else {
98    borderValue.arkWidth = calArkBorderWidth(value);
99    borderValue.arkColor = calArkBorderColor(value);
100    borderValue.arkRadius = calArkBorderRadius(value);
101    borderValue.arkStyle = calArkBorderStyle(value);
102  }
103  return borderValue;
104}
105
106class TextAreaFontStyleModifier extends ModifierWithKey<FontStyle> {
107  static identity: Symbol = Symbol('textAreaFontStyle');
108  applyPeer(node: KNode, reset: boolean): void {
109    if (reset) {
110      getUINativeModule().textArea.resetFontStyle(node);
111    } else {
112      getUINativeModule().textArea.setFontStyle(node, this.value!);
113    }
114  }
115  checkObjectDiff(): boolean {
116    return !isBaseOrResourceEqual(this.stageValue, this.value);
117  }
118}
119
120class TextAreaDecorationModifier extends ModifierWithKey<{ type: TextDecorationType; color?: ResourceColor; style?: TextDecorationStyle }> {
121  constructor(value: { type: TextDecorationType; color?: ResourceColor; style?: TextDecorationStyle }) {
122    super(value);
123  }
124  static identity: Symbol = Symbol('textAreaDecoration');
125  applyPeer(node: KNode, reset: boolean): void {
126    if (reset) {
127      getUINativeModule().textArea.resetDecoration(node);
128    } else {
129      getUINativeModule().textArea.setDecoration(node, this.value!.type, this.value!.color, this.value!.style);
130    }
131  }
132
133  checkObjectDiff(): boolean {
134    if (this.stageValue.type !== this.value.type || this.stageValue.style !== this.value.style) {
135      return true;
136    }
137    if (isResource(this.stageValue.color) && isResource(this.value.color)) {
138      return !isResourceEqual(this.stageValue.color, this.value.color);
139    } else if (!isResource(this.stageValue.color) && !isResource(this.value.color)) {
140      return !(this.stageValue.color === this.value.color);
141    } else {
142      return true;
143    }
144  }
145}
146
147class TextAreaLetterSpacingModifier extends ModifierWithKey<number | string> {
148  constructor(value: number | string) {
149    super(value);
150  }
151  static identity: Symbol = Symbol('textAreaLetterSpacing');
152  applyPeer(node: KNode, reset: boolean): void {
153    if (reset) {
154      getUINativeModule().textArea.resetLetterSpacing(node);
155    } else {
156      getUINativeModule().textArea.setLetterSpacing(node, this.value);
157    }
158  }
159
160  checkObjectDiff(): boolean {
161    return !isBaseOrResourceEqual(this.stageValue, this.value);
162  }
163}
164
165class TextAreaLineSpacingModifier extends ModifierWithKey<LengthMetrics> {
166  constructor(value: LengthMetrics) {
167    super(value);
168  }
169  static identity: Symbol = Symbol('textAreaLineSpacing');
170  applyPeer(node: KNode, reset: boolean): void {
171    if (reset) {
172      getUINativeModule().textArea.resetLineSpacing(node);
173    } else if (!isObject(this.value)) {
174      getUINativeModule().textArea.resetLineSpacing(node);
175    } else {
176      getUINativeModule().textArea.setLineSpacing(node, this.value.value, this.value.unit);
177    }
178  }
179
180  checkObjectDiff(): boolean {
181    return !isBaseOrResourceEqual(this.stageValue, this.value);
182  }
183}
184
185class TextAreaLineHeightModifier extends ModifierWithKey<number | string | Resource> {
186  constructor(value: number | string | Resource) {
187    super(value);
188  }
189  static identity: Symbol = Symbol('textAreaLineHeight');
190  applyPeer(node: KNode, reset: boolean): void {
191    if (reset) {
192      getUINativeModule().textArea.resetLineHeight(node);
193    } else {
194      getUINativeModule().textArea.setLineHeight(node, this.value);
195    }
196  }
197
198  checkObjectDiff(): boolean {
199    return !isBaseOrResourceEqual(this.stageValue, this.value);
200  }
201}
202
203class TextAreaWordBreakModifier extends ModifierWithKey<WordBreak> {
204  constructor(value: WordBreak) {
205    super(value);
206  }
207  static identity: Symbol = Symbol('textAreaWordBreak');
208  applyPeer(node: KNode, reset: boolean): void {
209    if (reset) {
210      getUINativeModule().textArea.resetWordBreak(node);
211    } else {
212      getUINativeModule().textArea.setWordBreak(node, this.value!);
213    }
214  }
215  checkObjectDiff(): boolean {
216    return !isBaseOrResourceEqual(this.stageValue, this.value);
217  }
218}
219
220class TextAreaLineBreakStrategyModifier extends ModifierWithKey<LineBreakStrategy> {
221  constructor(value: LineBreakStrategy) {
222    super(value);
223  }
224  static identity: Symbol = Symbol('textAreaLineBreakStrategy');
225  applyPeer(node: KNode, reset: boolean): void {
226    if (reset) {
227      getUINativeModule().textArea.resetLineBreakStrategy(node);
228    } else {
229      getUINativeModule().textArea.setLineBreakStrategy(node, this.value!);
230    }
231  }
232  checkObjectDiff(): boolean {
233    return !isBaseOrResourceEqual(this.stageValue, this.value);
234  }
235}
236
237class TextAreaCopyOptionModifier extends ModifierWithKey<CopyOptions> {
238  static identity: Symbol = Symbol('textAreaCopyOption');
239  applyPeer(node: KNode, reset: boolean): void {
240    if (reset) {
241      getUINativeModule().textArea.resetCopyOption(node);
242    } else {
243      getUINativeModule().textArea.setCopyOption(node, this.value!);
244    }
245  }
246  checkObjectDiff(): boolean {
247    return !isBaseOrResourceEqual(this.stageValue, this.value);
248  }
249}
250
251class TextAreaMaxLinesModifier extends ModifierWithKey<number | undefined> {
252  static identity: Symbol = Symbol('textAreaMaxLines');
253  applyPeer(node: KNode, reset: boolean): void {
254    if (reset) {
255      getUINativeModule().textArea.resetMaxLines(node);
256    } else {
257      getUINativeModule().textArea.setMaxLines(node, this.value!);
258    }
259  }
260  checkObjectDiff(): boolean {
261    return !isBaseOrResourceEqual(this.stageValue, this.value);
262  }
263}
264
265class TextAreaMinFontSizeModifier extends ModifierWithKey<number | string | Resource> {
266  constructor(value: number | string | Resource) {
267    super(value);
268  }
269  static identity: Symbol = Symbol('textAreaMinFontSize');
270  applyPeer(node: KNode, reset: boolean): void {
271    if (reset) {
272      getUINativeModule().textArea.resetMinFontSize(node);
273    } else {
274      getUINativeModule().textArea.setMinFontSize(node, this.value!);
275    }
276  }
277  checkObjectDiff(): boolean {
278    return !isBaseOrResourceEqual(this.stageValue, this.value);
279  }
280}
281
282class TextAreaMaxFontSizeModifier extends ModifierWithKey<number | string | Resource> {
283  constructor(value: number | string | Resource) {
284    super(value);
285  }
286  static identity: Symbol = Symbol('textAreaMaxFontSize');
287  applyPeer(node: KNode, reset: boolean): void {
288    if (reset) {
289      getUINativeModule().textArea.resetMaxFontSize(node);
290    } else {
291      getUINativeModule().textArea.setMaxFontSize(node, this.value!);
292    }
293  }
294  checkObjectDiff(): boolean {
295    return !isBaseOrResourceEqual(this.stageValue, this.value);
296  }
297}
298
299class TextAreaHeightAdaptivePolicyModifier extends ModifierWithKey<TextHeightAdaptivePolicy> {
300  constructor(value: TextHeightAdaptivePolicy) {
301    super(value);
302  }
303  static identity: Symbol = Symbol('textAreaHeightAdaptivePolicy');
304  applyPeer(node: KNode, reset: boolean): void {
305    if (reset) {
306      getUINativeModule().textArea.resetHeightAdaptivePolicy(node);
307    } else {
308      getUINativeModule().textArea.setHeightAdaptivePolicy(node, this.value!);
309    }
310  }
311  checkObjectDiff(): boolean {
312    return !isBaseOrResourceEqual(this.stageValue, this.value);
313  }
314}
315
316class TextAreaFontSizeModifier extends ModifierWithKey<string | number> {
317  static identity: Symbol = Symbol('textAreaFontSize');
318  applyPeer(node: KNode, reset: boolean): void {
319    if (reset) {
320      getUINativeModule().textArea.resetFontSize(node);
321    } else {
322      getUINativeModule().textArea.setFontSize(node, this.value!);
323    }
324  }
325  checkObjectDiff(): boolean {
326    return !isBaseOrResourceEqual(this.stageValue, this.value);
327  }
328}
329
330class TextAreaPlaceholderColorModifier extends ModifierWithKey<ResourceColor> {
331  static identity: Symbol = Symbol('textAreaPlaceholderColor');
332  applyPeer(node: KNode, reset: boolean): void {
333    if (reset) {
334      getUINativeModule().textArea.resetPlaceholderColor(node);
335    } else {
336      getUINativeModule().textArea.setPlaceholderColor(node, this.value!);
337    }
338  }
339  checkObjectDiff(): boolean {
340    return !isBaseOrResourceEqual(this.stageValue, this.value);
341  }
342}
343
344class TextAreaFontColorModifier extends ModifierWithKey<ResourceColor> {
345  static identity: Symbol = Symbol('textAreaFontColor');
346  applyPeer(node: KNode, reset: boolean): void {
347    if (reset) {
348      getUINativeModule().textArea.resetFontColor(node);
349    } else {
350      getUINativeModule().textArea.setFontColor(node, this.value!);
351    }
352  }
353  checkObjectDiff(): boolean {
354    return !isBaseOrResourceEqual(this.stageValue, this.value);
355  }
356}
357
358class TextAreaFontWeightModifier extends ModifierWithKey<number | FontWeight | string> {
359  static identity: Symbol = Symbol('textAreaFontWeight');
360  applyPeer(node: KNode, reset: boolean): void {
361    if (reset) {
362      getUINativeModule().textArea.resetFontWeight(node);
363    } else {
364      getUINativeModule().textArea.setFontWeight(node, this.value!);
365    }
366  }
367  checkObjectDiff(): boolean {
368    return !isBaseOrResourceEqual(this.stageValue, this.value);
369  }
370}
371
372class TextAreaBarStateModifier extends ModifierWithKey<BarState> {
373  static identity: Symbol = Symbol('textAreaBarState');
374  applyPeer(node: KNode, reset: boolean): void {
375    if (reset) {
376      getUINativeModule().textArea.resetBarState(node);
377    } else {
378      getUINativeModule().textArea.setBarState(node, this.value!);
379    }
380  }
381  checkObjectDiff(): boolean {
382    return !isBaseOrResourceEqual(this.stageValue, this.value);
383  }
384}
385
386class TextAreaEnableKeyboardOnFocusModifier extends ModifierWithKey<boolean> {
387  static identity: Symbol = Symbol('textAreaEnableKeyboardOnFocus');
388  applyPeer(node: KNode, reset: boolean): void {
389    if (reset) {
390      getUINativeModule().textArea.resetEnableKeyboardOnFocus(node);
391    } else {
392      getUINativeModule().textArea.setEnableKeyboardOnFocus(node, this.value!);
393    }
394  }
395  checkObjectDiff(): boolean {
396    return !isBaseOrResourceEqual(this.stageValue, this.value);
397  }
398}
399
400class TextAreaFontFamilyModifier extends ModifierWithKey<ResourceColor | string> {
401  static identity: Symbol = Symbol('textAreaFontFamily');
402  applyPeer(node: KNode, reset: boolean): void {
403    if (reset) {
404      getUINativeModule().textArea.resetFontFamily(node);
405    } else {
406      getUINativeModule().textArea.setFontFamily(node, this.value!);
407    }
408  }
409
410  checkObjectDiff(): boolean {
411    return !isBaseOrResourceEqual(this.stageValue, this.value);
412  }
413}
414
415class TextAreaCaretColorModifier extends ModifierWithKey<ResourceColor> {
416  static identity: Symbol = Symbol('textAreaCaretColor');
417  applyPeer(node: KNode, reset: boolean): void {
418    if (reset) {
419      getUINativeModule().textArea.resetCaretColor(node);
420    } else {
421      getUINativeModule().textArea.setCaretColor(node, this.value!);
422    }
423  }
424  checkObjectDiff(): boolean {
425    return !isBaseOrResourceEqual(this.stageValue, this.value);
426  }
427}
428
429class TextAreaMaxLengthModifier extends ModifierWithKey<number> {
430  static identity: Symbol = Symbol('textAreaMaxLength');
431  applyPeer(node: KNode, reset: boolean): void {
432    if (reset) {
433      getUINativeModule().textArea.resetMaxLength(node);
434    } else {
435      getUINativeModule().textArea.setMaxLength(node, this.value!);
436    }
437  }
438  checkObjectDiff(): boolean {
439    return !isBaseOrResourceEqual(this.stageValue, this.value);
440  }
441}
442
443class TextAreaStyleModifier extends ModifierWithKey<TextContentStyle> {
444  static identity: Symbol = Symbol('textAreaStyle');
445  applyPeer(node: KNode, reset: boolean): void {
446    if (reset) {
447      getUINativeModule().textArea.resetStyle(node);
448    } else {
449      getUINativeModule().textArea.setStyle(node, this.value!);
450    }
451  }
452  checkObjectDiff(): boolean {
453    return !isBaseOrResourceEqual(this.stageValue, this.value);
454  }
455}
456
457class TextAreaSelectionMenuHiddenModifier extends ModifierWithKey<boolean> {
458  static identity: Symbol = Symbol('textAreaSelectionMenuHidden');
459  applyPeer(node: KNode, reset: boolean): void {
460    if (reset) {
461      getUINativeModule().textArea.resetSelectionMenuHidden(node);
462    } else {
463      getUINativeModule().textArea.setSelectionMenuHidden(node, this.value!);
464    }
465  }
466  checkObjectDiff(): boolean {
467    return !isBaseOrResourceEqual(this.stageValue, this.value);
468  }
469}
470
471class TextAreaPlaceholderFontModifier extends ModifierWithKey<Font> {
472  static identity: Symbol = Symbol('textAreaPlaceholderFont');
473  applyPeer(node: KNode, reset: boolean): void {
474    if (reset) {
475      getUINativeModule().textArea.resetPlaceholderFont(node);
476    } else {
477      getUINativeModule().textArea.setPlaceholderFont(node, this.value.size,
478        this.value.weight, this.value.family, this.value.style);
479    }
480  }
481
482  checkObjectDiff(): boolean {
483    if (!(this.stageValue.weight === this.value.weight &&
484      this.stageValue.style === this.value.style)) {
485      return true;
486    } else {
487      return !isBaseOrResourceEqual(this.stageValue.size, this.value.size) ||
488        !isBaseOrResourceEqual(this.stageValue.family, this.value.family);
489    }
490  }
491}
492
493class TextAreaTextAlignModifier extends ModifierWithKey<TextAlign> {
494  constructor(value: TextAlign) {
495    super(value);
496  }
497  static identity: Symbol = Symbol('textAreaTextAlign');
498  applyPeer(node: KNode, reset: boolean): void {
499    if (reset) {
500      getUINativeModule().textArea.resetTextAlign(node);
501    } else {
502      getUINativeModule().textArea.setTextAlign(node, this.value!);
503    }
504  }
505  checkObjectDiff(): boolean {
506    return !isBaseOrResourceEqual(this.stageValue, this.value);
507  }
508}
509
510class TextAreaShowCounterModifier extends ModifierWithKey<ArkTextFieldShowCounter> {
511  constructor(value: ArkTextFieldShowCounter) {
512    super(value);
513  }
514  static identity: Symbol = Symbol('textAreaShowCounter');
515  applyPeer(node: KNode, reset: boolean): void {
516    if (reset) {
517      getUINativeModule().textArea.resetShowCounter(node);
518    } else {
519      getUINativeModule().textArea.setShowCounter(node, this.value.value!, this.value.highlightBorder, this.value.thresholdPercentage);
520    }
521  }
522  checkObjectDiff(): boolean {
523    return !isBaseOrResourceEqual(this.stageValue.value, this.value.value) ||
524      !isBaseOrResourceEqual(this.stageValue.highlightBorder, this.value.highlightBorder) ||
525      !isBaseOrResourceEqual(this.stageValue.thresholdPercentage, this.value.thresholdPercentage);
526  }
527}
528
529class TextAreaFontFeatureModifier extends ModifierWithKey<FontFeature> {
530  constructor(value: FontFeature) {
531    super(value);
532  }
533  static identity: Symbol = Symbol('textAreaFontFeature');
534  applyPeer(node: KNode, reset: boolean): void {
535    if (reset) {
536      getUINativeModule().textArea.resetFontFeature(node);
537    } else {
538      getUINativeModule().textArea.setFontFeature(node, this.value!);
539    }
540  }
541  checkObjectDiff(): boolean {
542    return !isBaseOrResourceEqual(this.stageValue, this.value);
543  }
544}
545
546class TextAreaSelectedBackgroundColorModifier extends ModifierWithKey<ResourceColor> {
547  constructor(value: ResourceColor) {
548    super(value);
549  }
550  static identity: Symbol = Symbol('textAreaSelectedBackgroundColor');
551  applyPeer(node: KNode, reset: boolean): void {
552    if (reset) {
553      getUINativeModule().textArea.resetSelectedBackgroundColor(node);
554    } else {
555      getUINativeModule().textArea.setSelectedBackgroundColor(node, this.value!);
556    }
557  }
558  checkObjectDiff(): boolean {
559    return !isBaseOrResourceEqual(this.stageValue, this.value);
560  }
561}
562
563class TextAreaCaretStyleModifier extends ModifierWithKey<CaretStyle> {
564  constructor(value: CaretStyle) {
565    super(value);
566  }
567  static identity: Symbol = Symbol('textAreaCaretStyle');
568  applyPeer(node: KNode, reset: boolean): void {
569    if (reset) {
570      getUINativeModule().textArea.resetCaretStyle(node);
571    } else {
572      getUINativeModule().textArea.setCaretStyle(node, this.value.width!,
573        this.value.color);
574    }
575  }
576  checkObjectDiff(): boolean {
577    return this.stageValue !== this.value;
578  }
579}
580
581class TextAreaTextOverflowModifier extends ModifierWithKey<TextOverflow> {
582  constructor(value: TextOverflow) {
583    super(value);
584  }
585  static identity: Symbol = Symbol('textAreaTextOverflow');
586  applyPeer(node: KNode, reset: boolean): void {
587    if (reset) {
588      getUINativeModule().textArea.resetTextOverflow(node);
589    } else {
590      getUINativeModule().textArea.setTextOverflow(node, this.value!);
591    }
592  }
593  checkObjectDiff(): boolean {
594    return this.stageValue !== this.value;
595  }
596}
597
598class TextAreaTextIndentModifier extends ModifierWithKey<Dimension> {
599  constructor(value: Dimension) {
600    super(value);
601  }
602  static identity: Symbol = Symbol('textAreaTextIndent');
603  applyPeer(node: KNode, reset: boolean): void {
604    if (reset) {
605      getUINativeModule().textArea.resetTextIndent(node);
606    } else {
607      getUINativeModule().textArea.setTextIndent(node, this.value!);
608    }
609  }
610  checkObjectDiff(): boolean {
611    return !isBaseOrResourceEqual(this.stageValue, this.value);
612  }
613}
614
615class TextAreaOnChangeModifier extends ModifierWithKey<(value: ChangeValueInfo) => void> {
616  constructor(value: (value: ChangeValueInfo) => void) {
617    super(value);
618  }
619  static identity = Symbol('textAreaOnChange');
620  applyPeer(node: KNode, reset: boolean): void {
621    if (reset) {
622      getUINativeModule().textArea.resetOnChange(node);
623    } else {
624      getUINativeModule().textArea.setOnChange(node, this.value);
625    }
626  }
627}
628
629class TextAreaEnterKeyTypeModifier extends ModifierWithKey<number> {
630  constructor(value: number) {
631    super(value);
632  }
633  static identity: Symbol = Symbol('textAreaEnterKeyType');
634  applyPeer(node: KNode, reset: boolean): void {
635    if (reset) {
636      getUINativeModule().textArea.resetEnterKeyType(node);
637    } else {
638      getUINativeModule().textArea.setEnterKeyType(node, this.value);
639    }
640  }
641  checkObjectDiff(): boolean {
642    return !isBaseOrResourceEqual(this.stageValue, this.value);
643  }
644}
645
646class TextAreaInputFilterModifier extends ModifierWithKey<ArkTextInputFilter> {
647  constructor(value: ArkTextInputFilter) {
648    super(value);
649  }
650  static identity = Symbol('textAreaInputFilter');
651  applyPeer(node: KNode, reset: boolean): void {
652    if (reset) {
653      getUINativeModule().textArea.resetInputFilter(node);
654    }
655    else {
656      getUINativeModule().textArea.setInputFilter(node, this.value.value, this.value.error);
657    }
658  }
659  checkObjectDiff(): boolean {
660    return !isBaseOrResourceEqual(this.stageValue.value, this.value.value) ||
661      !isBaseOrResourceEqual(this.stageValue.error, this.value.error);
662  }
663}
664
665class TextAreaOnTextSelectionChangeModifier extends ModifierWithKey<(selectionStart: number, selectionEnd: number) => void> {
666  constructor(value: (selectionStart: number, selectionEnd: number) => void) {
667    super(value);
668  }
669  static identity = Symbol('textAreaOnTextSelectionChange');
670  applyPeer(node: KNode, reset: boolean): void {
671    if (reset) {
672      getUINativeModule().textArea.resetOnTextSelectionChange(node);
673    } else {
674      getUINativeModule().textArea.setOnTextSelectionChange(node, this.value);
675    }
676  }
677}
678
679class TextAreaOnContentScrollModifier extends ModifierWithKey<(totalOffsetX: number, totalOffsetY: number) => void> {
680  constructor(value: (totalOffsetX: number, totalOffsetY: number) => void) {
681    super(value);
682  }
683  static identity = Symbol('textAreaOnContentScroll');
684  applyPeer(node: KNode, reset: boolean): void {
685    if (reset) {
686      getUINativeModule().textArea.resetOnContentScroll(node);
687    } else {
688      getUINativeModule().textArea.setOnContentScroll(node, this.value);
689    }
690  }
691}
692
693class TextAreaOnEditChangeModifier extends ModifierWithKey<(isEditing: boolean) => void> {
694  constructor(value: (isEditing: boolean) => void) {
695    super(value);
696  }
697  static identity = Symbol('textAreaOnEditChange');
698  applyPeer(node: KNode, reset: boolean): void {
699    if (reset) {
700      getUINativeModule().textArea.resetOnEditChange(node);
701    } else {
702      getUINativeModule().textArea.setOnEditChange(node, this.value);
703    }
704  }
705}
706
707class TextAreaOnCopyModifier extends ModifierWithKey<(value: string) => void> {
708  constructor(value: (value: string) => void) {
709    super(value);
710  }
711  static identity = Symbol('textAreaOnCopy');
712  applyPeer(node: KNode, reset: boolean): void {
713    if (reset) {
714      getUINativeModule().textArea.resetOnCopy(node);
715    } else {
716      getUINativeModule().textArea.setOnCopy(node, this.value);
717    }
718  }
719}
720
721class TextAreaOnCutModifier extends ModifierWithKey<(value: string) => void> {
722  constructor(value: (value: string) => void) {
723    super(value);
724  }
725  static identity = Symbol('textAreaOnCut');
726  applyPeer(node: KNode, reset: boolean): void {
727    if (reset) {
728      getUINativeModule().textArea.resetOnCut(node);
729    } else {
730      getUINativeModule().textArea.setOnCut(node, this.value);
731    }
732  }
733}
734
735class TextAreaOnPasteModifier extends ModifierWithKey<(value: string, event: PasteEvent) => void> {
736  constructor(value: (value: string, event: PasteEvent) => void) {
737    super(value);
738  }
739  static identity = Symbol('textAreaOnPaste');
740  applyPeer(node: KNode, reset: boolean): void {
741    if (reset) {
742      getUINativeModule().textArea.resetOnPaste(node);
743    } else {
744      getUINativeModule().textArea.setOnPaste(node, this.value);
745    }
746  }
747}
748
749class TextAreaTypeModifier extends ModifierWithKey<TextAreaType> {
750  constructor(value: TextAreaType) {
751    super(value);
752  }
753  static identity: Symbol = Symbol('textAreaType');
754  applyPeer(node: KNode, reset: boolean): void {
755    if (reset) {
756      getUINativeModule().textArea.resetType(node);
757    }
758    else {
759      getUINativeModule().textArea.setType(node, this.value);
760    }
761  }
762  checkObjectDiff(): boolean {
763    return !isBaseOrResourceEqual(this.stageValue, this.value);
764  }
765}
766
767class TextAreaPaddingModifier extends ModifierWithKey<ArkPadding> {
768  constructor(value: ArkPadding) {
769    super(value);
770  }
771  static identity: Symbol = Symbol('textAreaPadding');
772  applyPeer(node: KNode, reset: boolean): void {
773    if (reset) {
774      getUINativeModule().textArea.resetPadding(node);
775    }
776    else {
777      getUINativeModule().textArea.setPadding(node, this.value.top, this.value.right, this.value.bottom, this.value.left);
778    }
779  }
780  checkObjectDiff(): boolean {
781    return !isBaseOrResourceEqual(this.stageValue.top, this.value.top) ||
782      !isBaseOrResourceEqual(this.stageValue.right, this.value.right) ||
783      !isBaseOrResourceEqual(this.stageValue.bottom, this.value.bottom) ||
784      !isBaseOrResourceEqual(this.stageValue.left, this.value.left);
785  }
786}
787
788class TextAreaOnSubmitModifier extends ModifierWithKey<(enterKey: EnterKeyType, event: SubmitEvent) => void> {
789  constructor(value: (enterKey: EnterKeyType, event: SubmitEvent) => void) {
790    super(value);
791  }
792  static identity = Symbol('textAreaOnSubmit');
793  applyPeer(node: KNode, reset: boolean): void {
794    if (reset) {
795      getUINativeModule().textArea.resetOnSubmit(node);
796    } else {
797      getUINativeModule().textArea.setOnSubmit(node, this.value);
798    }
799  }
800}
801
802class TextAreaContentTypeModifier extends ModifierWithKey<ContentType> {
803  constructor(value: ContentType) {
804    super(value);
805  }
806  static identity: Symbol = Symbol('textAreaContentType');
807  applyPeer(node: KNode, reset: boolean): void {
808    if (reset) {
809      getUINativeModule().textArea.resetContentType(node);
810    }
811    else {
812      getUINativeModule().textArea.setContentType(node, this.value);
813    }
814  }
815  checkObjectDiff(): boolean {
816    return !isBaseOrResourceEqual(this.stageValue, this.value);
817  }
818}
819
820class TextAreaEnableAutoFillModifier extends ModifierWithKey<boolean> {
821  constructor(value: boolean) {
822    super(value);
823  }
824  static identity: Symbol = Symbol('textAreaEnableAutoFill');
825  applyPeer(node: KNode, reset: boolean): void {
826    if (reset) {
827      getUINativeModule().textArea.resetEnableAutoFill(node);
828    } else {
829      getUINativeModule().textArea.setEnableAutoFill(node, this.value!);
830    }
831  }
832  checkObjectDiff(): boolean {
833    return !isBaseOrResourceEqual(this.stageValue, this.value);
834  }
835}
836
837class TextAreaBorderModifier extends ModifierWithKey<ArkBorder> {
838  constructor(value: ArkBorder) {
839    super(value);
840  }
841  static identity: Symbol = Symbol('textAreaBorder');
842  applyPeer(node: KNode, reset: boolean): void {
843    if (reset) {
844      getUINativeModule().textArea.resetBorder(node);
845    } else {
846      getUINativeModule().textArea.setBorder(node,
847        this.value.arkWidth.left, this.value.arkWidth.right, this.value.arkWidth.top, this.value.arkWidth.bottom,
848        this.value.arkColor.leftColor, this.value.arkColor.rightColor, this.value.arkColor.topColor, this.value.arkColor.bottomColor,
849        this.value.arkRadius.topLeft, this.value.arkRadius.topRight, this.value.arkRadius.bottomLeft, this.value.arkRadius.bottomRight,
850        this.value.arkStyle.top, this.value.arkStyle.right, this.value.arkStyle.bottom, this.value.arkStyle.left);
851    }
852  }
853  checkObjectDiff(): boolean {
854    return this.value.checkObjectDiff(this.stageValue);
855  }
856}
857
858class TextAreaBorderWidthModifier extends ModifierWithKey<Length | EdgeWidths> {
859  constructor(value: Length | EdgeWidths) {
860    super(value);
861  }
862  static identity: Symbol = Symbol('textAreaBorderWidth');
863  applyPeer(node: KNode, reset: boolean): void {
864    if (reset) {
865      getUINativeModule().textArea.resetBorderWidth(node);
866    } else {
867      if (isNumber(this.value) || isString(this.value) || isResource(this.value)) {
868        getUINativeModule().textArea.setBorderWidth(node, this.value, this.value, this.value, this.value);
869      } else {
870        getUINativeModule().textArea.setBorderWidth(node,
871          (this.value as EdgeWidths).top,
872          (this.value as EdgeWidths).right,
873          (this.value as EdgeWidths).bottom,
874          (this.value as EdgeWidths).left);
875      }
876    }
877  }
878  checkObjectDiff(): boolean {
879    if (isResource(this.stageValue) && isResource(this.value)) {
880      return !isResourceEqual(this.stageValue, this.value);
881    } else if (!isResource(this.stageValue) && !isResource(this.value)) {
882      return !((this.stageValue as EdgeWidths).left === (this.value as EdgeWidths).left &&
883        (this.stageValue as EdgeWidths).right === (this.value as EdgeWidths).right &&
884        (this.stageValue as EdgeWidths).top === (this.value as EdgeWidths).top &&
885        (this.stageValue as EdgeWidths).bottom === (this.value as EdgeWidths).bottom);
886    } else {
887      return true;
888    }
889  }
890}
891
892class TextAreaBorderColorModifier extends ModifierWithKey<ResourceColor | EdgeColors> {
893  constructor(value: ResourceColor | EdgeColors) {
894    super(value);
895  }
896  static identity: Symbol = Symbol('textAreaBorderColor');
897  applyPeer(node: KNode, reset: boolean): void {
898    if (reset) {
899      getUINativeModule().textArea.resetBorderColor(node);
900    } else {
901      const valueType: string = typeof this.value;
902      if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
903        getUINativeModule().textArea.setBorderColor(node, this.value, this.value, this.value, this.value);
904      } else {
905        getUINativeModule().textArea.setBorderColor(node, (this.value as EdgeColors).top,
906          (this.value as EdgeColors).right, (this.value as EdgeColors).bottom,
907          (this.value as EdgeColors).left);
908      }
909    }
910  }
911  checkObjectDiff(): boolean {
912    if (isResource(this.stageValue) && isResource(this.value)) {
913      return !isResourceEqual(this.stageValue, this.value);
914    } else if (!isResource(this.stageValue) && !isResource(this.value)) {
915      return !((this.stageValue as EdgeColors).left === (this.value as EdgeColors).left &&
916        (this.stageValue as EdgeColors).right === (this.value as EdgeColors).right &&
917        (this.stageValue as EdgeColors).top === (this.value as EdgeColors).top &&
918        (this.stageValue as EdgeColors).bottom === (this.value as EdgeColors).bottom);
919    } else {
920      return true;
921    }
922  }
923}
924
925class TextAreaBorderStyleModifier extends ModifierWithKey<BorderStyle | EdgeStyles> {
926  constructor(value: BorderStyle | EdgeStyles) {
927    super(value);
928  }
929  static identity: Symbol = Symbol('textAreaBorderStyle');
930  applyPeer(node: KNode, reset: boolean): void {
931    if (reset) {
932      getUINativeModule().textArea.resetBorderStyle(node);
933    } else {
934      let type: boolean;
935      let style: BorderStyle;
936      let top: BorderStyle;
937      let right: BorderStyle;
938      let bottom: BorderStyle;
939      let left: BorderStyle;
940      if (isNumber(this.value)) {
941        style = this.value as BorderStyle;
942        type = true;
943      } else if (isObject(this.value)) {
944        top = (this.value as EdgeStyles)?.top;
945        right = (this.value as EdgeStyles)?.right;
946        bottom = (this.value as EdgeStyles)?.bottom;
947        left = (this.value as EdgeStyles)?.left;
948        type = true;
949      }
950      if (type === true) {
951        getUINativeModule().textArea.setBorderStyle(node, type, style, top, right, bottom, left);
952      } else {
953        getUINativeModule().textArea.resetBorderStyle(node);
954      }
955    }
956  }
957  checkObjectDiff(): boolean {
958    return !((this.value as EdgeStyles)?.top === (this.stageValue as EdgeStyles)?.top &&
959      (this.value as EdgeStyles)?.right === (this.stageValue as EdgeStyles)?.right &&
960      (this.value as EdgeStyles)?.bottom === (this.stageValue as EdgeStyles)?.bottom &&
961      (this.value as EdgeStyles)?.left === (this.stageValue as EdgeStyles)?.left);
962  }
963}
964
965class TextAreaBorderRadiusModifier extends ModifierWithKey<Length | BorderRadiuses> {
966  constructor(value: Length | BorderRadiuses) {
967    super(value);
968  }
969  static identity: Symbol = Symbol('textAreaBorderRadius');
970  applyPeer(node: KNode, reset: boolean): void {
971    if (reset) {
972      getUINativeModule().textArea.resetBorderRadius(node);
973    } else {
974      if (isNumber(this.value) || isString(this.value) || isResource(this.value)) {
975        getUINativeModule().textArea.setBorderRadius(node, this.value, this.value, this.value, this.value);
976      } else {
977        getUINativeModule().textArea.setBorderRadius(node,
978          (this.value as BorderRadiuses).topLeft,
979          (this.value as BorderRadiuses).topRight,
980          (this.value as BorderRadiuses).bottomLeft,
981          (this.value as BorderRadiuses).bottomRight);
982      }
983    }
984  }
985  checkObjectDiff(): boolean {
986    if (isResource(this.stageValue) && isResource(this.value)) {
987      return !isResourceEqual(this.stageValue, this.value);
988    } else if (!isResource(this.stageValue) && !isResource(this.value)) {
989      return !((this.stageValue as BorderRadiuses).topLeft === (this.value as BorderRadiuses).topLeft &&
990        (this.stageValue as BorderRadiuses).topRight === (this.value as BorderRadiuses).topRight &&
991        (this.stageValue as BorderRadiuses).bottomLeft === (this.value as BorderRadiuses).bottomLeft &&
992        (this.stageValue as BorderRadiuses).bottomRight === (this.value as BorderRadiuses).bottomRight);
993    } else {
994      return true;
995    }
996  }
997}
998
999class TextAreaBackgroundColorModifier extends ModifierWithKey<ResourceColor> {
1000  constructor(value: ResourceColor) {
1001    super(value);
1002  }
1003  static identity: Symbol = Symbol('textAreaBackgroundColor');
1004  applyPeer(node: KNode, reset: boolean): void {
1005    if (reset) {
1006      getUINativeModule().textArea.resetBackgroundColor(node);
1007    } else {
1008      getUINativeModule().textArea.setBackgroundColor(node, this.value);
1009    }
1010  }
1011
1012  checkObjectDiff(): boolean {
1013    return !isBaseOrResourceEqual(this.stageValue, this.value);
1014  }
1015}
1016
1017class TextAreaMarginModifier extends ModifierWithKey<ArkPadding> {
1018  constructor(value: ArkPadding) {
1019    super(value);
1020  }
1021  static identity: Symbol = Symbol('textAreaMargin');
1022  applyPeer(node: KNode, reset: boolean): void {
1023    if (reset) {
1024      getUINativeModule().textArea.resetMargin(node);
1025    } else {
1026      getUINativeModule().textArea.setMargin(node, this.value.top,
1027        this.value.right, this.value.bottom, this.value.left);
1028    }
1029  }
1030
1031  checkObjectDiff(): boolean {
1032    return !isBaseOrResourceEqual(this.stageValue.top, this.value.top) ||
1033      !isBaseOrResourceEqual(this.stageValue.right, this.value.right) ||
1034      !isBaseOrResourceEqual(this.stageValue.bottom, this.value.bottom) ||
1035      !isBaseOrResourceEqual(this.stageValue.left, this.value.left);
1036  }
1037}
1038
1039class TextAreaOnWillChangeModifier extends ModifierWithKey<Callback<ChangeValueInfo, boolean>> {
1040  constructor(value: Callback<ChangeValueInfo, boolean>) {
1041    super(value);
1042  }
1043  static identity = Symbol('textAreaOnWillChange');
1044  applyPeer(node: KNode, reset: boolean): void {
1045    if (reset) {
1046      getUINativeModule().textArea.resetOnWillChange(node);
1047    } else {
1048      getUINativeModule().textArea.setOnWillChange(node, this.value);
1049    }
1050  }
1051}
1052
1053class TextAreaOnWillInsertModifier extends ModifierWithKey<Callback<InsertValue, boolean>> {
1054  constructor(value: Callback<InsertValue, boolean>) {
1055    super(value);
1056  }
1057  static identity = Symbol('textAreaOnWillInsert');
1058  applyPeer(node: KNode, reset: boolean): void {
1059    if (reset) {
1060      getUINativeModule().textArea.resetOnWillInsert(node);
1061    } else {
1062      getUINativeModule().textArea.setOnWillInsert(node, this.value);
1063    }
1064  }
1065}
1066
1067class TextAreaOnDidInsertModifier extends ModifierWithKey<Callback<InsertValue>> {
1068  constructor(value: Callback<InsertValue>) {
1069    super(value);
1070  }
1071  static identity = Symbol('textAreaOnDidInsert');
1072  applyPeer(node: KNode, reset: boolean): void {
1073    if (reset) {
1074      getUINativeModule().textArea.resetOnDidInsert(node);
1075    } else {
1076      getUINativeModule().textArea.setOnDidInsert(node, this.value);
1077    }
1078  }
1079}
1080
1081class TextAreaOnWillDeleteModifier extends ModifierWithKey<Callback<DeleteValue, boolean>> {
1082  constructor(value: Callback<DeleteValue, boolean>) {
1083    super(value);
1084  }
1085  static identity = Symbol('textAreaOnWillDelete');
1086  applyPeer(node: KNode, reset: boolean): void {
1087    if (reset) {
1088      getUINativeModule().textArea.resetOnWillDelete(node);
1089    } else {
1090      getUINativeModule().textArea.setOnWillDelete(node, this.value);
1091    }
1092  }
1093}
1094
1095class TextAreaOnDidDeleteModifier extends ModifierWithKey<Callback<DeleteValue>> {
1096  constructor(value: Callback<DeleteValue>) {
1097    super(value);
1098  }
1099  static identity = Symbol('textAreaOnDidDelete');
1100  applyPeer(node: KNode, reset: boolean): void {
1101    if (reset) {
1102      getUINativeModule().textArea.resetOnDidDelete(node);
1103    } else {
1104      getUINativeModule().textArea.setOnDidDelete(node, this.value);
1105    }
1106  }
1107}
1108
1109class TextAreaEnablePreviewTextModifier extends ModifierWithKey<boolean> {
1110  constructor(value: boolean) {
1111    super(value);
1112  }
1113  static identity: Symbol = Symbol('textAreaEnablePreviewText');
1114  applyPeer(node: KNode, reset: boolean): void {
1115    if (reset) {
1116      getUINativeModule().textArea.resetEnablePreviewText(node);
1117    } else {
1118      getUINativeModule().textArea.setEnablePreviewText(node, this.value!);
1119    }
1120  }
1121  checkObjectDiff(): boolean {
1122    return !isBaseOrResourceEqual(this.stageValue, this.value);
1123  }
1124}
1125
1126class TextAreaEditMenuOptionsModifier extends ModifierWithKey<EditMenuOptions> {
1127  constructor(value: EditMenuOptions) {
1128    super(value);
1129  }
1130  static identity: Symbol = Symbol('textEditMenuOptions');
1131  applyPeer(node: KNode, reset: boolean): void {
1132    if (reset) {
1133      getUINativeModule().textArea.resetSelectionMenuOptions(node);
1134    } else {
1135      getUINativeModule().textArea.setSelectionMenuOptions(node, this.value);
1136    }
1137  }
1138}
1139
1140class TextAreaEnableHapticFeedbackModifier extends ModifierWithKey<boolean> {
1141  constructor(value: boolean) {
1142    super(value);
1143  }
1144  static identity: Symbol = Symbol('textAreaEnableHapticFeedback');
1145  applyPeer(node: KNode, reset: boolean): void {
1146    if (reset) {
1147      getUINativeModule().textArea.resetEnableHapticFeedback(node);
1148    } else {
1149      getUINativeModule().textArea.setEnableHapticFeedback(node, this.value!);
1150    }
1151  }
1152  checkObjectDiff(): boolean {
1153    return !isBaseOrResourceEqual(this.stageValue, this.value);
1154  }
1155}
1156
1157class TextAreaInitializeModifier extends ModifierWithKey<TextAreaOptions> {
1158  constructor(value: TextAreaOptions) {
1159    super(value);
1160  }
1161  static identity: Symbol = Symbol('textAreaInitialize');
1162  applyPeer(node: KNode, reset: boolean): void {
1163    if (reset) {
1164      getUINativeModule().textArea.setTextAreaInitialize(node, undefined, undefined, undefined);
1165    } else {
1166      getUINativeModule().textArea.setTextAreaInitialize(node, this.value?.placeholder, this.value?.text, this.value?.controller);
1167    }
1168  }
1169  checkObjectDiff(): boolean {
1170    return !isBaseOrResourceEqual(this.stageValue?.placeholder, this.value?.placeholder) ||
1171      !isBaseOrResourceEqual(this.stageValue?.text, this.value?.text) ||
1172      !isBaseOrResourceEqual(this.stageValue?.controller, this.value?.controller);
1173  }
1174}
1175
1176class ArkTextAreaComponent extends ArkComponent implements CommonMethod<TextAreaAttribute> {
1177  constructor(nativePtr: KNode, classType?: ModifierType) {
1178    super(nativePtr, classType);
1179  }
1180  allowChildCount(): number {
1181    return 0;
1182  }
1183  initialize(value: Object[]): TextAreaAttribute {
1184    if (value.length === 1 && isObject(value[0])) {
1185      modifierWithKey(this._modifiersWithKeys, TextAreaInitializeModifier.identity, TextAreaInitializeModifier, value[0]);
1186    }
1187    return this;
1188  }
1189  type(value: TextAreaType): TextAreaAttribute {
1190    modifierWithKey(this._modifiersWithKeys, TextAreaTypeModifier.identity, TextAreaTypeModifier, value);
1191    return this;
1192  }
1193  placeholderColor(value: ResourceColor): TextAreaAttribute {
1194    modifierWithKey(this._modifiersWithKeys, TextAreaPlaceholderColorModifier.identity, TextAreaPlaceholderColorModifier, value);
1195    return this;
1196  }
1197  placeholderFont(value: Font): TextAreaAttribute {
1198    modifierWithKey(this._modifiersWithKeys, TextAreaPlaceholderFontModifier.identity, TextAreaPlaceholderFontModifier, value);
1199    return this;
1200  }
1201
1202  textAlign(value: TextAlign): TextAreaAttribute {
1203    modifierWithKey(this._modifiersWithKeys, TextAreaTextAlignModifier.identity, TextAreaTextAlignModifier, value);
1204    return this;
1205  }
1206  caretColor(value: ResourceColor): TextAreaAttribute {
1207    modifierWithKey(this._modifiersWithKeys, TextAreaCaretColorModifier.identity, TextAreaCaretColorModifier, value);
1208    return this;
1209  }
1210  fontColor(value: ResourceColor): TextAreaAttribute {
1211    modifierWithKey(this._modifiersWithKeys, TextAreaFontColorModifier.identity, TextAreaFontColorModifier, value);
1212    return this;
1213  }
1214  fontSize(value: Length): TextAreaAttribute {
1215    modifierWithKey(this._modifiersWithKeys, TextAreaFontSizeModifier.identity, TextAreaFontSizeModifier, value);
1216    return this;
1217  }
1218  fontStyle(value: FontStyle): TextAreaAttribute {
1219    modifierWithKey(this._modifiersWithKeys, TextAreaFontStyleModifier.identity, TextAreaFontStyleModifier, value);
1220    return this;
1221  }
1222  fontWeight(value: number | FontWeight | string): TextAreaAttribute {
1223    modifierWithKey(this._modifiersWithKeys, TextAreaFontWeightModifier.identity, TextAreaFontWeightModifier, value);
1224    return this;
1225  }
1226  fontFamily(value: ResourceStr): TextAreaAttribute {
1227    modifierWithKey(this._modifiersWithKeys, TextAreaFontFamilyModifier.identity, TextAreaFontFamilyModifier, value);
1228    return this;
1229  }
1230  inputFilter(value: ResourceStr, error?: (value: string) => void): TextAreaAttribute {
1231    let arkValue = new ArkTextInputFilter();
1232    arkValue.value = value;
1233    arkValue.error = error;
1234    modifierWithKey(this._modifiersWithKeys, TextAreaInputFilterModifier.identity, TextAreaInputFilterModifier, arkValue);
1235    return this;
1236  }
1237  onChange(callback: (value: ChangeValueInfo) => void): TextAreaAttribute {
1238    modifierWithKey(this._modifiersWithKeys, TextAreaOnChangeModifier.identity,
1239      TextAreaOnChangeModifier, callback);
1240    return this;
1241  }
1242  onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextAreaAttribute {
1243    modifierWithKey(this._modifiersWithKeys, TextAreaOnTextSelectionChangeModifier.identity,
1244      TextAreaOnTextSelectionChangeModifier, callback);
1245    return this;
1246  }
1247  onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): TextAreaAttribute {
1248    modifierWithKey(this._modifiersWithKeys, TextAreaOnContentScrollModifier.identity,
1249      TextAreaOnContentScrollModifier, callback);
1250    return this;
1251  }
1252  onEditChange(callback: (isEditing: boolean) => void): TextAreaAttribute {
1253    modifierWithKey(this._modifiersWithKeys, TextAreaOnEditChangeModifier.identity,
1254      TextAreaOnEditChangeModifier, callback);
1255    return this;
1256  }
1257  onCopy(callback: (value: string) => void): TextAreaAttribute {
1258    modifierWithKey(this._modifiersWithKeys, TextAreaOnCopyModifier.identity,
1259      TextAreaOnCopyModifier, callback);
1260    return this;
1261  }
1262  onCut(callback: (value: string) => void): TextAreaAttribute {
1263    modifierWithKey(this._modifiersWithKeys, TextAreaOnCutModifier.identity,
1264      TextAreaOnCutModifier, callback);
1265    return this;
1266  }
1267  onPaste(callback: (value: string) => void): TextAreaAttribute {
1268    modifierWithKey(this._modifiersWithKeys, TextAreaOnPasteModifier.identity,
1269      TextAreaOnPasteModifier, callback);
1270    return this;
1271  }
1272  copyOption(value: CopyOptions): TextAreaAttribute {
1273    modifierWithKey(this._modifiersWithKeys, TextAreaCopyOptionModifier.identity, TextAreaCopyOptionModifier, value);
1274    return this;
1275  }
1276
1277  enableKeyboardOnFocus(value: boolean): TextAreaAttribute {
1278    modifierWithKey(this._modifiersWithKeys, TextAreaEnableKeyboardOnFocusModifier.identity, TextAreaEnableKeyboardOnFocusModifier, value);
1279    return this;
1280  }
1281
1282  maxLength(value: number): TextAreaAttribute {
1283    modifierWithKey(this._modifiersWithKeys, TextAreaMaxLengthModifier.identity, TextAreaMaxLengthModifier, value);
1284    return this;
1285  }
1286  showCounter(value: boolean, options?: InputCounterOptions): TextAreaAttribute {
1287    let arkValue: ArkTextFieldShowCounter = new ArkTextFieldShowCounter();
1288    arkValue.value = value;
1289    arkValue.highlightBorder = options?.highlightBorder;
1290    arkValue.thresholdPercentage = options?.thresholdPercentage;
1291    modifierWithKey(this._modifiersWithKeys, TextAreaShowCounterModifier.identity, TextAreaShowCounterModifier, arkValue);
1292    return this;
1293  }
1294  style(value: TextContentStyle): TextAreaAttribute {
1295    modifierWithKey(this._modifiersWithKeys, TextAreaStyleModifier.identity, TextAreaStyleModifier, value);
1296    return this;
1297  }
1298  barState(value: BarState): TextAreaAttribute {
1299    modifierWithKey(this._modifiersWithKeys, TextAreaBarStateModifier.identity, TextAreaBarStateModifier, value);
1300    return this;
1301  }
1302  selectionMenuHidden(value: boolean): TextAreaAttribute {
1303    modifierWithKey(this._modifiersWithKeys, TextAreaSelectionMenuHiddenModifier.identity, TextAreaSelectionMenuHiddenModifier, value);
1304    return this;
1305  }
1306  maxLines(value: number): TextAreaAttribute {
1307    modifierWithKey(this._modifiersWithKeys, TextAreaMaxLinesModifier.identity, TextAreaMaxLinesModifier, value);
1308    return this;
1309  }
1310  fontFeature(value: FontFeature): TextAreaAttribute {
1311    modifierWithKey(this._modifiersWithKeys, TextAreaFontFeatureModifier.identity, TextAreaFontFeatureModifier, value);
1312    return this;
1313  }
1314  customKeyboard(value: CustomBuilder): TextAreaAttribute {
1315    throw new Error('Method not implemented.');
1316  }
1317  decoration(value: { type: TextDecorationType; color?: ResourceColor; style?: TextDecorationStyle }): TextAreaAttribute {
1318    modifierWithKey(this._modifiersWithKeys, TextAreaDecorationModifier.identity, TextAreaDecorationModifier, value);
1319    return this;
1320  }
1321  letterSpacing(value: number | string): this {
1322    modifierWithKey(this._modifiersWithKeys, TextAreaLetterSpacingModifier.identity, TextAreaLetterSpacingModifier, value);
1323    return this;
1324  }
1325  lineHeight(value: number | string | Resource): this {
1326    modifierWithKey(this._modifiersWithKeys, TextAreaLineHeightModifier.identity, TextAreaLineHeightModifier, value);
1327    return this;
1328  }
1329  lineSpacing(value: LengthMetrics): this {
1330    modifierWithKey(this._modifiersWithKeys, TextAreaLineSpacingModifier.identity, TextAreaLineSpacingModifier, value);
1331    return this;
1332  }
1333  wordBreak(value: WordBreak): this {
1334    modifierWithKey(this._modifiersWithKeys, TextAreaWordBreakModifier.identity, TextAreaWordBreakModifier, value);
1335    return this;
1336  }
1337  lineBreakStrategy(value: LineBreakStrategy): this {
1338    modifierWithKey(this._modifiersWithKeys, TextAreaLineBreakStrategyModifier.identity,
1339      TextAreaLineBreakStrategyModifier, value);
1340    return this;
1341  }
1342  minFontSize(value: number | string | Resource): TextAreaAttribute {
1343    modifierWithKey(this._modifiersWithKeys, TextAreaMinFontSizeModifier.identity, TextAreaMinFontSizeModifier, value);
1344    return this;
1345  }
1346  maxFontSize(value: number | string | Resource): TextAreaAttribute {
1347    modifierWithKey(this._modifiersWithKeys, TextAreaMaxFontSizeModifier.identity, TextAreaMaxFontSizeModifier, value);
1348    return this;
1349  }
1350  heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextAreaAttribute {
1351    modifierWithKey(this._modifiersWithKeys, TextAreaHeightAdaptivePolicyModifier.identity, TextAreaHeightAdaptivePolicyModifier, value);
1352    return this;
1353  }
1354  selectedBackgroundColor(value: ResourceColor): this {
1355    modifierWithKey(this._modifiersWithKeys, TextAreaSelectedBackgroundColorModifier.identity, TextAreaSelectedBackgroundColorModifier, value);
1356    return this;
1357  }
1358  caretStyle(value: CaretStyle): this {
1359    modifierWithKey(this._modifiersWithKeys, TextAreaCaretStyleModifier.identity, TextAreaCaretStyleModifier, value);
1360    return this;
1361  }
1362  textOverflow(value: TextOverflow): this {
1363    modifierWithKey(this._modifiersWithKeys, TextAreaTextOverflowModifier.identity, TextAreaTextOverflowModifier, value);
1364    return this;
1365  }
1366  textIndent(value: Dimension): this {
1367    modifierWithKey(this._modifiersWithKeys, TextAreaTextIndentModifier.identity, TextAreaTextIndentModifier, value);
1368    return this;
1369  }
1370  enterKeyType(value: EnterKeyType): TextAreaAttribute {
1371    modifierWithKey(this._modifiersWithKeys, TextAreaEnterKeyTypeModifier.identity,
1372      TextAreaEnterKeyTypeModifier, value);
1373    return this;
1374  }
1375  padding(value: Padding | Length): this {
1376    let arkValue = new ArkPadding();
1377    if (value !== null && value !== undefined) {
1378      if (isLengthType(value) || isResource(value)) {
1379        arkValue.top = value;
1380        arkValue.right = value;
1381        arkValue.bottom = value;
1382        arkValue.left = value;
1383      }
1384      else {
1385        arkValue.top = value.top;
1386        arkValue.right = value.right;
1387        arkValue.bottom = value.bottom;
1388        arkValue.left = value.left;
1389      }
1390      modifierWithKey(this._modifiersWithKeys, TextAreaPaddingModifier.identity, TextAreaPaddingModifier, arkValue);
1391    }
1392    else {
1393      modifierWithKey(this._modifiersWithKeys, TextAreaPaddingModifier.identity, TextAreaPaddingModifier, undefined);
1394    }
1395    return this;
1396  }
1397  onSubmit(callback: (enterKey: EnterKeyType, event: SubmitEvent) => void): this {
1398    modifierWithKey(this._modifiersWithKeys, TextAreaOnSubmitModifier.identity,
1399      TextAreaOnSubmitModifier, callback);
1400    return this;
1401  }
1402  contentType(value: ContentType): this {
1403    modifierWithKey(this._modifiersWithKeys, TextAreaContentTypeModifier.identity,
1404      TextAreaContentTypeModifier, value);
1405    return this;
1406  }
1407  enableAutoFill(value: boolean): this {
1408    modifierWithKey(this._modifiersWithKeys, TextAreaEnableAutoFillModifier.identity,
1409      TextAreaEnableAutoFillModifier, value);
1410    return this;
1411  }
1412  border(value: BorderOptions): this {
1413    let borderValue = valueToArkBorder(value);
1414    modifierWithKey(this._modifiersWithKeys, TextAreaBorderModifier.identity, TextAreaBorderModifier, borderValue);
1415    return this;
1416  }
1417  borderWidth(value: Length | EdgeWidths): this {
1418    modifierWithKey(this._modifiersWithKeys, TextAreaBorderWidthModifier.identity, TextAreaBorderWidthModifier, value);
1419    return this;
1420  }
1421  borderColor(value: ResourceColor | EdgeColors): this {
1422    modifierWithKey(this._modifiersWithKeys, TextAreaBorderColorModifier.identity, TextAreaBorderColorModifier, value);
1423    return this;
1424  }
1425  borderStyle(value: BorderStyle | EdgeStyles): this {
1426    modifierWithKey(this._modifiersWithKeys, TextAreaBorderStyleModifier.identity, TextAreaBorderStyleModifier, value);
1427    return this;
1428  }
1429  borderRadius(value: Length | BorderRadiuses): this {
1430    modifierWithKey(this._modifiersWithKeys, TextAreaBorderRadiusModifier.identity, TextAreaBorderRadiusModifier, value);
1431    return this;
1432  }
1433  backgroundColor(value: ResourceColor): this {
1434    modifierWithKey(this._modifiersWithKeys, TextAreaBackgroundColorModifier.identity, TextAreaBackgroundColorModifier, value);
1435    return this;
1436  }
1437  margin(value: Margin | Length): this {
1438    let arkValue = new ArkPadding();
1439    if (value !== null && value !== undefined) {
1440      if (isLengthType(value) || isResource(value)) {
1441        arkValue.top = <Length>value;
1442        arkValue.right = <Length>value;
1443        arkValue.bottom = <Length>value;
1444        arkValue.left = <Length>value;
1445      } else {
1446        arkValue.top = (<Margin>value).top;
1447        arkValue.right = (<Margin>value).right;
1448        arkValue.bottom = (<Margin>value).bottom;
1449        arkValue.left = (<Margin>value).left;
1450      }
1451      modifierWithKey(this._modifiersWithKeys, TextAreaMarginModifier.identity, TextAreaMarginModifier, arkValue);
1452    } else {
1453      modifierWithKey(this._modifiersWithKeys, TextAreaMarginModifier.identity, TextAreaMarginModifier, undefined);
1454    }
1455    return this;
1456  }
1457  onWillChange(callback: Callback<ChangeValueInfo, boolean>): this {
1458    modifierWithKey(this._modifiersWithKeys, TextAreaOnWillChangeModifier.identity, TextAreaOnWillChangeModifier, callback);
1459    return this;
1460  }
1461  onWillInsert(callback: Callback<InsertValue, boolean>): this {
1462    modifierWithKey(this._modifiersWithKeys, TextAreaOnWillInsertModifier.identity, TextAreaOnWillInsertModifier, callback);
1463    return this;
1464  }
1465  onDidInsert(callback: Callback<InsertValue>): this {
1466    modifierWithKey(this._modifiersWithKeys, TextAreaOnDidInsertModifier.identity, TextAreaOnDidInsertModifier, callback);
1467    return this;
1468  }
1469  onWillDelete(callback: Callback<DeleteValue, boolean>): this {
1470    modifierWithKey(this._modifiersWithKeys, TextAreaOnWillDeleteModifier.identity, TextAreaOnWillDeleteModifier, callback);
1471    return this;
1472  }
1473  onDidDelete(callback: Callback<DeleteValue>): this {
1474    modifierWithKey(this._modifiersWithKeys, TextAreaOnDidDeleteModifier.identity, TextAreaOnDidDeleteModifier, callback);
1475    return this;
1476  }
1477  enablePreviewText(value: boolean): this {
1478    modifierWithKey(this._modifiersWithKeys, TextAreaEnablePreviewTextModifier.identity, TextAreaEnablePreviewTextModifier, value);
1479    return this;
1480  }
1481  editMenuOptions(value: EditMenuOptions): this {
1482    modifierWithKey(this._modifiersWithKeys, TextAreaEditMenuOptionsModifier.identity,
1483      TextAreaEditMenuOptionsModifier, value);
1484    return this;
1485  }
1486  enableHapticFeedback(value: boolean): this {
1487    modifierWithKey(this._modifiersWithKeys, TextAreaEnableHapticFeedbackModifier.identity, TextAreaEnableHapticFeedbackModifier, value);
1488    return this;
1489  }
1490}
1491// @ts-ignore
1492globalThis.TextArea.attributeModifier = function (modifier: ArkComponent): void {
1493  attributeModifierFunc.call(this, modifier, (nativePtr: KNode) => {
1494    return new ArkTextAreaComponent(nativePtr);
1495  }, (nativePtr: KNode, classType: ModifierType, modifierJS: ModifierJS) => {
1496    return new modifierJS.TextAreaModifier(nativePtr, classType);
1497  });
1498};
1499