@linzjs/step-ag-grid
Version:
[](https://github.com/semantic-release/semantic-release) > Reusable [ag-grid](https://www.ag-grid.com/) component for LINZ / Toitū te whenua.
11 lines (10 loc) • 629 B
TypeScript
import { GridBaseRow } from './types';
/**
* Reorders rows by removing movedRows from the array and inserting them at the target position.
* @param rows - The current row array.
* @param movedRows - Rows to move, in desired insertion order (typically display order).
* @param targetRow - The row to insert relative to.
* @param direction - -1 inserts above targetRow, 1 inserts below targetRow.
* @returns A new array with the rows reordered, or the original array if the operation is a no-op.
*/
export declare function reorderRows<T extends GridBaseRow>(rows: T[], movedRows: T[], targetRow: T, direction: -1 | 1): T[];