1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 3× 5× 5× 5× 5× 5× | import TransactionDocument from './TransactionDocument' import EditingInterface from './EditingInterface' import DocumentChange from './DocumentChange' export default class ChangeRecorder extends EditingInterface { constructor(doc) { super(new TransactionDocument(doc)) } generateChange() { const ops = this._document.ops.slice() this._document.ops.length = 0 let change = new DocumentChange(ops, {}, {}) change._extractInformation(this._document) return change } } |