import type { DataGridIntentTransactionDescriptor } from "../advanced"; import { useDataGridIntentHistory } from "../advanced"; import type { UseDataGridRuntimeResult } from "../composables/useDataGridRuntime"; export interface DataGridAppRowSnapshot { kind: "full" | "partial"; rows: Array<{ rowId: string | number; row: TRow; }>; budget?: DataGridAppHistorySnapshotBudgetResult; restoration?: DataGridAppHistoryRestorationState | null; operation?: DataGridAppHistoryOperationPayload | null; } export interface DataGridAppHistorySnapshotBudget { maxRows?: number; maxCells?: number; maxBytes?: number; } export interface DataGridAppHistorySnapshotBudgetResult { exceeded: true; limit: "rows" | "cells" | "bytes"; rowCount: number; cellCount: number; byteEstimate: number; maxRows: number; maxCells: number; maxBytes: number; } export interface DataGridAppHistoryRestorationCell { rowIndex: number; columnIndex: number; rowId?: string | number | null; columnKey?: string | null; } export interface DataGridAppHistoryRestorationState { activeCell?: DataGridAppHistoryRestorationCell | null; selectionSnapshot?: unknown; scrollAnchor?: DataGridAppHistoryRestorationCell | null; focusTarget?: DataGridAppHistoryRestorationCell | null; editTarget?: DataGridAppHistoryRestorationCell | null; } export type DataGridAppHistoryOperationKind = "edit" | "paste" | "cut-paste" | "fill" | "range-move" | "row-insert" | "row-delete" | "placeholder-materialization" | "snapshot-fallback"; export interface DataGridAppHistoryOperationScope { snapshotKind: DataGridAppRowSnapshot["kind"] | "snapshot-fallback"; rowIds: readonly (string | number)[]; rowCount: number; affectedRange?: { startRow: number; endRow: number; startColumn: number; endColumn: number; } | null; } export interface DataGridAppHistoryOperationPayload { version: 1; kind: DataGridAppHistoryOperationKind; intent: string; scope: DataGridAppHistoryOperationScope; metadata?: Record; } export interface UseDataGridAppIntentHistoryOptions { runtime: Pick, "api" | "getBodyRowAtIndex" | "resolveBodyRowIndexById">; cloneRowData: (row: TRow) => TRow; syncViewport: () => void; maxHistoryDepth?: number; snapshotBudget?: DataGridAppHistorySnapshotBudget; captureRestorationState?: () => DataGridAppHistoryRestorationState | null; applyRestorationState?: (state: DataGridAppHistoryRestorationState) => void | Promise; onOperationRecorded?: (operation: DataGridAppHistoryOperationPayload) => void; } export interface UseDataGridAppIntentHistoryResult { captureRowsSnapshot: () => DataGridAppRowSnapshot; captureRowsSnapshotByIds: (rowIds: readonly (string | number)[]) => DataGridAppRowSnapshot; canUndo: ReturnType>>["canUndo"]; canRedo: ReturnType>>["canRedo"]; runHistoryAction: ReturnType>>["runHistoryAction"]; recordIntentTransaction: ReturnType>>["recordIntentTransaction"]; dispose: ReturnType>>["dispose"]; } export declare function useDataGridAppIntentHistory(options: UseDataGridAppIntentHistoryOptions): UseDataGridAppIntentHistoryResult; export declare function createDataGridAppHistoryOperationPayload(descriptor: Pick, beforeSnapshot: DataGridAppRowSnapshot, afterSnapshot: DataGridAppRowSnapshot): DataGridAppHistoryOperationPayload; //# sourceMappingURL=useDataGridAppIntentHistory.d.ts.map