/**
 * @file useTableRowIndex.tsx
 * @input React, StyleX, Table types + the rendered data array
 * @output Exports useTableRowIndex hook + config type
 * @position Row-index plugin; consumed by Table via plugins prop
 *
 * SYNC: When modified, update these files to stay in sync:
 * - /packages/core/src/Table/index.ts (exports)
 */
import { type ReactNode } from 'react';
import type { TablePlugin } from '../../types';
/**
 * Configuration for {@link useTableRowIndex}.
 *
 * Astryx's `renderCell` receives only the row item (not its position), so the
 * plugin needs the rendered `data` array — the same array passed to
 * `<Table data>` — to derive each row's 1-based ordinal. Pass `getRowKey` when
 * items don't have a stable identity by reference (e.g. new objects each
 * render); it must return a **unique** string per row (duplicate keys collapse
 * to a single ordinal).
 */
export interface UseTableRowIndexConfig<T extends Record<string, unknown>> {
    /** The data array currently rendered by the table (post sort/filter/page). */
    data: T[];
    /**
     * Optional key extractor returning a **unique** string per row. When
     * provided, index lookup is keyed by the returned string (stable across new
     * object identities); otherwise items are matched by reference identity.
     * For a stable plugin identity across renders, memoize this with
     * `useCallback`.
     */
    getRowKey?: (item: T) => string;
    /** Header label for the index column. @default '#' */
    label?: ReactNode;
    /** First index value. @default 1 */
    startFrom?: number;
}
/**
 * Returns a {@link TablePlugin} that prepends a right-aligned, monospaced
 * row-number column. Numbering follows the order of the rendered `data` array,
 * so it reflects the current sort / filter / pagination view.
 *
 * @example
 * ```
 * const rowIndex = useTableRowIndex({data});
 * <Table data={data} columns={columns} idKey="id" plugins={{rowIndex}} />;
 * ```
 */
export declare function useTableRowIndex<T extends Record<string, unknown>>(config: UseTableRowIndexConfig<T>): TablePlugin<T>;
//# sourceMappingURL=useTableRowIndex.d.ts.map