import { DataEditorProps, DataEditorRef, GridSelection } from '@glideapps/glide-data-grid';
import * as io from 'io-ts';
import React, { CSSProperties } from 'react';
import { MenuItem } from '../../kit/Dropdown';
import { type Theme as HewTheme } from '../../kit/Theme';
import { Loadable } from '../../kit/utils/loadable';
import { ColumnDef } from './columns';
import { ContextMenuCompleteHandlerProps, ContextMenuComponentProps } from './contextMenu';
import '@glideapps/glide-data-grid/dist/index.css';
declare const directionType: io.KeyofC<{
    asc: null;
    desc: null;
}>;
export type DirectionType = io.TypeOf<typeof directionType>;
export declare const validSort: io.TypeC<{
    column: io.StringC;
    direction: io.KeyofC<{
        asc: null;
        desc: null;
    }>;
}>;
export type ValidSort = io.TypeOf<typeof validSort>;
declare const sort: io.PartialC<{
    column: io.StringC;
    direction: io.KeyofC<{
        asc: null;
        desc: null;
    }>;
}>;
export type Sort = io.TypeOf<typeof sort>;
/**
 * Glide Table Theme Reference
 * https://github.com/glideapps/glide-data-grid/blob/main/packages/core/API.md#theme
 */
export declare const getTheme: (appTheme: HewTheme) => DataEditorProps['theme'];
export interface DataGridHandle {
    gridRef?: DataEditorRef;
    scrollToTop: () => void;
}
interface DataGridCommonProps<T, ContextAction = void | string, ContextActionData = void> {
    columns: ColumnDef<T>[];
    renderContextMenuComponent?: (props: ContextMenuComponentProps<T, ContextAction, ContextActionData>) => JSX.Element;
    data: Loadable<T>[];
    /** return a color value to use for each row */
    getRowAccentColor?: (rowData: T) => string;
    getHeaderMenuItems?: (columnId: string, colIdx: number) => MenuItem[];
    height?: CSSProperties['height'];
    /** only display pinned columns */
    hideUnpinned?: boolean;
    onColumnResize?: (columnId: string, width: number) => void;
    onContextMenuComplete?: ContextMenuCompleteHandlerProps<ContextAction, ContextActionData>;
    onPinnedColumnsCountChange?: (count: number) => void;
    onSelectionChange?: HandleSelectionChangeType;
    onColumnsOrderChange?: (newColumnsOrder: string[]) => void;
    pinnedColumnsCount?: number;
    imperativeRef?: React.Ref<DataGridHandle>;
    rowHeight?: number;
    selection?: GridSelection;
    /** only used to draw correct arrow icon in header */
    sorts?: Sort[];
    /** always static columns, such as a checkbox column for row selection */
    staticColumns: string[];
    smoothScrollX?: boolean;
    smoothScrollY?: boolean;
}
interface Paginated {
    /** is displaying one page of results at a time, without infinite scroll */
    infiniteScroll?: false;
    total?: number;
    onPageUpdate?: (page: number) => void;
    page?: number;
    pageSize?: number;
}
interface InfiniteScroll {
    infiniteScroll?: true;
    /** total number of row items, for infinite scroll  */
    total: number;
    /** update page number, for infinite scroll */
    onPageUpdate: (page: number) => void;
    /** page number, for infinite scroll */
    page: number;
    /** pageSize, for infinite scroll */
    pageSize: number;
}
export type DataGridProps<T, ContextAction = void | string, ContextActionData = void> = DataGridCommonProps<T, ContextAction, ContextActionData> & (InfiniteScroll | Paginated);
export type RangelessSelectionType = 'add-all' | 'remove-all';
export type SelectionType = 'add' | 'remove' | 'set';
export interface HandleSelectionChangeType {
    (selectionType: RangelessSelectionType): void;
    (selectionType: SelectionType, range: [number, number]): void;
}
export declare function DataGrid<T, ContextAction = void | string, ContextActionData = void>({ columns, data, getHeaderMenuItems, getRowAccentColor, hideUnpinned, height, onColumnResize, onContextMenuComplete, onPinnedColumnsCountChange, onSelectionChange, onColumnsOrderChange, infiniteScroll, page, pageSize, onPageUpdate, pinnedColumnsCount, renderContextMenuComponent, rowHeight, selection, total, imperativeRef, sorts, staticColumns, smoothScrollX, smoothScrollY, }: DataGridProps<T, ContextAction, ContextActionData>): JSX.Element;
export default DataGrid;
//# sourceMappingURL=DataGrid.d.ts.map