UNPKG

@table-library/react-table-library

Version:
60 lines (59 loc) 2.06 kB
import * as React from 'react'; import { State, IdReducerFunctions, Modifier, Nullish } from '@table-library/react-table-library/types/common'; import { TableNode, GetRowProps, CellProps } from '@table-library/react-table-library/types/table'; export declare enum TreeExpandClickTypes { RowClick = 0, ButtonClick = 1 } export declare type CustomIcon<T extends TableNode> = React.ReactElement | ((node: T) => React.ReactElement) | Nullish; export declare type TreeOptionsIcon<T extends TableNode> = { margin?: string; size?: string; noIconMargin?: string; iconDefault?: CustomIcon<T>; iconRight?: CustomIcon<T>; iconDown?: CustomIcon<T>; }; export declare type TreeOptions<T extends TableNode> = { isServer?: boolean; treeIcon?: TreeOptionsIcon<T>; clickType?: TreeExpandClickTypes; indentation?: number; treeXLevel?: number; treeYLevel?: number; }; export declare type TreeOptionsIconSound<T extends TableNode> = { margin: string; size: string; noIconMargin: string; iconDefault: CustomIcon<T>; iconRight: CustomIcon<T>; iconDown: CustomIcon<T>; }; export declare type TreeOptionsSound<T extends TableNode> = { isServer: boolean; treeIcon: TreeOptionsIconSound<T>; clickType: TreeExpandClickTypes; indentation: number; treeXLevel: number; treeYLevel: number; }; export declare type ColumnTreePropsObject<T extends TableNode> = { treeIcon?: TreeOptionsIcon<T>; }; export declare type ColumnTreeProps<T extends TableNode> = ColumnTreePropsObject<T> | boolean; export declare type CellTreeProps<T extends TableNode> = { item: T; treeIcon?: TreeOptionsIcon<T>; children?: React.ReactNode; } & CellProps; export declare type Tree<T extends TableNode> = { state: State; fns: IdReducerFunctions<T>; options: TreeOptionsSound<T>; _getRowProps: GetRowProps<T>; modifier: Modifier<T>; components: { CellTree: React.FunctionComponent<CellTreeProps<T>>; }; };