@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
@@ -2,15 +2,15 @@
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 ClassPatterns, type MatcherPattern, type PropertyPatterns } from '../view/matcher.js';
6
- import ConversionHelpers from './conversionhelpers.js';
7
- import type { default as UpcastDispatcher, UpcastConversionApi, UpcastConversionData } from './upcastdispatcher.js';
8
- import type ModelElement from '../model/element.js';
5
+ import { type MatchClassPatterns, type MatcherPattern, type MatchPropertyPatterns } from '../view/matcher.js';
6
+ import { ConversionHelpers } from './conversionhelpers.js';
7
+ import type { UpcastDispatcher, UpcastConversionApi, UpcastConversionData } from './upcastdispatcher.js';
8
+ import { type ModelElement } from '../model/element.js';
9
9
  import type { ViewDocumentFragment, ViewElement, ViewText } from '../index.js';
10
- import type Mapper from './mapper.js';
11
- import type Model from '../model/model.js';
12
- import type ViewSelection from '../view/selection.js';
13
- import type ViewDocumentSelection from '../view/documentselection.js';
10
+ import { type Mapper } from './mapper.js';
11
+ import { type Model } from '../model/model.js';
12
+ import { type ViewSelection } from '../view/selection.js';
13
+ import { type ViewDocumentSelection } from '../view/documentselection.js';
14
14
  import { type EventInfo, type PriorityString } from '@ckeditor/ckeditor5-utils';
15
15
  /**
16
16
  * Contains the {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
@@ -25,7 +25,7 @@ import { type EventInfo, type PriorityString } from '@ckeditor/ckeditor5-utils';
25
25
  *
26
26
  * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
27
27
  */
28
- export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
28
+ export declare class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
29
29
  /**
30
30
  * View element to model element conversion helper.
31
31
  *
@@ -33,7 +33,7 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
33
33
  * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.
34
34
  *
35
35
  * Keep in mind that the element will be inserted only if it is allowed
36
- * by {@link module:engine/model/schema~Schema schema} configuration.
36
+ * by {@link module:engine/model/schema~ModelSchema schema} configuration.
37
37
  *
38
38
  * ```ts
39
39
  * editor.conversion.for( 'upcast' ).elementToElement( {
@@ -81,14 +81,14 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
81
81
  */
82
82
  elementToElement(config: {
83
83
  view: MatcherPattern;
84
- model: string | ElementCreatorFunction;
84
+ model: string | UpcastElementCreatorFunction;
85
85
  converterPriority?: PriorityString;
86
86
  }): this;
87
87
  /**
88
88
  * View element to model attribute conversion helper.
89
89
  *
90
90
  * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes
91
- * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.
91
+ * `Foo` {@link module:engine/model/text~ModelText model text node} with `bold` attribute set to `true`.
92
92
  *
93
93
  * This helper is meant to set a model attribute on all the elements that are inside the converted element:
94
94
  *
@@ -100,7 +100,8 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
100
100
  * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
101
101
  * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
102
102
  *
103
- * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
103
+ * Keep in mind that the attribute will be set only if it is allowed by
104
+ * {@link module:engine/model/schema~ModelSchema schema} configuration.
104
105
  *
105
106
  * ```ts
106
107
  * editor.conversion.for( 'upcast' ).elementToAttribute( {
@@ -201,7 +202,8 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
201
202
  * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
202
203
  * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text.
203
204
  *
204
- * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
205
+ * Keep in mind that the attribute will be set only if it is allowed by
206
+ * {@link module:engine/model/schema~ModelSchema schema} configuration.
205
207
  *
206
208
  * ```ts
207
209
  * editor.conversion.for( 'upcast' ).attributeToAttribute( {
@@ -308,14 +310,13 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
308
310
  name?: string;
309
311
  } | {
310
312
  name?: string | RegExp;
311
- styles?: PropertyPatterns;
312
- classes?: ClassPatterns;
313
- attributes?: PropertyPatterns;
313
+ styles?: MatchPropertyPatterns;
314
+ classes?: MatchClassPatterns;
315
+ attributes?: MatchPropertyPatterns;
314
316
  };
315
317
  model: string | {
316
318
  key: string;
317
319
  value: unknown | ((viewElement: ViewElement, conversionApi: UpcastConversionApi, data: UpcastConversionData<ViewElement>) => unknown);
318
- name?: string;
319
320
  };
320
321
  converterPriority?: PriorityString;
321
322
  }): this;
@@ -372,7 +373,7 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
372
373
  */
