import { IndexMap } from './indexMap'; /** * Map for storing mappings from an index to a physical index. * * It also updates the physical indexes (remaining in the map) on remove/add row or column action. * * Representation: while the sequence is the identity (`0, 1, …, n-1` — the state of an unsorted, * unmoved grid) it is kept as a single `length` number, not a materialized array. Insert, remove, * and init then run in O(1)/O(k) instead of rebuilding an n-element array, because inserting a * contiguous block at its own position or removing any subset of an identity sequence yields another * identity sequence. The array is materialized lazily only when a real reorder (sort/move) sets a * non-identity sequence. `getValues()` still returns a plain `number[]`, so the public contract is * unchanged. * * @class IndexesSequence */ export declare class IndexesSequence extends IndexMap { #private; /** * Initializes the sequence map with an identity function so each index maps to its own physical value. * * The sequence stores physical indexes (numbers), so a write of an unchanged index is provably a * no-op — `skipUnchangedWrites` is always on, which also preserves the compact identity * representation when an identity value is re-written. */ constructor(); /** * Get sequence of physical indexes. * * @returns {number[]} Physical indexes. */ getValues(): number[]; /** * Get the physical index at the given position. * * @param {number} index Position in the sequence. * @returns {T | undefined} */ getValueAtIndex(index: number): T | undefined; /** * Get length of the sequence. * * @returns {number} */ getLength(): number; /** * Set a completely new sequence. Detects the identity case to keep the compact representation. * * @param {Array} values List of physical indexes. */ setValues(values: unknown[]): void; /** * Set the physical index at a single position. Materializes the sequence first. * * @param {number} index The position. * @param {*} value The physical index to store. * @returns {boolean} */ setValueAtIndex(index: number, value: unknown): boolean; /** * Reset to the identity sequence of the given length. O(1) — no array is built. * * @private * @param {number} [length] Length of the sequence. */ setDefaultValues(length?: number): void; /** * Add values to the sequence and reorganize. * * @private * @param {number} insertionIndex Position inside the list. * @param {Array} insertedIndexes List of inserted indexes. */ insert(insertionIndex: number, insertedIndexes: number[]): void; /** * Remove values from the sequence and reorganize. * * @private * @param {Array} removedIndexes List of removed indexes. */ remove(removedIndexes: number[]): void; /** * Destroys the map instance. */ destroy(): void; }