import type { CSSProperties, ComponentInternalInstance, ExtractPropTypes, } from 'vue' export type Instance = ComponentInternalInstance export type StyleValue = string | CSSProperties | Array export type ScrollEvent = WheelEvent | MouseEvent export type Alignment = 'auto' | 'smart' | 'center' | 'start' | 'end' export type ItemSize = (idx: number) => number | number export type Direction = 'ltr' | 'rtl' export type LayoutDirection = 'horizontal' | 'vertical' export type RTLOffsetType = 'negative' | 'positive-descending' | 'positive-ascending'; export type ItemProps = { data: T style: CSSProperties scrolling?: boolean index: number } export type ListItem = { offset: number size: number } export type ListCache = { items: Record estimatedItemSize: number lastVisitedIndex: number clearCacheAfterIndex: (idx: number, forceUpdate?: boolean) => void } export type GridCache = { column: Record row: Record estimatedColumnWidth: number estimatedRowHeight: number lastVisitedColumnIndex: number lastVisitedRowIndex: number } export type ScrollDir = 'forwards' | 'backwards' export type ListItemSizer> = ( props: ExtractPropTypes, index: number, cache: ReturnType

) => number export type GetEstimatedTotalSize> = ( props: ExtractPropTypes, cache: ReturnType

) => number export type GetOffset> = ( props: ExtractPropTypes, idx: number, alignment: Alignment, offset: number, cache: ReturnType

, ) => number export type GetStartIndexForOffset> = ( props: ExtractPropTypes, offset: number, cache: ReturnType

, ) => number; export type GetStopIndexForStartIndex> = ( props: ExtractPropTypes, startIndex: number, scrollOffset: number, cache: ReturnType

, ) => number; export type PropValidator = (props: ExtractPropTypes) => void export type InitCacheFunc = (props: ExtractPropTypes, cache: Instance) => P export type InitListCacheFunc = InitCacheFunc export type InitGridCacheFunc = InitCacheFunc export type ListConstructorProps = InitListCacheFunc> = { name?: string getItemOffset: ListItemSizer getEstimatedTotalSize: GetEstimatedTotalSize getItemSize: ListItemSizer getOffset: GetOffset getStartIndexForOffset: GetStartIndexForOffset getStopIndexForStartIndex: GetStopIndexForStartIndex initCache: P clearCache: boolean validateProps: PropValidator } export type ExposesStates = { isScrolling: boolean updateRequested: boolean } export type SharedExposes = { windowRef: HTMLElement innerRef: HTMLElement getItemStyleCache: (_: any, __: any, ___: any) => CSSProperties } export type ListExposes = { scrollTo: (offset: number) => void scrollToItem: (idx: number, alignment?: Alignment) => void states: { scrollDir: Direction scrollOffset: number } & ExposesStates } & SharedExposes export type GridExposes = { states: { scrollLeft: number scrollTop: number xAxisScrollDir: Direction yAxisScrollDir: Direction } & ExposesStates scrollTo: (props: { scrollLeft: number scrollTop: number }) => void scrollToItem: (columnIndex?: number, rowIndex?: number, alignment?: Alignment) => void } & SharedExposes export type GetGridOffset> = ( props: ExtractPropTypes, index: number, alignment: Alignment, offset: number, cache: ReturnType

, scrollbarWidth: number, ) => number export type GetPosition> = ( props: ExtractPropTypes, index: number, cache: ReturnType

, ) => [number, number] export type GridConstructorProps = InitGridCacheFunc> = { name?: string // columns getter getColumnOffset: GetGridOffset getColumnPosition: GetPosition getColumnStartIndexForOffset: GetStartIndexForOffset getColumnStopIndexForStartIndex: GetStopIndexForStartIndex // grid meta getter getEstimatedTotalHeight: GetEstimatedTotalSize getEstimatedTotalWidth: GetEstimatedTotalSize // row getter getRowOffset: GetGridOffset getRowPosition: GetPosition getRowStartIndexForOffset: GetStartIndexForOffset getRowStopIndexForStartIndex: GetStopIndexForStartIndex // configs initCache: P clearCache: boolean validateProps: PropValidator }