373
374
  elementToMarker(config: {
374
375
  view: MatcherPattern;
375
- model: string | MarkerFromElementCreatorFunction;
376
+ model: string | UpcastMarkerFromElementCreatorFunction;
376
377
  converterPriority?: PriorityString;
377
378
  }): this;
378
379
  /**
@@ -448,36 +449,42 @@ export default class UpcastHelpers extends ConversionHelpers<UpcastDispatcher> {
448
449
  */
449
450
  dataToMarker(config: {
450
451
  view: string;
451
- model?: MarkerFromAttributeCreatorFunction;
452
+ model?: UpcastMarkerFromAttributeCreatorFunction;
452
453
  converterPriority?: PriorityString;
453
454
  }): this;
454
455
  }
455
456
  /**
456
- * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
457
- * or all children of {@link module:engine/view/element~Element} into
458
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.
457
+ * Function factory, creates a converter that converts
458
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment}
459
+ * or all children of {@link module:engine/view/element~ViewElement} into
460
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment}.
459
461
  * This is the "entry-point" converter for upcast (view to model conversion). This converter starts the conversion of all children
460
- * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.
462
+ * of passed view document fragment. Those children {@link module:engine/view/node~ViewNode view nodes} are then
463
+ * handled by other converters.
461
464
  *
462
465
  * This also a "default", last resort converter for all view elements that has not been converted by other converters.
463
466
  * When a view element is being converted to the model but it does not have converter specified, that view element
464
- * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.
467
+ * will be converted to {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment} and returned.
468
+ *
469
+ * @returns Universal converter for view {@link module:engine/view/documentfragment~ViewDocumentFragment fragments} and
470
+ * {@link module:engine/view/element~ViewElement elements} that returns
471
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model fragment} with children of converted view item.
465
472
  *
466
- * @returns Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and
467
- * {@link module:engine/view/element~Element elements} that returns
468
- * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.
473
+ * @internal
469
474
  */
470
475
  export declare function convertToModelFragment(): (evt: EventInfo, data: UpcastConversionData<ViewElement | ViewDocumentFragment>, conversionApi: UpcastConversionApi) => void;
471
476
  /**
472
- * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.
477
+ * Function factory, creates a converter that converts
478
+ * {@link module:engine/view/text~ViewText} to {@link module:engine/model/text~ModelText}.
473
479
  *
474
- * @returns {@link module:engine/view/text~Text View text} converter.
480
+ * @returns {@link module:engine/view/text~ViewText View text} converter.
481
+ * @internal
475
482
  */
476
483
  export declare function convertText(): (evt: EventInfo, data: UpcastConversionData<ViewText>, { schema, consumable, writer }: UpcastConversionApi) => void;
477
484
  /**
478
- * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection
479
- * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event
480
- * and sets in on the {@link module:engine/model/document~Document#selection model}.
485
+ * Function factory, creates a callback function which converts a {@link module:engine/view/selection~ViewSelection
486
+ * view selection} taken from the {@link module:engine/view/document~ViewDocument#event:selectionChange} event
487
+ * and sets in on the {@link module:engine/model/document~ModelDocument#selection model}.
481
488
  *
482
489
  * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model
483
490
  * conversion mechanism, the callback should be set directly on view document.
@@ -488,12 +495,13 @@ export declare function convertText(): (evt: EventInfo, data: UpcastConversionDa
488
495
  *
489
496
  * @param model Data model.
490
497
  * @param mapper Conversion mapper.
491
- * @returns {@link module:engine/view/document~Document#event:selectionChange} callback function.
498
+ * @returns {@link module:engine/view/document~ViewDocument#event:selectionChange} callback function.
499
+ * @internal
492
500
  */
493
501
  export declare function convertSelectionChange(model: Model, mapper: Mapper): (evt: EventInfo, data: {
494
502
  newSelection: ViewSelection | ViewDocumentSelection;
495
503
  }) => void;
