import * as react from 'react';
import { ReactNode, HTMLAttributes, MouseEventHandler } from 'react';
import { ButtonUnstyledProps } from '@mui/base/ButtonUnstyled';

interface SortLabelProps extends Omit<ButtonUnstyledProps, "disabled"> {
    active?: boolean;
    children?: ReactNode;
    className?: string;
    direction?: "asc" | "desc";
}

interface TableRowProps extends HTMLAttributes<HTMLDivElement> {
    asChild?: boolean;
    children: ReactNode;
    className?: string;
    onClick?: MouseEventHandler<HTMLDivElement>;
}

interface TableCellProps {
    align?: "left" | "right" | "center";
    children: ReactNode;
    className?: string;
    colSpan?: number;
    left?: number;
    onClick?: MouseEventHandler<HTMLDivElement>;
    right?: number;
    sticky?: boolean;
    width?: number;
}

interface TableSlotState {
    variant: "body" | "header";
}

interface TableSlotProps extends HTMLAttributes<HTMLDivElement> {
    children: ReactNode;
    className?: string;
    variant: TableSlotState["variant"];
}

interface TableProps {
    children: ReactNode;
    className?: string;
    noPadding?: boolean;
}
interface TableClasses {
    alignCenter: string;
    alignLeft: string;
    alignRight: string;
    clickable: string;
    firstStickyRight: string;
    lastStickyLeft: string;
    noPadding: string;
    root: string;
    sortActive: string;
    sortedAsc: string;
    sortedDesc: string;
    sortLabel: string;
    sticky: string;
    stickyLeft: string;
    stickyRight: string;
    tableBody: string;
    tableCell: string;
    tableCellHead: string;
    tableHeader: string;
    tableRow: string;
}

declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLDivElement>> & {
    Body: react.ForwardRefExoticComponent<Omit<TableSlotProps, "variant"> & react.RefAttributes<HTMLDivElement>>;
    Cell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLDivElement>>;
    Header: react.ForwardRefExoticComponent<Omit<TableSlotProps, "variant"> & react.RefAttributes<HTMLDivElement>>;
    Row: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLDivElement>>;
    SortLabel: react.ForwardRefExoticComponent<Omit<SortLabelProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
};

declare const tableClasses: TableClasses;

export { Table as T, TableProps as a, TableClasses as b, tableClasses as t };
