@nativescript/core 8.5.0-alpha.0 → 8.5.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/abortcontroller/abortsignal.js +5 -5
  2. package/abortcontroller/abortsignal.js.map +1 -1
  3. package/accessibility/accessibility-common.d.ts +1 -1
  4. package/accessibility/accessibility-common.js.map +1 -1
  5. package/accessibility/accessibility-properties.js +5 -13
  6. package/accessibility/accessibility-properties.js.map +1 -1
  7. package/accessibility/font-scale.android.js.map +1 -1
  8. package/accessibility/index.android.d.ts +2 -2
  9. package/accessibility/index.android.js.map +1 -1
  10. package/accessibility/index.d.ts +1 -2
  11. package/accessibility/index.ios.d.ts +1 -2
  12. package/accessibility/index.ios.js.map +1 -1
  13. package/animation-frame/animation-native.ios.d.ts +1 -1
  14. package/application/application-common.d.ts +5 -4
  15. package/application/application-common.js +5 -5
  16. package/application/application-common.js.map +1 -1
  17. package/application/application-interfaces.d.ts +27 -5
  18. package/application/index.android.d.ts +12 -12
  19. package/application/index.android.js.map +1 -1
  20. package/application/index.d.ts +30 -35
  21. package/application/index.ios.d.ts +1 -0
  22. package/application/index.ios.js +23 -28
  23. package/application/index.ios.js.map +1 -1
  24. package/core-types/index.d.ts +10 -10
  25. package/css/CSS3Parser.d.ts +3 -3
  26. package/css/parser.d.ts +17 -17
  27. package/data/observable/index.d.ts +140 -165
  28. package/data/observable/index.js +102 -6
  29. package/data/observable/index.js.map +1 -1
  30. package/file-system/file-system-access.android.d.ts +13 -0
  31. package/file-system/file-system-access.android.js +149 -1
  32. package/file-system/file-system-access.android.js.map +1 -1
  33. package/file-system/file-system-access.d.ts +12 -0
  34. package/file-system/file-system-access.ios.d.ts +7 -0
  35. package/file-system/file-system-access.ios.js +56 -0
  36. package/file-system/file-system-access.ios.js.map +1 -1
  37. package/fps-meter/fps-native.android.js.map +1 -1
  38. package/global-types.d.ts +94 -104
  39. package/globals/index.js.map +1 -1
  40. package/image-source/index.android.js +5 -5
  41. package/image-source/index.android.js.map +1 -1
  42. package/image-source/index.ios.js +5 -5
  43. package/image-source/index.ios.js.map +1 -1
  44. package/index.d.ts +2 -0
  45. package/index.js +3 -1
  46. package/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/platform/index.android.d.ts +2 -2
  49. package/platform/index.ios.d.ts +2 -2
  50. package/platforms/android/widgets-release.aar +0 -0
  51. package/profiling/index.js +1 -1
  52. package/profiling/index.js.map +1 -1
  53. package/ui/action-bar/action-bar-common.js +4 -4
  54. package/ui/action-bar/action-bar-common.js.map +1 -1
  55. package/ui/action-bar/index.d.ts +2 -2
  56. package/ui/animation/animation-interfaces.d.ts +4 -4
  57. package/ui/builder/component-builder/index.js.map +1 -1
  58. package/ui/builder/xml2ui.js +3 -3
  59. package/ui/builder/xml2ui.js.map +1 -1
  60. package/ui/button/index.d.ts +2 -2
  61. package/ui/core/properties/index.js +6 -6
  62. package/ui/core/properties/index.js.map +1 -1
  63. package/ui/core/view/index.android.d.ts +1 -1
  64. package/ui/core/view/index.android.js.map +1 -1
  65. package/ui/core/view/index.ios.js +39 -23
  66. package/ui/core/view/index.ios.js.map +1 -1
  67. package/ui/core/view/view-common.d.ts +5 -1
  68. package/ui/core/view/view-common.js +33 -12
  69. package/ui/core/view/view-common.js.map +1 -1
  70. package/ui/core/view/view-helper/index.d.ts +9 -9
  71. package/ui/core/view/view-helper/index.ios.d.ts +10 -0
  72. package/ui/core/view/view-helper/index.ios.js +99 -40
  73. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  74. package/ui/core/view-base/index.d.ts +454 -532
  75. package/ui/core/view-base/index.js +168 -5
  76. package/ui/core/view-base/index.js.map +1 -1
  77. package/ui/core/weak-event-listener/index.js.map +1 -1
  78. package/ui/dialogs/dialogs-common.js +1 -0
  79. package/ui/dialogs/dialogs-common.js.map +1 -1
  80. package/ui/dialogs/index.android.js +7 -9
  81. package/ui/dialogs/index.android.js.map +1 -1
  82. package/ui/editable-text-base/editable-text-base-common.js +1 -2
  83. package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
  84. package/ui/editable-text-base/index.android.js +2 -7
  85. package/ui/editable-text-base/index.android.js.map +1 -1
  86. package/ui/frame/fragment.transitions.d.ts +0 -4
  87. package/ui/frame/frame-common.d.ts +8 -2
  88. package/ui/frame/frame-common.js +11 -2
  89. package/ui/frame/frame-common.js.map +1 -1
  90. package/ui/frame/index.android.d.ts +2 -1
  91. package/ui/frame/index.android.js +26 -10
  92. package/ui/frame/index.android.js.map +1 -1
  93. package/ui/frame/index.d.ts +3 -3
  94. package/ui/frame/index.ios.js +58 -8
  95. package/ui/frame/index.ios.js.map +1 -1
  96. package/ui/gestures/gestures-common.js +5 -5
  97. package/ui/gestures/gestures-common.js.map +1 -1
  98. package/ui/gestures/index.android.js +3 -3
  99. package/ui/gestures/index.android.js.map +1 -1
  100. package/ui/gestures/index.d.ts +2 -2
  101. package/ui/gestures/index.ios.js +6 -6
  102. package/ui/gestures/index.ios.js.map +1 -1
  103. package/ui/gestures/touch-manager.d.ts +2 -2
  104. package/ui/image-cache/image-cache-common.d.ts +5 -5
  105. package/ui/image-cache/image-cache-common.js +2 -2
  106. package/ui/image-cache/image-cache-common.js.map +1 -1
  107. package/ui/image-cache/index.d.ts +3 -3
  108. package/ui/index.d.ts +8 -2
  109. package/ui/index.js +7 -2
  110. package/ui/index.js.map +1 -1
  111. package/ui/label/index.android.js +1 -0
  112. package/ui/label/index.android.js.map +1 -1
  113. package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +12 -12
  114. package/ui/layouts/grid-layout/grid-layout-common.d.ts +1 -1
  115. package/ui/layouts/root-layout/root-layout-common.js +45 -36
  116. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  117. package/ui/list-view/index.d.ts +6 -6
  118. package/ui/list-view/list-view-common.js +8 -2
  119. package/ui/list-view/list-view-common.js.map +1 -1
  120. package/ui/page/index.ios.d.ts +4 -1
  121. package/ui/page/index.ios.js +84 -58
  122. package/ui/page/index.ios.js.map +1 -1
  123. package/ui/page/page-common.d.ts +72 -39
  124. package/ui/placeholder/index.android.d.ts +2 -2
  125. package/ui/placeholder/index.d.ts +2 -2
  126. package/ui/repeater/index.js +2 -1
  127. package/ui/repeater/index.js.map +1 -1
  128. package/ui/scroll-view/scroll-view-common.d.ts +4 -4
  129. package/ui/scroll-view/scroll-view-common.js.map +1 -1
  130. package/ui/search-bar/index.d.ts +3 -3
  131. package/ui/segmented-bar/index.d.ts +2 -2
  132. package/ui/segmented-bar/segmented-bar-common.d.ts +2 -2
  133. package/ui/styling/background.ios.js +3 -0
  134. package/ui/styling/background.ios.js.map +1 -1
  135. package/ui/styling/css-animation-parser.d.ts +12 -7
  136. package/ui/styling/css-animation-parser.js +90 -36
  137. package/ui/styling/css-animation-parser.js.map +1 -1
  138. package/ui/styling/css-selector.d.ts +1 -1
  139. package/ui/styling/css-utils.d.ts +1 -0
  140. package/ui/styling/css-utils.js +12 -0
  141. package/ui/styling/css-utils.js.map +1 -0
  142. package/ui/styling/font-common.js +6 -6
  143. package/ui/styling/font-common.js.map +1 -1
  144. package/ui/styling/font-interfaces.d.ts +3 -3
  145. package/ui/styling/font.ios.js +2 -1
  146. package/ui/styling/font.ios.js.map +1 -1
  147. package/ui/styling/style/index.d.ts +3 -0
  148. package/ui/styling/style/index.js.map +1 -1
  149. package/ui/styling/style-properties.js +5 -13
  150. package/ui/styling/style-properties.js.map +1 -1
  151. package/ui/styling/style-scope.js +7 -5
  152. package/ui/styling/style-scope.js.map +1 -1
  153. package/ui/tab-view/index.d.ts +2 -2
  154. package/ui/tab-view/tab-view-common.d.ts +2 -2
  155. package/ui/text-base/index.ios.js +21 -4
  156. package/ui/text-base/index.ios.js.map +1 -1
  157. package/ui/text-base/span.js.map +1 -1
  158. package/ui/transition/fade-transition.d.ts +1 -3
  159. package/ui/transition/fade-transition.ios.d.ts +14 -1
  160. package/ui/transition/fade-transition.ios.js +60 -26
  161. package/ui/transition/fade-transition.ios.js.map +1 -1
  162. package/ui/transition/index.android.d.ts +5 -5
  163. package/ui/transition/index.android.js +7 -6
  164. package/ui/transition/index.android.js.map +1 -1
  165. package/ui/transition/index.d.ts +38 -14
  166. package/ui/transition/index.ios.d.ts +5 -10
  167. package/ui/transition/index.ios.js +8 -22
  168. package/ui/transition/index.ios.js.map +1 -1
  169. package/ui/transition/modal-transition.android.d.ts +5 -0
  170. package/ui/transition/modal-transition.android.js +7 -0
  171. package/ui/transition/modal-transition.android.js.map +1 -0
  172. package/ui/transition/modal-transition.d.ts +2 -0
  173. package/ui/transition/modal-transition.ios.d.ts +34 -0
  174. package/ui/transition/modal-transition.ios.js +160 -0
  175. package/ui/transition/modal-transition.ios.js.map +1 -0
  176. package/ui/transition/page-transition.android.d.ts +6 -0
  177. package/ui/transition/page-transition.android.js +182 -0
  178. package/ui/transition/page-transition.android.js.map +1 -0
  179. package/ui/transition/page-transition.d.ts +2 -0
  180. package/ui/transition/page-transition.ios.d.ts +34 -0
  181. package/ui/transition/page-transition.ios.js +181 -0
  182. package/ui/transition/page-transition.ios.js.map +1 -0
  183. package/ui/transition/shared-transition-helper.android.d.ts +5 -0
  184. package/ui/transition/shared-transition-helper.android.js +6 -0
  185. package/ui/transition/shared-transition-helper.android.js.map +1 -0
  186. package/ui/transition/shared-transition-helper.d.ts +10 -0
  187. package/ui/transition/shared-transition-helper.ios.d.ts +14 -0
  188. package/ui/transition/shared-transition-helper.ios.js +471 -0
  189. package/ui/transition/shared-transition-helper.ios.js.map +1 -0
  190. package/ui/transition/shared-transition.d.ts +230 -0
  191. package/ui/transition/shared-transition.js +192 -0
  192. package/ui/transition/shared-transition.js.map +1 -0
  193. package/ui/transition/slide-transition.android.d.ts +1 -1
  194. package/ui/transition/slide-transition.android.js +1 -1
  195. package/ui/transition/slide-transition.android.js.map +1 -1
  196. package/ui/transition/slide-transition.d.ts +1 -1
  197. package/ui/transition/slide-transition.ios.d.ts +15 -2
  198. package/ui/transition/slide-transition.ios.js +86 -52
  199. package/ui/transition/slide-transition.ios.js.map +1 -1
  200. package/ui/web-view/index.d.ts +3 -3
  201. package/ui/web-view/web-view-interfaces.d.ts +1 -1
  202. package/utils/index.d.ts +0 -82
  203. package/utils/mainthread-helper.android.js +2 -2
  204. package/utils/mainthread-helper.android.js.map +1 -1
  205. package/utils/native-helper.d.ts +35 -0
  206. package/utils/native-helper.ios.d.ts +13 -0
  207. package/utils/native-helper.ios.js +73 -0
  208. package/utils/native-helper.ios.js.map +1 -1
  209. package/utils/number-utils.d.ts +10 -0
  210. package/utils/number-utils.js +12 -0
  211. package/utils/number-utils.js.map +1 -1
  212. package/utils/typescript-utils.d.ts +6 -0
  213. package/xhr/index.js +28 -28
  214. package/xhr/index.js.map +1 -1
  215. package/xml/index.js.map +1 -1
  216. package/ui/frame/fragment.transitions.ios.d.ts +0 -2
  217. package/ui/frame/fragment.transitions.ios.js +0 -71
  218. package/ui/frame/fragment.transitions.ios.js.map +0 -1
