@ckeditor/ckeditor5-engine 45.2.1 → 46.0.0-alpha.0

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 (241) hide show
  1. package/dist/index.js +2563 -2257
  2. package/dist/index.js.map +1 -1
  3. package/package.json +3 -3
  4. package/src/controller/datacontroller.d.ts +33 -32
  5. package/src/controller/datacontroller.js +29 -28
  6. package/src/controller/editingcontroller.d.ts +8 -8
  7. package/src/controller/editingcontroller.js +10 -10
  8. package/src/conversion/conversion.d.ts +18 -19
  9. package/src/conversion/conversion.js +4 -4
  10. package/src/conversion/conversionhelpers.d.ts +1 -1
  11. package/src/conversion/conversionhelpers.js +1 -1
  12. package/src/conversion/downcastdispatcher.d.ts +63 -69
  13. package/src/conversion/downcastdispatcher.js +16 -16
  14. package/src/conversion/downcasthelpers.d.ts +94 -83
  15. package/src/conversion/downcasthelpers.js +63 -53
  16. package/src/conversion/mapper.d.ts +27 -27
  17. package/src/conversion/mapper.js +15 -15
  18. package/src/conversion/modelconsumable.d.ts +26 -26
  19. package/src/conversion/modelconsumable.js +23 -23
  20. package/src/conversion/upcastdispatcher.d.ts +33 -32
  21. package/src/conversion/upcastdispatcher.js +19 -19
  22. package/src/conversion/upcasthelpers.d.ts +46 -38
  23. package/src/conversion/upcasthelpers.js +33 -24
  24. package/src/conversion/viewconsumable.d.ts +50 -45
  25. package/src/conversion/viewconsumable.js +32 -27
  26. package/src/dataprocessor/basichtmlwriter.d.ts +4 -2
  27. package/src/dataprocessor/basichtmlwriter.js +3 -1
  28. package/src/dataprocessor/dataprocessor.d.ts +7 -6
  29. package/src/dataprocessor/htmldataprocessor.d.ts +10 -10
  30. package/src/dataprocessor/htmldataprocessor.js +6 -6
  31. package/src/dataprocessor/htmlwriter.d.ts +1 -1
  32. package/src/dataprocessor/xmldataprocessor.d.ts +10 -10
  33. package/src/dataprocessor/xmldataprocessor.js +6 -6
  34. package/src/dev-utils/model.d.ts +25 -26
  35. package/src/dev-utils/model.js +35 -36
  36. package/src/dev-utils/operationreplayer.d.ts +5 -3
  37. package/src/dev-utils/operationreplayer.js +4 -2
  38. package/src/dev-utils/utils.d.ts +8 -0
  39. package/src/dev-utils/utils.js +8 -0
  40. package/src/dev-utils/view.d.ts +66 -63
  41. package/src/dev-utils/view.js +144 -134
  42. package/src/index.d.ts +135 -106
  43. package/src/index.js +120 -71
  44. package/src/legacyerrors.d.ts +5 -0
  45. package/src/legacyerrors.js +17 -0
  46. package/src/model/batch.d.ts +2 -15
  47. package/src/model/batch.js +1 -23
  48. package/src/model/differ.d.ts +54 -31
  49. package/src/model/differ.js +15 -15
  50. package/src/model/document.d.ts +31 -31
  51. package/src/model/document.js +13 -13
  52. package/src/model/documentfragment.d.ts +45 -45
  53. package/src/model/documentfragment.js +40 -40
  54. package/src/model/documentselection.d.ts +92 -92
  55. package/src/model/documentselection.js +71 -70
  56. package/src/model/element.d.ts +31 -31
  57. package/src/model/element.js +29 -29
  58. package/src/model/history.d.ts +3 -3
  59. package/src/model/history.js +2 -2
  60. package/src/model/item.d.ts +4 -5
  61. package/src/model/liveposition.d.ts +31 -31
  62. package/src/model/liveposition.js +18 -18
  63. package/src/model/liverange.d.ts +42 -38
  64. package/src/model/liverange.js +17 -16
  65. package/src/model/markercollection.d.ts +41 -40
  66. package/src/model/markercollection.js +22 -20
  67. package/src/model/model.d.ts +82 -81
  68. package/src/model/model.js +54 -54
  69. package/src/model/node.d.ts +48 -48
  70. package/src/model/node.js +31 -31
  71. package/src/model/nodelist.d.ts +17 -17
  72. package/src/model/nodelist.js +11 -11
  73. package/src/model/operation/attributeoperation.d.ts +10 -10
  74. package/src/model/operation/attributeoperation.js +7 -7
  75. package/src/model/operation/detachoperation.d.ts +11 -9
  76. package/src/model/operation/detachoperation.js +8 -6
  77. package/src/model/operation/insertoperation.d.ts +13 -13
  78. package/src/model/operation/insertoperation.js +15 -15
  79. package/src/model/operation/markeroperation.d.ts +12 -12
  80. package/src/model/operation/markeroperation.js +5 -5
  81. package/src/model/operation/mergeoperation.d.ts +16 -16
  82. package/src/model/operation/mergeoperation.js +18 -18
  83. package/src/model/operation/moveoperation.d.ts +16 -16
  84. package/src/model/operation/moveoperation.js +18 -15
  85. package/src/model/operation/nooperation.d.ts +4 -4
  86. package/src/model/operation/nooperation.js +2 -2
  87. package/src/model/operation/operation.d.ts +10 -10
  88. package/src/model/operation/operation.js +5 -5
  89. package/src/model/operation/operationfactory.d.ts +4 -4
  90. package/src/model/operation/operationfactory.js +12 -12
  91. package/src/model/operation/renameoperation.d.ts +10 -10
  92. package/src/model/operation/renameoperation.js +7 -7
  93. package/src/model/operation/rootattributeoperation.d.ts +12 -12
  94. package/src/model/operation/rootattributeoperation.js +8 -8
  95. package/src/model/operation/rootoperation.d.ts +8 -8
  96. package/src/model/operation/rootoperation.js +3 -3
  97. package/src/model/operation/splitoperation.d.ts +17 -17
  98. package/src/model/operation/splitoperation.js +19 -19
  99. package/src/model/operation/transform.d.ts +11 -8
  100. package/src/model/operation/transform.js +66 -49
  101. package/src/model/operation/utils.d.ts +24 -23
  102. package/src/model/operation/utils.js +20 -20
  103. package/src/model/position.d.ts +101 -97
  104. package/src/model/position.js +69 -64
  105. package/src/model/range.d.ts +90 -90
  106. package/src/model/range.js +87 -87
  107. package/src/model/rootelement.d.ts +11 -11
  108. package/src/model/rootelement.js +9 -9
  109. package/src/model/schema.d.ts +158 -154
  110. package/src/model/schema.js +93 -90
  111. package/src/model/selection.d.ts +73 -73
  112. package/src/model/selection.js +62 -62
  113. package/src/model/text.d.ts +11 -10
  114. package/src/model/text.js +11 -10
  115. package/src/model/textproxy.d.ts +39 -38
  116. package/src/model/textproxy.js +31 -30
  117. package/src/model/treewalker.d.ts +37 -37
  118. package/src/model/treewalker.js +14 -14
  119. package/src/model/typecheckable.d.ts +45 -45
  120. package/src/model/typecheckable.js +1 -1
  121. package/src/model/utils/autoparagraphing.d.ts +7 -7
  122. package/src/model/utils/deletecontent.d.ts +7 -5
  123. package/src/model/utils/deletecontent.js +13 -11
  124. package/src/model/utils/getselectedcontent.d.ts +6 -5
  125. package/src/model/utils/getselectedcontent.js +2 -1
  126. package/src/model/utils/insertcontent.d.ts +9 -8
  127. package/src/model/utils/insertcontent.js +41 -40
  128. package/src/model/utils/insertobject.d.ts +9 -9
  129. package/src/model/utils/insertobject.js +4 -4
  130. package/src/model/utils/modifyselection.d.ts +5 -4
  131. package/src/model/utils/modifyselection.js +12 -11
  132. package/src/model/utils/selection-post-fixer.d.ts +12 -8
  133. package/src/model/utils/selection-post-fixer.js +15 -11
  134. package/src/model/writer.d.ts +102 -101
  135. package/src/model/writer.js +99 -98
  136. package/src/view/attributeelement.d.ts +29 -29
  137. package/src/view/attributeelement.js +25 -25
  138. package/src/view/containerelement.d.ts +16 -15
  139. package/src/view/containerelement.js +15 -14
  140. package/src/view/datatransfer.d.ts +7 -7
  141. package/src/view/datatransfer.js +1 -1
  142. package/src/view/document.d.ts +25 -25
  143. package/src/view/document.js +15 -15
  144. package/src/view/documentfragment.d.ts +21 -21
  145. package/src/view/documentfragment.js +14 -14
  146. package/src/view/documentselection.d.ts +65 -63
  147. package/src/view/documentselection.js +27 -25
  148. package/src/view/domconverter.d.ts +94 -89
  149. package/src/view/domconverter.js +78 -73
  150. package/src/view/downcastwriter.d.ts +185 -181
  151. package/src/view/downcastwriter.js +222 -210
  152. package/src/view/editableelement.d.ts +13 -13
  153. package/src/view/editableelement.js +8 -8
  154. package/src/view/element.d.ts +75 -74
  155. package/src/view/element.js +58 -58
  156. package/src/view/elementdefinition.d.ts +3 -4
  157. package/src/view/emptyelement.d.ts +13 -13
  158. package/src/view/emptyelement.js +13 -13
  159. package/src/view/filler.d.ts +14 -3
  160. package/src/view/filler.js +12 -1
  161. package/src/view/item.d.ts +4 -5
  162. package/src/view/matcher.d.ts +22 -19
  163. package/src/view/matcher.js +6 -6
  164. package/src/view/node.d.ts +33 -33
  165. package/src/view/node.js +9 -9
  166. package/src/view/observer/arrowkeysobserver.d.ts +10 -10
  167. package/src/view/observer/arrowkeysobserver.js +5 -5
  168. package/src/view/observer/bubblingemittermixin.d.ts +5 -5
  169. package/src/view/observer/bubblingemittermixin.js +2 -9
  170. package/src/view/observer/bubblingeventinfo.d.ts +9 -9
  171. package/src/view/observer/bubblingeventinfo.js +1 -1
  172. package/src/view/observer/clickobserver.d.ts +8 -8
  173. package/src/view/observer/clickobserver.js +4 -4
  174. package/src/view/observer/compositionobserver.d.ts +19 -19
  175. package/src/view/observer/compositionobserver.js +6 -6
  176. package/src/view/observer/domeventdata.d.ts +9 -9
  177. package/src/view/observer/domeventdata.js +2 -2
  178. package/src/view/observer/domeventobserver.d.ts +3 -3
  179. package/src/view/observer/domeventobserver.js +5 -5
  180. package/src/view/observer/fakeselectionobserver.d.ts +9 -9
  181. package/src/view/observer/fakeselectionobserver.js +8 -8
  182. package/src/view/observer/focusobserver.d.ts +16 -16
  183. package/src/view/observer/focusobserver.js +7 -7
  184. package/src/view/observer/inputobserver.d.ts +18 -18
  185. package/src/view/observer/inputobserver.js +5 -5
  186. package/src/view/observer/keyobserver.d.ts +11 -11
  187. package/src/view/observer/keyobserver.js +3 -3
  188. package/src/view/observer/mouseobserver.d.ts +16 -16
  189. package/src/view/observer/mouseobserver.js +3 -3
  190. package/src/view/observer/mutationobserver.d.ts +21 -21
  191. package/src/view/observer/mutationobserver.js +7 -7
  192. package/src/view/observer/observer.d.ts +12 -12
  193. package/src/view/observer/observer.js +6 -6
  194. package/src/view/observer/selectionobserver.d.ts +33 -33
  195. package/src/view/observer/selectionobserver.js +14 -14
  196. package/src/view/observer/tabobserver.d.ts +10 -10
  197. package/src/view/observer/tabobserver.js +5 -5
  198. package/src/view/observer/touchobserver.d.ts +13 -13
  199. package/src/view/observer/touchobserver.js +3 -3
  200. package/src/view/placeholder.d.ts +21 -21
  201. package/src/view/placeholder.js +23 -23
  202. package/src/view/position.d.ts +49 -49
  203. package/src/view/position.js +42 -42
  204. package/src/view/range.d.ts +76 -74
  205. package/src/view/range.js +67 -65
  206. package/src/view/rawelement.d.ts +19 -19
  207. package/src/view/rawelement.js +16 -16
  208. package/src/view/renderer.d.ts +14 -14
  209. package/src/view/renderer.js +7 -7
  210. package/src/view/rooteditableelement.d.ts +8 -7
  211. package/src/view/rooteditableelement.js +7 -6
  212. package/src/view/selection.d.ts +66 -64
  213. package/src/view/selection.js +50 -48
  214. package/src/view/styles/background.d.ts +2 -2
  215. package/src/view/styles/background.js +9 -9
  216. package/src/view/styles/border.d.ts +2 -2
  217. package/src/view/styles/border.js +13 -13
  218. package/src/view/styles/margin.d.ts +2 -2
  219. package/src/view/styles/margin.js +5 -5
  220. package/src/view/styles/padding.d.ts +2 -2
  221. package/src/view/styles/padding.js +5 -5
  222. package/src/view/styles/utils.d.ts +24 -24
  223. package/src/view/styles/utils.js +25 -25
  224. package/src/view/stylesmap.d.ts +28 -32
  225. package/src/view/stylesmap.js +52 -39
  226. package/src/view/text.d.ts +11 -11
  227. package/src/view/text.js +10 -10
  228. package/src/view/textproxy.d.ts +33 -32
  229. package/src/view/textproxy.js +23 -22
  230. package/src/view/tokenlist.d.ts +14 -14
  231. package/src/view/tokenlist.js +10 -10
  232. package/src/view/treewalker.d.ts +42 -40
  233. package/src/view/treewalker.js +36 -35
  234. package/src/view/typecheckable.d.ts +76 -75
  235. package/src/view/typecheckable.js +1 -1
  236. package/src/view/uielement.d.ts +22 -21
  237. package/src/view/uielement.js +17 -16
  238. package/src/view/upcastwriter.d.ts +70 -70
  239. package/src/view/upcastwriter.js +42 -42
  240. package/src/view/view.d.ts +70 -69
  241. package/src/view/view.js +56 -55