496
- export type ElementCreatorFunction = (viewElement: ViewElement, conversionApi: UpcastConversionApi) => ModelElement | null;
497
- export type AttributeCreatorFunction = (modelElement: ModelElement, conversionApi: UpcastConversionApi) => unknown;
498
- export type MarkerFromElementCreatorFunction = (viewElement: ViewElement, conversionApi: UpcastConversionApi) => string;
499
- export type MarkerFromAttributeCreatorFunction = (attributeValue: string, conversionApi: UpcastConversionApi) => string;
504
+ export type UpcastElementCreatorFunction = (viewElement: ViewElement, conversionApi: UpcastConversionApi) => ModelElement | null;
505
+ export type UpcastAttributeCreatorFunction = (modelElement: ModelElement, conversionApi: UpcastConversionApi) => unknown;
506
+ export type UpcastMarkerFromElementCreatorFunction = (viewElement: ViewElement, conversionApi: UpcastConversionApi) => string;
507
+ export type UpcastMarkerFromAttributeCreatorFunction = (attributeValue: string, conversionApi: UpcastConversionApi) => string;
@@ -2,8 +2,8 @@
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 Matcher from '../view/matcher.js';
6
- import ConversionHelpers from './conversionhelpers.js';
5
+ import { Matcher } from '../view/matcher.js';
6
+ import { ConversionHelpers } from './conversionhelpers.js';
7
7
  import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing.js';
8
8
  import { priorities } from '@ckeditor/ckeditor5-utils';
9
9
  import { cloneDeep } from 'es-toolkit/compat';
@@ -20,7 +20,7 @@ import { cloneDeep } from 'es-toolkit/compat';
20
20
  *
21
21
  * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
22
22
  */
