import React, { ReactElement, ReactNode } from "react"; import { DataDownloadProps } from "../DataDownload.js"; import { TableOptions } from "react-table"; /** * Adapted from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-table/react-table-tests.tsx * For more inspiration see https://codesandbox.io/s/github/ggascoigne/react-table-example?file=/src/Table/Table.tsx:0-62 * See react-table-config.d.ts for full merged types * @types/react-table README has more info on this approach */ declare module "react-table" { /** * Types for Table component. As the library is plugin-based, so are the community types * This module combines the @types/react-table base and plugin types and re-exports them with the same name * This is possible through "interface merging", as long as the type signature stays the same * The Table component that imports 'react-table' will find and use this extended module automatically * Custom properties we support on our Table component are also included. * Adjust this module as feature needs change or if react-library has breaking changes! * Unused plugings are commented out */ interface TableOptions extends UseExpandedOptions, UseGlobalFiltersOptions, UsePaginationOptions, UseSortByOptions { /** Optional method to pass style. Added to table element */ className?: string; data: D[]; /** Function called for each table header allowing style/className/role props to be overridden */ headerProps?: (header: HeaderGroup) => TableCommonProps; /** Function called for each table column allowing style/className/role props to be overridden */ columnProps?: (column: Column) => TableCommonProps; /** Function called for each table row allowing style/className/role props to be overridden */ rowProps?: (row: Row) => TableCommonProps; /** Function called for each table cell allowing style/className/role props to be overridden */ cellProps?: (cell: Cell) => TableCommonProps; /** Toolbar title */ title?: string | ReactNode; /** Enable toolbar with download option */ downloadEnabled?: boolean; downloadFilename?: DataDownloadProps["filename"]; downloadFormats?: DataDownloadProps["formats"]; } interface Hooks extends UseExpandedHooks, UseGroupByHooks, UseRowSelectHooks, UseSortByHooks { } interface TableInstance extends UseColumnOrderInstanceProps, UseExpandedInstanceProps, UseFiltersInstanceProps, UseGlobalFiltersInstanceProps, UseGroupByInstanceProps, UsePaginationInstanceProps, UseRowSelectInstanceProps, UseRowStateInstanceProps, UseSortByInstanceProps { } interface TableState extends UseColumnOrderState, UseExpandedState, UseFiltersState, UseGlobalFiltersState, UseGroupByState, UsePaginationState, UseResizeColumnsState, UseRowSelectState, UseRowStateState, UseSortByState { } interface ColumnInterface extends UseFiltersColumnOptions, UseGlobalFiltersColumnOptions, UseGroupByColumnOptions, UseResizeColumnsColumnOptions, UseSortByColumnOptions, TableCommonProps { } interface ColumnInstance extends UseFiltersColumnProps, UseGroupByColumnProps, UseResizeColumnsColumnProps, UseSortByColumnProps, TableCommonProps { } interface Cell extends UseGroupByCellProps, UseRowStateCellProps { } interface Row extends UseExpandedRowProps, UseGroupByRowProps, UseRowSelectRowProps, UseRowStateRowProps { } } export { Column, Row, TableOptions } from "react-table"; export declare const TableStyled: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit, HTMLDivElement>, never>> & string; /** * Table component suited to geoprocessing client reports. * Builds on the `react-table` useTable hook and re-exports its interface, * so reference those API docs to suit your needs. * @param props * @returns */ export declare function Table(props: TableOptions): ReactElement; export default Table;