/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * Local placements, in order (#859). A draft's ordered place — before or * after another row, or at the start or the end — applies one after another, * as a batch applies them. The rows are a list linked through their ids, so a * move is a constant-time unlink and link: never a search and two splices over * the whole collection per move, which made a paste of thousands of placed * rows quadratic. * * @packageDocumentation */ import type { Placement } from "./transactions.js"; /** * The rows in the order their placements put them, each applied in turn: * O(rows + moves). * * @remarks * A placement whose row or anchor is not among the rows moves nothing, and * neither does one anchored on its own row (a batch refuses it). A keyed * placement leaves the order to the key sort. Where two rows share an id, * the first is the one that moves and the one anchored on. * * @typeParam T - The row * @param rows - The rows in their current order * @param idOf - A row's id * @param moves - Each placed row's id and its placement, in the order they apply * @returns The rows in their new order — `rows` itself when nothing moved */ export declare function placeInOrder(rows: T[], idOf: (row: T) => string, moves: Iterable): T[]; //# sourceMappingURL=placement.d.ts.map