UNPKG

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