UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

15 lines (14 loc) 530 B
import type { StringOp } from './types'; /** * Transforms an operation such that the transformed operations can be * applied to a string in reverse order. * * ``` * apply(apply(doc, op1), transform(op2, op1)) === apply(apply(doc, op2), transform(op1, op2)) * ``` * * @param op1 The operation to transform. * @param op2 The operation to transform against. * @returns A new operation with user intentions preserved. */ export declare const transform: (op1: StringOp, op2: StringOp, leftInsertFirst: boolean) => StringOp;