@@ -5,56 +5,56 @@
5
5
  /**
6
6
  * @module engine/model/range
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import Position from './position.js';
10
- import TreeWalker, { type TreeWalkerOptions, type TreeWalkerValue } from './treewalker.js';
11
- import type Document from './document.js';
12
- import type DocumentFragment from './documentfragment.js';
13
- import type Element from './element.js';
14
- import type InsertOperation from './operation/insertoperation.js';
15
- import type Item from './item.js';
16
- import type MergeOperation from './operation/mergeoperation.js';
17
- import type MoveOperation from './operation/moveoperation.js';
18
- import type Operation from './operation/operation.js';
19
- import type SplitOperation from './operation/splitoperation.js';
8
+ import { ModelTypeCheckable } from './typecheckable.js';
9
+ import { ModelPosition } from './position.js';
10
+ import { ModelTreeWalker, type ModelTreeWalkerOptions, type ModelTreeWalkerValue } from './treewalker.js';
11
+ import { type ModelDocument } from './document.js';
12
+ import { type ModelDocumentFragment } from './documentfragment.js';
13
+ import { type ModelElement } from './element.js';
14
+ import { type InsertOperation } from './operation/insertoperation.js';
15
+ import { type ModelItem } from './item.js';
16
+ import { type MergeOperation } from './operation/mergeoperation.js';
17
+ import { type MoveOperation } from './operation/moveoperation.js';
18
+ import { type Operation } from './operation/operation.js';
19
+ import { type SplitOperation } from './operation/splitoperation.js';
20
20
  /**
21
21
  * Represents a range in the model tree.
22
22
  *
23
- * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}
23
+ * A range is defined by its {@link module:engine/model/range~ModelRange#start} and {@link module:engine/model/range~ModelRange#end}
24
24
  * positions.
25
25
  *
26
26
  * You can create range instances via its constructor or the `createRange*()` factory methods of
27
- * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
27
+ * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~ModelWriter}.
28
28
  */
