import { OplogColumnChanges, OplogEntry, PendingChanges } from './oplog.js'; import { RelationsCache, Row } from '../util/index.js'; /** * Merge server-sent operation with local pending oplog to arrive at the same row state the server is at. * @param localOrigin string specifying the local origin * @param local local oplog entries * @param incomingOrigin string specifying the upstream origin * @param incoming incoming oplog entries * @returns Changes to be made to the shadow tables */ export declare function mergeEntries(localOrigin: string, local: OplogEntry[], incomingOrigin: string, incoming: OplogEntry[], relations: RelationsCache): PendingChanges; /** * Merge two sets of changes, using the timestamp to arbitrate conflicts * so that the last write wins. * * @remarks * * The `fullRow` is mutated to reflect the outcome of LWW. * For columns that have no changes in `second` we assign the * column value from `first`. * * @param firstOrigin - Origin of the first changes * @param first - Changes * @param secondOrigin - Origin of the second changes * @param second - Changes * @param fullRow - The complete row after changes in `second` * @returns The merged changes */ export declare const mergeChangesLastWriteWins: (firstOrigin: string, first: OplogColumnChanges, secondOrigin: string, second: OplogColumnChanges, fullRow: Row) => OplogColumnChanges;