Skip to content

Type Editor


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

ParameterTypeDescription
stepsreadonly Rebaseable[]The local steps to rebase, wrapped as Rebaseable objects.
overreadonly PmStep[]The remote steps to rebase over.
transformPmTransactionThe transform to apply all steps to.

Returns

Rebaseable[]

An array of rebased steps that could be successfully reapplied.