29
- export default class Range extends TypeCheckable implements Iterable<TreeWalkerValue> {
29
+ export declare class ModelRange extends ModelTypeCheckable implements Iterable<ModelTreeWalkerValue> {
30
30
  /**
31
31
  * Start position.
32
32
  */
33
- readonly start: Position;
33
+ readonly start: ModelPosition;
34
34
  /**
35
35
  * End position.
36
36
  */
37
- readonly end: Position;
37
+ readonly end: ModelPosition;
38
38
  /**
39
39
  * Creates a range spanning from `start` position to `end` position.
40
40
  *
41
41
  * @param start The start position.
42
42
  * @param end The end position. If not set, the range will be collapsed at the `start` position.
43
43
  */
44
- constructor(start: Position, end?: Position | null);
44
+ constructor(start: ModelPosition, end?: ModelPosition | null);
45
45
  /**
46
46
  * Iterable interface.
47
47
  *
48
- * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
49
- * them together with additional information like length or {@link module:engine/model/position~Position positions},
50
- * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.
51
- * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range
52
- * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.
48
+ * Iterates over all {@link module:engine/model/item~ModelItem items} that are in this range and returns
49
+ * them together with additional information like length or {@link module:engine/model/position~ModelPosition positions},
50
+ * grouped as {@link module:engine/model/treewalker~ModelTreeWalkerValue}.
51
+ * It iterates over all {@link module:engine/model/textproxy~ModelTextProxy text contents} that are inside the range
52
+ * and all the {@link module:engine/model/element~ModelElement}s that are entered into when iterating over this range.
53
53
  *
54
- * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range
54
+ * This iterator uses {@link module:engine/model/treewalker~ModelTreeWalker} with `boundaries` set to this range
55
55
  * and `ignoreElementEnd` option set to `true`.
56
56
  */
57
- [Symbol.iterator](): IterableIterator<TreeWalkerValue>;
57
+ [Symbol.iterator](): IterableIterator<ModelTreeWalkerValue>;
58
58
  /**
59
59
  * Describes whether the range is collapsed, that is if {@link #start} and
60
60
  * {@link #end} positions are equal.
@@ -62,52 +62,52 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
62
62
  get isCollapsed(): boolean;
63
63
  /**
64
64
  * Describes whether this range is flat, that is if {@link #start} position and
65
- * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.
65
+ * {@link #end} position are in the same {@link module:engine/model/position~ModelPosition#parent}.
66
66
  */
67
67
  get isFlat(): boolean;
68
68
  /**
69
69
  * Range root element.
70
70
  */
71
- get root(): Element | DocumentFragment;
71
+ get root(): ModelElement | ModelDocumentFragment;
72
72
  /**
73
- * Checks whether this range contains given {@link module:engine/model/position~Position position}.
73
+ * Checks whether this range contains given {@link module:engine/model/position~ModelPosition position}.
74
74
  *
75
75
  * @param position Position to check.
76
- * @returns `true` if given {@link module:engine/model/position~Position position} is contained
76
+ * @returns `true` if given {@link module:engine/model/position~ModelPosition position} is contained
77
77
  * in this range,`false` otherwise.
78
78
  */
79
- containsPosition(position: Position): boolean;
79
+ containsPosition(position: ModelPosition): boolean;
80
80
  /**
81
- * Checks whether this range contains given {@link ~Range range}.
81
+ * Checks whether this range contains given {@link ~ModelRange range}.
82
82
  *
83
83
  * @param otherRange Range to check.
84
84
  * @param loose Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
85
85
  * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
86
86
  * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
87
- * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.
87
+ * @returns {Boolean} `true` if given {@link ~ModelRange range} boundaries are contained by this range, `false` otherwise.
88
88
  */
89
- containsRange(otherRange: Range, loose?: boolean): boolean;
89
+ containsRange(otherRange: ModelRange, loose?: boolean): boolean;
90
90
  /**
91
- * Checks whether given {@link module:engine/model/item~Item} is inside this range.
91
+ * Checks whether given {@link module:engine/model/item~ModelItem} is inside this range.
92
92
  */
93
- containsItem(item: Item): boolean;
93
+ containsItem(item: ModelItem): boolean;
94
94
  /**
95
95
  * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.
96
96
  *
97
97
  * @param otherRange Range to compare with.
98
98
  * @returns `true` if ranges are equal, `false` otherwise.
99
99
  */
100
- isEqual(otherRange: Range): boolean;
100
+ isEqual(otherRange: ModelRange): boolean;
101
101
  /**
102
102
  * Checks and returns whether this range intersects with given range.
103
103
  *
104
104
  * @param otherRange Range to compare with.
105
105
  * @returns `true` if ranges intersect, `false` otherwise.
106
106
  */
107
- isIntersecting(otherRange: Range): boolean;
107
+ isIntersecting(otherRange: ModelRange): boolean;
108
108
  /**
109
- * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.
110
- * Returned array contains zero, one or two {@link ~Range ranges}.
109
+ * Computes which part(s) of this {@link ~ModelRange range} is not a part of given {@link ~ModelRange range}.
110
+ * Returned array contains zero, one or two {@link ~ModelRange ranges}.
111
111
  *
112
112
  * Examples:
113
113
  *
@@ -132,9 +132,9 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
132
132
  * @param otherRange Range to differentiate against.
133
133
  * @returns The difference between ranges.
134
134
  */
135
- getDifference(otherRange: Range): Array<Range>;
135
+ getDifference(otherRange: ModelRange): Array<ModelRange>;
136
136
  /**
137
- * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.
137
+ * Returns an intersection of this {@link ~ModelRange range} and given {@link ~ModelRange range}.
138
138
  * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
139
139
  *
140
140
  * Examples:
@@ -154,9 +154,9 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
154
154
  * @param otherRange Range to check for intersection.
155
155
  * @returns A common part of given ranges or `null` if ranges have no common part.
156
156
  */
157
- getIntersection(otherRange: Range): Range | null;
157
+ getIntersection(otherRange: ModelRange): ModelRange | null;
158
158
  /**
159
- * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.
159
+ * Returns a range created by joining this {@link ~ModelRange range} with the given {@link ~ModelRange range}.
160
160
  * If ranges have no common part, returns `null`.
161
161
  *
162
162
  * Examples:
@@ -182,10 +182,10 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
182
182
  * @param otherRange Range to be joined.
183
183
  * @param loose Whether the intersection check is loose or strict. If the check is strict (`false`),
184
184
  * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),
185
- * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.
185
+ * compared range is also checked if it's {@link module:engine/model/position~ModelPosition#isTouching touching} current range.
186
186
  * @returns A sum of given ranges or `null` if ranges have no common part.
187
187
  */
188
- getJoined(otherRange: Range, loose?: boolean): Range | null;
188
+ getJoined(otherRange: ModelRange, loose?: boolean): ModelRange | null;
189
189
  /**
190
190
  * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.
191
191
  *
@@ -221,7 +221,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
221
221
  * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = "se"
222
222
  * ```
223
223
  *
224
- * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned
224
+ * **Note:** if an {@link module:engine/model/element~ModelElement element} is not wholly contained in this range, it won't be returned
225
225
  * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range
226
226
  * were omitted. Only their parts that were wholly in the range were returned.
227
227
  *
@@ -229,9 +229,9 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
229
229
  *
230
230
  * @returns Array of flat ranges covering this range.
231
231
  */
232
- getMinimalFlatRanges(): Array<Range>;
232
+ getMinimalFlatRanges(): Array<ModelRange>;
233
233
  /**
234
- * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
234
+ * Creates a {@link module:engine/model/treewalker~ModelTreeWalker TreeWalker} instance with this range as a boundary.
235
235
  *
236
236
  * For example, to iterate over all items in the entire document root:
237
237
  *
@@ -245,36 +245,36 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
245
245
  * }
246
246
  * ```
247
247
  *
248
- * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
248
+ * @param options Object with configuration options. See {@link module:engine/model/treewalker~ModelTreeWalker}.
249
249
  */
250
- getWalker(options?: TreeWalkerOptions): TreeWalker;
250
+ getWalker(options?: ModelTreeWalkerOptions): ModelTreeWalker;
251
251
  /**
252
- * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
252
+ * Returns an iterator that iterates over all {@link module:engine/model/item~ModelItem items} that are in this range and returns
253
253
  * them.
254
254
  *
255
- * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
256
- * set to `true`. However it returns only {@link module:engine/model/item~Item model items},
257
- * not {@link module:engine/model/treewalker~TreeWalkerValue}.
255
+ * This method uses {@link module:engine/model/treewalker~ModelTreeWalker} with `boundaries` set to this range and
256
+ * `ignoreElementEnd` option set to `true`. However it returns only {@link module:engine/model/item~ModelItem model items},
257
+ * not {@link module:engine/model/treewalker~ModelTreeWalkerValue}.
258
258
  *
259
- * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
259
+ * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~ModelTreeWalker} for
260
260
  * a full list of available options.
261
261
  *
262
- * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
262
+ * @param options Object with configuration options. See {@link module:engine/model/treewalker~ModelTreeWalker}.
263
263
  */
264
- getItems(options?: TreeWalkerOptions): IterableIterator<Item>;
264
+ getItems(options?: ModelTreeWalkerOptions): IterableIterator<ModelItem>;
265
265
  /**
266
- * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or
266
+ * Returns an iterator that iterates over all {@link module:engine/model/position~ModelPosition positions} that are boundaries or
267
267
  * contained in this range.
268
268
  *
269
- * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
270
- * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.
269
+ * This method uses {@link module:engine/model/treewalker~ModelTreeWalker} with `boundaries` set to this range. However it returns only
270
+ * {@link module:engine/model/position~ModelPosition positions}, not {@link module:engine/model/treewalker~ModelTreeWalkerValue}.
271
271
  *
272
- * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
272
+ * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~ModelTreeWalker} for
273
273
  * a full list of available options.
274
274
  *
275
- * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
275
+ * @param options Object with configuration options. See {@link module:engine/model/treewalker~ModelTreeWalker}.
276
276
  */
277
- getPositions(options?: TreeWalkerOptions): IterableIterator<Position>;
277
+ getPositions(options?: ModelTreeWalkerOptions): IterableIterator<ModelPosition>;
278
278
  /**
279
279
  * Returns a range that is a result of transforming this range by given `operation`.
280
280
  *
@@ -285,26 +285,26 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
285
285
  * @param operation Operation to transform range by.
286
286
  * @returns Range which is the result of transformation.
287
287
  */
288
- getTransformedByOperation(operation: Operation): Array<Range>;
288
+ getTransformedByOperation(operation: Operation): Array<ModelRange>;
289
289
  /**
290
290
  * Returns a range that is a result of transforming this range by multiple `operations`.
291
291
  *
292
- * @see ~Range#getTransformedByOperation
292
+ * @see ~ModelRange#getTransformedByOperation
293
293
  * @param operations Operations to transform the range by.
294
294
  * @returns Range which is the result of transformation.
295
295
  */
296
- getTransformedByOperations(operations: Iterable<Operation>): Array<Range>;
296
+ getTransformedByOperations(operations: Iterable<Operation>): Array<ModelRange>;
297
297
  /**
298
- * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
298
+ * Returns an {@link module:engine/model/element~ModelElement} or {@link module:engine/model/documentfragment~ModelDocumentFragment}
299
299
  * which is a common ancestor of the range's both ends (in which the entire range is contained).
300
300
  */
301
- getCommonAncestor(): Element | DocumentFragment | null;
301
+ getCommonAncestor(): ModelElement | ModelDocumentFragment | null;
302
302
  /**
303
- * Returns an {@link module:engine/model/element~Element Element} contained by the range.
303
+ * Returns an {@link module:engine/model/element~ModelElement Element} contained by the range.
304
304
  * The element will be returned when it is the **only** node within the range and **fully–contained**
305
305
  * at the same time.
306
306
  */
307
- getContainedElement(): Element | null;
307
+ getContainedElement(): ModelElement | null;
308
308
  /**
309
309
  * Converts `Range` to plain object and returns it.
310
310
  *
@@ -322,7 +322,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
322
322
  *
323
323
  * @internal
324
324
  */
325
- _getTransformedByInsertOperation(operation: InsertOperation, spread?: boolean): Array<Range>;
325
+ _getTransformedByInsertOperation(operation: InsertOperation, spread?: boolean): Array<ModelRange>;
326
326
  /**
327
327
  * Returns a result of transforming a copy of this range by move operation.
328
328
  *
@@ -330,7 +330,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
330
330
  *
331
331
  * @internal
332
332
  */
333
- _getTransformedByMoveOperation(operation: MoveOperation, spread?: boolean): Array<Range>;
333
+ _getTransformedByMoveOperation(operation: MoveOperation, spread?: boolean): Array<ModelRange>;
334
334
  /**
335
335
  * Returns a result of transforming a copy of this range by split operation.
336
336
  *
@@ -338,7 +338,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
338
338
  *
339
339
  * @internal
340
340
  */
341
- _getTransformedBySplitOperation(operation: SplitOperation): Range;
341
+ _getTransformedBySplitOperation(operation: SplitOperation): ModelRange;
342
342
  /**
343
343
  * Returns a result of transforming a copy of this range by merge operation.
344
344
  *
@@ -346,11 +346,11 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
346
346
  *
347
347
  * @internal
348
348
  */
349
- _getTransformedByMergeOperation(operation: MergeOperation): Range;
349
+ _getTransformedByMergeOperation(operation: MergeOperation): ModelRange;
350
350
  /**
351
- * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this
352
- * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are
353
- * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.
351
+ * Returns an array containing one or two {@link ~ModelRange ranges} that are a result of transforming this
352
+ * {@link ~ModelRange range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~ModelRange ranges} are
353
+ * returned if the insertion was inside this {@link ~ModelRange range} and `spread` is set to `true`.
354
354
  *
355
355
  * Examples:
356
356
  *
@@ -379,10 +379,10 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
379
379
  * was inside the range. Defaults to `false`.
380
380
  * @returns Result of the transformation.
381
381
  */
382
- _getTransformedByInsertion(insertPosition: Position, howMany: number, spread?: boolean): Array<Range>;
382
+ _getTransformedByInsertion(insertPosition: ModelPosition, howMany: number, spread?: boolean): Array<ModelRange>;
383
383
  /**
384
- * Returns an array containing {@link ~Range ranges} that are a result of transforming this
385
- * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
384
+ * Returns an array containing {@link ~ModelRange ranges} that are a result of transforming this
385
+ * {@link ~ModelRange range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
386
386
  *
387
387
  * @internal
388
388
  * @param sourcePosition Position from which nodes are moved.
@@ -391,7 +391,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
391
391
  * @param spread Whether the range should be spread if the move points inside the range.
392
392
  * @returns Result of the transformation.
393
393
  */
394
- _getTransformedByMove(sourcePosition: Position, targetPosition: Position, howMany: number, spread?: boolean): Array<Range>;
394
+ _getTransformedByMove(sourcePosition: ModelPosition, targetPosition: ModelPosition, howMany: number, spread?: boolean): Array<ModelRange>;
395
395
  /**
396
396
  * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.
397
397
  *
@@ -404,30 +404,30 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
404
404
  * @param howMany How many nodes are removed.
405
405
  * @returns Result of the transformation.
406
406
  */
407
- _getTransformedByDeletion(deletePosition: Position, howMany: number): Range | null;
407
+ _getTransformedByDeletion(deletePosition: ModelPosition, howMany: number): ModelRange | null;
408
408
  /**
409
- * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by
409
+ * Creates a new range, spreading from specified {@link module:engine/model/position~ModelPosition position} to a position moved by
410
410
  * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
411
411
  *
412
412
  * @internal
413
413
  * @param position Beginning of the range.
414
414
  * @param shift How long the range should be.
415
415
  */
416
- static _createFromPositionAndShift(position: Position, shift: number): Range;
416
+ static _createFromPositionAndShift(position: ModelPosition, shift: number): ModelRange;
417
417
  /**
418
- * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
418
+ * Creates a range inside an {@link module:engine/model/element~ModelElement element} which starts before the first child of
419
419
  * that element and ends after the last child of that element.
420
420
  *
421
421
  * @internal
422
422
  * @param element Element which is a parent for the range.
423
423
  */
424
- static _createIn(element: Element | DocumentFragment): Range;
424
+ static _createIn(element: ModelElement | ModelDocumentFragment): ModelRange;
425
425
  /**
426
- * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.
426
+ * Creates a range that starts before given {@link module:engine/model/item~ModelItem model item} and ends after it.
427
427
  *
428
428
  * @internal
429
429
  */
430
- static _createOn(item: Item): Range;
430
+ static _createOn(item: ModelItem): ModelRange;
431
431
  /**
432
432
  * Combines all ranges from the passed array into a one range. At least one range has to be passed.
433
433
  * Passed ranges must not have common parts.
@@ -446,7 +446,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
446
446
  * @param ranges Ranges to combine.
447
447
  * @returns Combined range.
448
448
  */
449
- static _createFromRanges(ranges: Array<Range>): Range;
449
+ static _createFromRanges(ranges: Array<ModelRange>): ModelRange;
450
450
  /**
451
451
  * Creates a `Range` instance from given plain object (i.e. parsed JSON string).
452
452
  *
@@ -454,5 +454,5 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
454
454
  * @param doc Document object that will be range owner.
455
455
  * @returns `Range` instance created using given plain object.
456
456
  */
457
- static fromJSON(json: any, doc: Document): Range;
457
+ static fromJSON(json: any, doc: ModelDocument): ModelRange;
458
458
  }