@ckeditor/ckeditor5-engine 45.2.1-alpha.9 → 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
@@ -6,24 +6,24 @@
6
6
  * @module engine/model/typecheckable
7
7
  */
8
8
  import type { Marker } from './markercollection.js';
9
- import type DocumentFragment from './documentfragment.js';
10
- import type DocumentSelection from './documentselection.js';
11
- import type Element from './element.js';
12
- import type LivePosition from './liveposition.js';
13
- import type LiveRange from './liverange.js';
14
- import type Node from './node.js';
15
- import type Position from './position.js';
16
- import type Range from './range.js';
17
- import type RootElement from './rootelement.js';
18
- import type Selection from './selection.js';
19
- import type Text from './text.js';
20
- import type TextProxy from './textproxy.js';
21
- export default abstract class TypeCheckable {
9
+ import { type ModelDocumentFragment } from './documentfragment.js';
10
+ import { type ModelDocumentSelection } from './documentselection.js';
11
+ import { type ModelElement } from './element.js';
12
+ import { type ModelLivePosition } from './liveposition.js';
13
+ import { type ModelLiveRange } from './liverange.js';
14
+ import { type ModelNode } from './node.js';
15
+ import { type ModelPosition } from './position.js';
16
+ import { type ModelRange } from './range.js';
17
+ import { type ModelRootElement } from './rootelement.js';
18
+ import { type ModelSelection } from './selection.js';
19
+ import { type ModelText } from './text.js';
20
+ import { type ModelTextProxy } from './textproxy.js';
21
+ export declare abstract class ModelTypeCheckable {
22
22
  /**
23
- * Checks whether the object is of type {@link module:engine/model/node~Node} or its subclass.
23
+ * Checks whether the object is of type {@link module:engine/model/node~ModelNode} or its subclass.
24
24
  *
25
25
  * This method is useful when processing model objects that are of unknown type. For example, a function
26
- * may return a {@link module:engine/model/documentfragment~DocumentFragment} or a {@link module:engine/model/node~Node}
26
+ * may return a {@link module:engine/model/documentfragment~ModelDocumentFragment} or a {@link module:engine/model/node~ModelNode}
27
27
  * that can be either a text node or an element. This method can be used to check what kind of object is returned.
28
28
  *
29
29
  * ```ts
@@ -50,9 +50,9 @@ export default abstract class TypeCheckable {
50
50
  *
51
51
  * @label NODE
52
52
  */
53
- is(type: 'node' | 'model:node'): this is Node | Element | Text | RootElement;
53
+ is(type: 'node' | 'model:node'): this is ModelNode | ModelElement | ModelText | ModelRootElement;
54
54
  /**
55
- * Checks whether the object is of type {@link module:engine/model/element~Element} or its subclass.
55
+ * Checks whether the object is of type {@link module:engine/model/element~ModelElement} or its subclass.
56
56
  *
57
57
  * ```ts
58
58
  * element.is( 'element' ); // -> true
@@ -65,7 +65,7 @@ export default abstract class TypeCheckable {
65
65
  * ```
66
66
  *
67
67
  * Assuming that the object being checked is an element, you can also check its
68
- * {@link module:engine/model/element~Element#name name}:
68
+ * {@link module:engine/model/element~ModelElement#name name}:
69
69
  *
70
70
  * ```ts
71
71
  * element.is( 'element', 'imageBlock' ); // -> true if this is an <imageBlock> element
@@ -74,9 +74,9 @@ export default abstract class TypeCheckable {
74
74
  *
75
75
  * @label ELEMENT
76
76
  */
77
- is(type: 'element' | 'model:element'): this is Element | RootElement;
77
+ is(type: 'element' | 'model:element'): this is ModelElement | ModelRootElement;
78
78
  /**
79
- * Checks whether the object is of type {@link module:engine/model/rootelement~RootElement}.
79
+ * Checks whether the object is of type {@link module:engine/model/rootelement~ModelRootElement}.
80
80
  *
81
81
  * ```ts
82
82
  * rootElement.is( 'rootElement' ); // -> true
@@ -91,7 +91,7 @@ export default abstract class TypeCheckable {
91
91
  * ```
92
92
  *
93
93
  * Assuming that the object being checked is an element, you can also check its
94
- * {@link module:engine/model/element~Element#name name}:
94
+ * {@link module:engine/model/element~ModelElement#name name}:
95
95
  *
96
96
  * ```ts
97
97
  * rootElement.is( 'rootElement', '$root' ); // -> same as above
@@ -99,9 +99,9 @@ export default abstract class TypeCheckable {
99
99
  *
100
100
  * @label ROOT_ELEMENT
101
101
  */
102
- is(type: 'rootElement' | 'model:rootElement'): this is RootElement;
102
+ is(type: 'rootElement' | 'model:rootElement'): this is ModelRootElement;
103
103
  /**
104
- * Checks whether the object is of type {@link module:engine/model/text~Text}.
104
+ * Checks whether the object is of type {@link module:engine/model/text~ModelText}.
105
105
  *
106
106
  * ```ts
107
107
  * text.is( '$text' ); // -> true
@@ -118,9 +118,9 @@ export default abstract class TypeCheckable {
118
118
  *
119
119
  * @label TEXT
120
120
  */
121
- is(type: '$text' | 'model:$text'): this is Text;
121
+ is(type: '$text' | 'model:$text'): this is ModelText;
122
122
  /**
123
- * Checks whether the object is of type {@link module:engine/model/position~Position} or its subclass.
123
+ * Checks whether the object is of type {@link module:engine/model/position~ModelPosition} or its subclass.
124
124
  *
125
125
  * ```ts
126
126
  * position.is( 'position' ); // -> true
@@ -132,9 +132,9 @@ export default abstract class TypeCheckable {
132
132
  *
133
133
  * @label POSITION
134
134
  */
135
- is(type: 'position' | 'model:position'): this is Position | LivePosition;
135
+ is(type: 'position' | 'model:position'): this is ModelPosition | ModelLivePosition;
136
136
  /**
137
- * Checks whether the object is of type {@link module:engine/model/liveposition~LivePosition}.
137
+ * Checks whether the object is of type {@link module:engine/model/liveposition~ModelLivePosition}.
138
138
  *
139
139
  * ```ts
140
140
  * livePosition.is( 'position' ); // -> true
@@ -148,9 +148,9 @@ export default abstract class TypeCheckable {
148
148
  *
149
149
  * @label LIVE_POSITION
150
150
  */
151
- is(type: 'livePosition' | 'model:livePosition'): this is LivePosition;
151
+ is(type: 'livePosition' | 'model:livePosition'): this is ModelLivePosition;
152
152
  /**
153
- * Checks whether the object is of type {@link module:engine/model/range~Range} or its subclass.
153
+ * Checks whether the object is of type {@link module:engine/model/range~ModelRange} or its subclass.
154
154
  *
155
155
  * ```ts
156
156
  * range.is( 'range' ); // -> true
@@ -162,9 +162,9 @@ export default abstract class TypeCheckable {
162
162
  *
163
163
  * @label RANGE
164
164
  */
165
- is(type: 'range' | 'model:range'): this is Range | LiveRange;
165
+ is(type: 'range' | 'model:range'): this is ModelRange | ModelLiveRange;
166
166
  /**
167
- * Checks whether the object is of type {@link module:engine/model/liverange~LiveRange}.
167
+ * Checks whether the object is of type {@link module:engine/model/liverange~ModelLiveRange}.
168
168
  *
169
169
  * ```ts
170
170
  * liveRange.is( 'range' ); // -> true
@@ -178,9 +178,9 @@ export default abstract class TypeCheckable {
178
178
  *
179
179
  * @label LIVE_RANGE
180
180
  */
181
- is(type: 'liveRange' | 'model:liveRange'): this is LiveRange;
181
+ is(type: 'liveRange' | 'model:liveRange'): this is ModelLiveRange;
182
182
  /**
183
- * Checks whether the object is of type {@link module:engine/model/documentfragment~DocumentFragment}.
183
+ * Checks whether the object is of type {@link module:engine/model/documentfragment~ModelDocumentFragment}.
184
184
  *
185
185
  * ```ts
186
186
  * docFrag.is( 'documentFragment' ); // -> true
@@ -193,10 +193,10 @@ export default abstract class TypeCheckable {
193
193
  *
194
194
  * @label DOCUMENT_FRAGMENT
195
195
  */
196
- is(type: 'documentFragment' | 'model:documentFragment'): this is DocumentFragment;
196
+ is(type: 'documentFragment' | 'model:documentFragment'): this is ModelDocumentFragment;
197
197
  /**
198
- * Checks whether the object is of type {@link module:engine/model/selection~Selection}
199
- * or {@link module:engine/model/documentselection~DocumentSelection}.
198
+ * Checks whether the object is of type {@link module:engine/model/selection~ModelSelection}
199
+ * or {@link module:engine/model/documentselection~ModelDocumentSelection}.
200
200
  *
201
201
  * ```ts
202
202
  * selection.is( 'selection' ); // -> true
@@ -208,9 +208,9 @@ export default abstract class TypeCheckable {
208
208
  *
209
209
  * @label SELECTION
210
210
  */
211
- is(type: 'selection' | 'model:selection'): this is Selection | DocumentSelection;
211
+ is(type: 'selection' | 'model:selection'): this is ModelSelection | ModelDocumentSelection;
212
212
  /**
213
- * Checks whether the object is of type {@link module:engine/model/documentselection~DocumentSelection}.
213
+ * Checks whether the object is of type {@link module:engine/model/documentselection~ModelDocumentSelection}.
214
214
  *
215
215
  * ```ts
216
216
  * selection.is( 'selection' ); // -> true
@@ -225,7 +225,7 @@ export default abstract class TypeCheckable {
225
225
  *
226
226
  * @label DOCUMENT_SELECTION
227
227
  */
228
- is(type: 'documentSelection' | 'model:documentSelection'): this is DocumentSelection;
228
+ is(type: 'documentSelection' | 'model:documentSelection'): this is ModelDocumentSelection;
229
229
  /**
230
230
  * Checks whether the object is of type {@link module:engine/model/markercollection~Marker}.
231
231
  *
@@ -241,7 +241,7 @@ export default abstract class TypeCheckable {
241
241
  */
242
242
  is(type: 'marker' | 'model:marker'): this is Marker;
243
243
  /**
244
- * Checks whether the object is of type {@link module:engine/model/textproxy~TextProxy}.
244
+ * Checks whether the object is of type {@link module:engine/model/textproxy~ModelTextProxy}.
245
245
  *
246
246
  * ```ts
247
247
  * textProxy.is( '$textProxy' ); // -> true
@@ -256,9 +256,9 @@ export default abstract class TypeCheckable {
256
256
  *
257
257
  * @label TEXT_PROXY
258
258
  */
259
- is(type: '$textProxy' | 'model:$textProxy'): this is TextProxy;
259
+ is(type: '$textProxy' | 'model:$textProxy'): this is ModelTextProxy;
260
260
  /**
261
- * Checks whether the object is of type {@link module:engine/model/element~Element} or its subclass and has the specified `name`.
261
+ * Checks whether the object is of type {@link module:engine/model/element~ModelElement} or its subclass and has the specified `name`.
262
262
  *
263
263
  * ```ts
264
264
  * element.is( 'element', 'imageBlock' ); // -> true if this is an <imageBlock> element
@@ -267,11 +267,11 @@ export default abstract class TypeCheckable {
267
267
  *
268
268
  * @label ELEMENT_NAME
269
269
  */
270
- is<N extends string>(type: 'element' | 'model:element', name: N): this is (Element | RootElement) & {
270
+ is<N extends string>(type: 'element' | 'model:element', name: N): this is (ModelElement | ModelRootElement) & {
271
271
  name: N;
272
272
  };
273
273
  /**
274
- * Checks whether the object is of type {@link module:engine/model/rootelement~RootElement} and has the specified `name`.
274
+ * Checks whether the object is of type {@link module:engine/model/rootelement~ModelRootElement} and has the specified `name`.
275
275
  *
276
276
  * ```ts
277
277
  * rootElement.is( 'rootElement', '$root' );
@@ -279,7 +279,7 @@ export default abstract class TypeCheckable {
279
279
  *
280
280
  * @label ROOT_ELEMENT_NAME
281
281
  */
282
- is<N extends string>(type: 'rootElement' | 'model:rootElement', name: N): this is RootElement & {
282
+ is<N extends string>(type: 'rootElement' | 'model:rootElement', name: N): this is ModelRootElement & {
283
283
  name: N;
284
284
  };
285
285
  }
@@ -2,7 +2,7 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- export default class TypeCheckable {
5
+ export class ModelTypeCheckable {
6
6
  /* istanbul ignore next -- @preserve */
7
7
  is() {
8
8
  // There are a lot of overloads above.
@@ -2,10 +2,10 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import type Node from '../node.js';
6
- import type Position from '../position.js';
7
- import type Schema from '../schema.js';
8
- import type Writer from '../writer.js';
5
+ import { type ModelNode } from '../node.js';
6
+ import { type ModelPosition } from '../position.js';
7
+ import { type ModelSchema } from '../schema.js';
8
+ import { type ModelWriter } from '../writer.js';
9
9
  /**
10
10
  * @module engine/model/utils/autoparagraphing
11
11
  */
@@ -16,7 +16,7 @@ import type Writer from '../writer.js';
16
16
  * @param writer The model writer.
17
17
  * @returns `true` if any change has been applied, `false` otherwise.
18
18
  */
19
- export declare function autoParagraphEmptyRoots(writer: Writer): boolean;
19
+ export declare function autoParagraphEmptyRoots(writer: ModelWriter): boolean;
20
20
  /**
21
21
  * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
22
22
  *
@@ -25,7 +25,7 @@ export declare function autoParagraphEmptyRoots(writer: Writer): boolean;
25
25
  * @param nodeOrType The child node or child type to check.
26
26
  * @param schema A schema instance used for element validation.
27
27
  */
28
- export declare function isParagraphable(position: Position, nodeOrType: Node | string, schema: Schema): boolean;
28
+ export declare function isParagraphable(position: ModelPosition, nodeOrType: ModelNode | string, schema: ModelSchema): boolean;
29
29
  /**
30
30
  * Inserts a new paragraph at the given position and returns a position inside that paragraph.
31
31
  *
@@ -34,4 +34,4 @@ export declare function isParagraphable(position: Position, nodeOrType: Node | s
34
34
  * @param writer The model writer.
35
35
  * @returns Position inside the created paragraph.
36
36
  */
37
- export declare function wrapInParagraph(position: Position, writer: Writer): Position;
37
+ export declare function wrapInParagraph(position: ModelPosition, writer: ModelWriter): ModelPosition;
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module engine/model/utils/deletecontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import type Model from '../model.js';
10
- import type Selection from '../selection.js';
8
+ import { ModelDocumentSelection } from '../documentselection.js';
9
+ import { type Model } from '../model.js';
10
+ import { type ModelSelection } from '../selection.js';
11
11
  /**
12
12
  * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
13
13
  *
@@ -25,7 +25,7 @@ import type Selection from '../selection.js';
25
25
  * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
26
26
  * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
27
27
  *
28
- * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
28
+ * Note: {@link module:engine/model/schema~ModelSchema#isObject object} and {@link module:engine/model/schema~ModelSchema#isLimit limit}
29
29
  * elements will not be merged.
30
30
  *
31
31
  * @param options.doNotResetEntireContent Whether to skip replacing the entire content with a
@@ -62,8 +62,10 @@ import type Selection from '../selection.js';
62
62
  *
63
63
  * However, in some cases, it is expected to remove content exactly as selected in the selection, without any fixing. In these cases,
64
64
  * this flag can be set to `true`, which will prevent fixing the selection.
65
+ *
66
+ * @internal
65
67
  */
66
- export default function deleteContent(model: Model, selection: Selection | DocumentSelection, options?: {
68
+ export declare function deleteContent(model: Model, selection: ModelSelection | ModelDocumentSelection, options?: {
67
69
  leaveUnmerged?: boolean;
68
70
  doNotResetEntireContent?: boolean;
69
71
  doNotAutoparagraph?: boolean;
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module engine/model/utils/deletecontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import LivePosition from '../liveposition.js';
10
- import Range from '../range.js';
8
+ import { ModelDocumentSelection } from '../documentselection.js';
9
+ import { ModelLivePosition } from '../liveposition.js';
10
+ import { ModelRange } from '../range.js';
11
11
  /**
12
12
  * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
13
13
  *
@@ -25,7 +25,7 @@ import Range from '../range.js';
25
25
  * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
26
26
  * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
27
27
  *
28
- * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
28
+ * Note: {@link module:engine/model/schema~ModelSchema#isObject object} and {@link module:engine/model/schema~ModelSchema#isLimit limit}
29
29
  * elements will not be merged.
30
30
  *
31
31
  * @param options.doNotResetEntireContent Whether to skip replacing the entire content with a
@@ -62,8 +62,10 @@ import Range from '../range.js';
62
62
  *
63
63
  * However, in some cases, it is expected to remove content exactly as selected in the selection, without any fixing. In these cases,
64
64
  * this flag can be set to `true`, which will prevent fixing the selection.
65
+ *
66
+ * @internal
65
67
  */
66
- export default function deleteContent(model, selection, options = {}) {
68
+ export function deleteContent(model, selection, options = {}) {
67
69
  if (selection.isCollapsed) {
68
70
  return;
69
71
  }
@@ -94,8 +96,8 @@ export default function deleteContent(model, selection, options = {}) {
94
96
  [startPosition, endPosition] = getLivePositionsForSelectedBlocks(selRange);
95
97
  }
96
98
  else {
97
- startPosition = LivePosition.fromPosition(selRange.start, 'toPrevious');
98
- endPosition = LivePosition.fromPosition(selRange.end, 'toNext');
99
+ startPosition = ModelLivePosition.fromPosition(selRange.start, 'toPrevious');
100
+ endPosition = ModelLivePosition.fromPosition(selRange.end, 'toNext');
99
101
  }
100
102
  // 2. Remove the content if there is any.
101
103
  if (!startPosition.isTouching(endPosition)) {
@@ -170,8 +172,8 @@ function getLivePositionsForSelectedBlocks(range) {
170
172
  }
171
173
  }
172
174
  return [
173
- LivePosition.fromPosition(startPosition, 'toPrevious'),
174
- LivePosition.fromPosition(endPosition, 'toNext')
175
+ ModelLivePosition.fromPosition(startPosition, 'toPrevious'),
176
+ ModelLivePosition.fromPosition(endPosition, 'toNext')
175
177
  ];
176
178
  }
177
179
  /**
@@ -457,7 +459,7 @@ function shouldAutoparagraph(schema, position) {
457
459
  * Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.
458
460
  */
459
461
  function isCrossingLimitElement(leftPos, rightPos, schema) {
460
- const rangeToCheck = new Range(leftPos, rightPos);
462
+ const rangeToCheck = new ModelRange(leftPos, rightPos);
461
463
  for (const value of rangeToCheck.getWalker()) {
462
464
  if (schema.isLimit(value.item)) {
463
465
  return false;
@@ -498,7 +500,7 @@ function shouldEntireContentBeReplacedWithParagraph(schema, selection) {
498
500
  * uses a different method to set it.
499
501
  */
500
502
  function collapseSelectionAt(writer, selection, positionOrRange) {
501
- if (selection instanceof DocumentSelection) {
503
+ if (selection instanceof ModelDocumentSelection) {
502
504
  writer.setSelection(positionOrRange);
503
505
  }
504
506
  else {
@@ -2,10 +2,10 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import type DocumentFragment from '../documentfragment.js';
6
- import type DocumentSelection from '../documentselection.js';
7
- import type Model from '../model.js';
8
- import type Selection from '../selection.js';
5
+ import { type ModelDocumentFragment } from '../documentfragment.js';
6
+ import { type ModelDocumentSelection } from '../documentselection.js';
7
+ import { type Model } from '../model.js';
8
+ import { type ModelSelection } from '../selection.js';
9
9
  /**
10
10
  * @module engine/model/utils/getselectedcontent
11
11
  */
@@ -26,5 +26,6 @@ import type Selection from '../selection.js';
26
26
  *
27
27
  * @param model The model in context of which the selection modification should be performed.
28
28
  * @param selection The selection of which content will be returned.
29
+ * @internal
29
30
  */
30
- export default function getSelectedContent(model: Model, selection: Selection | DocumentSelection): DocumentFragment;
31
+ export declare function getSelectedContent(model: Model, selection: ModelSelection | ModelDocumentSelection): ModelDocumentFragment;
@@ -22,8 +22,9 @@
22
22
  *
23
23
  * @param model The model in context of which the selection modification should be performed.
24
24
  * @param selection The selection of which content will be returned.
25
+ * @internal
25
26
  */
26
- export default function getSelectedContent(model, selection) {
27
+ export function getSelectedContent(model, selection) {
27
28
  return model.change(writer => {
28
29
  const frag = writer.createDocumentFragment();
29
30
  const range = selection.getFirstRange();
@@ -5,12 +5,12 @@
5
5
  /**
6
6
  * @module engine/model/utils/insertcontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import Range from '../range.js';
10
- import type DocumentFragment from '../documentfragment.js';
11
- import type Item from '../item.js';
12
- import type Model from '../model.js';
13
- import type Selection from '../selection.js';
8
+ import { ModelDocumentSelection } from '../documentselection.js';
9
+ import { ModelRange } from '../range.js';
10
+ import { type ModelDocumentFragment } from '../documentfragment.js';
11
+ import { type ModelItem } from '../item.js';
12
+ import { type Model } from '../model.js';
13
+ import { type ModelSelection } from '../selection.js';
14
14
  /**
15
15
  * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
16
16
  *
@@ -26,7 +26,7 @@ import type Selection from '../selection.js';
26
26
  * <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>
27
27
  * ```
28
28
  *
29
- * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified
29
+ * If an instance of {@link module:engine/model/selection~ModelSelection} is passed as `selectable` it will be modified
30
30
  * to the insertion selection (equal to a range to be selected after insertion).
31
31
  *
32
32
  * If `selectable` is not passed, the content will be inserted using the current selection of the model document.
@@ -41,5 +41,6 @@ import type Selection from '../selection.js';
41
41
  * @returns Range which contains all the performed changes. This is a range that, if removed,
42
42
  * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
43
43
  * at the insertion position.
44
+ * @internal
44
45
  */
45
- export default function insertContent(model: Model, content: Item | DocumentFragment, selectable?: Selection | DocumentSelection): Range;
46
+ export declare function insertContent(model: Model, content: ModelItem | ModelDocumentFragment, selectable?: ModelSelection | ModelDocumentSelection): ModelRange;