This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-19 17:44:04 +08:00

38 lines
1.1 KiB
TypeScript

import { View, Superview, NativeViewModel } from "../ui/view";
import { Stack } from "./layouts";
import { BridgeContext } from "../runtime/global";
export declare class ListItem extends Stack {
/**
* Set to reuse native view
*/
identifier?: string;
}
export declare class List extends Superview {
private cachedViews;
allSubviews(): IterableIterator<ListItem> | ListItem[];
itemCount: number;
renderItem: (index: number) => ListItem;
batchCount: number;
onLoadMore?: () => void;
loadMore?: boolean;
loadMoreView?: ListItem;
onScroll?: (offset: {
x: number;
y: number;
}) => void;
onScrollEnd?: (offset: {
x: number;
y: number;
}) => void;
scrolledPosition?: number;
scrollToItem(context: BridgeContext, index: number, config?: {
animated?: boolean;
}): Promise<any>;
reset(): void;
private getItem;
private renderBunchedItems;
toModel(): NativeViewModel;
}
export declare function list(config: Partial<List>): List;
export declare function listItem(item: View | View[], config?: Partial<ListItem>): ListItem;