Conservative server-ordered rebase for pending offline work. Non-overlapping
literal edits are shifted across row/column insertion and deletion. Ambiguous
formula, overlapping, sheet-lifecycle, and move cases become explicit
conflicts instead of lossy guesses. This is the collaboration design gate;
no CRDT dependency is required for the supported cases.
Package
@sheetwrite/core
Source
packages/core/src/rebase.ts#L46
Declaration
functionrebaseDocumentOperations(
localOperations:readonlyDocumentOptype DocumentOp =
| {
op: "set";
addr: CellAddress;
value: CellValue;
style?: CellStyle;
}
| { op: "setRange"; range: Range; cells: SnapshotCell[] }
| { op: "setBlock"; range: Range; block: PackedCellBlock }
| {
op: "setRangeStyle";
range: Range;
style: Partial<CellStyle> | null;
}
| {
// … 78 more lines — see the API reference
}typeDocumentOp=| {op:"set";addr:CellAddress;value:CellValue;style?:CellStyle;}| { op:"setRange"; range:Range; cells:SnapshotCell[] }| { op:"setBlock"; range:Range; block:PackedCellBlock }| {op:"setRangeStyle";range:Range;style:Partial<CellStyle> |null;}| {// … 78 more lines — see the API reference}typeDocumentOp=| {op:"set";addr:CellAddress;value:CellValue;style?:CellStyle;}| {op:"setRange";range:Range;cells:SnapshotCell[];}| {op:"setBlock";range:Range;block:PackedCellBlock;}| {op:"setRangeStyle";// … 138 more lines — see the API reference}Exhaustive serializable operation union for workbook mutations.API reference →[],
remoteOperations:readonlyDocumentOptype DocumentOp =
| {
op: "set";
addr: CellAddress;
value: CellValue;
style?: CellStyle;
}
| { op: "setRange"; range: Range; cells: SnapshotCell[] }
| { op: "setBlock"; range: Range; block: PackedCellBlock }
| {
op: "setRangeStyle";
range: Range;
style: Partial<CellStyle> | null;
}
| {
// … 78 more lines — see the API reference
}typeDocumentOp=| {op:"set";addr:CellAddress;value:CellValue;style?:CellStyle;}| { op:"setRange"; range:Range; cells:SnapshotCell[] }| { op:"setBlock"; range:Range; block:PackedCellBlock }| {op:"setRangeStyle";range:Range;style:Partial<CellStyle> |null;}| {// … 78 more lines — see the API reference}typeDocumentOp=| {op:"set";addr:CellAddress;value:CellValue;style?:CellStyle;}| {op:"setRange";range:Range;cells:SnapshotCell[];}| {op:"setBlock";range:Range;block:PackedCellBlock;}| {op:"setRangeStyle";// … 138 more lines — see the API reference}Exhaustive serializable operation union for workbook mutations.API reference →[],