import { TableComponent } from './tableComponent.js'; import type { HeaderLabel } from './types/Label.js'; import type { AnyPlugins } from './types/TablePlugin.js'; import type { RenderConfig } from '@humanspeak/svelte-render'; /** * Initialization options for creating a HeaderCell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type HeaderCellInit = { /** Unique identifier for the cell. */ id: string; /** Label content or render function for the header. */ label: HeaderLabel; /** Number of columns this cell spans. */ colspan: number; /** Starting column index. */ colstart: number; }; /** * HTML attributes for a header cell element. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type HeaderCellAttributes = { role: 'columnheader'; colspan: number; }; /** * Abstract base class representing a cell in the table header. * Extended by FlatHeaderCell, DataHeaderCell, GroupHeaderCell, etc. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export declare abstract class HeaderCell extends TableComponent { /** Label content or render function for the header. */ label: HeaderLabel; /** Number of columns this cell spans. */ colspan: number; /** Starting column index. */ colstart: number; /** * Creates a new HeaderCell. * * @param init - Initialization options. */ constructor({ id, label, colspan, colstart }: HeaderCellInit); /** * Renders the header cell content. * * @returns The render configuration for displaying this cell. * @throws Error if state reference is missing when using a function label. */ render(): RenderConfig; /** * Gets the HTML attributes for this header cell. * * @returns A readable store of cell attributes. */ attrs(): import("svelte/store").Readable<{ role: "columnheader"; colspan: number; }>; abstract clone(): HeaderCell; /** * Type guard to check if this is a flat header cell. * * @returns True if this is a FlatHeaderCell. */ isFlat(): this is FlatHeaderCell; /** * Type guard to check if this is a data header cell. * * @returns True if this is a DataHeaderCell. */ isData(): this is DataHeaderCell; /** * Type guard to check if this is a flat display header cell. * * @returns True if this is a FlatDisplayHeaderCell. */ isFlatDisplay(): this is FlatDisplayHeaderCell; /** * Type guard to check if this is a group header cell. * * @returns True if this is a GroupHeaderCell. */ isGroup(): this is GroupHeaderCell; /** * Type guard to check if this is a group display header cell. * * @returns True if this is a GroupDisplayHeaderCell. */ isGroupDisplay(): this is GroupDisplayHeaderCell; } /** * Initialization options for a flat (non-grouped) header cell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type FlatHeaderCellInit = Omit, 'colspan'>; /** * HTML attributes for a flat header cell element. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type FlatHeaderCellAttributes = HeaderCellAttributes; /** * A flat (non-grouped) header cell that spans a single column. * Base class for DataHeaderCell and FlatDisplayHeaderCell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export declare class FlatHeaderCell extends HeaderCell { __flat: boolean; /** * Creates a new FlatHeaderCell. * * @param init - Initialization options. */ constructor({ id, label, colstart }: FlatHeaderCellInit); /** * Creates a copy of this header cell. * * @returns A cloned FlatHeaderCell. */ clone(): FlatHeaderCell; } /** * Initialization options for a data header cell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type DataHeaderCellInit = FlatHeaderCellInit & { /** The key used to access data from the item. */ accessorKey?: keyof Item; /** Function to extract data from the item. */ accessorFn?: (item: Item) => unknown; }; /** * A header cell for a data column that displays values from the data source. * Contains accessor information for retrieving cell values. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export declare class DataHeaderCell extends FlatHeaderCell { __data: boolean; /** The key used to access data from the item. */ accessorKey?: keyof Item; /** Function to extract data from the item. */ accessorFn?: (item: Item) => unknown; /** * Creates a new DataHeaderCell. * * @param init - Initialization options. */ constructor({ id, label, accessorKey, accessorFn, colstart }: DataHeaderCellInit); /** * Creates a copy of this header cell. * * @returns A cloned DataHeaderCell. */ clone(): DataHeaderCell; } /** * Initialization options for a flat display header cell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type FlatDisplayHeaderCellInit = Omit, 'label'> & { /** Optional label content (defaults to non-breaking space). */ label?: HeaderLabel; }; /** * A flat header cell for display-only columns (e.g., action columns). * Does not contain data accessor information. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export declare class FlatDisplayHeaderCell extends FlatHeaderCell { __display: boolean; /** * Creates a new FlatDisplayHeaderCell. * * @param init - Initialization options. */ constructor({ id, label, colstart }: FlatDisplayHeaderCellInit); /** * Creates a copy of this header cell. * * @returns A cloned FlatDisplayHeaderCell. */ clone(): FlatDisplayHeaderCell; } /** * Initialization options for a group header cell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type GroupHeaderCellInit = Omit, 'id'> & { /** Current column IDs covered by this group. */ ids: string[]; /** All column IDs in the original group definition. */ allIds: string[]; }; /** * A header cell that spans multiple columns, used for column grouping. * Contains information about which columns are part of the group. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export declare class GroupHeaderCell extends HeaderCell { __group: boolean; /** Current column IDs covered by this group. */ ids: string[]; /** Combined ID string for all columns in the original group. */ allId: string; /** All column IDs in the original group definition. */ allIds: string[]; /** * Creates a new GroupHeaderCell. * * @param init - Initialization options. */ constructor({ label, ids, allIds, colspan, colstart }: GroupHeaderCellInit); /** * Sets the column IDs covered by this group and updates the cell ID. * * @param ids - The new array of column IDs. */ setIds(ids: string[]): void; /** * Adds a column ID to this group and updates the cell ID. * * @param id - The column ID to add. */ pushId(id: string): void; /** * Creates a copy of this header cell. * * @returns A cloned GroupHeaderCell. */ clone(): GroupHeaderCell; } /** * Initialization options for a group display header cell. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export type GroupDisplayHeaderCellInit = Omit, 'label' | 'colspan'> & { /** Optional label content (defaults to non-breaking space). */ label?: HeaderLabel; /** Optional colspan (defaults to 1). */ colspan?: number; }; /** * A group header cell for display purposes (e.g., empty group headers). * Used to fill gaps in the header row matrix. * * @template Item - The type of data items in the table. * @template Plugins - The plugins used by the table. */ export declare class GroupDisplayHeaderCell extends GroupHeaderCell { __display: boolean; /** * Creates a new GroupDisplayHeaderCell. * * @param init - Initialization options. */ constructor({ label, ids, allIds, colspan, colstart }: GroupDisplayHeaderCellInit); /** * Creates a copy of this header cell. * * @returns A cloned GroupDisplayHeaderCell. */ clone(): GroupDisplayHeaderCell; }