1 |
|
2 |
|
3 | import { ReactNode, Component, ComponentType } from 'react';
|
4 | import { LoadingProps } from '../loading';
|
5 | import CommonProps from '../util';
|
6 |
|
7 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
8 | title?: any
|
9 | }
|
10 |
|
11 | export interface ListProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
12 | |
13 |
|
14 |
|
15 | header?: ReactNode,
|
16 | |
17 |
|
18 |
|
19 | footer?: ReactNode,
|
20 | |
21 |
|
22 |
|
23 | size?: 'medium' | 'small',
|
24 | |
25 |
|
26 |
|
27 | divider?: boolean,
|
28 | |
29 |
|
30 |
|
31 | children?: ReactNode;
|
32 | dataSource?: any[];
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 | renderItem?: (current: any, index: number) => any;
|
39 | loading?: boolean;
|
40 | |
41 |
|
42 |
|
43 |
|
44 | loadingComponent?: (props: LoadingProps) => ReactNode;
|
45 | emptyContent?: ReactNode;
|
46 | }
|
47 |
|
48 | export interface ListItemProps extends HTMLAttributesWeak, CommonProps {
|
49 | |
50 |
|
51 |
|
52 | title?: ReactNode,
|
53 | |
54 |
|
55 |
|
56 | description?: ReactNode,
|
57 | |
58 |
|
59 |
|
60 | media?: ReactNode,
|
61 | |
62 |
|
63 |
|
64 | extra?: ReactNode,
|
65 | }
|
66 |
|
67 | export default class List extends Component<ListProps, any> {
|
68 | static Item: ComponentType<ListItemProps>;
|
69 | }
|