UNPKG

1.95 kBTypeScriptView Raw
1import * as React from 'react';
2import { SpinProps } from '../spin';
3import { PaginationConfig } from '../pagination';
4export { ListItemProps, ListItemMetaProps } from './Item';
5export declare type ColumnCount = number;
6export declare type ColumnType = 'gutter' | 'column' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
7export interface ListGridType {
8 gutter?: number;
9 column?: ColumnCount;
10 xs?: ColumnCount;
11 sm?: ColumnCount;
12 md?: ColumnCount;
13 lg?: ColumnCount;
14 xl?: ColumnCount;
15 xxl?: ColumnCount;
16}
17export declare type ListSize = 'small' | 'default' | 'large';
18export declare type ListItemLayout = 'horizontal' | 'vertical';
19export interface ListProps<T> {
20 bordered?: boolean;
21 className?: string;
22 style?: React.CSSProperties;
23 children?: React.ReactNode;
24 dataSource?: T[];
25 extra?: React.ReactNode;
26 grid?: ListGridType;
27 id?: string;
28 itemLayout?: ListItemLayout;
29 loading?: boolean | SpinProps;
30 loadMore?: React.ReactNode;
31 pagination?: PaginationConfig | false;
32 prefixCls?: string;
33 rowKey?: ((item: T) => string) | string;
34 renderItem?: (item: T, index: number) => React.ReactNode;
35 size?: ListSize;
36 split?: boolean;
37 header?: React.ReactNode;
38 footer?: React.ReactNode;
39 locale?: ListLocale;
40}
41export interface ListLocale {
42 emptyText: React.ReactNode | (() => React.ReactNode);
43}
44export interface ListConsumerProps {
45 grid?: any;
46 itemLayout?: string;
47}
48export declare const ListContext: React.Context<ListConsumerProps>;
49export declare const ListConsumer: React.Consumer<ListConsumerProps>;
50declare function List<T>({ pagination, prefixCls: customizePrefixCls, bordered, split, className, children, itemLayout, loadMore, grid, dataSource, size, header, footer, loading, rowKey, renderItem, locale, ...rest }: ListProps<T>): JSX.Element;
51declare namespace List {
52 var Item: import("./Item").ListItemTypeProps;
53}
54export default List;
55
\No newline at end of file