import type { TableDataSource } from '@mezzanine-ui/core/table'; export interface TableTransitionState { /** Keys of rows that are currently in "adding" state (highlighted) */ addingKeys: Set; /** Keys of rows that are currently in "deleting" state (red highlight before fade) */ deletingKeys: Set; /** Keys of rows that are currently fading out */ fadingOutKeys: Set; } export interface UseTableDataSourceOptions { /** Initial data source */ initialData?: T[]; /** Duration of highlight animation in ms (stay phase) * @default 700 — matches `long` motion token */ highlightDuration?: number; /** Duration of fade out animation in ms (exit phase) * @default 150 — matches `fast` motion token */ fadeOutDuration?: number; } export interface UpdateDataSourceOptions { /** * Keys of newly added items that should be animated. * If provided, these items will show the adding animation. * If not provided, new items will appear without animation. */ addedKeys?: string[]; /** * Keys of items being removed that should be animated. * These items should NOT be in the new data array. * The hook will temporarily keep them for animation, then remove after animation completes. */ removedKeys?: string[]; } export interface UseTableDataSourceReturn { /** Current data source to pass to Table component */ dataSource: T[]; /** * Update the data source with optional animation support. * This is the recommended method for GraphQL refetch pattern. * * @example * // After create mutation + refetch * const { data } = await refetch(); * updateDataSource(data.items, { addedKeys: [newItem.id] }); * * @example * // After delete mutation + refetch * const { data } = await refetch(); * updateDataSource(data.items, { removedKeys: [deletedId] }); */ updateDataSource: (data: T[], options?: UpdateDataSourceOptions) => void; /** Transition state for Table component */ transitionState: TableTransitionState; } export declare function useTableDataSource(options?: UseTableDataSourceOptions): UseTableDataSourceReturn;