@@ -1,557 +1,479 @@
1
+ import { AlignSelf, FlexGrow, FlexShrink, FlexWrapBefore, Order } from '../../layouts/flexbox-layout';
2
+ import { Page } from '../../page';
3
+ import { CoreTypes } from '../../../core-types';
1
4
  import { Property, CssProperty, CssAnimationProperty, InheritedProperty } from '../properties';
2
5
  import { BindingOptions } from '../bindable';
3
6
  import { Observable } from '../../../data/observable';
4
7
  import { Style } from '../../styling/style';
5
- import { CoreTypes } from '../../../core-types';
6
- import { Page } from '../../page';
7
-
8
- import { Order, FlexGrow, FlexShrink, FlexWrapBefore, AlignSelf } from '../../layouts/flexbox-layout';
9
- import { Length } from '../../styling/style-properties';
10
- import { DOMNode } from '../../../debugger/dom-node';
11
- import type { CustomTransitionModal } from '../../transition';
12
-
13
- /**
14
- * Iterates through all child views (via visual tree) and executes a function.
15
- * @param view - Starting view (parent container).
16
- * @param callback - A function to execute on every child. If function returns false it breaks the iteration.
17
- */
18
- export function eachDescendant(view: ViewBase, callback: (child: ViewBase) => boolean);
19
-
8
+ import type { ModalTransition } from '../../transition/modal-transition';
9
+ import * as dnm from '../../../debugger/dom-node';
10
+ import * as ssm from '../../styling/style-scope';
11
+ import { ViewBase as ViewBaseDefinition } from '.';
12
+ export interface ModalTransitionType {
13
+ name?: string;
14
+ instance?: ModalTransition;
15
+ duration?: number;
16
+ curve?: any;
17
+ }
18
+ export interface ShowModalOptions {
19
+ /**
20
+ * Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.
21
+ */
22
+ context: any;
23
+ /**
24
+ * A function that will be called when the view is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.
25
+ */
26
+ closeCallback: (...args: any[]) => void;
27
+ /**
28
+ * An optional parameter specifying whether to show the modal view in full-screen mode.
29
+ */
30
+ fullscreen?: boolean;
31
+ /**
32
+ * An optional parameter specifying whether to show the modal view with animation.
33
+ */
34
+ animated?: boolean;
35
+ /**
36
+ * An optional parameter specifying whether to stretch the modal view when not in full-screen mode.
37
+ */
38
+ stretched?: boolean;
39
+ /**
40
+ * An optional custom transition effect
41
+ */
42
+ transition?: ModalTransitionType;
43
+ /**
44
+ * An optional parameter that specify options specific to iOS as an object.
45
+ */
46
+ ios?: {
47
+ /**
48
+ * The UIModalPresentationStyle to be used when showing the dialog in iOS .
49
+ */
50
+ presentationStyle?: any;
51
+ /**
52
+ * width of the popup dialog
53
+ */
54
+ width?: number;
55
+ /**
56
+ * height of the popup dialog
57
+ */
58
+ height?: number;
59
+ };
60
+ android?: {
61
+ /**
62
+ * @deprecated Use ShowModalOptions.cancelable instead.
63
+ * An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
64
+ */
65
+ cancelable?: boolean;
66
+ /**
67
+ * An optional parameter specifying the windowSoftInputMode of the dialog window.
68
+ * For possible values see https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode
69
+ */
70
+ windowSoftInputMode?: number;
71
+ };
72
+ /**
73
+ * An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
74
+ */
75
+ cancelable?: boolean;
76
+ }
20
77
  /**
21
78
  * Gets an ancestor from a given type.
22
79
  * @param view - Starting view (child view).
23
80
  * @param criterion - The type of ancestor view we are looking for. Could be a string containing a class name or an actual type.
24
81
  * Returns an instance of a view (if found), otherwise undefined.
25
82
  */
