@ckeditor/ckeditor5-engine 44.1.0 → 44.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/index-content.css +2 -2
  3. package/dist/index-editor.css +2 -2
  4. package/dist/index.css +4 -4
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.js +646 -77
  7. package/dist/index.js.map +1 -1
  8. package/package.json +23 -3
  9. package/src/controller/datacontroller.d.ts +1 -1
  10. package/src/controller/datacontroller.js +1 -1
  11. package/src/controller/editingcontroller.d.ts +1 -1
  12. package/src/controller/editingcontroller.js +1 -1
  13. package/src/conversion/conversion.d.ts +1 -1
  14. package/src/conversion/conversion.js +1 -1
  15. package/src/conversion/conversionhelpers.d.ts +1 -1
  16. package/src/conversion/conversionhelpers.js +1 -1
  17. package/src/conversion/downcastdispatcher.d.ts +1 -1
  18. package/src/conversion/downcastdispatcher.js +1 -1
  19. package/src/conversion/downcasthelpers.d.ts +1 -1
  20. package/src/conversion/downcasthelpers.js +1 -1
  21. package/src/conversion/mapper.d.ts +249 -20
  22. package/src/conversion/mapper.js +524 -38
  23. package/src/conversion/modelconsumable.d.ts +1 -1
  24. package/src/conversion/modelconsumable.js +1 -1
  25. package/src/conversion/upcastdispatcher.d.ts +1 -1
  26. package/src/conversion/upcastdispatcher.js +1 -1
  27. package/src/conversion/upcasthelpers.d.ts +1 -1
  28. package/src/conversion/upcasthelpers.js +1 -1
  29. package/src/conversion/viewconsumable.d.ts +1 -1
  30. package/src/conversion/viewconsumable.js +1 -1
  31. package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
  32. package/src/dataprocessor/basichtmlwriter.js +1 -1
  33. package/src/dataprocessor/dataprocessor.d.ts +1 -1
  34. package/src/dataprocessor/dataprocessor.js +1 -1
  35. package/src/dataprocessor/htmldataprocessor.d.ts +1 -1
  36. package/src/dataprocessor/htmldataprocessor.js +1 -1
  37. package/src/dataprocessor/htmlwriter.d.ts +1 -1
  38. package/src/dataprocessor/htmlwriter.js +1 -1
  39. package/src/dataprocessor/xmldataprocessor.d.ts +1 -1
  40. package/src/dataprocessor/xmldataprocessor.js +1 -1
  41. package/src/dev-utils/model.d.ts +1 -1
  42. package/src/dev-utils/model.js +1 -1
  43. package/src/dev-utils/operationreplayer.d.ts +1 -1
  44. package/src/dev-utils/operationreplayer.js +1 -1
  45. package/src/dev-utils/utils.d.ts +1 -1
  46. package/src/dev-utils/utils.js +1 -1
  47. package/src/dev-utils/view.d.ts +1 -1
  48. package/src/dev-utils/view.js +1 -1
  49. package/src/index.d.ts +4 -2
  50. package/src/index.js +2 -1
  51. package/src/model/batch.d.ts +1 -1
  52. package/src/model/batch.js +7 -3
  53. package/src/model/differ.d.ts +1 -1
  54. package/src/model/differ.js +1 -1
  55. package/src/model/document.d.ts +1 -1
  56. package/src/model/document.js +1 -1
  57. package/src/model/documentfragment.d.ts +1 -1
  58. package/src/model/documentfragment.js +1 -1
  59. package/src/model/documentselection.d.ts +1 -1
  60. package/src/model/documentselection.js +1 -1
  61. package/src/model/element.d.ts +1 -1
  62. package/src/model/element.js +1 -1
  63. package/src/model/history.d.ts +1 -1
  64. package/src/model/history.js +1 -1
  65. package/src/model/item.d.ts +1 -1
  66. package/src/model/item.js +1 -1
  67. package/src/model/liveposition.d.ts +1 -1
  68. package/src/model/liveposition.js +1 -1
  69. package/src/model/liverange.d.ts +1 -1
  70. package/src/model/liverange.js +1 -1
  71. package/src/model/markercollection.d.ts +1 -1
  72. package/src/model/markercollection.js +1 -1
  73. package/src/model/model.d.ts +1 -1
  74. package/src/model/model.js +1 -1
  75. package/src/model/node.d.ts +1 -1
  76. package/src/model/node.js +1 -1
  77. package/src/model/nodelist.d.ts +1 -1
  78. package/src/model/nodelist.js +1 -1
  79. package/src/model/operation/attributeoperation.d.ts +1 -1
  80. package/src/model/operation/attributeoperation.js +1 -1
  81. package/src/model/operation/detachoperation.d.ts +1 -1
  82. package/src/model/operation/detachoperation.js +1 -1
  83. package/src/model/operation/insertoperation.d.ts +1 -1
  84. package/src/model/operation/insertoperation.js +1 -1
  85. package/src/model/operation/markeroperation.d.ts +1 -1
  86. package/src/model/operation/markeroperation.js +1 -1
  87. package/src/model/operation/mergeoperation.d.ts +1 -1
  88. package/src/model/operation/mergeoperation.js +1 -1
  89. package/src/model/operation/moveoperation.d.ts +1 -1
  90. package/src/model/operation/moveoperation.js +1 -1
  91. package/src/model/operation/nooperation.d.ts +1 -1
  92. package/src/model/operation/nooperation.js +1 -1
  93. package/src/model/operation/operation.d.ts +4 -1
  94. package/src/model/operation/operation.js +2 -2
  95. package/src/model/operation/operationfactory.d.ts +1 -1
  96. package/src/model/operation/operationfactory.js +1 -1
  97. package/src/model/operation/renameoperation.d.ts +1 -1
  98. package/src/model/operation/renameoperation.js +1 -1
  99. package/src/model/operation/rootattributeoperation.d.ts +1 -1
  100. package/src/model/operation/rootattributeoperation.js +1 -1
  101. package/src/model/operation/rootoperation.d.ts +1 -1
  102. package/src/model/operation/rootoperation.js +1 -1
  103. package/src/model/operation/splitoperation.d.ts +1 -1
  104. package/src/model/operation/splitoperation.js +1 -1
  105. package/src/model/operation/transform.d.ts +1 -1
  106. package/src/model/operation/transform.js +1 -1
  107. package/src/model/operation/utils.d.ts +1 -1
  108. package/src/model/operation/utils.js +1 -1
  109. package/src/model/position.d.ts +1 -1
  110. package/src/model/position.js +1 -1
  111. package/src/model/range.d.ts +1 -1
  112. package/src/model/range.js +1 -1
  113. package/src/model/rootelement.d.ts +1 -1
  114. package/src/model/rootelement.js +1 -1
  115. package/src/model/schema.d.ts +1 -1
  116. package/src/model/schema.js +1 -1
  117. package/src/model/selection.d.ts +1 -1
  118. package/src/model/selection.js +9 -2
  119. package/src/model/text.d.ts +1 -1
  120. package/src/model/text.js +1 -1
  121. package/src/model/textproxy.d.ts +1 -1
  122. package/src/model/textproxy.js +1 -1
  123. package/src/model/treewalker.d.ts +17 -1
  124. package/src/model/treewalker.js +26 -1
  125. package/src/model/typecheckable.d.ts +1 -1
  126. package/src/model/typecheckable.js +1 -1
  127. package/src/model/utils/autoparagraphing.d.ts +1 -1
  128. package/src/model/utils/autoparagraphing.js +1 -1
  129. package/src/model/utils/deletecontent.d.ts +1 -1
  130. package/src/model/utils/deletecontent.js +1 -1
  131. package/src/model/utils/getselectedcontent.d.ts +1 -1
  132. package/src/model/utils/getselectedcontent.js +1 -1
  133. package/src/model/utils/insertcontent.d.ts +1 -1
  134. package/src/model/utils/insertcontent.js +1 -1
  135. package/src/model/utils/insertobject.d.ts +1 -1
  136. package/src/model/utils/insertobject.js +1 -1
  137. package/src/model/utils/modifyselection.d.ts +1 -1
  138. package/src/model/utils/modifyselection.js +1 -1
  139. package/src/model/utils/selection-post-fixer.d.ts +1 -1
  140. package/src/model/utils/selection-post-fixer.js +1 -1
  141. package/src/model/writer.d.ts +1 -1
  142. package/src/model/writer.js +1 -1
  143. package/src/view/attributeelement.d.ts +1 -1
  144. package/src/view/attributeelement.js +1 -1
  145. package/src/view/containerelement.d.ts +1 -1
  146. package/src/view/containerelement.js +1 -1
  147. package/src/view/datatransfer.d.ts +1 -1
  148. package/src/view/datatransfer.js +1 -1
  149. package/src/view/document.d.ts +1 -1
  150. package/src/view/document.js +1 -1
  151. package/src/view/documentfragment.d.ts +6 -4
  152. package/src/view/documentfragment.js +7 -7
  153. package/src/view/documentselection.d.ts +1 -1
  154. package/src/view/documentselection.js +1 -1
  155. package/src/view/domconverter.d.ts +1 -1
  156. package/src/view/domconverter.js +1 -1
  157. package/src/view/downcastwriter.d.ts +1 -1
  158. package/src/view/downcastwriter.js +1 -1
  159. package/src/view/editableelement.d.ts +1 -1
  160. package/src/view/editableelement.js +1 -1
  161. package/src/view/element.d.ts +1 -1
  162. package/src/view/element.js +3 -3
  163. package/src/view/elementdefinition.d.ts +1 -1
  164. package/src/view/elementdefinition.js +1 -1
  165. package/src/view/emptyelement.d.ts +1 -1
  166. package/src/view/emptyelement.js +1 -1
  167. package/src/view/filler.d.ts +1 -1
  168. package/src/view/filler.js +1 -1
  169. package/src/view/item.d.ts +1 -1
  170. package/src/view/item.js +1 -1
  171. package/src/view/matcher.d.ts +1 -1
  172. package/src/view/matcher.js +1 -1
  173. package/src/view/node.d.ts +13 -4
  174. package/src/view/node.js +5 -4
  175. package/src/view/observer/arrowkeysobserver.d.ts +1 -1
  176. package/src/view/observer/arrowkeysobserver.js +1 -1
  177. package/src/view/observer/bubblingemittermixin.d.ts +1 -1
  178. package/src/view/observer/bubblingemittermixin.js +1 -1
  179. package/src/view/observer/bubblingeventinfo.d.ts +1 -1
  180. package/src/view/observer/bubblingeventinfo.js +1 -1
  181. package/src/view/observer/clickobserver.d.ts +1 -1
  182. package/src/view/observer/clickobserver.js +1 -1
  183. package/src/view/observer/compositionobserver.d.ts +1 -1
  184. package/src/view/observer/compositionobserver.js +1 -1
  185. package/src/view/observer/domeventdata.d.ts +1 -1
  186. package/src/view/observer/domeventdata.js +1 -1
  187. package/src/view/observer/domeventobserver.d.ts +1 -1
  188. package/src/view/observer/domeventobserver.js +1 -1
  189. package/src/view/observer/fakeselectionobserver.d.ts +1 -1
  190. package/src/view/observer/fakeselectionobserver.js +1 -1
  191. package/src/view/observer/focusobserver.d.ts +1 -1
  192. package/src/view/observer/focusobserver.js +1 -1
  193. package/src/view/observer/inputobserver.d.ts +1 -1
  194. package/src/view/observer/inputobserver.js +1 -1
  195. package/src/view/observer/keyobserver.d.ts +1 -1
  196. package/src/view/observer/keyobserver.js +1 -1
  197. package/src/view/observer/mouseobserver.d.ts +1 -1
  198. package/src/view/observer/mouseobserver.js +1 -1
  199. package/src/view/observer/mutationobserver.d.ts +1 -1
  200. package/src/view/observer/mutationobserver.js +1 -1
  201. package/src/view/observer/observer.d.ts +1 -1
  202. package/src/view/observer/observer.js +1 -1
  203. package/src/view/observer/selectionobserver.d.ts +1 -1
  204. package/src/view/observer/selectionobserver.js +1 -1
  205. package/src/view/observer/tabobserver.d.ts +1 -1
  206. package/src/view/observer/tabobserver.js +1 -1
  207. package/src/view/observer/touchobserver.d.ts +73 -0
  208. package/src/view/observer/touchobserver.js +29 -0
  209. package/src/view/placeholder.d.ts +1 -1
  210. package/src/view/placeholder.js +23 -17
  211. package/src/view/position.d.ts +1 -1
  212. package/src/view/position.js +1 -1
  213. package/src/view/range.d.ts +1 -1
  214. package/src/view/range.js +1 -1
  215. package/src/view/rawelement.d.ts +1 -1
  216. package/src/view/rawelement.js +1 -1
  217. package/src/view/renderer.d.ts +1 -1
  218. package/src/view/renderer.js +1 -1
  219. package/src/view/rooteditableelement.d.ts +1 -1
  220. package/src/view/rooteditableelement.js +1 -1
  221. package/src/view/selection.d.ts +1 -1
  222. package/src/view/selection.js +1 -1
  223. package/src/view/styles/background.d.ts +1 -1
  224. package/src/view/styles/background.js +1 -1
  225. package/src/view/styles/border.d.ts +1 -1
  226. package/src/view/styles/border.js +1 -1
  227. package/src/view/styles/margin.d.ts +1 -1
  228. package/src/view/styles/margin.js +1 -1
  229. package/src/view/styles/padding.d.ts +1 -1
  230. package/src/view/styles/padding.js +1 -1
  231. package/src/view/styles/utils.d.ts +1 -1
  232. package/src/view/styles/utils.js +1 -1
  233. package/src/view/stylesmap.d.ts +1 -1
  234. package/src/view/stylesmap.js +1 -1
  235. package/src/view/text.d.ts +1 -1
  236. package/src/view/text.js +1 -1
  237. package/src/view/textproxy.d.ts +1 -1
  238. package/src/view/textproxy.js +1 -1
  239. package/src/view/treewalker.d.ts +17 -1
  240. package/src/view/treewalker.js +25 -1
  241. package/src/view/typecheckable.d.ts +1 -1
  242. package/src/view/typecheckable.js +1 -1
  243. package/src/view/uielement.d.ts +1 -1
  244. package/src/view/uielement.js +1 -1
  245. package/src/view/upcastwriter.d.ts +1 -1
  246. package/src/view/upcastwriter.js +1 -1
  247. package/src/view/view.d.ts +1 -1
  248. package/src/view/view.js +1 -1
  249. package/theme/placeholder.css +1 -1
  250. package/theme/renderer.css +1 -1
  251. package/dist/controller/datacontroller.d.ts +0 -339
  252. package/dist/controller/editingcontroller.d.ts +0 -102
  253. package/dist/conversion/conversion.d.ts +0 -482
  254. package/dist/conversion/conversionhelpers.d.ts +0 -30
  255. package/dist/conversion/downcastdispatcher.d.ts +0 -566
  256. package/dist/conversion/downcasthelpers.d.ts +0 -1194
  257. package/dist/conversion/mapper.d.ts +0 -507
  258. package/dist/conversion/modelconsumable.d.ts +0 -205
  259. package/dist/conversion/upcastdispatcher.d.ts +0 -496
  260. package/dist/conversion/upcasthelpers.d.ts +0 -503
  261. package/dist/conversion/viewconsumable.d.ts +0 -373
  262. package/dist/dataprocessor/basichtmlwriter.d.ts +0 -22
  263. package/dist/dataprocessor/dataprocessor.d.ts +0 -65
  264. package/dist/dataprocessor/htmldataprocessor.d.ts +0 -80
  265. package/dist/dataprocessor/htmlwriter.d.ts +0 -20
  266. package/dist/dataprocessor/xmldataprocessor.d.ts +0 -94
  267. package/dist/dev-utils/model.d.ts +0 -130
  268. package/dist/dev-utils/operationreplayer.d.ts +0 -55
  269. package/dist/dev-utils/utils.d.ts +0 -41
  270. package/dist/dev-utils/view.d.ts +0 -324
  271. package/dist/index.d.ts +0 -122
  272. package/dist/model/batch.d.ts +0 -110
  273. package/dist/model/differ.d.ts +0 -511
  274. package/dist/model/document.d.ts +0 -278
  275. package/dist/model/documentfragment.d.ts +0 -223
  276. package/dist/model/documentselection.d.ts +0 -424
  277. package/dist/model/element.d.ts +0 -191
  278. package/dist/model/history.d.ts +0 -118
  279. package/dist/model/item.d.ts +0 -18
  280. package/dist/model/liveposition.d.ts +0 -81
  281. package/dist/model/liverange.d.ts +0 -106
  282. package/dist/model/markercollection.d.ts +0 -339
  283. package/dist/model/model.d.ts +0 -923
  284. package/dist/model/node.d.ts +0 -262
  285. package/dist/model/nodelist.d.ts +0 -119
  286. package/dist/model/operation/attributeoperation.d.ts +0 -107
  287. package/dist/model/operation/detachoperation.d.ts +0 -64
  288. package/dist/model/operation/insertoperation.d.ts +0 -94
  289. package/dist/model/operation/markeroperation.d.ts +0 -95
  290. package/dist/model/operation/mergeoperation.d.ts +0 -104
  291. package/dist/model/operation/moveoperation.d.ts +0 -100
  292. package/dist/model/operation/nooperation.d.ts +0 -42
  293. package/dist/model/operation/operation.d.ts +0 -100
  294. package/dist/model/operation/operationfactory.d.ts +0 -22
  295. package/dist/model/operation/renameoperation.d.ts +0 -87
  296. package/dist/model/operation/rootattributeoperation.d.ts +0 -102
  297. package/dist/model/operation/rootoperation.d.ts +0 -80
  298. package/dist/model/operation/splitoperation.d.ts +0 -113
  299. package/dist/model/operation/transform.d.ts +0 -104
  300. package/dist/model/operation/utils.d.ts +0 -75
  301. package/dist/model/position.d.ts +0 -549
  302. package/dist/model/range.d.ts +0 -462
  303. package/dist/model/rootelement.d.ts +0 -64
  304. package/dist/model/schema.d.ts +0 -1334
  305. package/dist/model/selection.d.ts +0 -486
  306. package/dist/model/text.d.ts +0 -70
  307. package/dist/model/textproxy.d.ts +0 -148
  308. package/dist/model/treewalker.d.ts +0 -190
  309. package/dist/model/typecheckable.d.ts +0 -289
  310. package/dist/model/utils/autoparagraphing.d.ts +0 -41
  311. package/dist/model/utils/deletecontent.d.ts +0 -62
  312. package/dist/model/utils/getselectedcontent.d.ts +0 -34
  313. package/dist/model/utils/insertcontent.d.ts +0 -50
  314. package/dist/model/utils/insertobject.d.ts +0 -51
  315. package/dist/model/utils/modifyselection.d.ts +0 -52
  316. package/dist/model/utils/selection-post-fixer.d.ts +0 -78
  317. package/dist/model/writer.d.ts +0 -855
  318. package/dist/view/attributeelement.d.ts +0 -112
  319. package/dist/view/containerelement.d.ts +0 -53
  320. package/dist/view/datatransfer.d.ts +0 -83
  321. package/dist/view/document.d.ts +0 -188
  322. package/dist/view/documentfragment.d.ts +0 -157
  323. package/dist/view/documentselection.d.ts +0 -310
  324. package/dist/view/domconverter.d.ts +0 -665
  325. package/dist/view/downcastwriter.d.ts +0 -1000
  326. package/dist/view/editableelement.d.ts +0 -66
  327. package/dist/view/element.d.ts +0 -472
  328. package/dist/view/elementdefinition.d.ts +0 -91
  329. package/dist/view/emptyelement.d.ts +0 -45
  330. package/dist/view/filler.d.ts +0 -115
  331. package/dist/view/item.d.ts +0 -18
  332. package/dist/view/matcher.d.ts +0 -490
  333. package/dist/view/node.d.ts +0 -166
  334. package/dist/view/observer/arrowkeysobserver.d.ts +0 -49
  335. package/dist/view/observer/bubblingemittermixin.d.ts +0 -170
  336. package/dist/view/observer/bubblingeventinfo.d.ts +0 -51
  337. package/dist/view/observer/clickobserver.d.ts +0 -47
  338. package/dist/view/observer/compositionobserver.d.ts +0 -86
  339. package/dist/view/observer/domeventdata.d.ts +0 -54
  340. package/dist/view/observer/domeventobserver.d.ts +0 -82
  341. package/dist/view/observer/fakeselectionobserver.d.ts +0 -51
  342. package/dist/view/observer/focusobserver.d.ts +0 -98
  343. package/dist/view/observer/inputobserver.d.ts +0 -90
  344. package/dist/view/observer/keyobserver.d.ts +0 -70
  345. package/dist/view/observer/mouseobserver.d.ts +0 -93
  346. package/dist/view/observer/mutationobserver.d.ts +0 -119
  347. package/dist/view/observer/observer.d.ts +0 -93
  348. package/dist/view/observer/selectionobserver.d.ts +0 -151
  349. package/dist/view/observer/tabobserver.d.ts +0 -50
  350. package/dist/view/placeholder.d.ts +0 -100
  351. package/dist/view/position.d.ts +0 -192
  352. package/dist/view/range.d.ts +0 -283
  353. package/dist/view/rawelement.d.ts +0 -77
  354. package/dist/view/renderer.d.ts +0 -281
  355. package/dist/view/rooteditableelement.d.ts +0 -45
  356. package/dist/view/selection.d.ts +0 -379
  357. package/dist/view/styles/background.d.ts +0 -37
  358. package/dist/view/styles/border.d.ts +0 -47
  359. package/dist/view/styles/margin.d.ts +0 -33
  360. package/dist/view/styles/padding.d.ts +0 -33
  361. package/dist/view/styles/utils.d.ts +0 -97
  362. package/dist/view/stylesmap.d.ts +0 -685
  363. package/dist/view/text.d.ts +0 -78
  364. package/dist/view/textproxy.d.ts +0 -101
  365. package/dist/view/treewalker.d.ts +0 -199
  366. package/dist/view/typecheckable.d.ts +0 -452
  367. package/dist/view/uielement.d.ts +0 -100
  368. package/dist/view/upcastwriter.d.ts +0 -421
  369. package/dist/view/view.d.ts +0 -488
