amis-rpc-design/node_modules/rc-virtual-list/es/interface.d.ts
2023-10-07 19:42:30 +08:00

26 lines
726 B
TypeScript

/// <reference types="react" />
export type RenderFunc<T> = (item: T, index: number, props: {
style?: React.CSSProperties;
}) => React.ReactNode;
export interface SharedConfig<T> {
getKey: (item: T) => React.Key;
}
export type GetKey<T> = (item: T) => React.Key;
export type GetSize = (startKey: React.Key, endKey?: React.Key) => {
top: number;
bottom: number;
};
export interface ExtraRenderInfo {
/** Virtual list start line */
start: number;
/** Virtual list end line */
end: number;
/** Is current in virtual render */
virtual: boolean;
/** Used for `scrollWidth` tell the horizontal offset */
offsetX: number;
offsetY: number;
rtl: boolean;
getSize: GetSize;
}