UNPKG

2.48 kBTypeScriptView Raw
1import { LayoutBase } from '../layouts/layout-base';
2import { View, CustomLayoutView, Template, KeyedTemplate } from '../core/view';
3import { Property } from '../core/properties';
4import { ChangedData } from '../../data/observable-array';
5export interface ItemsSource {
6 length: number;
7 getItem(index: number): any;
8}
9/**
10 * Represents a UI Repeater component.
11 */
12export declare class Repeater extends CustomLayoutView {
13 static knownFunctions: string[];
14 private _isDirty;
15 private _itemTemplateSelector;
16 private _itemTemplateSelectorBindable;
17 ios: any;
18 android: any;
19 constructor();
20 onLoaded(): void;
21 /**
22 * Gets or set the items collection of the Repeater.
23 * The items property can be set to an array or an object defining length and getItem(index) method.
24 */
25 items: any[] | ItemsSource;
26 /**
27 * Gets or set the item template of the Repeater.
28 */
29 itemTemplate: string | Template;
30 /**
31 * Gets or set the item templates of the Repeater.
32 */
33 itemTemplates: string | Array<KeyedTemplate>;
34 /**
35 * Gets or set the items layout of the Repeater. Default value is StackLayout with orientation="vertical".
36 */
37 itemsLayout: LayoutBase;
38 get itemTemplateSelector(): string | ((item: any, index: number, items: any) => string);
39 set itemTemplateSelector(value: string | ((item: any, index: number, items: any) => string));
40 _requestRefresh(): void;
41 /**
42 * Forces the Repeater to reload all its items.
43 */
44 refresh(): void;
45 _onItemsChanged(data: ChangedData<any>): void;
46 _getDefaultItemContent(index: number): View;
47 private _getDataItem;
48 get _childrenCount(): number;
49 eachChildView(callback: (child: View) => boolean): void;
50 onLayout(left: number, top: number, right: number, bottom: number): void;
51 onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
52}
53/**
54 * Represents the item template property of each Repeater instance.
55 */
56export declare const itemTemplateProperty: Property<Repeater, string | Template>;
57/**
58 * Represents the items template property of each Repeater instance.
59 */
60export declare const itemTemplatesProperty: Property<Repeater, string | KeyedTemplate[]>;
61/**
62 * Represents the property backing the items property of each Repeater instance.
63 */
64export declare const itemsProperty: Property<Repeater, any[] | ItemsSource>;
65export declare const itemsLayoutProperty: Property<Repeater, LayoutBase>;