@@ -1,118 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- import type Operation from './operation/operation.js';
10
- /**
11
- * @module engine/model/history
12
- */
13
- /**
14
- * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.
15
- */
16
- export default class History {
17
- /**
18
- * Operations added to the history.
19
- */
20
- private _operations;
21
- /**
22
- * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which
23
- * {@link module:engine/model/operation/operation~Operation operation}.
24
- *
25
- * Keys of the map are "undoing operations", that is operations that undone some other operations. For each key, the
26
- * value is an operation that has been undone by the "undoing operation".
27
- */
28
- private _undoPairs;
29
- /**
30
- * Holds all undone operations.
31
- */
32
- private _undoneOperations;
33
- /**
34
- * A map that allows retrieving the operations fast based on the given base version.
35
- */
36
- private _baseVersionToOperationIndex;
37
- /**
38
- * The history version.
39
- */
40
- private _version;
41
- /**
42
- * The gap pairs kept in the <from,to> format.
43
- *
44
- * Anytime the `history.version` is set to a version larger than `history.version + 1`,
45
- * a new <lastHistoryVersion, newHistoryVersion> entry is added to the map.
46
- */
47
- private _gaps;
48
- /**
49
- * The version of the last operation in the history.
50
- *
51
- * The history version is incremented automatically when a new operation is added to the history.
52
- * Setting the version manually should be done only in rare circumstances when a gap is planned
53
- * between history versions. When doing so, a gap will be created and the history will accept adding
54
- * an operation with base version equal to the new history version.
55
- */
56
- get version(): number;
57
- set version(version: number);
58
- /**
59
- * The last history operation.
60
- */
61
- get lastOperation(): Operation | undefined;
62
- /**
63
- * Adds an operation to the history and increments the history version.
64
- *
65
- * The operation's base version should be equal to the history version. Otherwise an error is thrown.
66
- */
67
- addOperation(operation: Operation): void;
68
- /**
69
- * Returns operations from the given range of operation base versions that were added to the history.
70
- *
71
- * Note that there may be gaps in operations base versions.
72
- *
73
- * @param fromBaseVersion Base version from which operations should be returned (inclusive).
74
- * @param toBaseVersion Base version up to which operations should be returned (exclusive).
75
- * @returns History operations for the given range, in chronological order.
76
- */
77
- getOperations(fromBaseVersion?: number, toBaseVersion?: number): Array<Operation>;
78
- /**
79
- * Returns operation from the history that bases on given `baseVersion`.
80
- *
81
- * @param baseVersion Base version of the operation to get.
82
- * @returns Operation with given base version or `undefined` if there is no such operation in history.
83
- */
84
- getOperation(baseVersion: number): Operation | undefined;
85
- /**
86
- * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,
87
- * history is keeping more context information about operations, which helps in operational transformation.
88
- *
89
- * @param undoneOperation Operation which is undone by `undoingOperation`.
90
- * @param undoingOperation Operation which undoes `undoneOperation`.
91
- */
92
- setOperationAsUndone(undoneOperation: Operation, undoingOperation: Operation): void;
93
- /**
94
- * Checks whether given `operation` is undoing any other operation.
95
- *
96
- * @param operation Operation to check.
97
- * @returns `true` if given `operation` is undoing any other operation, `false` otherwise.
98
- */
99
- isUndoingOperation(operation: Operation): boolean;
100
- /**
101
- * Checks whether given `operation` has been undone by any other operation.
102
- *
103
- * @param operation Operation to check.
104
- * @returns `true` if given `operation` has been undone any other operation, `false` otherwise.
105
- */
106
- isUndoneOperation(operation: Operation): boolean;
107
- /**
108
- * For given `undoingOperation`, returns the operation which has been undone by it.
109
- *
110
- * @returns Operation that has been undone by given `undoingOperation` or `undefined`
111
- * if given `undoingOperation` is not undoing any other operation.
112
- */
113
- getUndoneOperation(undoingOperation: Operation): Operation | undefined;
114
- /**
115
- * Resets the history of operations.
116
- */
117
- reset(): void;
118
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- import type Node from './node.js';
10
- import type TextProxy from './textproxy.js';
11
- /**
12
- * @module engine/model/item
13
- */
14
- /**
15
- * Item is a {@link module:engine/model/node~Node} or {@link module:engine/model/textproxy~TextProxy}.
16
- */
17
- type Item = Node | TextProxy;
18
- export default Item;
@@ -1,81 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module engine/model/liveposition
11
- */
12
- import Position, { type PositionOffset, type PositionStickiness } from './position.js';
13
- import type DocumentFragment from './documentfragment.js';
14
- import type Item from './item.js';
15
- import type RootElement from './rootelement.js';
16
- declare const LivePosition_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof Position, import("@ckeditor/ckeditor5-utils").Emitter>;
17
- /**
18
- * `LivePosition` is a type of {@link module:engine/model/position~Position Position}
19
- * that updates itself as {@link module:engine/model/document~Document document}
20
- * is changed through operations. It may be used as a bookmark.
21
- *
22
- * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are
23
- * {@link module:engine/model/rootelement~RootElement}.
24
- * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.
25
- *
26
- * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might
27
- * have to be unbound.
28
- * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.
29
- */
30
- export default class LivePosition extends /* #__PURE__ */ LivePosition_base {
31
- /**
32
- * Root of the position path.
33
- */
34
- readonly root: RootElement;
35
- /**
36
- * Creates a live position.
37
- *
38
- * @see module:engine/model/position~Position
39
- */
40
- constructor(root: RootElement, path: Array<number>, stickiness?: PositionStickiness);
41
- /**
42
- * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance
43
- * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
44
- * referring to it).
45
- */
46
- detach(): void;
47
- /**
48
- * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.
49
- */
50
- toPosition(): Position;
51
- /**
52
- * Creates a `LivePosition` instance that is equal to position.
53
- */
54
- static fromPosition(position: Position, stickiness?: PositionStickiness): LivePosition;
55
- /**
56
- * @internal
57
- * @see module:engine/model/position~Position._createAfter
58
- */
59
- static readonly _createAfter: (item: Item | DocumentFragment, stickiness?: PositionStickiness) => LivePosition;
60
- /**
61
- * @internal
62
- * @see module:engine/model/position~Position._createBefore
63
- */
64
- static readonly _createBefore: (item: Item | DocumentFragment, stickiness?: PositionStickiness) => LivePosition;
65
- /**
66
- * @internal
67
- * @see module:engine/model/position~Position._createAt
68
- */
69
- static readonly _createAt: (itemOrPosition: Item | Position | DocumentFragment, offset?: PositionOffset, stickiness?: PositionStickiness) => LivePosition;
70
- }
71
- /**
72
- * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.
73
- *
74
- * @eventName ~LivePosition#change
75
- * @param oldPosition Position equal to this live position before it got changed.
76
- */
77
- export type LivePositionChangeEvent = {
78
- name: 'change';
79
- args: [oldPosition: Position];
80
- };
81
- export {};
@@ -1,106 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module engine/model/liverange
11
- */
12
- import Range from './range.js';
13
- import type DocumentFragment from './documentfragment.js';
14
- import type Element from './element.js';
15
- import type Item from './item.js';
16
- import type Position from './position.js';
17
- declare const LiveRange_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof Range, import("@ckeditor/ckeditor5-utils").Emitter>;
18
- /**
19
- * `LiveRange` is a type of {@link module:engine/model/range~Range Range}
20
- * that updates itself as {@link module:engine/model/document~Document document}
21
- * is changed through operations. It may be used as a bookmark.
22
- *
23
- * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might
24
- * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.
25
- */
26
- export default class LiveRange extends /* #__PURE__ */ LiveRange_base {
27
- /**
28
- * Creates a live range.
29
- *
30
- * @see module:engine/model/range~Range
31
- */
32
- constructor(start: Position, end?: Position | null);
33
- /**
34
- * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance
35
- * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
36
- * referring to it).
37
- */
38
- detach(): void;
39
- /**
40
- * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.
41
- */
42
- toRange(): Range;
43
- /**
44
- * Creates a `LiveRange` instance that is equal to the given range.
45
- */
46
- static fromRange(range: Range): LiveRange;
47
- /**
48
- * @see module:engine/model/range~Range._createIn
49
- * @internal
50
- */
51
- static readonly _createIn: (element: Element | DocumentFragment) => LiveRange;
52
- /**
53
- * @see module:engine/model/range~Range._createOn
54
- * @internal
55
- */
56
- static readonly _createOn: (element: Item | DocumentFragment) => LiveRange;
57
- /**
58
- * @see module:engine/model/range~Range._createFromPositionAndShift
59
- * @internal
60
- */
61
- static readonly _createFromPositionAndShift: (position: Position, shift: number) => LiveRange;
62
- }
63
- /**
64
- * Fired when `LiveRange` instance boundaries have changed due to changes in the
65
- * {@link module:engine/model/document~Document document}.
66
- *
67
- * @eventName ~LiveRange#change:range
68
- * @param oldRange Range with start and end position equal to start and end position of this live
69
- * range before it got changed.
70
- * @param data Object with additional information about the change.
71
- * @param data.deletionPosition Source position for remove and merge changes.
72
- * Available if the range was moved to the graveyard root, `null` otherwise.
73
- */
74
- export type LiveRangeChangeRangeEvent = {
75
- name: 'change' | 'change:range';
76
- args: [range: Range, data: {
77
- deletionPosition: Position | null;
78
- }];
79
- };
80
- /**
81
- * Fired when `LiveRange` instance boundaries have not changed after a change in {@link module:engine/model/document~Document document}
82
- * but the change took place inside the range, effectively changing its content.
83
- *
84
- * @eventName ~LiveRange#change:content
85
- * @param range Range with start and end position equal to start and end position of
86
- * change range.
87
- * @param data Object with additional information about the change.
88
- * @param data.deletionPosition Due to the nature of this event, this property is always set to `null`. It is passed
89
- * for compatibility with the {@link module:engine/model/liverange~LiveRange#event:change:range} event.
90
- */
91
- export type LiveRangeChangeContentEvent = {
92
- name: 'change' | 'change:content';
93
- args: [range: Range, data: {
94
- deletionPosition: null;
95
- }];
96
- };
97
- /**
98
- * Describes `change:range` or `change:content` event.
99
- */
100
- export type LiveRangeChangeEvent = {
101
- name: 'change' | 'change:range' | 'change:content';
102
- args: [range: Range, data: {
103
- deletionPosition: Position | null;
104
- }];
105
- };
106
- export {};
@@ -1,339 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module engine/model/markercollection
11
- */
12
- import TypeCheckable from './typecheckable.js';
13
- import LiveRange, { type LiveRangeChangeContentEvent, type LiveRangeChangeRangeEvent, type LiveRangeChangeEvent } from './liverange.js';
14
- import type Position from './position.js';
15
- import type Range from './range.js';
16
- declare const MarkerCollection_base: {
17
- new (): import("@ckeditor/ckeditor5-utils").Emitter;
18
- prototype: import("@ckeditor/ckeditor5-utils").Emitter;
19
- };
20
- /**
21
- * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
22
- * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
23
- * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.
24
- *
25
- * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:
26
- * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since
27
- * the writer is the only proper way to change the data model it is not possible to change markers directly using this
28
- * collection. All markers created by the writer will be automatically added to this collection.
29
- *
30
- * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.
31
- *
32
- * @see module:engine/model/markercollection~Marker
33
- */
34
- export default class MarkerCollection extends /* #__PURE__ */ MarkerCollection_base implements Iterable<Marker> {
35
- /**
36
- * Stores {@link ~Marker markers} added to the collection.
37
- */
38
- private _markers;
39
- /**
40
- * Iterable interface.
41
- *
42
- * Iterates over all {@link ~Marker markers} added to the collection.
43
- */
44
- [Symbol.iterator](): IterableIterator<Marker>;
45
- /**
46
- * Checks if given {@link ~Marker marker} or marker name is in the collection.
47
- *
48
- * @param markerOrName Name of marker or marker instance to check.
49
- * @returns `true` if marker is in the collection, `false` otherwise.
50
- */
51
- has(markerOrName: string | Marker): boolean;
52
- /**
53
- * Returns {@link ~Marker marker} with given `markerName`.
54
- *
55
- * @param markerName Name of marker to get.
56
- * @returns Marker with given name or `null` if such marker was
57
- * not added to the collection.
58
- */
59
- get(markerName: string): Marker | null;
60
- /**
61
- * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given
62
- * {@link module:engine/model/range~Range range}.
63
- *
64
- * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in
65
- * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired
66
- * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}
67
- * flag has changed.
68
- *
69
- * @internal
70
- * @fires update
71
- * @param markerOrName Name of marker to set or marker instance to update.
72
- * @param range Marker range.
73
- * @param managedUsingOperations Specifies whether the marker is managed using operations.
74
- * @param affectsData Specifies whether the marker affects the data produced by the data pipeline
75
- * (is persisted in the editor's data).
76
- * @returns `Marker` instance which was added or updated.
77
- */
78
- _set(markerOrName: string | Marker, range: Range, managedUsingOperations?: boolean, affectsData?: boolean): Marker;
79
- /**
80
- * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.
81
- *
82
- * @internal
83
- * @fires update
84
- * @param markerOrName Marker or name of a marker to remove.
85
- * @returns `true` if marker was found and removed, `false` otherwise.
86
- */
87
- _remove(markerOrName: string | Marker): boolean;
88
- /**
89
- * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}
90
- * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast
91
- * conversion} for the marker.
92
- *
93
- * @internal
94
- * @fires update
95
- * @param markerOrName Marker or name of a marker to refresh.
96
- */
97
- _refresh(markerOrName: string | Marker): void;
98
- /**
99
- * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.
100
- */
101
- getMarkersAtPosition(position: Position): IterableIterator<Marker>;
102
- /**
103
- * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.
104
- */
105
- getMarkersIntersectingRange(range: Range): Iterable<Marker>;
106
- /**
107
- * Destroys marker collection and all markers inside it.
108
- */
109
- destroy(): void;
110
- /**
111
- * Iterates over all markers that starts with given `prefix`.
112
- *
113
- * ```ts
114
- * const markerFooA = markersCollection._set( 'foo:a', rangeFooA );
115
- * const markerFooB = markersCollection._set( 'foo:b', rangeFooB );
116
- * const markerBarA = markersCollection._set( 'bar:a', rangeBarA );
117
- * const markerFooBarA = markersCollection._set( 'foobar:a', rangeFooBarA );
118
- * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
119
- * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
120
- * ```
121
- */
122
- getMarkersGroup(prefix: string): IterableIterator<Marker>;
123
- /**
124
- * Destroys the marker.
125
- */
126
- private _destroyMarker;
127
- }
128
- export interface MarkerData {
129
- /**
130
- * Marker range. `null` if the marker was removed.
131
- */
132
- range: Range | null;
133
- /**
134
- * A property defining if the marker affects data.
135
- */
136
- affectsData: boolean;
137
- /**
138
- * A property defining if the marker is managed using operations.
139
- */
140
- managedUsingOperations: boolean;
141
- }
142
- declare const Marker_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof TypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
143
- /**
144
- * `Marker` is a continuous part of the model (like a range), is named and represents some kind of information about the
145
- * marked part of the model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of
146
- * the model document tree, markers are not stored directly in the document tree but in the
147
- * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving
148
- * additional meaning to the part of a model document between marker start and marker end.
149
- *
150
- * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is
151
- * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).
152
- * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that
153
- * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being
154
- * "special" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document
155
- * model, it starts being "special" and the marker is enlarged.
156
- *
157
- * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes
158
- * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access
159
- * to the range which it is marking at the moment.
160
- *
161
- * Markers are built from a name and a range.
162
- *
163
- * Range of the marker is updated automatically when document changes, using
164
- * {@link module:engine/model/liverange~LiveRange live range} mechanism.
165
- *
166
- * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by
167
- * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating
168
- * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in
169
- * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.
170
- * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.
171
- *
172
- * There are two types of markers.
173
- *
174
- * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}
175
- * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used
176
- * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.
177
- *
178
- * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}
179
- * but changes in these markers is managed the same way all other changes in the model structure - using operations.
180
- * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.
181
- * This type of markers is useful for solutions like spell checking or comments.
182
- *
183
- * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}
184
- * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.
185
- *
186
- * ```ts
187
- * model.change( ( writer ) => {
188
- * const marker = writer.addMarker( name, { range, usingOperation: true } );
189
- *
190
- * // ...
191
- *
192
- * writer.removeMarker( marker );
193
- * } );
194
- * ```
195
- *
196
- * See {@link module:engine/model/writer~Writer} to find more examples.
197
- *
198
- * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little
199
- * markers as possible and remove them as soon as they are not needed anymore.
200
- *
201
- * Markers can be downcasted and upcasted.
202
- *
203
- * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and
204
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.
205
- * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.
206
- * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.
207
- * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or
208
- * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.
209
- *
210
- * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.
211
- */
212
- declare class Marker extends /* #__PURE__ */ Marker_base {
213
- /**
214
- * Marker's name.
215
- */
216
- readonly name: string;
217
- /**
218
- * Flag indicates if the marker is managed using operations or not.
219
- *
220
- * @internal
221
- */
222
- _managedUsingOperations: boolean;
223
- /**
224
- * Specifies whether the marker affects the data produced by the data pipeline
225
- * (is persisted in the editor's data).
226
- *
227
- * @internal
228
- */
229
- _affectsData: boolean;
230
- /**
231
- * Range marked by the marker.
232
- */
233
- private _liveRange;
234
- /**
235
- * Creates a marker instance.
236
- *
237
- * @param name Marker name.
238
- * @param liveRange Range marked by the marker.
239
- * @param managedUsingOperations Specifies whether the marker is managed using operations.
240
- * @param affectsData Specifies whether the marker affects the data produced by the data pipeline (is persisted in the editor's data).
241
- */
242
- constructor(name: string, liveRange: LiveRange, managedUsingOperations: boolean, affectsData: boolean);
243
- /**
244
- * A value indicating if the marker is managed using operations.
245
- * See {@link ~Marker marker class description} to learn more about marker types.
246
- * See {@link module:engine/model/writer~Writer#addMarker}.
247
- */
248
- get managedUsingOperations(): boolean;
249
- /**
250
- * A value indicating if the marker changes the data.
251
- */
252
- get affectsData(): boolean;
253
- /**
254
- * Returns the marker data (properties defining the marker).
255
- */
256
- getData(): MarkerData;
257
- /**
258
- * Returns current marker start position.
259
- */
260
- getStart(): Position;
261
- /**
262
- * Returns current marker end position.
263
- */
264
- getEnd(): Position;
265
- /**
266
- * Returns a range that represents the current state of the marker.
267
- *
268
- * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a
269
- * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only
270
- * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}
271
- * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every
272
- * time there is a need to read marker properties. This will guarantee that the marker has not been removed and
273
- * that it's data is up-to-date.
274
- */
275
- getRange(): Range;
276
- /**
277
- * Binds new live range to the marker and detach the old one if is attached.
278
- *
279
- * @internal
280
- * @param liveRange Live range to attach
281
- * @returns Attached live range.
282
- */
283
- _attachLiveRange(liveRange: LiveRange): LiveRange;
284
- /**
285
- * Unbinds and destroys currently attached live range.
286
- *
287
- * @internal
288
- */
289
- _detachLiveRange(): void;
290
- }
291
- export type { Marker };
292
- /**
293
- * Fired whenever {@link ~Marker#_liveRange marker range} is changed due to changes on {@link module:engine/model/document~Document}.
294
- * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:range LiveRange change:range event}.
295
- *
296
- * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
297
- * all event listeners listening to it should be removed. It is best to do it on
298
- * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
299
- *
300
- * @see module:engine/model/liverange~LiveRange#event:change:range
301
- * @eventName ~Marker#change:range
302
- */
303
- export type MarkerChangeRangeEvent = LiveRangeChangeRangeEvent;
304
- /**
305
- * Fired whenever change on {@link module:engine/model/document~Document} is done inside {@link ~Marker#_liveRange marker range}.
306
- * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:content LiveRange change:content event}.
307
- *
308
- * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
309
- * all event listeners listening to it should be removed. It is best to do it on
310
- * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
311
- *
312
- * @see module:engine/model/liverange~LiveRange#event:change:content
313
- * @eventName ~Marker#change:content
314
- */
315
- export type MarkerCollectionChangeContentEvent = LiveRangeChangeContentEvent;
316
- /**
317
- * Describes `change:range` or `change:content` event.
318
- */
319
- export type MarkerChangeEvent = LiveRangeChangeEvent;
320
- /**
321
- * Fired whenever marker is added, updated or removed from `MarkerCollection`.
322
- *
323
- * @eventName ~MarkerCollection#update
324
- * @param marker Updated Marker.
325
- * @param oldRange Marker range before the update. When is not defined it
326
- * means that marker is just added.
327
- * @param newRange Marker range after update. When is not defined it
328
- * means that marker is just removed.
329
- * @param oldMarkerData Data of the marker before the change.
330
- */
331
- export type MarkerCollectionUpdateEvent = {
332
- name: 'update' | `update:${string}`;
333
- args: [marker: Marker, oldRange: Range | null, newRange: Range | null, oldMarkerData: MarkerData];
334
- };
335
- /**
336
- * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.
337
- *
338
- * @error marker-destroyed
339
- */