UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

25 lines (24 loc) 573 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Draft = void 0; class Draft { constructor(opts) { const base = (this.base = opts.base); const head = (this.head = base.clone()); this.tip = opts.tip; for (const patch of opts.head) head.applyPatch(patch); } /** * * @param patches */ rebase(patches) { this.base.applyBatch(patches); this.head.applyBatch(patches); } advance(index) { } undo() { } redo() { } } exports.Draft = Draft;