import { default as React, ReactNode } from 'react';
import { BoxProps } from '@mantine/core';
export interface VirtualListItem {
    id: string | number;
    [key: string]: any;
}
export interface ArchbaseVirtualListProps<T extends VirtualListItem> extends Omit<BoxProps, 'children'> {
    /** Array de itens */
    items: T[];
    /** Altura de cada item em pixels */
    itemHeight: number;
    /** Altura do container */
    height: number | string;
    /** Largura do container */
    width?: number | string;
    /** Quantidade de itens extras para renderizar (overscan) */
    overscan?: number;
    /** Renderizador de item */
    renderItem: (item: T, index: number, style: React.CSSProperties) => ReactNode;
    /** Callback ao alcançar o final */
    onEndReached?: () => void;
    /** Threshold para onEndReached (em pixels) */
    endReachedThreshold?: number;
    /** Estado de carregamento */
    loading?: boolean;
    /** Componente de loading */
    loadingComponent?: ReactNode;
    /** Mensagem quando vazio */
    emptyMessage?: string;
    /** Componente quando vazio */
    emptyComponent?: ReactNode;
    /** Renderizar header */
    header?: ReactNode;
    /** Renderizar footer */
    footer?: ReactNode;
    /** Callback ao scrollar */
    onScroll?: (scrollTop: number) => void;
    /** Scroll inicial */
    initialScrollTop?: number;
    /** Estilo dos itens */
    itemStyle?: React.CSSProperties;
    /** Gap entre itens */
    gap?: number;
    /** Key extractor */
    keyExtractor?: (item: T, index: number) => string | number;
}
export interface ArchbaseVirtualListRef {
    scrollToIndex: (index: number, align?: 'start' | 'center' | 'end') => void;
    scrollToTop: () => void;
    scrollToBottom: () => void;
    getScrollTop: () => number;
}
declare function ArchbaseVirtualListInner<T extends VirtualListItem>({ items, itemHeight, height, width, overscan, renderItem, onEndReached, endReachedThreshold, loading, loadingComponent, emptyMessage, emptyComponent, header, footer, onScroll, initialScrollTop, itemStyle, gap, keyExtractor, ...boxProps }: ArchbaseVirtualListProps<T>, ref: React.Ref<ArchbaseVirtualListRef>): import("react/jsx-runtime").JSX.Element;
export declare const ArchbaseVirtualList: <T extends VirtualListItem>(props: ArchbaseVirtualListProps<T> & {
    ref?: React.Ref<ArchbaseVirtualListRef>;
}) => ReturnType<typeof ArchbaseVirtualListInner>;
export interface ArchbaseVirtualGridProps<T extends VirtualListItem> extends Omit<BoxProps, 'children'> {
    /** Array de itens */
    items: T[];
    /** Largura de cada item */
    itemWidth: number;
    /** Altura de cada item */
    itemHeight: number;
    /** Altura do container */
    height: number | string;
    /** Gap entre itens */
    gap?: number;
    /** Overscan de linhas */
    overscan?: number;
    /** Renderizador de item */
    renderItem: (item: T, index: number, style: React.CSSProperties) => ReactNode;
    /** Callback ao alcançar o final */
    onEndReached?: () => void;
    /** Threshold para onEndReached */
    endReachedThreshold?: number;
    /** Estado de carregamento */
    loading?: boolean;
    /** Mensagem quando vazio */
    emptyMessage?: string;
    /** Key extractor */
    keyExtractor?: (item: T, index: number) => string | number;
}
export declare function ArchbaseVirtualGrid<T extends VirtualListItem>({ items, itemWidth, itemHeight, height, gap, overscan, renderItem, onEndReached, endReachedThreshold, loading, emptyMessage, keyExtractor, ...boxProps }: ArchbaseVirtualGridProps<T>): import("react/jsx-runtime").JSX.Element;
export interface ArchbaseInfiniteListProps<T extends VirtualListItem> extends Omit<ArchbaseVirtualListProps<T>, 'onEndReached'> {
    /** Função para carregar mais itens */
    loadMore: () => Promise<void>;
    /** Se há mais itens para carregar */
    hasMore: boolean;
    /** Erro ao carregar */
    error?: string | null;
    /** Componente de erro */
    errorComponent?: ReactNode;
    /** Callback para retry */
    onRetry?: () => void;
}
export declare function ArchbaseInfiniteList<T extends VirtualListItem>({ loadMore, hasMore, error, errorComponent, onRetry, loading, ...props }: ArchbaseInfiniteListProps<T>): import("react/jsx-runtime").JSX.Element;
export interface UseVirtualListOptions<T> {
    items: T[];
    itemHeight: number;
    containerHeight: number;
    overscan?: number;
    gap?: number;
}
export declare function useVirtualList<T>({ items, itemHeight, containerHeight, overscan, gap, }: UseVirtualListOptions<T>): {
    totalHeight: number;
    visibleItems: {
        item: T;
        index: number;
        style: React.CSSProperties;
    }[];
    handleScroll: (event: React.UIEvent<HTMLDivElement>) => void;
    scrollToIndex: (index: number, align?: "start" | "center" | "end") => number;
    scrollTop: number;
    setScrollTop: React.Dispatch<React.SetStateAction<number>>;
};
export default ArchbaseVirtualList;
