import { BodyCell } from './bodyCells.js';
import type { FlatColumn } from './columns.js';
import { TableComponent } from './tableComponent.js';
import type { AnyPlugins } from './types/TablePlugin.js';
import { type Readable } from 'svelte/store';
/**
 * Initialization options for creating a BodyRow.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export type BodyRowInit<Item, Plugins extends AnyPlugins = AnyPlugins> = {
    id: string;
    cells: BodyCell<Item, Plugins>[];
    cellForId: Record<string, BodyCell<Item, Plugins>>;
    depth?: number;
    parentRow?: BodyRow<Item, Plugins>;
};
/**
 * HTML attributes for a body row element.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export type BodyRowAttributes<Item, Plugins extends AnyPlugins = AnyPlugins> = {
    role: 'row';
};
/**
 * Abstract base class representing a row in the table body.
 * Extended by DataBodyRow for data rows and DisplayBodyRow for display-only rows.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export declare abstract class BodyRow<Item, Plugins extends AnyPlugins = AnyPlugins> extends TableComponent<Item, Plugins, 'tbody.tr'> {
    cells: BodyCell<Item, Plugins>[];
    /**
     * Get the cell with a given column id.
     *
     * **This includes hidden cells.**
     */
    cellForId: Record<string, BodyCell<Item, Plugins>>;
    depth: number;
    parentRow?: BodyRow<Item, Plugins>;
    subRows?: BodyRow<Item, Plugins>[];
    constructor({ id, cells, cellForId, depth, parentRow }: BodyRowInit<Item, Plugins>);
    attrs(): Readable<BodyRowAttributes<Item, Plugins>>;
    abstract clone(props?: BodyRowCloneProps): BodyRow<Item, Plugins>;
    /**
     * Type guard to check if this row is a data row.
     *
     * @returns True if this is a DataBodyRow.
     */
    isData(): this is DataBodyRow<Item, Plugins>;
    /**
     * Type guard to check if this row is a display row.
     *
     * @returns True if this is a DisplayBodyRow.
     */
    isDisplay(): this is DisplayBodyRow<Item, Plugins>;
}
/**
 * Options for cloning a BodyRow.
 */
type BodyRowCloneProps = {
    /** Whether to clone the cells as well. */
    includeCells?: boolean;
    /** Whether to recursively clone sub-rows. */
    includeSubRows?: boolean;
};
/**
 * Initialization options for creating a DataBodyRow.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export type DataBodyRowInit<Item, Plugins extends AnyPlugins = AnyPlugins> = BodyRowInit<Item, Plugins> & {
    /** Unique identifier for the data item. */
    dataId: string;
    /** The original data item. */
    original: Item;
};
/**
 * A body row that contains actual data from the data source.
 * Provides access to the original data item and a unique data ID.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export declare class DataBodyRow<Item, Plugins extends AnyPlugins = AnyPlugins> extends BodyRow<Item, Plugins> {
    __data: boolean;
    /** Unique identifier for the data item. */
    dataId: string;
    /** The original data item from the data source. */
    original: Item;
    /**
     * Creates a new DataBodyRow.
     *
     * @param init - Initialization options.
     */
    constructor({ id, dataId, original, cells, cellForId, depth, parentRow }: DataBodyRowInit<Item, Plugins>);
    /**
     * Creates a copy of this row with optional deep cloning of cells and sub-rows.
     *
     * @param props - Cloning options.
     * @returns A cloned DataBodyRow.
     */
    clone({ includeCells, includeSubRows }?: BodyRowCloneProps): DataBodyRow<Item, Plugins>;
}
/**
 * Initialization options for creating a DisplayBodyRow.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export type DisplayBodyRowInit<Item, Plugins extends AnyPlugins = AnyPlugins> = BodyRowInit<Item, Plugins>;
/**
 * A body row used for display purposes only (e.g., grouped rows, aggregate rows).
 * Does not contain direct data from the data source.
 *
 * @template Item - The type of data items in the table.
 * @template Plugins - The plugins used by the table.
 */
export declare class DisplayBodyRow<Item, Plugins extends AnyPlugins = AnyPlugins> extends BodyRow<Item, Plugins> {
    __display: boolean;
    /**
     * Creates a new DisplayBodyRow.
     *
     * @param init - Initialization options.
     */
    constructor({ id, cells, cellForId, depth, parentRow }: DisplayBodyRowInit<Item, Plugins>);
    /**
     * Creates a copy of this row with optional deep cloning of cells and sub-rows.
     *
     * @param props - Cloning options.
     * @returns A cloned DisplayBodyRow.
     */
    clone({ includeCells, includeSubRows }?: BodyRowCloneProps): DisplayBodyRow<Item, Plugins>;
}
/**
 * Options for creating body rows from data.
 *
 * @template Item - The type of data items.
 */
export interface BodyRowsOptions<Item> {
    /** Optional function to generate a unique ID for each data item. */
    rowDataId?: (item: Item, index: number) => string;
}
/**
 * Converts an array of items into an array of table `BodyRow`s based on the column structure.
 * @param data The data to display.
 * @param flatColumns The column structure.
 * @returns An array of `BodyRow`s representing the table structure.
 */
export declare const getBodyRows: <Item, Plugins extends AnyPlugins = AnyPlugins>(data: Item[], 
/**
 * Flat columns before column transformations.
 */
flatColumns: FlatColumn<Item, Plugins>[], { rowDataId }?: BodyRowsOptions<Item>) => DataBodyRow<Item, Plugins>[];
/**
 * Arranges and hides columns in an array of `BodyRow`s based on
 * `columnIdOrder` by transforming the `cells` property of each row.
 *
 * `cellForId` should remain unaffected.
 *
 * @param rows The rows to transform.
 * @param columnIdOrder The column order to transform to.
 * @returns A new array of `BodyRow`s with corrected row references.
 */
export declare const getColumnedBodyRows: <Item, Plugins extends AnyPlugins = AnyPlugins>(rows: DataBodyRow<Item, Plugins>[], columnIdOrder: string[]) => DataBodyRow<Item, Plugins>[];
/**
 * Converts an array of items into an array of table `BodyRow`s based on a parent row.
 * @param subItems The sub data to display.
 * @param parentRow The parent row.
 * @returns An array of `BodyRow`s representing the child rows of `parentRow`.
 */
export declare const getSubRows: <Item, Plugins extends AnyPlugins = AnyPlugins>(subItems: Item[], parentRow: BodyRow<Item, Plugins>, { rowDataId }?: BodyRowsOptions<Item>) => BodyRow<Item, Plugins>[];
export {};
