export interface Options { acceptedWinsOnEqualPath?: boolean; } export declare enum OpType { add = "add", remove = "remove", replace = "replace", copy = "copy", move = "move", test = "test" } export interface OperationBase { id?: number; path: string; } export interface OperationAdd extends OperationBase { op: OpType.add; value: any; } export interface OperationRemove extends OperationBase { op: OpType.remove; oldValue?: any; } export interface OperationReplace extends OperationBase { op: OpType.replace; value: any; oldValue?: any; } export interface OperationCopy extends OperationBase { op: OpType.copy; from: string; } export interface OperationMove extends OperationBase { op: OpType.move; from: string; } export interface OperationTest extends OperationBase { op: OpType.test; value: any; } export declare type PathOperation = OperationAdd | OperationRemove | OperationReplace | OperationTest; export declare type FromOperation = OperationMove | OperationCopy; export declare type Operation = FromOperation | PathOperation; export declare type PathProp = keyof Pick; /** * Takes array of proposed patches and transforms them against an array of already accepted patches. * @param acceptedOps Array of already accepted patches * @param proposedOps Array of proposed patches * @param options Options object * * @returns Array of transformed changes */ export default function JSONPatchOT(acceptedOps: Operation[], proposedOps: Operation[], options?: Options): Operation[];