import { location, record } from '@synnaxlabs/x';
import { PropsWithChildren, ReactElement, RefCallback } from 'react';
export interface ItemSpec<K extends record.Key = record.Key> {
    key: K;
    index: number;
    translate?: number;
}
export interface DataContextValue<K extends record.Key = record.Key> {
    data: K[];
    getItems: () => ItemSpec<K>[];
    getTotalSize: () => number | undefined;
    itemHeight?: number;
}
export interface UtilContextValue<K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined> {
    ref: RefCallback<HTMLDivElement | null>;
    getItem?: (key: K) => E | undefined;
    subscribe?: (callback: () => void, key: K) => () => void;
    scrollToIndex: (index: number, direction?: location.Y) => void;
}
export interface FrameProps<K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined> extends PropsWithChildren, Pick<UtilContextValue<K, E>, "getItem" | "subscribe"> {
    data: K[];
    virtual?: boolean;
    overscan?: number;
    itemHeight?: number;
    onFetchMore?: () => void;
}
export declare const useUtilContext: <K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined>() => UtilContextValue<K, E>;
export declare const useScroller: <K extends record.Key = record.Key>() => Pick<UtilContextValue<K>, "scrollToIndex">;
export declare const useItem: <K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined>(key: K) => E | undefined;
export declare const useData: <K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined>() => DataContextValue<K> & UtilContextValue<K, E>;
export declare const CoreFrame: <K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined>({ virtual, ...rest }: FrameProps<K, E>) => ReactElement;
export declare const Frame: typeof CoreFrame;
//# sourceMappingURL=Frame.d.ts.map