///
import { ComponentProps } from 'react';
import { ComponentType } from 'react';
import { Context } from 'react';
import { ElementType } from 'react';
import { PropsWithChildren } from 'react';
import { ReactElement } from 'react';
import { ReactNode } from 'react';
export declare type Accessor = string | ((row: D) => C);
export declare function ArrayOutput(props: ArrayOutputProps): JSX.Element;
declare interface ArrayOutputOwnProps {
value: ReadonlyArray;
getKey?: (value: V, index: number) => string | number;
}
export declare type ArrayOutputProps = PropsWithChildren<
ArrayOutputOwnProps
>;
export declare function Cell<
C extends ComponentType = ComponentType,
A extends Accessor = Accessor,
>(props: CellProps): JSX.Element;
declare interface CellOwnProps<
C extends ComponentType,
A extends Accessor,
> {
accessor: A | null;
TdProps?: Partial>;
tdEl?: ReactElement;
}
export declare type CellProps<
C extends ComponentType,
A extends Accessor,
> = PropsWithChildren>;
export declare function Children(props: ChildrenProps): JSX.Element;
declare type ChildrenContextType = ReactNode;
declare interface ChildrenOwnProps {}
declare type ChildrenProps = ChildrenOwnProps;
export declare function ChildrenProvider(
props: ChildrenProviderProps,
): JSX.Element;
declare interface ChildrenProviderOwnProps {
value: ChildrenContextType;
}
declare type ChildrenProviderProps =
PropsWithChildren;
export declare function Column<
C extends ComponentType = ComponentType,
H extends ComponentType = ComponentType,
A extends Accessor = Accessor,
>(props: ColumnProps): JSX.Element;
declare interface ColumnOwnProps<
C extends ComponentType,
H extends ComponentType,
A extends Accessor,
> {
header?: ReactNode;
accessor?: A | null;
TdProps?: Partial>;
ThProps?: Partial>;
tdEl?: ReactElement;
thEl?: ReactElement;
}
export declare type ColumnProps<
C extends ComponentType,
H extends ComponentType,
A extends Accessor,
> = PropsWithChildren>;
export declare function Columns(props: ColumnsProps): JSX.Element | null;
export declare namespace Columns {
var __COLUMNS__: boolean;
}
export declare const ColumnsContext: Context;
export declare type ColumnsNode = ReactNode;
declare interface ColumnsOwnProps {
part?: string;
}
export declare type ColumnsProps = PropsWithChildren;
export declare function ColumnsProvider(
props: ColumnsProviderProps,
): JSX.Element;
declare interface ColumnsProviderOwnProps {
value: ColumnsNode;
}
export declare type ColumnsProviderProps =
PropsWithChildren;
export declare interface ColumnsType {
__COLUMNS__: true;
}
export declare type Content = V;
export declare const ContentContext: Context | undefined>;
export declare function ContentProvider(
props: ContentProviderProps,
): JSX.Element;
declare interface ContentProviderOwnProps {
value: Content;
}
export declare type ContentProviderProps = PropsWithChildren<
ContentProviderOwnProps
>;
export declare function ContentValue(
props: ContentValueProps,
): JSX.Element;
declare interface ContentValueOwnProps {
accessor: Accessor | null;
}
export declare type ContentValueProps = PropsWithChildren<
ContentValueOwnProps
>;
export declare type CurrentValue = V;
export declare const CurrentValueContext: Context<
CurrentValue | undefined
>;
export declare function CurrentValueProvider(
props: CurrentValueProviderProps,
): JSX.Element;
export declare type CurrentValueProviderProps = PropsWithChildren<
ItemProviderOwnProps
>;
export declare type Data = ReadonlyArray;
export declare const DataContext: Context | undefined>;
export declare function DataProvider(
props: DataProviderProps,
): JSX.Element;
declare interface DataProviderOwnProps {
value: Data;
}
export declare type DataProviderProps = PropsWithChildren<
DataProviderOwnProps
>;
export declare function DataTable(props: DataTableProps): JSX.Element;
declare interface DataTableOwnProps {
data?: ReadonlyArray;
}
export declare type DataTableProps = PropsWithChildren>;
export declare function DefaultContent(
props: DefaultContentProps,
): JSX.Element;
declare interface DefaultContentOwnProps {}
export declare type DefaultContentProps = PropsWithChildren<
DefaultContentOwnProps
>;
export declare const defaultTableComponents: TableComponents;
export declare function findColumns(
children: ReactNode,
): ReactNode;
export declare function getValue(data: D, accessor: null): null;
export declare function getValue(data: D, accessor: Accessor): C;
export declare function getValue(
data: D,
accessor: Accessor | null,
): C | null;
export declare function HeaderCell(
props: HeaderCellProps,
): JSX.Element;
declare interface HeaderCellOwnProps {
ThProps?: Partial>;
thEl?: ReactElement;
}
export declare type HeaderCellProps =
PropsWithChildren>;
export declare function HeaderRow(
props: HeaderRowProps,
): JSX.Element;
declare interface HeaderRowOwnProps {
TrProps?: Partial>;
trEl?: ReactElement;
}
export declare type HeaderRowProps = PropsWithChildren<
HeaderRowOwnProps
>;
export declare type Index = number;
export declare const IndexContext: Context;
export declare function IndexProvider(props: IndexProviderProps): JSX.Element;
declare interface IndexProviderOwnProps {
value: Index;
}
export declare type IndexProviderProps =
PropsWithChildren;
export declare function isColumnsType(
type: any,
): type is ColumnsType;
declare interface ItemProviderOwnProps {
value: CurrentValue;
}
export declare function Row(
props: RowProps,
): JSX.Element;
export declare type RowData = V;
export declare const RowDataContext: Context | undefined>;
export declare function RowDataProvider(
props: RowDataProviderProps,
): JSX.Element;
declare interface RowDataProviderOwnProps {
value: RowData;
}
export declare type RowDataProviderProps = PropsWithChildren<
RowDataProviderOwnProps
>;
declare interface RowOwnProps {
row?: D;
TrProps?: Partial>;
trEl?: ReactElement;
}
export declare type RowProps = PropsWithChildren<
RowOwnProps
>;
export declare function Rows(props: RowsProps): JSX.Element;
declare interface RowsOwnProps {
keyAccessor?: Accessor;
data?: ReadonlyArray;
}
export declare type RowsProps = PropsWithChildren>;
export declare function Table(
props: TableProps,
): JSX.Element;
export declare function TableBody(
props: TableBodyProps,
): JSX.Element;
declare interface TableBodyOwnProps {
TbodyProps?: Partial>;
tbodyEl?: ReactElement;
}
export declare type TableBodyProps<
D,
C extends ComponentType,
> = PropsWithChildren>;
export declare interface TableComponents {
Table: ElementType;
Thead: ElementType;
Tbody: ElementType;
Tr: ElementType;
Th: ElementType;
Td: ElementType;
}
export declare const TableComponentsContext: Context;
export declare function TableComponentsProvider(
props: TableComponentsProviderProps,
): JSX.Element;
declare interface TableComponentsProviderOwnProps {
value: TableComponents;
}
export declare type TableComponentsProviderProps =
PropsWithChildren;
declare interface TableElements {
table: ReactElement;
thead: ReactElement;
tbody: ReactElement;
tr: ReactElement;
th: ReactElement;
td: ReactElement;
}
export declare const TableElementsContext: Context;
export declare function TableElementsProvider(
props: TableElementsProviderProps,
): JSX.Element;
declare interface TableElementsProviderOwnProps {
value: TableElements;
}
declare type TableElementsProviderProps =
PropsWithChildren;
export declare function TableHeader(
props: TableHeaderProps,
): JSX.Element;
declare interface TableHeaderOwnProps {
TheadProps?: Partial>;
theadEl?: ReactElement;
}
export declare type TableHeaderProps =
PropsWithChildren>;
declare interface TableOwnProps {
TableProps?: Partial>;
tableEl?: ReactElement;
}
export declare type TablePart = TablePartType;
export declare const TablePartContext: Context;
export declare function TablePartProvider(
props: TablePartProviderProps,
): JSX.Element;
declare interface TablePartProviderOwnProps {
value: TablePart;
}
export declare type TablePartProviderProps =
PropsWithChildren;
export declare type TablePartType = 'definition' | 'header' | 'body';
export declare type TableProps = PropsWithChildren<
TableOwnProps
>;
export declare function useChildren(): ChildrenContextType;
export declare function UseColumns(props: UseColumnsProps): JSX.Element;
export declare function useColumns(): ColumnsNode;
declare interface UseColumnsOwnProps {
part?: string;
}
export declare type UseColumnsProps = PropsWithChildren;
export declare function useContent(): Content;
export declare function useContentValue(accessor: null): null;
export declare function useContentValue(accessor: Accessor): C;
export declare function useContentValue(
accessor: Accessor | null,
): C | null;
export declare function useCurrentValue(value?: V): CurrentValue;
export declare function useData(value?: ReadonlyArray): Data;
export declare function useIndex(): Index;
export declare function useRowData(): RowData;
export declare function useTableComponents(): TableComponents;
export declare function useTableElements(): TableElements;
export declare function useTablePart(): TablePart;
export declare function withDefaultChildren<
TProps extends {
children?: ReactNode;
},
C extends ComponentType | keyof JSX.IntrinsicElements,
>(Cmp: C): ComponentType>;
export {};