26
- export function getAncestor(view: ViewBase, criterion: string | Function): ViewBase;
27
-
28
- export function isEventOrGesture(name: string, view: ViewBase): boolean;
29
-
83
+ export declare function getAncestor(view: ViewBaseDefinition, criterion: string | {
84
+ new (): any;
85
+ }): ViewBaseDefinition;
30
86
  /**
31
87
  * Gets a child view by id.
32
88
  * @param view - The parent (container) view of the view to look for.
33
89
  * @param id - The id of the view to look for.
34
90
  * Returns an instance of a view (if found), otherwise undefined.
35
91
  */
36
- export function getViewById(view: ViewBase, id: string): ViewBase;
37
-
92
+ export declare function getViewById(view: ViewBaseDefinition, id: string): ViewBaseDefinition;
38
93
  /**
39
94
  * Gets a child view by domId.
40
95
  * @param view - The parent (container) view of the view to look for.
41
96
  * @param domId - The id of the view to look for.
42
97
  * Returns an instance of a view (if found), otherwise undefined.
43
98
  */
44
- export function getViewByDomId(view: ViewBase, domId: number): ViewBase;
45
-
46
- export interface ModalTransition {
47
- name?: string;
48
- instance?: CustomTransitionModal;
49
- duration?: number;
50
- curve?: any;
51
- }
52
-
53
- export interface ShowModalOptions {
54
- /**
55
- * Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.
56
- */
57
- context: any;
58
-
59
- /**
60
- * A function that will be called when the view is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.
61
- */
62
- closeCallback: Function;
63
-
64
- /**
65
- * An optional parameter specifying whether to show the modal view in full-screen mode.
66
- */
67
- fullscreen?: boolean;
68
-
69
- /**
70
- * An optional parameter specifying whether to show the modal view with animation.
71
- */
72
- animated?: boolean;
73
-
74
- /**
75
- * An optional parameter specifying whether to stretch the modal view when not in full-screen mode.
76
- */
77
- stretched?: boolean;
78
-
79
- /**
80
- * An optional custom transition effect
81
- */
82
- transition?: ModalTransition;
83
-
84
- /**
85
- * An optional parameter that specify options specific to iOS as an object.
86
- */
87
- ios?: {
88
- /**
89
- * The UIModalPresentationStyle to be used when showing the dialog in iOS .
90
- */
91
- presentationStyle?: any /* UIModalPresentationStyle */;
92
- /**
93
- * width of the popup dialog
94
- */
95
- width?: number;
96
- /**
97
- * height of the popup dialog
98
- */
99
- height?: number;
100
- };
101
- android?: {
102
- /**
103
- * @deprecated Use ShowModalOptions.cancelable instead.
104
- * An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
105
- */
106
- cancelable?: boolean;
107
- /**
108
- * An optional parameter specifying the windowSoftInputMode of the dialog window
109
- * For possible values see https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode
110
- */
111
- windowSoftInputMode?: number;
112
- };
113
- /**
114
- * An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
115
- */
116
- cancelable?: boolean;
99
+ export declare function getViewByDomId(view: ViewBaseDefinition, domId: number): ViewBaseDefinition;
100
+ /**
101
+ * Gets a child view by selector.
102
+ * @param view - The parent (container) view of the view to look for.
103
+ * @param selector - The selector of the view to look for.
104
+ * Returns an instance of a view (if found), otherwise undefined.
105
+ */
106
+ export declare function querySelectorAll(view: ViewBaseDefinition, selector: string): Array<ViewBaseDefinition>;
107
+ /**
108
+ * Iterates through all child views (via visual tree) and executes a function.
109
+ * @param view - Starting view (parent container).
110
+ * @param callback - A function to execute on every child. If function returns false it breaks the iteration.
111
+ */
112
+ export declare function eachDescendant(view: ViewBaseDefinition, callback: (child: ViewBaseDefinition) => boolean): void;
113
+ declare enum SuspendType {
114
+ Incremental = 0,
115
+ Loaded = 1048576,
116
+ NativeView = 2097152,
117
+ UISetup = 4194304,
118
+ IncrementalCountMask = -7340033
117
119
  }
118
-
119
- export abstract class ViewBase extends Observable {
120
- // Dynamic properties.
121
- left: CoreTypes.LengthType;
122
- top: CoreTypes.LengthType;
123
- effectiveLeft: number;
124
- effectiveTop: number;
125
- dock: 'left' | 'top' | 'right' | 'bottom';
126
- row: number;
127
- col: number;
128
- /**
129
- * Setting `column` property is the same as `col`
130
- */
131
- column: number;
132
- rowSpan: number;
133
- colSpan: number;
134
- /**
135
- * Setting `columnSpan` property is the same as `colSpan`
136
- */
137
- columnSpan: number;
138
- domNode: DOMNode;
139
-
140
- order: Order;
141
- flexGrow: FlexGrow;
142
- flexShrink: FlexShrink;
143
- flexWrapBefore: FlexWrapBefore;
144
- alignSelf: AlignSelf;
145
-
146
- /**
147
- * @private
148
- * Module name when the view is a module root. Otherwise, it is undefined.
149
- */
150
- _moduleName?: string;
151
-
152
- //@private
153
- /**
154
- * @private
155
- */
156
- _oldLeft: number;
157
- /**
158
- * @private
159
- */
160
- _oldTop: number;
161
- /**
162
- * @private
163
- */
164
- _oldRight: number;
165
- /**
166
- * @private
167
- */
168
- _oldBottom: number;
169
- /**
170
- * @private
171
- */
172
- _defaultPaddingTop: number;
173
- /**
174
- * @private
175
- */
176
- _defaultPaddingRight: number;
177
- /**
178
- * @private
179
- */
180
- _defaultPaddingBottom: number;
181
- /**
182
- * @private
183
- */
184
- _defaultPaddingLeft: number;
185
-
186
- /**
187
- * A property bag holding suspended native updates.
188
- * Native setters that had to execute while there was no native view,
189
- * or the view was detached from the visual tree etc. will accumulate in this object,
190
- * and will be applied when all prerequisites are met.
191
- * @private
192
- */
193
- _suspendedUpdates: {
194
- [propertyName: string]: Property<any, any> | CssProperty<Style, any> | CssAnimationProperty<Style, any>;
195
- };
196
- //@endprivate
197
-
198
- /**
199
- * Shows the View contained in moduleName as a modal view.
200
- * @param moduleName - The name of the module to load starting from the application root.
201
- * @param modalOptions - A ShowModalOptions instance
202
- */
203
- showModal(moduleName: string, modalOptions?: ShowModalOptions): ViewBase;
204
-
205
- /**
206
- * Shows the view passed as parameter as a modal view.
207
- * @param view - View instance to be shown modally.
208
- * @param modalOptions - A ShowModalOptions instance
209
- */
210
- showModal(view: ViewBase, modalOptions?: ShowModalOptions): ViewBase;
211
-
212
- /**
213
- * Closes the current modal view that this page is showing.
214
- * @param context - Any context you want to pass back to the host when closing the modal view.
215
- */
216
- closeModal(context?: any): void;
217
-
218
- public effectiveMinWidth: number;
219
- public effectiveMinHeight: number;
220
- public effectiveWidth: number;
221
- public effectiveHeight: number;
222
- public effectiveMarginTop: number;
223
- public effectiveMarginRight: number;
224
- public effectiveMarginBottom: number;
225
- public effectiveMarginLeft: number;
226
- public effectivePaddingTop: number;
227
- public effectivePaddingRight: number;
228
- public effectivePaddingBottom: number;
229
- public effectivePaddingLeft: number;
230
- public effectiveBorderTopWidth: number;
231
- public effectiveBorderRightWidth: number;
232
- public effectiveBorderBottomWidth: number;
233
- public effectiveBorderLeftWidth: number;
234
-
235
- /**
236
- * String value used when hooking to loaded event.
237
- */
238
- public static loadedEvent: string;
239
-
240
- /**
241
- * String value used when hooking to unloaded event.
242
- */
243
- public static unloadedEvent: string;
244
-
245
- /**
246
- * String value used when hooking to creation event
247
- */
248
- public static createdEvent: string;
249
-
250
- /**
251
- * String value used when hooking to disposeNativeView event
252
- */
253
- public static disposeNativeViewEvent: string;
254
-
255
- public ios: any;
256
- public android: any;
257
-
258
- /**
259
- * returns the native UIViewController.
260
- */
261
- public viewController: any;
262
-
263
- /**
264
- * read-only. If you want to set out-of-band the nativeView use the setNativeView method.
265
- */
266
- public nativeViewProtected: any;
267
- public nativeView: any;
268
- public bindingContext: any;
269
-
270
- /**
271
- * Gets or sets if the view is reusable.
272
- * Reusable views are not automatically destroyed when removed from the View tree.
273
- */
274
- public reusable: boolean;
275
-
276
- /**
277
- * Gets the name of the constructor function for this instance. E.g. for a Button class this will return "Button".
278
- */
279
- public typeName: string;
280
-
281
- /**
282
- * Gets the parent view. This property is read-only.
283
- */
284
- public readonly parent: ViewBase;
285
-
286
- /**
287
- * Gets the template parent or the native parent. Sets the template parent.
288
- */
289
- public parentNode: ViewBase;
290
-
291
- /**
292
- * Gets or sets the id for this view.
293
- */
294
- public id: string;
295
-
296
- /**
297
- * Gets or sets the CSS class name for this view.
298
- */
299
- public className: string;
300
-
301
- /**
302
- * Gets owner page. This is a read-only property.
303
- */
304
- public readonly page: Page;
305
-
306
- /**
307
- * Gets the style object associated to this view.
308
- */
309
- public readonly style: Style;
310
-
311
- /**
312
- * Returns true if visibility is set to 'collapse'.
313
- * Readonly property
314
- */
315
- public isCollapsed: boolean;
316
- public readonly isLoaded: boolean;
317
-
318
- /**
319
- * Returns the child view with the specified id.
320
- */
321
- public getViewById<T extends ViewBase>(id: string): T;
322
-
323
- /**
324
- * Returns the child view with the specified domId.
325
- */
326
- public getViewByDomId<T extends ViewBase>(id: number): T;
327
-
328
- /**
329
- * Load view.
330
- * @param view to load.
331
- */
332
- public loadView(view: ViewBase): void;
333
-
334
- /**
335
- * Unload view.
336
- * @param view to unload.
337
- */
338
- public unloadView(view: ViewBase): void;
339
-
340
- public onLoaded(): void;
341
- public onUnloaded(): void;
342
- public onResumeNativeUpdates(): void;
343
-
344
- public bind(options: BindingOptions, source?: Object): void;
345
- public unbind(property: string): void;
346
-
347
- /**
348
- * Invalidates the layout of the view and triggers a new layout pass.
349
- */
350
- public requestLayout(): void;
351
-
352
- /**
353
- * Iterates over children of type ViewBase.
354
- * @param callback Called for each child of type ViewBase. Iteration stops if this method returns falsy value.
355
- */
356
- public eachChild(callback: (child: ViewBase) => boolean): void;
357
-
358
- public _addView(view: ViewBase, atIndex?: number): void;
359
- /**
360
- * Method is intended to be overridden by inheritors and used as "protected"
361
- */
362
- public _addViewCore(view: ViewBase, atIndex?: number): void;
363
-
364
- public _removeView(view: ViewBase): void;
365
- /**
366
- * Method is intended to be overridden by inheritors and used as "protected"
367
- */
368
- public _removeViewCore(view: ViewBase): void;
369
- public _parentChanged(oldParent: ViewBase): void;
370
- /**
371
- * Method is intended to be overridden by inheritors and used as "protected"
372
- */
373
- public _dialogClosed(): void;
374
- /**
375
- * Method is intended to be overridden by inheritors and used as "protected"
376
- */
377
- public _onRootViewReset(): void;
378
-
379
- _domId: number;
380
-
381
- _cssState: any /* "ui/styling/style-scope" */;
382
- /**
383
- * @private
384
- * Notifies each child's css state for change, recursively.
385
- * Either the style scope, className or id properties were changed.
386
- */
387
- _onCssStateChange(): void;
388
-
389
- public cssClasses: Set<string>;
390
- public cssPseudoClasses: Set<string>;
391
-
392
- public _goToVisualState(state: string): void;
393
-
394
- public setInlineStyle(style: string): void;
395
-
396
- _context: any /* android.content.Context */;
397
-
398
- /**
399
- * Setups the UI for ViewBase and all its children recursively.
400
- * This method should *not* be overridden by derived views.
401
- */
402
- _setupUI(context: any /* android.content.Context */, atIndex?: number): void;
403
-
404
- /**
405
- * Tears down the UI for ViewBase and all its children recursively.
406
- * This method should *not* be overridden by derived views.
407
- */
408
- _tearDownUI(force?: boolean): void;
409
-
410
- /**
411
- * Tears down the UI of a reusable node by making it no longer reusable.
412
- * @see _tearDownUI
413
- * @param forceDestroyChildren Force destroy the children (even if they are reusable)
414
- */
415
- destroyNode(forceDestroyChildren?: boolean): void;
416
-
417
- /**
418
- * Creates a native view.
419
- * Returns either android.view.View or UIView.
420
- */
421
- createNativeView(): Object;
422
-
423
- /**
424
- * Initializes properties/listeners of the native view.
425
- */
426
- initNativeView(): void;
427
-
428
- /**
429
- * Clean up references to the native view.
430
- */
431
- disposeNativeView(): void;
432
-
433
- /**
434
- * Resets properties/listeners set to the native view.
435
- */
436
- resetNativeView(): void;
437
-
438
- /**
439
- * Set the nativeView field performing extra checks and updates to the native properties on the new view.
440
- * Use in cases where the createNativeView is not suitable.
441
- * As an example use in item controls where the native parent view will create the native views for child items.
442
- */
443
- setNativeView(view: any): void;
444
-
445
- _isAddedToNativeVisualTree: boolean;
446
-
447
- /**
448
- * Performs the core logic of adding a child view to the native visual tree. Returns true if the view's native representation has been successfully added, false otherwise.
449
- */
450
- _addViewToNativeVisualTree(view: ViewBase, atIndex?: number): boolean;
451
- _removeViewFromNativeVisualTree(view: ViewBase): void;
452
- _childIndexToNativeChildIndex(index?: number): number;
453
-
454
- /**
455
- * @protected
456
- * @unstable
457
- * A widget can call this method to add a matching css pseudo class.
458
- */
459
- public addPseudoClass(name: string): void;
460
-
461
- /**
462
- * @protected
463
- * @unstable
464
- * A widget can call this method to discard matching css pseudo class.
465
- */
466
- public deletePseudoClass(name: string): void;
467
-
468
- /**
469
- * @unstable
470
- * Ensures a dom-node for this view.
471
- */
472
- public ensureDomNode();
473
-
474
- public recycleNativeView: 'always' | 'never' | 'auto';
475
-
476
- /**
477
- * @private
478
- */
479
- public _isPaddingRelative: boolean;
480
-
481
- /**
482
- * @private
483
- */
484
- public _ignoreFlexMinWidthHeightReset: boolean;
485
-
486
- public _styleScope: any;
487
-
488
- /**
489
- * @private
490
- */
491
- public _automaticallyAdjustsScrollViewInsets: boolean;
492
- /**
493
- * @private
494
- */
495
- _isStyleScopeHost: boolean;
496
-
497
- /**
498
- * @private
499
- */
500
- public _layoutParent(): void;
501
-
502
- /**
503
- * Determines the depth of suspended updates.
504
- * When the value is 0 the current property updates are not batched nor scoped and must be immediately applied.
505
- * If the value is 1 or greater, the current updates are batched and does not have to provide immediate update.
506
- * Do not set this field, the _batchUpdate method is responsible to keep the count up to date,
507
- * as well as adding/rmoving the view to/from the visual tree.
508
- */
509
- public _suspendNativeUpdatesCount: number;
510
-
511
- /**
512
- * Allow multiple updates to be performed on the instance at once.
513
- */
514
- public _batchUpdate<T>(callback: () => T): T;
515
- /**
516
- * @private
517
- */
518
- _setupAsRootView(context: any): void;
519
-
520
- /**
521
- * When returning true the callLoaded method will be run in setTimeout
522
- * Method is intended to be overridden by inheritors and used as "protected"
523
- */
524
- _shouldDelayLayout(): boolean;
525
-
526
- /**
527
- * @private
528
- */
529
- _inheritStyleScope(styleScope: any /* StyleScope */): void;
530
-
531
- /**
532
- * @private
533
- */
534
- callLoaded(): void;
535
-
536
- /**
537
- * @private
538
- */
539
- callUnloaded(): void;
540
- //@endprivate
120
+ declare namespace SuspendType {
121
+ function toString(type: SuspendType): string;
541
122
  }
542
-
543
- export class Binding {
544
- constructor(target: ViewBase, options: BindingOptions);
545
- public bind(source: Object): void;
546
- public unbind();
123
+ export declare abstract class ViewBase extends Observable implements ViewBaseDefinition {
124
+ /**
125
+ * String value used when hooking to loaded event.
126
+ */
127
+ static loadedEvent: string;
128
+ /**
129
+ * String value used when hooking to unloaded event.
130
+ */
131
+ static unloadedEvent: string;
132
+ /**
133
+ * String value used when hooking to creation event
134
+ */
135
+ static createdEvent: string;
136
+ /**
137
+ * String value used when hooking to disposeNativeView event
138
+ */
139
+ static disposeNativeViewEvent: string;
140
+ private _onLoadedCalled;
141
+ private _onUnloadedCalled;
142
+ private _iosView;
143
+ private _androidView;
144
+ private _style;
145
+ private _isLoaded;
146
+ private _visualState;
147
+ private _templateParent;
148
+ private __nativeView;
149
+ domNode: dnm.DOMNode;
150
+ recycleNativeView: 'always' | 'never' | 'auto';
151
+ /**
152
+ * returns the native UIViewController.
153
+ */
154
+ viewController: any;
155
+ bindingContext: any;
156
+ /**
157
+ * read-only. If you want to set out-of-band the nativeView use the setNativeView method.
158
+ */
159
+ nativeViewProtected: any;
160
+ /**
161
+ * Gets the parent view. This property is read-only.
162
+ */
163
+ parent: ViewBase;
164
+ /**
165
+ * Returns true if visibility is set to 'collapse'.
166
+ * Default(false) set in prototype
167
+ * Readonly property
168
+ */
169
+ isCollapsed: any;
170
+ /**
171
+ * Gets or sets the id for this view.
172
+ */
173
+ id: string;
174
+ /**
175
+ * Gets or sets the CSS class name for this view.
176
+ */
177
+ className: string;
178
+ /**
179
+ * Gets or sets the shared transition tag for animated view transitions
180
+ */
181
+ sharedTransitionTag: string;
182
+ /**
183
+ * Opt out of shared transition under different binding conditions
184
+ */
185
+ sharedTransitionIgnore: boolean;
186
+ _domId: number;
187
+ _context: any;
188
+ _isAddedToNativeVisualTree: boolean;
189
+ _cssState: ssm.CssState;
190
+ _styleScope: ssm.StyleScope;
191
+ /**
192
+ * A property bag holding suspended native updates.
193
+ * Native setters that had to execute while there was no native view,
194
+ * or the view was detached from the visual tree etc. will accumulate in this object,
195
+ * and will be applied when all prerequisites are met.
196
+ * @private
197
+ */
198
+ _suspendedUpdates: {
199
+ [propertyName: string]: Property<ViewBase, any> | CssProperty<Style, any> | CssAnimationProperty<Style, any>;
200
+ };
201
+ /**
202
+ * Determines the depth of suspended updates.
203
+ * When the value is 0 the current property updates are not batched nor scoped and must be immediately applied.
204
+ * If the value is 1 or greater, the current updates are batched and does not have to provide immediate update.
205
+ * Do not set this field, the _batchUpdate method is responsible to keep the count up to date,
206
+ * as well as adding/rmoving the view to/from the visual tree.
207
+ */
208
+ _suspendNativeUpdatesCount: number;
209
+ _isStyleScopeHost: boolean;
210
+ _automaticallyAdjustsScrollViewInsets: boolean;
211
+ left: CoreTypes.LengthType;
212
+ top: CoreTypes.LengthType;
213
+ effectiveLeft: number;
214
+ effectiveTop: number;
215
+ dock: 'left' | 'top' | 'right' | 'bottom';
216
+ row: number;
217
+ col: number;
218
+ column: number;
219
+ rowSpan: number;
220
+ colSpan: number;
221
+ columnSpan: number;
222
+ order: Order;
223
+ flexGrow: FlexGrow;
224
+ flexShrink: FlexShrink;
225
+ flexWrapBefore: FlexWrapBefore;
226
+ alignSelf: AlignSelf;
227
+ _oldLeft: number;
228
+ _oldTop: number;
229
+ _oldRight: number;
230
+ _oldBottom: number;
231
+ _ignoreFlexMinWidthHeightReset: boolean;
232
+ effectiveMinWidth: number;
233
+ effectiveMinHeight: number;
234
+ effectiveWidth: number;
235
+ effectiveHeight: number;
236
+ effectiveMarginTop: number;
237
+ effectiveMarginRight: number;
238
+ effectiveMarginBottom: number;
239
+ effectiveMarginLeft: number;
240
+ effectivePaddingTop: number;
241
+ effectivePaddingRight: number;
242
+ effectivePaddingBottom: number;
243
+ effectivePaddingLeft: number;
244
+ effectiveBorderTopWidth: number;
245
+ effectiveBorderRightWidth: number;
246
+ effectiveBorderBottomWidth: number;
247
+ effectiveBorderLeftWidth: number;
248
+ _defaultPaddingTop: number;
249
+ _defaultPaddingRight: number;
250
+ _defaultPaddingBottom: number;
251
+ _defaultPaddingLeft: number;
252
+ _isPaddingRelative: boolean;
253
+ /**
254
+ * @private
255
+ * Module name when the view is a module root. Otherwise, it is undefined.
256
+ */
257
+ _moduleName: string;
258
+ /**
259
+ * Gets or sets if the view is reusable.
260
+ * Reusable views are not automatically destroyed when removed from the View tree.
261
+ */
262
+ reusable: boolean;
263
+ constructor();
264
+ /**
265
+ * Gets the template parent or the native parent. Sets the template parent.
266
+ */
267
+ get parentNode(): ViewBase;
268
+ set parentNode(node: ViewBase);
269
+ get nativeView(): any;
270
+ set nativeView(value: any);
271
+ /**
272
+ * Gets the name of the constructor function for this instance. E.g. for a Button class this will return "Button".
273
+ */
274
+ get typeName(): string;
275
+ /**
276
+ * Gets the style object associated to this view.
277
+ */
278
+ get style(): Style;
279
+ set style(inlineStyle: Style);
280
+ get android(): any;
281
+ get ios(): any;
282
+ get isLoaded(): boolean;
283
+ get ['class'](): string;
284
+ set ['class'](v: string);
285
+ /**
286
+ * Returns the child view with the specified id.
287
+ */
288
+ getViewById<T extends ViewBaseDefinition>(id: string): T;
289
+ /**
290
+ * Returns the child view with the specified domId.
291
+ */
292
+ getViewByDomId<T extends ViewBaseDefinition>(domId: number): T;
293
+ /**
294
+ * Gets owner page. This is a read-only property.
295
+ */
296
+ get page(): Page;
297
+ /**
298
+ * @unstable
299
+ * Ensures a dom-node for this view.
300
+ */
301
+ ensureDomNode(): void;
302
+ set(name: string, value: any): void;
303
+ onLoaded(): void;
304
+ onUnloaded(): void;
305
+ _layoutParent(): void;
306
+ _suspendNativeUpdates(type: SuspendType): void;
307
+ _resumeNativeUpdates(type: SuspendType): void;
308
+ /**
309
+ * Allow multiple updates to be performed on the instance at once.
310
+ */
311
+ _batchUpdate<T>(callback: () => T): T;
312
+ private setFlag;
313
+ private isFlagSet;
314
+ private callFunctionWithSuper;
315
+ callLoaded(): void;
316
+ callUnloaded(): void;
317
+ private notifyPseudoClassChanged;
318
+ private pseudoClassAliases;
319
+ cssClasses: Set<string>;
320
+ cssPseudoClasses: Set<string>;
321
+ private getAllAliasedStates;
322
+ /**
323
+ * @protected
324
+ * @unstable
325
+ * A widget can call this method to add a matching css pseudo class.
326
+ */
327
+ addPseudoClass(name: string): void;
328
+ /**
329
+ * @protected
330
+ * @unstable
331
+ * A widget can call this method to discard matching css pseudo class.
332
+ */
333
+ deletePseudoClass(name: string): void;
334
+ private bindingContextChanged;
335
+ private bindings;
336
+ private shouldAddHandlerToParentBindingContextChanged;
337
+ private bindingContextBoundToParentBindingContextChanged;
338
+ bind(options: BindingOptions, source?: Object): void;
339
+ unbind(property: string): void;
340
+ private performLayout;
341
+ /**
342
+ * Invalidates the layout of the view and triggers a new layout pass.
343
+ */
344
+ requestLayout(): void;
345
+ /**
346
+ * Iterates over children of type ViewBase.
347
+ * @param callback Called for each child of type ViewBase. Iteration stops if this method returns falsy value.
348
+ */
349
+ eachChild(callback: (child: ViewBase) => boolean): void;
350
+ _addView(view: ViewBase, atIndex?: number): void;
351
+ /**
352
+ * Method is intended to be overridden by inheritors and used as "protected"
353
+ */
354
+ _addViewCore(view: ViewBase, atIndex?: number): void;
355
+ /**
356
+ * Load view.
357
+ * @param view to load.
358
+ */
359
+ loadView(view: ViewBase): void;
360
+ /**
361
+ * When returning true the callLoaded method will be run in setTimeout
362
+ * Method is intended to be overridden by inheritors and used as "protected"
363
+ */
364
+ _shouldDelayLayout(): boolean;
365
+ /**
366
+ * Unload view.
367
+ * @param view to unload.
368
+ */
369
+ unloadView(view: ViewBase): void;
370
+ /**
371
+ * Core logic for removing a child view from this instance. Used by the framework to handle lifecycle events more centralized. Do not use outside the UI Stack implementation.
372
+ */
373
+ _removeView(view: ViewBase): void;
374
+ /**
375
+ * Method is intended to be overridden by inheritors and used as "protected"
376
+ */
377
+ _removeViewCore(view: ViewBase): void;
378
+ /**
379
+ * Creates a native view.
380
+ * Returns either android.view.View or UIView.
381
+ */
382
+ createNativeView(): Object;
383
+ /**
384
+ * Clean up references to the native view.
385
+ */
386
+ disposeNativeView(): void;
387
+ /**
388
+ * Initializes properties/listeners of the native view.
389
+ */
390
+ initNativeView(): void;
391
+ /**
392
+ * Resets properties/listeners set to the native view.
393
+ */
394
+ resetNativeView(): void;
395
+ private resetNativeViewInternal;
396
+ _setupAsRootView(context: any): void;
397
+ /**
398
+ * Setups the UI for ViewBase and all its children recursively.
399
+ * This method should *not* be overridden by derived views.
400
+ */
401
+ _setupUI(context: any, atIndex?: number, parentIsLoaded?: boolean): void;
402
+ /**
403
+ * Set the nativeView field performing extra checks and updates to the native properties on the new view.
404
+ * Use in cases where the createNativeView is not suitable.
405
+ * As an example use in item controls where the native parent view will create the native views for child items.
406
+ */
407
+ setNativeView(value: any): void;
408
+ /**
409
+ * Tears down the UI of a reusable node by making it no longer reusable.
410
+ * @see _tearDownUI
411
+ * @param forceDestroyChildren Force destroy the children (even if they are reusable)
412
+ */
413
+ destroyNode(forceDestroyChildren?: boolean): void;
414
+ /**
415
+ * Tears down the UI for ViewBase and all its children recursively.
416
+ * This method should *not* be overridden by derived views.
417
+ */
418
+ _tearDownUI(force?: boolean): void;
419
+ _childIndexToNativeChildIndex(index?: number): number;
420
+ /**
421
+ * Performs the core logic of adding a child view to the native visual tree. Returns true if the view's native representation has been successfully added, false otherwise.
422
+ * Method is intended to be overridden by inheritors and used as "protected".
423
+ */
424
+ _addViewToNativeVisualTree(view: ViewBase, atIndex?: number): boolean;
425
+ /**
426
+ * Method is intended to be overridden by inheritors and used as "protected"
427
+ */
428
+ _removeViewFromNativeVisualTree(view: ViewBase): void;
429
+ _goToVisualState(state: string): void;
430
+ /**
431
+ * @deprecated
432
+ *
433
+ * This used to be the way to set attribute values in early {N} versions.
434
+ * Now attributes are expected to be set as plain properties on the view instances.
435
+ */
436
+ _applyXmlAttribute(attribute: string, value: string): boolean;
437
+ setInlineStyle(style: string): void;
438
+ _parentChanged(oldParent: ViewBase): void;
439
+ onResumeNativeUpdates(): void;
440
+ toString(): string;
441
+ /**
442
+ * @private
443
+ * Notifies each child's css state for change, recursively.
444
+ * Either the style scope, className or id properties were changed.
445
+ */
446
+ _onCssStateChange(): void;
447
+ _inheritStyleScope(styleScope: ssm.StyleScope): void;
448
+ /**
449
+ * Shows the view passed as parameter as a modal view.
450
+ * @param view - View instance to be shown modally.
451
+ * @param modalOptions - A ShowModalOptions instance
452
+ */
453
+ showModal(view: ViewBase, modalOptions?: ShowModalOptions): ViewBase;
454
+ /**
455
+ * Shows the View contained in moduleName as a modal view.
456
+ * @param moduleName - The name of the module to load starting from the application root.
457
+ * @param modalOptions - A ShowModalOptions instance
458
+ */
459
+ showModal(moduleName: string, modalOptions?: ShowModalOptions): ViewBase;
460
+ /**
461
+ * Closes the current modal view that this page is showing.
462
+ * @param context - Any context you want to pass back to the host when closing the modal view.
463
+ */
464
+ closeModal(...args: any[]): void;
465
+ /**
466
+ * Method is intended to be overridden by inheritors and used as "protected"
467
+ */
468
+ _dialogClosed(): void;
469
+ /**
470
+ * Method is intended to be overridden by inheritors and used as "protected"
471
+ */
472
+ _onRootViewReset(): void;
547
473
  }
548
-
549
- export const idProperty: Property<any, string>;
550
- export const classNameProperty: Property<any, string>;
551
- export const bindingContextProperty: InheritedProperty<any, any>;
552
-
553
- /**
554
- * Converts string into boolean value.
555
- * Throws error if value is not 'true' or 'false'.
556
- */
557
- export function booleanConverter(v: string): boolean;
474
+ export declare const bindingContextProperty: InheritedProperty<ViewBaseDefinition, any>;
475
+ export declare const hiddenProperty: Property<ViewBaseDefinition, boolean>;
476
+ export declare const classNameProperty: Property<ViewBaseDefinition, string>;
477
+ export declare const idProperty: Property<ViewBaseDefinition, string>;
478
+ export declare function booleanConverter(v: string | boolean): boolean;
479
+ export {};