From 1db1e81174d23984a636067a860b42de3a807084 Mon Sep 17 00:00:00 2001 From: Alexander Vakrilov Date: Mon, 17 Sep 2018 22:34:26 +0300 Subject: [PATCH] docs: document eachChild callback function (#6253) --- tns-core-modules/ui/core/view-base/view-base.d.ts | 8 ++++++++ tns-core-modules/ui/core/view/view.d.ts | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/core/view-base/view-base.d.ts b/tns-core-modules/ui/core/view-base/view-base.d.ts index e780386dc..e6298d714 100644 --- a/tns-core-modules/ui/core/view-base/view-base.d.ts +++ b/tns-core-modules/ui/core/view-base/view-base.d.ts @@ -253,7 +253,15 @@ export abstract class ViewBase extends Observable { public bind(options: BindingOptions, source?: Object): void; public unbind(property: string): void; + /** + * Invalidates the layout of the view and triggers a new layout pass. + */ public requestLayout(): void; + + /** + * Iterates over children of type ViewBase. + * @param callback Called for each child of type ViewBase. Iteration stops if this method returns falsy value. + */ public eachChild(callback: (child: ViewBase) => boolean): void; public _addView(view: ViewBase, atIndex?: number): void; diff --git a/tns-core-modules/ui/core/view/view.d.ts b/tns-core-modules/ui/core/view/view.d.ts index b475e60e6..ceeaf8796 100644 --- a/tns-core-modules/ui/core/view/view.d.ts +++ b/tns-core-modules/ui/core/view/view.d.ts @@ -576,7 +576,11 @@ export abstract class View extends ViewBase { _getNativeViewsCount(): number; _eachLayoutView(callback: (View) => void): void; - + + /** + * Iterates over children of type View. + * @param callback Called for each child of type View. Iteration stops if this method returns falsy value. + */ public eachChildView(callback: (view: View) => boolean): void; //@private