import type { Identifier, Order } from "natural-orderby";
import type { JSX, ReactNode, RefObject } from "react";
import type { tableNames } from "../constants/names.js";
import type { Account, FixedIncome, FixedIncomeType, GroupTransaction, ServiceProviderFeeType, SPV } from "./state.js";
export type ColumnCountByTableWidth = Record<number, number>;
export type SortDirection = "asc" | "desc";
export type ItemData = string | number | Date | null | undefined;
export type Item = Record<string, any>;
export type TableItem<TItem extends Item> = TItem & {
    id: string;
    itemNumber: number;
    moreDetails?: null;
};
export type TableColumn = {
    key: string;
    label: ReactNode | null;
    allowSorting?: boolean;
    isSpecialColumn?: boolean;
    isNumberColumn?: boolean;
    decimalScale?: number;
    displayTime?: boolean;
};
export type TableBaseProps = {
    columns: TableColumn[];
    ref: RefObject<HTMLDivElement | null>;
    tableData: TableItemType<TableName>[] | undefined;
    renderRow: (item: TableItemType<TableName>, columns: TableColumn[], index: number) => JSX.Element;
    onClickSort: (key: string, direction: SortDirection) => void;
    children?: ReactNode;
    footer?: ReactNode;
    headerRef: RefObject<HTMLTableSectionElement | null>;
    maxHeight?: string;
    hasSelectedItem?: boolean;
    specialFirstRow?: (columns: TableColumn[]) => JSX.Element;
    specialLastRow?: (columns: TableColumn[]) => JSX.Element;
};
export type TableProps = {
    tableName: TableName;
    tableData: TableItemType<TableName>[] | undefined;
    columnCountByTableWidth?: ColumnCountByTableWidth;
    sortHandler: (column: Identifier<TableItemType<TableName>>, direction: Order) => void;
    specialFirstRow?: (columns: TableColumn[]) => JSX.Element;
    specialLastRow?: (columns: TableColumn[]) => JSX.Element;
};
export type Operation = "view" | "create" | "edit" | null;
export type GroupTransactionsTableData = GroupTransaction & {
    typeLabel: string;
    asset: string | null | undefined;
    quantity: number | null | undefined;
    cashAmount: number | null | undefined;
    totalFees: number;
    cashBalanceChange: number;
};
export type ServiceProviderFeeTypeTableData = ServiceProviderFeeType & {
    accountName: string | null | undefined;
    accountReference: string | null | undefined;
};
export type AssetsTableData = FixedIncome & {
    currentValue: number | null | undefined;
};
export type TableDataByTableName = {
    SERVICE_PROVIDER_FEE_TYPE: ServiceProviderFeeTypeTableData;
    FIXED_INCOME_TYPE: FixedIncomeType;
    ACCOUNT: Account;
    TRANSACTION: GroupTransactionsTableData;
    ASSET: AssetsTableData;
    SPV: SPV;
};
export type TableName = keyof typeof tableNames;
export type TableItemType<TTableName extends TableName> = TableItem<TableDataByTableName[TTableName]>;
//# sourceMappingURL=table.d.ts.map