1 | import * as React from 'react';
|
2 | import type { InnerProps } from './Filler';
|
3 | import type { ScrollBarDirectionType } from './ScrollBar';
|
4 | import type { RenderFunc, ExtraRenderInfo } from './interface';
|
5 | import type { ScrollPos, ScrollTarget } from './hooks/useScrollTo';
|
6 | export interface ScrollInfo {
|
7 | x: number;
|
8 | y: number;
|
9 | }
|
10 | export type ScrollConfig = ScrollTarget | ScrollPos;
|
11 | export type ScrollTo = (arg: number | ScrollConfig) => void;
|
12 | export type ListRef = {
|
13 | scrollTo: ScrollTo;
|
14 | getScrollInfo: () => ScrollInfo;
|
15 | };
|
16 | export interface ListProps<T> extends Omit<React.HTMLAttributes<any>, 'children'> {
|
17 | prefixCls?: string;
|
18 | children: RenderFunc<T>;
|
19 | data: T[];
|
20 | height?: number;
|
21 | itemHeight?: number;
|
22 |
|
23 | fullHeight?: boolean;
|
24 | itemKey: React.Key | ((item: T) => React.Key);
|
25 | component?: string | React.FC<any> | React.ComponentClass<any>;
|
26 | /** Set `false` will always use real scroll instead of virtual one */
|
27 | virtual?: boolean;
|
28 | direction?: ScrollBarDirectionType;
|
29 | /**
|
30 | * By default `scrollWidth` is same as container.
|
31 | * When set this, it will show the horizontal scrollbar and
|
32 | * `scrollWidth` will be used as the real width instead of container width.
|
33 | */
|
34 | scrollWidth?: number;
|
35 | onScroll?: React.UIEventHandler<HTMLElement>;
|
36 | /**
|
37 | * Given the virtual offset value.
|
38 | * It's the logic offset from start position.
|
39 | */
|
40 | onVirtualScroll?: (info: ScrollInfo) => void;
|
41 |
|
42 | onVisibleChange?: (visibleList: T[], fullList: T[]) => void;
|
43 |
|
44 | innerProps?: InnerProps;
|
45 |
|
46 | extraRender?: (info: ExtraRenderInfo) => React.ReactNode;
|
47 | }
|
48 | export declare function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>): React.JSX.Element;
|
49 | declare const _default: <Item = any>(props: ListProps<Item> & {
|
50 | ref?: React.Ref<ListRef>;
|
51 | }) => React.ReactElement;
|
52 | export default _default;
|