@akylas/nativescript 8.9.6 → 8.9.7

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