Type Editor / @type-editor/collab / rebase-steps / rebaseSteps
Function: rebaseSteps()
ts
function rebaseSteps(steps, over, transform): Rebaseable[];Defined in: rebase-steps.ts:20
Internal
Rebases a set of steps over another set of steps by undoing them, applying the other steps, and then reapplying the original steps with proper position mapping.
This is essential for collaborative editing when local changes need to be rebased over remote changes received from other clients.
Parameters
| Parameter | Type | Description |
|---|---|---|
steps | readonly Rebaseable[] | The local steps to rebase, wrapped as Rebaseable objects. |
over | readonly PmStep[] | The remote steps to rebase over. |
transform | PmTransaction | The transform to apply all steps to. |
Returns
An array of rebased steps that could be successfully reapplied.