tdesign-vue
Version:
26 lines (25 loc) • 849 B
TypeScript
import { Ref } from '@vue/composition-api';
import { TScroll } from '../common';
export declare type UseVirtualScrollParams = Ref<{
data: {
[key: string]: any;
}[];
scroll: TScroll;
}>;
export interface ScrollToElementParams {
index: number;
top?: number;
time?: number;
behavior?: 'auto' | 'smooth';
}
declare const useVirtualScroll: (container: Ref<HTMLElement>, params: UseVirtualScrollParams) => {
visibleData: Ref<any[]>;
translateY: Ref<number>;
scrollHeight: Ref<number>;
isVirtualScroll: import("@vue/composition-api").ComputedRef<boolean>;
handleScroll: () => void;
handleRowMounted: (rowData: any) => void;
scrollToElement: (p: ScrollToElementParams) => void;
};
export declare type VirtualScrollConfig = ReturnType<typeof useVirtualScroll>;
export default useVirtualScroll;