23
- export default class UpcastHelpers extends ConversionHelpers {
23
+ export class UpcastHelpers extends ConversionHelpers {
24
24
  /**
25
25
  * View element to model element conversion helper.
26
26
  *
@@ -28,7 +28,7 @@ export default class UpcastHelpers extends ConversionHelpers {
28
28
  * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.
29
29
  *
30
30
  * Keep in mind that the element will be inserted only if it is allowed
31
- * by {@link module:engine/model/schema~Schema schema} configuration.
31
+ * by {@link module:engine/model/schema~ModelSchema schema} configuration.
32
32
  *
33
33
  * ```ts
34
34
  * editor.conversion.for( 'upcast' ).elementToElement( {
@@ -81,7 +81,7 @@ export default class UpcastHelpers extends ConversionHelpers {
81
81
  * View element to model attribute conversion helper.
82
82
  *
83
83
  * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes
84
- * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.
84
+ * `Foo` {@link module:engine/model/text~ModelText model text node} with `bold` attribute set to `true`.
85
85
  *
86
86
  * This helper is meant to set a model attribute on all the elements that are inside the converted element:
87
87
  *
@@ -93,7 +93,8 @@ export default class UpcastHelpers extends ConversionHelpers {
93
93
  * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
94
94
  * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
95
95
  *
96
- * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
96
+ * Keep in mind that the attribute will be set only if it is allowed by
97
+ * {@link module:engine/model/schema~ModelSchema schema} configuration.
97
98
  *
98
99
  * ```ts
99
100
  * editor.conversion.for( 'upcast' ).elementToAttribute( {
@@ -189,7 +190,8 @@ export default class UpcastHelpers extends ConversionHelpers {
189
190
  * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
190
191
  * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text.
191
192
  *
192
- * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
193
+ * Keep in mind that the attribute will be set only if it is allowed by
194
+ * {@link module:engine/model/schema~ModelSchema schema} configuration.
193
195
  *
194
196
  * ```ts
195
197
  * editor.conversion.for( 'upcast' ).attributeToAttribute( {
@@ -422,19 +424,23 @@ export default class UpcastHelpers extends ConversionHelpers {
422
424
  }
423
425
  }
424
426
  /**
425
- * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
426
- * or all children of {@link module:engine/view/element~Element} into
427
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.
427
+ * Function factory, creates a converter that converts
428
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment}
429
+ * or all children of {@link module:engine/view/element~ViewElement} into
430
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment}.
428
431
  * This is the "entry-point" converter for upcast (view to model conversion). This converter starts the conversion of all children
429
- * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.
432
+ * of passed view document fragment. Those children {@link module:engine/view/node~ViewNode view nodes} are then
433
+ * handled by other converters.
430
434
  *
431
435
  * This also a "default", last resort converter for all view elements that has not been converted by other converters.
432
436
  * When a view element is being converted to the model but it does not have converter specified, that view element
433
- * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.
437
+ * will be converted to {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment} and returned.
434
438
  *
435
- * @returns Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and
436
- * {@link module:engine/view/element~Element elements} that returns
437
- * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.
439
+ * @returns Universal converter for view {@link module:engine/view/documentfragment~ViewDocumentFragment fragments} and
440
+ * {@link module:engine/view/element~ViewElement elements} that returns
441
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model fragment} with children of converted view item.
442
+ *
443
+ * @internal
438
444
  */
439
445
  export function convertToModelFragment() {
440
446
  return (evt, data, conversionApi) => {
@@ -447,9 +453,11 @@ export function convertToModelFragment() {
447
453
  };
448
454
  }
449
455
  /**
450
- * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.
456
+ * Function factory, creates a converter that converts
457
+ * {@link module:engine/view/text~ViewText} to {@link module:engine/model/text~ModelText}.
451
458
  *
452
- * @returns {@link module:engine/view/text~Text View text} converter.
459
+ * @returns {@link module:engine/view/text~ViewText View text} converter.
460
+ * @internal
453
461
  */
454
462
  export function convertText() {
455
463
  return (evt, data, { schema, consumable, writer }) => {
@@ -476,9 +484,9 @@ export function convertText() {
476
484
  };
477
485
  }
478
486
  /**
479
- * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection
480
- * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event
481
- * and sets in on the {@link module:engine/model/document~Document#selection model}.
487
+ * Function factory, creates a callback function which converts a {@link module:engine/view/selection~ViewSelection
488
+ * view selection} taken from the {@link module:engine/view/document~ViewDocument#event:selectionChange} event
489
+ * and sets in on the {@link module:engine/model/document~ModelDocument#selection model}.
482
490
  *
483
491
  * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model
484
492
  * conversion mechanism, the callback should be set directly on view document.
@@ -489,7 +497,8 @@ export function convertText() {
489
497
  *
490
498
  * @param model Data model.
491
499
  * @param mapper Conversion mapper.
492
- * @returns {@link module:engine/view/document~Document#event:selectionChange} callback function.
500
+ * @returns {@link module:engine/view/document~ViewDocument#event:selectionChange} callback function.
501
+ * @internal
493
502
  */
494
503
  export function convertSelectionChange(model, mapper) {
495
504
  return (evt, data) => {
@@ -844,7 +853,7 @@ function prepareToAttributeConverter(config, shallow) {
844
853
  const modelValue = typeof config.model.value == 'function' ?
845
854
  config.model.value(data.viewItem, conversionApi, data) : config.model.value;
846
855
  // Do not convert if attribute building function returned falsy value.
847
- if (modelValue === null) {
856
+ if (modelValue === null || modelValue === undefined) {
848
857
  return;
849
858
  }
850
859
  // Since we are converting to attribute we need a range on which we will set the attribute.
@@ -884,8 +893,8 @@ function onlyViewNameIsDefined(viewConfig, viewItem) {
884
893
  return !configToTest.classes && !configToTest.attributes && !configToTest.styles;
885
894
  }
886
895
  /**
887
- * Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}
888
- * to ensure proper model structure.
896
+ * Helper function for to-model-attribute converter. Sets model attribute on given range.
897
+ * Checks {@link module:engine/model/schema~ModelSchema} to ensure proper model structure.
889
898
  *
890
899
  * If any node on the given range has already defined an attribute with the same name, its value will not be updated.
891
900
  *
@@ -2,14 +2,15 @@
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 { default as Element, NormalizedConsumables } from '../view/element.js';
6
- import type Node from '../view/node.js';
7
- import type Text from '../view/text.js';
8
- import type DocumentFragment from '../view/documentfragment.js';
5
+ import type { ViewElement, ViewNormalizedConsumables } from '../view/element.js';
6
+ import { type ViewNode } from '../view/node.js';
7
+ import { type ViewText } from '../view/text.js';
8
+ import { type ViewDocumentFragment } from '../view/documentfragment.js';
9
9
  import type { Match } from '../view/matcher.js';
10
10
  /**
11
- * Class used for handling consumption of view {@link module:engine/view/element~Element elements},
12
- * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
11
+ * Class used for handling consumption of view {@link module:engine/view/element~ViewElement elements},
12
+ * {@link module:engine/view/text~ViewText text nodes} and
13
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment document fragments}.
13
14
  * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name
14
15
  * does not consume its attributes, classes and styles.
15
16
  * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.
@@ -32,17 +33,17 @@ import type { Match } from '../view/matcher.js';
32
33
  * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.
33
34
  * ```
34
35
  */
35
- export default class ViewConsumable {
36
+ export declare class ViewConsumable {
36
37
  /**
37
- * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,
38
+ * Map of consumable elements. If {@link module:engine/view/element~ViewElement element} is used as a key,
38
39
  * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.
39
- * For {@link module:engine/view/text~Text text nodes} and
40
- * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.
40
+ * For {@link module:engine/view/text~ViewText text nodes} and
41
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment document fragments} boolean value is stored as value.
41
42
  */
42
43
  private _consumables;
43
44
  /**
44
- * Adds view {@link module:engine/view/element~Element element}, {@link module:engine/view/text~Text text node} or
45
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.
45
+ * Adds view {@link module:engine/view/element~ViewElement element}, {@link module:engine/view/text~ViewText text node} or
46
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment document fragment} as ready to be consumed.
46
47
  *
47
48
  * ```ts
48
49
  * viewConsumable.add( p, { name: true } ); // Adds element's name to consume.
@@ -63,16 +64,16 @@ export default class ViewConsumable {
63
64
  * viewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.
64
65
  * ```
65
66
  *
66
- * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
67
+ * @param consumables Used only if first parameter is {@link module:engine/view/element~ViewElement view element} instance.
67
68
  * @param consumables.name If set to true element's name will be included.
68
69
  * @param consumables.attributes Attribute name or array of attribute names.
69
70
  * @param consumables.classes Class name or array of class names.
70
71
  * @param consumables.styles Style name or array of style names.
71
72
  */
72
- add(element: Text | Element | DocumentFragment, consumables?: Consumables | NormalizedConsumables): void;
73
+ add(element: ViewText | ViewElement | ViewDocumentFragment, consumables?: Consumables | ViewNormalizedConsumables): void;
73
74
  /**
74
- * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
75
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.
75
+ * Tests if {@link module:engine/view/element~ViewElement view element}, {@link module:engine/view/text~ViewText text node} or
76
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment document fragment} can be consumed.
76
77
  * It returns `true` when all items included in method's call can be consumed. Returns `false` when
77
78
  * first already consumed item is found and `null` when first non-consumable item is found.
78
79
  *
@@ -94,7 +95,7 @@ export default class ViewConsumable {
94
95
  * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.
95
96
  * ```
96
97
  *
97
- * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
98
+ * @param consumables Used only if first parameter is {@link module:engine/view/element~ViewElement view element} instance.
98
99
  * @param consumables.name If set to true element's name will be included.
99
100
  * @param consumables.attributes Attribute name or array of attribute names.
100
101
  * @param consumables.classes Class name or array of class names.
@@ -102,10 +103,10 @@ export default class ViewConsumable {
102
103
  * @returns Returns `true` when all items included in method's call can be consumed. Returns `false`
103
104
  * when first already consumed item is found and `null` when first non-consumable item is found.
104
105
  */
105
- test(element: Node | DocumentFragment, consumables?: Consumables | Match): boolean | null;
106
+ test(element: ViewNode | ViewDocumentFragment, consumables?: Consumables | Match): boolean | null;
106
107
  /**
107
- * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
108
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
108
+ * Consumes {@link module:engine/view/element~ViewElement view element}, {@link module:engine/view/text~ViewText text node} or
109
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment document fragment}.
109
110
  * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
110
111
  *
111
112
  * ```ts
@@ -126,7 +127,7 @@ export default class ViewConsumable {
126
127
  * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.
127
128
  * ```
128
129
  *
129
- * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
130
+ * @param consumables Used only if first parameter is {@link module:engine/view/element~ViewElement view element} instance.
130
131
  * @param consumables.name If set to true element's name will be included.
131
132
  * @param consumables.attributes Attribute name or array of attribute names.
132
133
  * @param consumables.classes Class name or array of class names.
@@ -134,10 +135,10 @@ export default class ViewConsumable {
134
135
  * @returns Returns `true` when all items included in method's call can be consumed,
135
136
  * otherwise returns `false`.
136
137
  */
137
- consume(element: Node | DocumentFragment, consumables?: Consumables | Match): boolean;
138
+ consume(element: ViewNode | ViewDocumentFragment, consumables?: Consumables | Match): boolean;
138
139
  /**
139
- * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
140
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.
140
+ * Reverts {@link module:engine/view/element~ViewElement view element}, {@link module:engine/view/text~ViewText text node} or
141
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment document fragment} so they can be consumed once again.
141
142
  * Method does not revert items that were never previously added for consumption, even if they are included in
142
143
  * method's call.
143
144
  *
@@ -160,27 +161,27 @@ export default class ViewConsumable {
160
161
  * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.
161
162
  * ```
162
163
  *
163
- * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
164
+ * @param consumables Used only if first parameter is {@link module:engine/view/element~ViewElement view element} instance.
164
165
  * @param consumables.name If set to true element's name will be included.
165
166
  * @param consumables.attributes Attribute name or array of attribute names.
166
167
  * @param consumables.classes Class name or array of class names.
167
168
  * @param consumables.styles Style name or array of style names.
168
169
  */
169
- revert(element: Node, consumables: Consumables | Match): void;
170
+ revert(element: ViewNode, consumables: Consumables | Match): void;
170
171
  /**
171
172
  * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from
172
- * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
173
+ * {@link module:engine/view/node~ViewNode node} or {@link module:engine/view/documentfragment~ViewDocumentFragment document fragment}.
173
174
  * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.
174
175
  *
175
176
  * @param from View node or document fragment from which `ViewConsumable` will be created.
176
177
  * @param instance If provided, given `ViewConsumable` instance will be used
177
178
  * to add all consumables. It will be returned instead of a new instance.
178
179
  */
179
- static createFrom(from: Node | DocumentFragment, instance?: ViewConsumable): ViewConsumable;
180
+ static createFrom(from: ViewNode | ViewDocumentFragment, instance?: ViewConsumable): ViewConsumable;
180
181
  }
181
182
  /**
182
183
  * Object describing all features of a view element that could be consumed and converted individually.
183
- * This is a non-normalized form of {@link module:engine/view/element~NormalizedConsumables} generated from the view Element.
184
+ * This is a non-normalized form of {@link module:engine/view/element~ViewNormalizedConsumables} generated from the view Element.
184
185
  *
185
186
  * Example element:
186
187
  *
@@ -198,7 +199,7 @@ export default class ViewConsumable {
198
199
  * }
199
200
  * ```
200
201
  *
201
- * You could convert a `Consumable` into a {@link module:engine/view/element~NormalizedConsumables}
202
+ * You could convert a `Consumable` into a {@link module:engine/view/element~ViewNormalizedConsumables}
202
203
  * using the {@link module:engine/conversion/viewconsumable~normalizeConsumables} helper.
203
204
  */
204
205
  export interface Consumables {
@@ -222,10 +223,12 @@ export interface Consumables {
222
223
  }
223
224
  /**
224
225
  * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.
225
- * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.
226
+ * It represents and manipulates consumable parts of a single {@link module:engine/view/element~ViewElement}.
227
+ *
228
+ * @internal
226
229
  */
227
230
  export declare class ViewElementConsumables {
228
- readonly element: Element;
231
+ readonly element: ViewElement;
229
232
  /**
230
233
  * Flag indicating if name of the element can be consumed.
231
234
  */
@@ -242,9 +245,9 @@ export declare class ViewElementConsumables {
242
245
  *
243
246
  * @param from View element from which `ViewElementConsumables` is being created.
244
247
  */
245
- constructor(from: Element);
248
+ constructor(from: ViewElement);
246
249
  /**
247
- * Adds consumable parts of the {@link module:engine/view/element~Element view element}.
250
+ * Adds consumable parts of the {@link module:engine/view/element~ViewElement view element}.
248
251
  * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and
249
252
  * styles still could be consumed):
250
253
  *
@@ -259,18 +262,18 @@ export declare class ViewElementConsumables {
259
262
  * consumables.add( { attributes: [ [ 'title' ], [ 'name' ], [ 'class', 'foo' ], [ 'class', 'bar' ] ] } );
260
263
  * ```
261
264
  *
262
- * Note: This method accepts only {@link module:engine/view/element~NormalizedConsumables}.
265
+ * Note: This method accepts only {@link module:engine/view/element~ViewNormalizedConsumables}.
263
266
  * You can use {@link module:engine/conversion/viewconsumable~normalizeConsumables} helper to convert from
264
- * {@link module:engine/conversion/viewconsumable~Consumables} to `NormalizedConsumables`.
267
+ * {@link module:engine/conversion/viewconsumable~Consumables} to `ViewNormalizedConsumables`.
265
268
  *
266
269
  * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
267
270
  * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.
268
271
  *
269
272
  * @param consumables Object describing which parts of the element can be consumed.
270
273
  */
271
- add(consumables: NormalizedConsumables): void;
274
+ add(consumables: ViewNormalizedConsumables): void;
272
275
  /**
273
- * Tests if parts of the {@link module:engine/view/element~Element view element} can be consumed.
276
+ * Tests if parts of the {@link module:engine/view/element~ViewElement view element} can be consumed.
274
277
  *
275
278
  * Element's name can be tested:
276
279
  *
@@ -289,9 +292,9 @@ export declare class ViewElementConsumables {
289
292
  * @returns `true` when all tested items can be consumed, `null` when even one of the items
290
293
  * was never marked for consumption and `false` when even one of the items was already consumed.
291
294
  */
292
- test(consumables: NormalizedConsumables): boolean | null;
295
+ test(consumables: ViewNormalizedConsumables): boolean | null;
293
296
  /**
294
- * Tests if parts of the {@link module:engine/view/element~Element view element} can be consumed and consumes them if available.
297
+ * Tests if parts of the {@link module:engine/view/element~ViewElement view element} can be consumed and consumes them if available.
295
298
  * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
296
299
  *
297
300
  * Element's name can be consumed:
@@ -310,9 +313,9 @@ export declare class ViewElementConsumables {
310
313
  * @param consumables Object describing which parts of the element should be consumed.
311
314
  * @returns `true` when all tested items can be consumed and `false` when even one of the items could not be consumed.
312
315
  */
313
- consume(consumables: NormalizedConsumables): boolean;
316
+ consume(consumables: ViewNormalizedConsumables): boolean;
314
317
  /**
315
- * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.
318
+ * Revert already consumed parts of {@link module:engine/view/element~ViewElement view Element}, so they can be consumed once again.
316
319
  * Element's name can be reverted:
317
320
  *
318
321
  * ```ts
@@ -328,10 +331,12 @@ export declare class ViewElementConsumables {
328
331
  *
329
332
  * @param consumables Object describing which parts of the element should be reverted.
330
333
  */
331
- revert(consumables: NormalizedConsumables): void;
334
+ revert(consumables: ViewNormalizedConsumables): void;
332
335
  }
333
336
  /**
334
337
  * Normalizes a {@link module:engine/conversion/viewconsumable~Consumables} or {@link module:engine/view/matcher~Match}
335
- * to a {@link module:engine/view/element~NormalizedConsumables}.
338
+ * to a {@link module:engine/view/element~ViewNormalizedConsumables}.
339
+ *
340
+ * @internal
336
341
  */
337
- export declare function normalizeConsumables(consumables: Consumables | Match): NormalizedConsumables;
342
+ export declare function normalizeConsumables(consumables: Consumables | Match): ViewNormalizedConsumables;