UNPKG

28.7 kBTypeScriptView Raw
1import { ViewBase } from '../view-base';
2import { Property, InheritedProperty } from '../properties';
3import { EventData } from '../../../data/observable';
4import { Color } from '../../../color';
5import { Animation, AnimationDefinition, AnimationPromise } from '../../animation';
6import { GestureTypes, GesturesObserver } from '../../gestures';
7import { LinearGradient } from '../../styling/linear-gradient';
8import { AccessibilityLiveRegion, AccessibilityRole, AccessibilityState, AccessibilityTrait, AccessibilityEventOptions } from '../../../accessibility/accessibility-types';
9import { CoreTypes } from '../../../core-types';
10import { ShadowCSSValues } from '../../styling/css-shadow';
11import { ViewCommon } from './view-common';
12
13export * from './view-common';
14// helpers (these are okay re-exported here)
15export * from './view-helper';
16
17// This one can eventually be cleaned up but causes issues with a lot of ui-suite plugins in particular if not exported here
18export * from '../properties';
19
20export function PseudoClassHandler(...pseudoClasses: string[]): MethodDecorator;
21
22/**
23 * Specifies the type name for the instances of this View class,
24 * that is used when matching CSS type selectors.
25 *
26 * Usage:
27 * ```
28 * @CSSType("Button")
29 * class Button extends View {
30 * }
31 * ```
32 *
33 * Internally the decorator set `Button.prototype.cssType = "Button"`.
34 * @param type The type name, e. g. "Button", "Label", etc.
35 */
36export function CSSType(type: string): ClassDecorator;
37
38/**
39 *
40 * @param view The view
41 * @param context The ModuleType
42 * @param type Type of the ModuleType to be matched
43 */
44export function viewMatchesModuleContext(view: View, context: ModuleContext, type: ModuleType[]): boolean;
45
46/**
47 * The Point interface describes a two dimensional location.
48 * It has two properties x and y, representing the x and y coordinate of the location.
49 */
50export interface Point {
51 /**
52 * Represents the x coordinate of the location.
53 */
54 x: number;
55
56 /**
57 * Represents the y coordinate of the location.
58 */
59 y: number;
60
61 /**
62 * Represents the z coordinate of the location.
63 */
64 z?: number;
65}
66
67/**
68 * The Size interface describes abstract dimensions in two dimensional space.
69 * It has two properties width and height, representing the width and height values of the size.
70 */
71export interface Size {
72 /**
73 * Represents the width of the size.
74 */
75 width: number;
76
77 /**
78 * Represents the height of the size.
79 */
80 height: number;
81}
82
83/**
84 * Defines the data for the shownModally event.
85 */
86export interface ShownModallyData extends EventData {
87 /**
88 * The context (optional, may be undefined) passed to the view when shown modally.
89 */
90 context?: any;
91
92 /**
93 * A callback to call when you want to close the modally shown view.
94 * Pass in any kind of arguments and you will receive when the callback parameter
95 * of View.showModal is executed.
96 */
97 closeCallback?: Function;
98}
99
100/**
101 * This class is the base class for all UI components.
102 * A View occupies a rectangular area on the screen and is responsible for drawing and layouting of all UI components within.
103 */
104export abstract class View extends ViewCommon {
105 /**
106 * String value used when hooking to layoutChanged event.
107 */
108 public static layoutChangedEvent: string;
109 /**
110 * String value used when hooking to showingModally event.
111 */
112 public static showingModallyEvent: string;
113
114 /**
115 * String value used when hooking to shownModally event.
116 */
117 public static shownModallyEvent: string;
118
119 /**
120 * String value used when hooking to accessibilityBlur event.
121 */
122 public static accessibilityBlurEvent: string;
123
124 /**
125 * String value used when hooking to accessibilityFocus event.
126 */
127 public static accessibilityFocusEvent: string;
128
129 /**
130 * String value used when hooking to accessibilityFocusChanged event.
131 */
132 public static accessibilityFocusChangedEvent: string;
133
134 /**
135 * Gets the android-specific native instance that lies behind this proxy. Will be available if running on an Android platform.
136 */
137 // @ts-ignore
138 public android: any;
139
140 /**
141 * Gets the ios-specific native instance that lies behind this proxy. Will be available if running on an iOS platform.
142 */
143 // @ts-ignore
144 public ios: any;
145
146 /**
147 * Gets or sets the binding context of this instance. This object is used as a source for each Binding that does not have a source object specified.
148 */
149 bindingContext: any;
150
151 /**
152 * Gets or sets the border color of the view.
153 */
154 borderColor: string | Color;
155
156 /**
157 * Gets or sets the top border color of the view.
158 */
159 borderTopColor: Color;
160
161 /**
162 * Gets or sets the right border color of the view.
163 */
164 borderRightColor: Color;
165
166 /**
167 * Gets or sets the bottom border color of the view.
168 */
169 borderBottomColor: Color;
170
171 /**
172 * Gets or sets the left border color of the view.
173 */
174 borderLeftColor: Color;
175
176 /**
177 * Gets or sets the border width of the view.
178 */
179 borderWidth: string | CoreTypes.LengthType;
180
181 /**
182 * Gets or sets the top border width of the view.
183 */
184 borderTopWidth: CoreTypes.LengthType;
185
186 /**
187 * Gets or sets the right border width of the view.
188 */
189 borderRightWidth: CoreTypes.LengthType;
190
191 /**
192 * Gets or sets the bottom border width of the view.
193 */
194 borderBottomWidth: CoreTypes.LengthType;
195
196 /**
197 * Gets or sets the left border width of the view.
198 */
199 borderLeftWidth: CoreTypes.LengthType;
200
201 /**
202 * Gets or sets the border radius of the view.
203 */
204 borderRadius: string | CoreTypes.LengthType;
205
206 /**
207 * Gets or sets the top left border radius of the view.
208 */
209 borderTopLeftRadius: CoreTypes.LengthType;
210
211 /**
212 * Gets or sets the top right border radius of the view.
213 */
214 borderTopRightRadius: CoreTypes.LengthType;
215
216 /**
217 * Gets or sets the bottom right border radius of the view.
218 */
219 borderBottomRightRadius: CoreTypes.LengthType;
220
221 /**
222 * Gets or sets the bottom left border radius of the view.
223 */
224 borderBottomLeftRadius: CoreTypes.LengthType;
225
226 /**
227 * Gets or sets the color of the view.
228 */
229 color: Color;
230
231 /**
232 * If `true` the element is an accessibility element and all the children will be treated as a single selectable component.
233 */
234 accessible: boolean;
235
236 /**
237 * Hide the view and its children from the a11y service
238 */
239 accessibilityHidden: boolean;
240
241 /**
242 * The view's unique accessibilityIdentifier.
243 *
244 * This is used for automated testing.
245 */
246 accessibilityIdentifier: string;
247
248 /**
249 * Which role should this view be treated by the a11y service?
250 */
251 accessibilityRole: AccessibilityRole;
252
253 /**
254 * Which state should this view be treated as by the a11y service?
255 */
256 accessibilityState: AccessibilityState;
257
258 /**
259 * Short description of the element, ideally one word.
260 */
261 accessibilityLabel: string;
262
263 /**
264 * Current value of the element in a localized string.
265 */
266 accessibilityValue: string;
267
268 /**
269 * A hint describes the elements behavior. Example: 'Tap change playback speed'
270 */
271 accessibilityHint: string;
272 accessibilityLiveRegion: AccessibilityLiveRegion;
273
274 /**
275 * Sets the language in which to speak the element's label and value.
276 * Accepts language ID tags that follows the "BCP 47" specification.
277 */
278 accessibilityLanguage: string;
279
280 /**
281 * This view starts a media session. Equivalent to trait = startsMedia
282 */
283 accessibilityMediaSession: boolean;
284
285 /**
286 * Defines whether accessibility font scale should affect font size.
287 */
288 iosAccessibilityAdjustsFontSize: boolean;
289
290 /**
291 * Gets or sets the minimum accessibility font scale.
292 */
293 iosAccessibilityMinFontScale: number;
294
295 /**
296 * Gets or sets the maximum accessibility font scale.
297 */
298 iosAccessibilityMaxFontScale: number;
299
300 /**
301 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
302 */
303 _androidContentDescriptionUpdated?: boolean;
304
305 automationText: string;
306
307 /**
308 * Gets or sets the elevation of the android view.
309 */
310 androidElevation: number;
311
312 /**
313 * Gets or sets the dynamic elevation offset of the android view.
314 */
315 androidDynamicElevationOffset: number;
316
317 /**
318 * Gets or sets the background style property.
319 */
320 background: string;
321
322 /**
323 * Gets or sets the background color of the view.
324 */
325 backgroundColor: string | Color;
326
327 /**
328 * Gets or sets the background image of the view.
329 */
330 backgroundImage: string | LinearGradient;
331
332 /**
333 * Gets or sets the box shadow of the view.
334 */
335 boxShadow: string | ShadowCSSValues;
336
337 /**
338 * Gets or sets the minimum width the view may grow to.
339 */
340 minWidth: CoreTypes.LengthType;
341
342 /**
343 * Gets or sets the minimum height the view may grow to.
344 */
345 minHeight: CoreTypes.LengthType;
346
347 /**
348 * Gets or sets the desired width of the view.
349 */
350 width: CoreTypes.PercentLengthType;
351
352 /**
353 * Gets or sets the desired height of the view.
354 */
355 height: CoreTypes.PercentLengthType;
356
357 /**
358 * Gets or sets margin style property.
359 */
360 margin: string | CoreTypes.PercentLengthType;
361
362 /**
363 * Specifies extra space on the left side of this view.
364 */
365 marginLeft: CoreTypes.PercentLengthType;
366
367 /**
368 * Specifies extra space on the top side of this view.
369 */
370 marginTop: CoreTypes.PercentLengthType;
371
372 /**
373 * Specifies extra space on the right side of this view.
374 */
375 marginRight: CoreTypes.PercentLengthType;
376
377 /**
378 * Specifies extra space on the bottom side of this view.
379 */
380 marginBottom: CoreTypes.PercentLengthType;
381
382 /**
383 * Gets or sets the alignment of this view within its parent along the Horizontal axis.
384 */
385 horizontalAlignment: CoreTypes.HorizontalAlignmentType;
386
387 /**
388 * Gets or sets the alignment of this view within its parent along the Vertical axis.
389 */
390 verticalAlignment: CoreTypes.VerticalAlignmentType;
391
392 /**
393 * Gets or sets the visibility of the view.
394 */
395 visibility: CoreTypes.VisibilityType;
396
397 /**
398 * Gets or sets the opacity style property.
399 */
400 opacity: number;
401
402 /**
403 * Gets or sets the rotate affine transform of the view along the Z axis.
404 */
405 rotate: number;
406
407 /**
408 * Gets or sets the rotate affine transform of the view along the X axis.
409 */
410 rotateX: number;
411
412 /**
413 * Gets or sets the rotate affine transform of the view along the Y axis.
414 */
415 rotateY: number;
416
417 /**
418 * Gets or sets the distance of the camera form the view perspective.
419 * Usually needed when rotating the view over the X or Y axis.
420 */
421 perspective: number;
422
423 /**
424 * Gets or sets the translateX affine transform of the view in device independent pixels.
425 */
426 translateX: CoreTypes.dip;
427
428 /**
429 * Gets or sets the translateY affine transform of the view in device independent pixels.
430 */
431 translateY: CoreTypes.dip;
432
433 /**
434 * Gets or sets the scaleX affine transform of the view.
435 */
436 scaleX: number;
437
438 /**
439 * Gets or sets the scaleY affine transform of the view.
440 */
441 scaleY: number;
442
443 //END Style property shortcuts
444
445 /**
446 * Gets or sets the X component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.
447 */
448 originX: number;
449
450 /**
451 * Gets or sets the Y component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.
452 */
453 originY: number;
454
455 /**
456 * Gets or sets a value indicating whether the the view is enabled. This affects the appearance of the view.
457 */
458 isEnabled: boolean;
459
460 /**
461 * Gets or sets a value indicating whether the user can interact with the view. This does not affect the appearance of the view.
462 */
463 isUserInteractionEnabled: boolean;
464
465 /**
466 * Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: false
467 */
468 iosOverflowSafeArea: boolean;
469
470 /**
471 * Enables or disables the iosOverflowSafeArea property for all children. This property is iOS specific. Default value: true
472 */
473 iosOverflowSafeAreaEnabled: boolean;
474
475 /**
476 * Gets or sets a value indicating whether the the view should totally ignore safe areas computation. This property is iOS specific. Default value: false
477 */
478 iosIgnoreSafeArea: boolean;
479
480 /**
481 * Gets is layout is valid. This is a read-only property.
482 */
483 isLayoutValid: boolean;
484
485 /**
486 * Gets the CSS fully qualified type name.
487 * Using this as element type should allow for PascalCase and kebap-case selectors, when fully qualified, to match the element.
488 */
489 cssType: string;
490
491 cssClasses: Set<string>;
492 cssPseudoClasses: Set<string>;
493
494 /**
495 * This is called to find out how big a view should be. The parent supplies constraint information in the width and height parameters.
496 * The actual measurement work of a view is performed in onMeasure(int, int), called by this method. Therefore, only onMeasure(int, int) can and must be overridden by subclasses.
497 * @param widthMeasureSpec Horizontal space requirements as imposed by the parent
498 * @param heightMeasureSpec Vertical space requirements as imposed by the parent
499 */
500 public measure(widthMeasureSpec: number, heightMeasureSpec: number): void;
501
502 /**
503 * Assign a size and position to a view and all of its descendants
504 * This is the second phase of the layout mechanism. (The first is measuring). In this phase, each parent calls layout on all of its children to position them. This is typically done using the child measurements that were stored in the measure pass().
505 * Derived classes should not override this method. Derived classes with children should override onLayout. In that method, they should call layout on each of their children.
506 * @param l Left position, relative to parent
507 * @param t Top position, relative to parent
508 * @param r Right position, relative to parent
509 * @param b Bottom position, relative to parent
510 */
511 public layout(left: number, top: number, right: number, bottom: number, setFrame?: boolean): void;
512
513 /**
514 * Returns the raw width component.
515 */
516 public getMeasuredWidth(): number;
517
518 /**
519 * Returns the raw height component.
520 */
521 public getMeasuredHeight(): number;
522
523 public getMeasuredState(): number;
524
525 /**
526 * Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int) and should be overriden by subclasses to provide accurate and efficient measurement of their contents.
527 * When overriding this method, you must call setMeasuredDimension(int, int) to store the measured width and height of this view. Failure to do so will trigger an exception, thrown by measure(int, int).
528 * @param widthMeasureSpec horizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
529 * @param heightMeasureSpec vertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
530 */
531 public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
532
533 /**
534 * Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.
535 * @param left Left position, relative to parent
536 * @param top Top position, relative to parent
537 * @param right Right position, relative to parent
538 * @param bottom Bottom position, relative to parent
539 */
540 public onLayout(left: number, top: number, right: number, bottom: number): void;
541
542 /**
543 * This method must be called by onMeasure(int, int) to store the measured width and measured height. Failing to do so will trigger an exception at measurement time.
544 * @param measuredWidth The measured width of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
545 * @param measuredHeight The measured height of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
546 */
547 public setMeasuredDimension(measuredWidth: number, measuredHeight: number): void;
548
549 /**
550 * Called from onLayout when native view position is about to be changed.
551 * @param left Left position, relative to parent
552 * @param top Top position, relative to parent
553 * @param right Right position, relative to parent
554 * @param bottom Bottom position, relative to parent
555 */
556 public layoutNativeView(left: number, top: number, right: number, bottom: number): void;
557
558 /**
559 * Measure a child by taking into account its margins and a given measureSpecs.
560 * @param parent This parameter is not used. You can pass null.
561 * @param child The view to be measured.
562 * @param measuredWidth The measured width that the parent layout specifies for this view.
563 * @param measuredHeight The measured height that the parent layout specifies for this view.
564 */
565 public static measureChild(parent: View, child: View, widthMeasureSpec: number, heightMeasureSpec: number): { measuredWidth: number; measuredHeight: number };
566
567 /**
568 * Layout a child by taking into account its margins, horizontal and vertical alignments and a given bounds.
569 * @param parent This parameter is not used. You can pass null.
570 * @param left Left position, relative to parent
571 * @param top Top position, relative to parent
572 * @param right Right position, relative to parent
573 * @param bottom Bottom position, relative to parent
574 */
575 public static layoutChild(parent: View, child: View, left: number, top: number, right: number, bottom: number): void;
576
577 /**
578 * Utility to reconcile a desired size and state, with constraints imposed
579 * by a MeasureSpec. Will take the desired size, unless a different size
580 * is imposed by the constraints. The returned value is a compound integer,
581 * with the resolved size in the MEASURED_SIZE_MASK bits and
582 * optionally the bit MEASURED_STATE_TOO_SMALL set if the resulting
583 * size is smaller than the size the view wants to be.
584 */
585 public static resolveSizeAndState(size: number, specSize: number, specMode: number, childMeasuredState: number): number;
586
587 public static combineMeasuredStates(curState: number, newState): number;
588
589 /**
590 * Tries to focus the view.
591 * Returns a value indicating whether this view or one of its descendants actually took focus.
592 */
593 public focus(): boolean;
594
595 public getGestureObservers(type: GestureTypes): Array<GesturesObserver> | undefined;
596
597 /**
598 * Removes the listener(s) for the specified event name.
599 *
600 * @param eventName The name of the event.
601 * @param callback An optional specific event listener to remove (if omitted,
602 * all event listeners by this name will be removed).
603 * @param thisArg An optional parameter which, when set, will be used to
604 * refine search of the correct event listener to be removed.
605 */
606 off(eventName: string, callback?: (args: EventData) => void, thisArg?: any);
607
608 /**
609 * Adds a listener for the specified event name.
610 *
611 * @param eventName The name of the event.
612 * @param callback The event listener to add. Will be called when an event of
613 * the given name is raised.
614 * @param thisArg An optional parameter which, when set, will be bound as the
615 * `this` context when the callback is called. Falsy values will be not be
616 * bound.
617 */
618 on(eventName: string, callback: (args: EventData) => void, thisArg?: any);
619
620 /**
621 * Raised when a loaded event occurs.
622 */
623 on(event: 'loaded', callback: (args: EventData) => void, thisArg?: any);
624
625 /**
626 * Raised when an unloaded event occurs.
627 */
628 on(event: 'unloaded', callback: (args: EventData) => void, thisArg?: any);
629
630 /**
631 * Raised when a back button is pressed.
632 * This event is raised only for android.
633 */
634 on(event: 'androidBackPressed', callback: (args: EventData) => void, thisArg?: any);
635
636 /**
637 * Raised before the view is shown as a modal dialog.
638 */
639 on(event: 'showingModally', callback: (args: ShownModallyData) => void, thisArg?: any): void;
640
641 /**
642 * Raised after the view is shown as a modal dialog.
643 */
644 on(event: 'shownModally', callback: (args: ShownModallyData) => void, thisArg?: any);
645
646 /**
647 * Returns the current modal view that this page is showing (is parent of), if any.
648 */
649 modal: View;
650
651 /**
652 * Animates one or more properties of the view based on the supplied options.
653 */
654 public animate(options: AnimationDefinition): AnimationPromise;
655
656 /**
657 * Creates an Animation object based on the supplied options.
658 */
659 public createAnimation(options: AnimationDefinition): Animation;
660
661 /**
662 * Returns the iOS safe area insets of this view.
663 */
664 public getSafeAreaInsets(): { left; top; right; bottom };
665
666 /**
667 * Returns the location of this view in the window coordinate system.
668 */
669 public getLocationInWindow(): Point;
670
671 /**
672 * Returns the location of this view in the screen coordinate system.
673 */
674 public getLocationOnScreen(): Point;
675
676 /**
677 * Returns the location of this view in the otherView's coordinate system.
678 */
679 public getLocationRelativeTo(otherView: View): Point;
680
681 /**
682 * Returns the actual size of the view in device-independent pixels.
683 */
684 public getActualSize(): Size;
685
686 /**
687 * Derived classes can override this method to handle Android back button press.
688 */
689 onBackPressed(): boolean;
690
691 /**
692 * @private
693 * A valid css string which will be applied for all nested UI components (based on css rules).
694 */
695 css: string;
696
697 /**
698 * @private
699 * Adds a new values to current css.
700 * @param cssString - A valid css which will be added to current css.
701 */
702 addCss(cssString: string): void;
703
704 /**
705 * @private
706 * Adds the content of the file to the current css.
707 * @param cssFileName - A valid file name (from the application root) which contains a valid css.
708 */
709 addCssFile(cssFileName: string): void;
710
711 /**
712 * @private
713 * Changes the current css to the content of the file.
714 * @param cssFileName - A valid file name (from the application root) which contains a valid css.
715 */
716 changeCssFile(cssFileName: string): void;
717
718 // Lifecycle events
719 _getNativeViewsCount(): number;
720
721 /**
722 * Internal method:
723 * Closes all modal views. Should be used by plugins like `nativescript-angular` which implement their own `modal views` service.
724 */
725 _closeAllModalViewsInternal(): boolean;
726
727 /**
728 * Internal method:
729 * Gets all modal views of the current view.
730 */
731 _getRootModalViews(): Array<ViewBase>;
732
733 _eachLayoutView(callback: (View) => void): void;
734
735 /**
736 * iOS Only Internal method used to update various view details like background rerendering, border, etc.
737 */
738 _onSizeChanged?(): void;
739
740 /**
741 * Android only check if gesture observers are attached
742 */
743 hasGestureObservers?(): boolean;
744
745 /**
746 * Android only to set the touch listener
747 */
748 setOnTouchListener?(): void;
749
750 /**
751 * Iterates over children of type View.
752 * @param callback Called for each child of type View. Iteration stops if this method returns falsy value.
753 */
754 public eachChildView(callback: (view: View) => boolean): void;
755
756 /**
757 * Send accessibility event
758 * @params options AccessibilityEventOptions
759 * androidAccessibilityEvent: AndroidAccessibilityEvent;
760 * iosNotificationType: IOSPostAccessibilityNotificationType;
761 * message: string;
762 *
763 * iOS Notes:
764 * type = 'announcement' will announce `args` via VoiceOver. If no args element will be announced instead.
765 * type = 'layout' used when the layout of a screen changes.
766 * type = 'screen' large change made to the screen.
767 */
768 public sendAccessibilityEvent(options: Partial<AccessibilityEventOptions>): void;
769
770 /**
771 * Make an announcement to the screen reader.
772 */
773 public accessibilityAnnouncement(msg?: string): void;
774
775 /**
776 * Announce screen changed
777 */
778 public accessibilityScreenChanged(): void;
779
780 //@private
781 /**
782 * @private
783 */
784 _modalParent?: View;
785 /**
786 * @private
787 */
788 isLayoutRequired: boolean;
789 /**
790 * @private
791 */
792 get needsNativeDrawableFill(): boolean;
793 /**
794 * @private
795 */
796 _gestureObservers: any;
797 /**
798 * @private
799 * androidx.fragment.app.FragmentManager
800 */
801 _manager: any;
802 /**
803 * @private
804 */
805 _setNativeClipToBounds(): void;
806 /**
807 * Called by measure method to cache measureSpecs.
808 * @private
809 */
810 _setCurrentMeasureSpecs(widthMeasureSpec: number, heightMeasureSpec: number): boolean;
811 /**
812 * Called by layout method to cache view bounds.
813 * @private
814 */
815 _setCurrentLayoutBounds(left: number, top: number, right: number, bottom: number): { boundsChanged: boolean; sizeChanged: boolean };
816 /**
817 * Return view bounds.
818 * @private
819 */
820 _getCurrentLayoutBounds(): {
821 left: number;
822 top: number;
823 right: number;
824 bottom: number;
825 };
826 /**
827 * @private
828 */
829 _goToVisualState(state: string);
830 /**
831 * @private
832 */
833 _setNativeViewFrame(nativeView: any, frame: any): void;
834 // _onStylePropertyChanged(property: dependencyObservable.Property): void;
835 /**
836 * @private
837 */
838 _updateEffectiveLayoutValues(parentWidthMeasureSize: number, parentWidthMeasureMode: number, parentHeightMeasureSize: number, parentHeightMeasureMode: number): void;
839 /**
840 * @private
841 */
842 _currentWidthMeasureSpec: number;
843 /**
844 * @private
845 */
846 _currentHeightMeasureSpec: number;
847 /**
848 * @private
849 */
850 _setMinWidthNative(value: CoreTypes.LengthType): void;
851 /**
852 * @private
853 */
854 _setMinHeightNative(value: CoreTypes.LengthType): void;
855 /**
856 * @private
857 */
858 _redrawNativeBackground(value: any): void;
859 /**
860 * @private
861 * method called on Android to apply the background. This allows custom handling
862 */
863 _applyBackground(background: Background, isBorderDrawable: boolean, onlyColor: boolean, backgroundDrawable: any);
864
865 /**
866 * @private
867 */
868 _removeAnimation(animation: Animation): boolean;
869 /**
870 * @private
871 */
872 _onLivesync(context?: { type: string; path: string }): boolean;
873 /**
874 * @private
875 */
876 _getFragmentManager(): any; /* androidx.fragment.app.FragmentManager */
877 _handleLivesync(context?: { type: string; path: string }): boolean;
878
879 /**
880 * Updates styleScope or create new styleScope.
881 * @param cssFileName
882 * @param cssString
883 * @param css
884 */
885 _updateStyleScope(cssFileName?: string, cssString?: string, css?: string): void;
886
887 /**
888 * Called in android when native view is attached to window.
889 */
890 _onAttachedToWindow(): void;
891
892 /**
893 * Called in android when native view is dettached from window.
894 */
895 _onDetachedFromWindow(): void;
896
897 /**
898 * Checks whether the current view has specific view for an ancestor.
899 */
900 _hasAncestorView(ancestorView: View): boolean;
901 //@endprivate
902
903 /**
904 * __Obsolete:__ There is a new property system that does not rely on _getValue.
905 */
906 _getValue(property: any): never;
907
908 /**
909 * __Obsolete:__ There is a new property system that does not rely on _setValue.
910 */
911 _setValue(property: any, value: any): never;
912}
913
914/**
915 * Base class for all UI components that are containers.
916 */
917export class ContainerView extends View {
918 /**
919 * Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: true
920 */
921 public iosOverflowSafeArea: boolean;
922}
923
924/**
925 * Base class for all UI components that implement custom layouts.
926 */
927export class CustomLayoutView extends ContainerView {
928 //@private
929 /**
930 * @private
931 */
932 _updateNativeLayoutParams(child: View): void;
933 /**
934 * @private
935 */
936 _setChildMinWidthNative(child: View, value: CoreTypes.LengthType): void;
937 /**
938 * @private
939 */
940 _setChildMinHeightNative(child: View, value: CoreTypes.LengthType): void;
941 //@endprivate
942}
943
944/**
945 * Defines an interface for a View factory function.
946 * Commonly used to specify the visualization of data objects.
947 */
948export interface Template {
949 /**
950 * Call signature of the factory function.
951 * Returns a new View instance.
952 */
953 (): View;
954}
955
956/**
957 * Defines an interface for Template with a key.
958 */
959export interface KeyedTemplate {
960 /**
961 * The unique key of the template.
962 */
963 key: string;
964
965 /**
966 * The function that creates the view.
967 */
968 createView: Template;
969}
970
971/**
972 * Defines an interface for adding arrays declared in xml.
973 */
974export interface AddArrayFromBuilder {
975 /**
976 * A function that is called when an array declaration is found in xml.
977 * @param name - Name of the array.
978 * @param value - The actual value of the array.
979 */
980 _addArrayFromBuilder(name: string, value: Array<any>): void;
981}
982
983/**
984 * Defines an interface for adding a child element declared in xml.
985 */
986export interface AddChildFromBuilder {
987 /**
988 * Called for every child element declared in xml.
989 * This method will add a child element (value) to current element.
990 * @param name - Name of the element.
991 * @param value - Value of the element.
992 */
993 _addChildFromBuilder(name: string, value: any): void;
994}
995
996export const originXProperty: Property<View, number>;
997export const originYProperty: Property<View, number>;
998export const isEnabledProperty: Property<View, boolean>;
999export const isUserInteractionEnabledProperty: Property<View, boolean>;
1000export const iosOverflowSafeAreaProperty: Property<View, boolean>;
1001export const iosOverflowSafeAreaEnabledProperty: InheritedProperty<View, boolean>;