import { location, record } from '@synnaxlabs/x';
import { PropsWithChildren, ReactElement, RefCallback } from 'react';
/**
 * Function interface for getting items from a list by key(s).
 *
 * @template K The type of the key (must be a record key)
 * @template E The type of the entity (must be keyed by K)
 */
export interface GetItem<K extends record.Key, E extends record.Keyed<K> | undefined> extends GetSingleItem<K, E>, GetMultipleItems<K, E> {
}
export interface GetSingleItem<K extends record.Key, E extends record.Keyed<K> | undefined> {
    (key: K): E | undefined;
}
export interface GetMultipleItems<K extends record.Key, E extends record.Keyed<K> | undefined> {
    (keys: K[]): E[];
}
export declare const createGetItem: <K extends record.Key, E extends record.Keyed<K> | undefined>(first: GetSingleItem<K, E>, second: GetMultipleItems<K, E>) => GetItem<K, E>;
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;
    sentinelRef?: RefCallback<HTMLDivElement>;
}
export interface UtilContextValue<K extends record.Key = record.Key, E extends record.Keyed<K> | undefined = record.Keyed<K> | undefined> {
    ref: RefCallback<HTMLDivElement | null>;
    getItem?: GetItem<K, E>;
    subscribe?: (callback: () => void, key: K) => () => void;
    scrollToIndex: (index: number, direction?: location.Y) => 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 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 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 BaseFrame: <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 BaseFrame;
//# sourceMappingURL=Frame.d.ts.map