Skip to content

rebaseRecord

function rebaseRecord(
record,
over,
baseDoc): RebaseResult;

Defined in: ledger-rebase.ts:379

Rebase a record so it applies after over, where both were authored against baseDoc. over may be a single record, a list of records, or a raw op list (applied in the given order). The returned record keeps the same id and timestamps — it is the same logical change, repositioned — with its ops and touches transformed into the post-over document space.

Returns { ok: false, reason } when the rebase is ambiguous (the concurrent change deleted/relocated content this record depends on, or a split tore one of its ranges across blocks). Callers should then fall back to resolveConflicts.

ParameterType
recordLedgerRecord
over| TransactionOp[] | LedgerRecord | LedgerRecord[]
baseDocDocumentNode

RebaseResult