import { CellContext, PaginationInstance as ReactTablePaginationInstance, SortingColumn } from "@tanstack/react-table"; import { ComponentType, ReactNode } from "react"; import React from "react"; import { PaginationTableConfig, TableConfig } from "./core"; import { FilterDefinition, FilterState, PaginationState } from "./core/types"; import { FetcherState } from "./fetcher"; import { CheckFilterDef, CheckFilterState, SearchFilterDef, SearchFilterState, SelectFilterDef, SelectFilterState } from "./filtering"; type RelevantFetcherState = Pick, "isLoading" | "error">; export interface TableComponentProps { children: ReactNode; fetcherState: RelevantFetcherState; tableConfig: TableConfig; } export interface FilterProps { filterDefinition: FD; filter?: FS; setFilter: (filter: FS["value"] | ((value: FS["value"]) => void)) => void; props?: any; } export type HeaderProps = TableComponentProps & SortingColumn; type TableComponent = ComponentType; type HeaderComponent = ComponentType; export interface PaginationProps { paginationConfig: PaginationTableConfig; paginationMethods: Omit, "getPrePaginationRowModel" | "getPaginationRowModel" | "_getPaginationRowModel" | "_autoResetPageIndex">; paginationState: PaginationState; position: "top" | "bottom" | "custom"; } export interface TooltipProps { children: ReactNode; text: string; } export interface LinkProps { children: ReactNode; href: string; } export interface TableUI { Table: TableComponent; TableHead: TableComponent; TableHeadRow: TableComponent; TableHeadCell: HeaderComponent; TableBody: TableComponent; TableRow: TableComponent; TableCell: TableComponent; TablePagination?: ComponentType; SelectFilter?: ComponentType>; SearchFilter?: ComponentType>; CheckFilter?: ComponentType>; } export type TableusConfig = Pick & { tableUI: TableUI; EmptyValue?: (() => ReactNode) | string | number | null | undefined; DateCell?: (props: CellContext) => ReactNode; DatetimeCell?: (props: CellContext) => ReactNode; TimeCell?: (props: CellContext) => ReactNode; Link?: ComponentType; Tooltip?: ComponentType; }; interface Context { config: TableusConfig; } export declare const TableusContext: React.Context; export declare const TableusContextProvider: ({ config, children, }: { config: TableusConfig; children: ReactNode; }) => React.JSX.Element; export {}; //# sourceMappingURL=context.d.ts.map