import { IAnalytics } from '@procore/core-react';
import { ColumnApi, GridApi, IServerSideGetRowsParams } from 'ag-grid-community';
import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/dist/styles/ag-theme-alpine.css';
import React from 'react';
import { RowSize } from './constants';
import { IFilterStorage, IServerFilter } from './FilterRenderers';
import { BulkEditResult } from './Panels/BulkEdit';
import { ISearchStorage } from './QuickControls/ServerSideSearch';
import { useNextFilterState as useFilterState } from './state/useFilterState';
import { ColumnDefinition, ContextPanelApi, CustomBulkEditorFields, CustomFilter, DataTableConfig, FilterComponents, GetRowHeightWithFooters, ISearchState, NestedColumnDefinition, ServerSideGetRowsParams, TableApi, TablePanelProps, TableProps, UpdateServerSideDataSourceParams } from './types';
interface DataTableTranslations {
    loadingLabel?: string;
    searchEmptyStateTitle?: string;
    tableName?: string;
}
export interface InternalTableContext {
    analytics?: AnalyticsConfig;
    columnApi?: ColumnApi;
    columnDefinitions: ColumnDefinition[];
    contextPanel: ContextPanelApi;
    customBulkEditorFields?: CustomBulkEditorFields;
    getRowHeight: GetRowHeightWithFooters;
    getRowId?: DataTableProps['getRowId'];
    gridApi?: GridApi;
    initialTableConfig?: DataTableConfig;
    filterState: ReturnType<typeof useFilterState>;
    filterStorage: IFilterStorage;
    onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
    onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
    updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
    onTableConfigChange: () => void;
    rowHeight: RowSize;
    searchStorage: ISearchStorage;
    selectedGroupIndex?: string | null;
    setColumnApi: (columnApi: ColumnApi) => void;
    setGridApi: (gridApi: GridApi) => void;
    setIsGridReady: (isGridReady: boolean) => void;
    setRowHeight: (rowHeight: RowSize, createTrackEvent?: boolean, triggerTableConfigChange?: boolean) => void;
    tableRef: React.RefObject<TableApi> | null;
    filterComponents: FilterComponents;
    getColumnDefinition: (field: string) => ColumnDefinition | undefined;
    totalRowCount: number;
    setTotalRowCount: React.Dispatch<React.SetStateAction<number>>;
    pagination: {
        currentPage: number;
    };
    setPagination: React.Dispatch<React.SetStateAction<{
        currentPage: number;
    }>>;
    setSelectedGroupIndex?: React.Dispatch<React.SetStateAction<string | null>>;
}
export declare const useInternalTableContext: () => InternalTableContext;
export interface DataTableProps {
    analytics?: AnalyticsConfig;
    columnDefinitions: (ColumnDefinition | NestedColumnDefinition)[];
    /**
     * Getter for row id, used in bulk actions
     */
    getRowId?: (rowData: any) => number | string;
    initialTableConfig?: DataTableConfig;
    onTableConfigChange?: (config: DataTableConfig) => void;
    onServerSideDataRequest?: (params: ServerSideGetRowsParams) => void;
    /**
     * Callback after bulk edit action is performed.
     * Each object in the array represents a selected row with
     * the updated values
     */
    onBulkEditUpdate?: (rows: BulkEditResult[]) => Promise<void>;
    translations?: DataTableTranslations;
    customFilters?: CustomFilter[];
    customBulkEditorFields?: CustomBulkEditorFields;
}
export interface AnalyticsClient extends IAnalytics {
    sendAllEvents: () => Promise<void>;
    addEvent: IAnalytics['trackEvent'];
}
export interface AnalyticsConfig {
    client: AnalyticsClient;
    clientName: string;
}
export declare const DataTable: ({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, translations, customFilters, }: React.PropsWithChildren<DataTableProps>) => JSX.Element;
export declare function getServerSideDatasource(onServerSideDataRequestCallback: DataTableProps['onServerSideDataRequest'], onEmptyResponseCallback: (() => void) | undefined, onNonEmptyResponseCallback: (() => void) | undefined, filters: IServerFilter[], search: ISearchState, setTableTotalRowCount: React.Dispatch<React.SetStateAction<number>>): {
    getRows: (params: IServerSideGetRowsParams) => Promise<void>;
};
export declare const Table: React.FC<TableProps>;
export declare const ContextPanel: React.FC<TablePanelProps>;
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, translations, customFilters, }: React.PropsWithChildren<DataTableProps>) => JSX.Element) & {
    BulkActions: React.FunctionComponent<React.PropsWithChildren<import("./BulkActions/BulkActions").BulkActionProps>>;
    BulkEditActionButton: React.FunctionComponent<import("./BulkActions/BulkEditActionButton").ActionButtonProp>;
    ConfigPanelButton: React.FC<{}>;
    ContextPanel: React.FC<TablePanelProps>;
    QuickControls: React.FunctionComponent<import("./QuickControls/QuickControls").QuickControlsProps>;
    QuickFilters: React.FunctionComponent<{}>;
    RowGroupSelector: React.FC<{
        localeText: {
            reset: string;
            placeholder: string;
            selectedItemsPrefix?: string | undefined;
        };
    }>;
    Search: React.FunctionComponent<import("./QuickControls/Search").SearchProps>;
    Table: React.FC<TableProps<any, any>>;
    FiltersPanel: React.FunctionComponent<TablePanelProps>;
    NextFiltersPanel: React.FunctionComponent<TablePanelProps>;
    NextQuickFilters: React.FunctionComponent<{}>;
};
export default _default;
