Delta Format
const ytext = ydoc.getText()
ytext.toDelta() // => []
ytext.insert(0, 'World', { bold: true })
ytext.insert(0, 'Hello ')
ytext.toDelta() // => [{ insert: 'Hello ' }, { insert: 'World', attributes: { bold: true } }]ytext.insert(0, 'Hello ')
ytext.insert(6, 'World', { bold: true })
// is equivalent to
ytext.applyDelta([{ insert: 'Hello ' }, { insert: 'World', attributes: { bold: true } }])Delta Description
Delete
delta = [{
delete: 3
}]Retain
Insert (on Y.Text)
Retain (on Y.Text)
Insert (on Y.Array & Y.XmlFragment)
Last updated