import { type Ref } from "vue"; import { type DataGridColumnSnapshot, type DataGridRowNode } from "@affino/datagrid-core"; import type { UseDataGridRuntimeResult } from "../composables/useDataGridRuntime"; import type { DataGridAppMode } from "./useDataGridAppControls"; interface DataGridAppEditingCell { rowId: string | number; columnKey: string; } interface DataGridAppEditingCoord { rowIndex: number; columnIndex: number; rowId: string | number; } type DataGridAppInlineEditCommitTarget = "stay" | "next" | "previous" | "below" | "above" | "none"; interface DataGridAppInlineEditStartOptions { draftValue?: string; openOnMount?: boolean; } export interface UseDataGridAppInlineEditingOptions { mode: Ref; bodyViewportRef: Ref; visibleColumns: Ref; totalRows: Ref; runtime: Pick, "api" | "getBodyRowAtIndex">; ensureEditableRowAtIndex?: (rowIndex: number) => DataGridRowNode | null; readCell: (row: DataGridRowNode, columnKey: string) => string; resolveBodyRowIndexById?: (rowId: string | number) => number; resolveRowIndexById?: (rowId: string | number) => number; applyCellSelection: (coord: DataGridAppEditingCoord) => void; ensureActiveCellVisible: (rowIndex: number, columnIndex: number) => void; isCellEditable: (row: DataGridRowNode, rowIndex: number, columnKey: string, columnIndex: number) => boolean; captureRowsSnapshot: () => TSnapshot; captureRowsSnapshotForRowIds?: (rowIds: readonly (string | number)[]) => TSnapshot; recordEditTransaction: (beforeSnapshot: TSnapshot, afterSnapshotOverride?: TSnapshot, label?: string) => void; setLastAction?: (message: string) => void; onCellEdit?: (payload: { rowId: string | number; columnKey: string; oldValue: unknown; newValue: unknown; patch: { rowId: string | number; data: Partial; }; }) => void; } export interface UseDataGridAppInlineEditingResult { editingCell: Ref; editingCellValue: Ref; editingCellInitialFilter: Ref; editingCellOpenOnMount: Ref; editingCellValidationMessage: Ref; editingCellPending: Ref; editingCellRejectedReason: Ref; isEditingCell: (row: DataGridRowNode, columnKey: string) => boolean; startInlineEdit: (row: DataGridRowNode, columnKey: string, options?: DataGridAppInlineEditStartOptions) => void; updateEditingCellValue: (value: string) => void; appendInlineEditTextInput: (value: string) => boolean; handleEditorBlur: () => void; commitInlineEdit: (targetOrEvent?: DataGridAppInlineEditCommitTarget | boolean | FocusEvent) => void; cancelInlineEdit: () => void; handleEditorKeydown: (event: KeyboardEvent) => void; } export declare function useDataGridAppInlineEditing(options: UseDataGridAppInlineEditingOptions): UseDataGridAppInlineEditingResult; export {}; //# sourceMappingURL=useDataGridAppInlineEditing.d.ts.map