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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +96 -91
  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,16 +5,16 @@
5
5
  /**
6
6
  * @module engine/model/schema
7
7
  */
8
- import Element from './element.js';
9
- import Position from './position.js';
10
- import Range from './range.js';
11
- import type DocumentFragment from './documentfragment.js';
12
- import type DocumentSelection from './documentselection.js';
13
- import type Item from './item.js';
14
- import type Node from './node.js';
15
- import type Selection from './selection.js';
16
- import type Writer from './writer.js';
17
- declare const Schema_base: {
8
+ import { ModelElement } from './element.js';
9
+ import { ModelPosition } from './position.js';
10
+ import { ModelRange } from './range.js';
11
+ import { type ModelDocumentFragment } from './documentfragment.js';
12
+ import { type ModelDocumentSelection } from './documentselection.js';
13
+ import { type ModelItem } from './item.js';
14
+ import { type ModelNode } from './node.js';
15
+ import { type ModelSelection } from './selection.js';
16
+ import { type ModelWriter } from './writer.js';
17
+ declare const ModelSchema_base: {
18
18
  new (): import("@ckeditor/ckeditor5-utils").Observable;
19
19
  prototype: import("@ckeditor/ckeditor5-utils").Observable;
20
20
  };
@@ -31,27 +31,28 @@ declare const Schema_base: {
31
31
  * {@glink framework/architecture/editing-engine Introduction to the Editing engine architecture} guide.
32
32
  * * The {@glink framework/deep-dive/schema Schema deep-dive} guide.
33
33
  */
34
- export default class Schema extends /* #__PURE__ */ Schema_base {
34
+ export declare class ModelSchema extends /* #__PURE__ */ ModelSchema_base {
35
35
  private readonly _sourceDefinitions;
36
36
  /**
37
37
  * A dictionary containing attribute properties.
38
38
  */
39
39
  private readonly _attributeProperties;
40
40
  /**
41
- * Stores additional callbacks registered for schema items, which are evaluated when {@link ~Schema#checkChild} is called.
41
+ * Stores additional callbacks registered for schema items, which are evaluated when {@link ~ModelSchema#checkChild} is called.
42
42
  *
43
43
  * Keys are schema item names for which the callbacks are registered. Values are arrays with the callbacks.
44
44
  *
45
- * Some checks are added under {@link ~Schema#_genericCheckSymbol} key, these are evaluated for every {@link ~Schema#checkChild} call.
45
+ * Some checks are added under {@link ~ModelSchema#_genericCheckSymbol} key, these are
46
+ * evaluated for every {@link ~ModelSchema#checkChild} call.
46
47
  */
47
48
  private readonly _customChildChecks;
48
49
  /**
49
- * Stores additional callbacks registered for attribute names, which are evaluated when {@link ~Schema#checkAttribute} is called.
50
+ * Stores additional callbacks registered for attribute names, which are evaluated when {@link ~ModelSchema#checkAttribute} is called.
50
51
  *
51
52
  * Keys are schema attribute names for which the callbacks are registered. Values are arrays with the callbacks.
52
53
  *
53
- * Some checks are added under {@link ~Schema#_genericCheckSymbol} key, these are evaluated for every
54
- * {@link ~Schema#checkAttribute} call.
54
+ * Some checks are added under {@link ~ModelSchema#_genericCheckSymbol} key, these are evaluated for every
55
+ * {@link ~ModelSchema#checkAttribute} call.
55
56
  */
56
57
  private readonly _customAttributeChecks;
57
58
  private readonly _genericCheckSymbol;
@@ -69,7 +70,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
69
70
  * } );
70
71
  * ```
71
72
  */
72
- register(itemName: string, definition?: SchemaItemDefinition): void;
73
+ register(itemName: string, definition?: ModelSchemaItemDefinition): void;
73
74
  /**
74
75
  * Extends a {@link #register registered} item's definition.
75
76
  *
@@ -93,7 +94,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
93
94
  * // }
94
95
  * ```
95
96
  */
96
- extend(itemName: string, definition: SchemaItemDefinition): void;
97
+ extend(itemName: string, definition: ModelSchemaItemDefinition): void;
97
98
  /**
98
99
  * Returns data of all registered items.
99
100
  *
@@ -102,7 +103,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
102
103
  * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
103
104
  * in other cases.
104
105
  */
105
- getDefinitions(): Record<string, SchemaCompiledItemDefinition>;
106
+ getDefinitions(): Record<string, ModelSchemaCompiledItemDefinition>;
106
107
  /**
107
108
  * Returns a definition of the given item or `undefined` if an item is not registered.
108
109
  *
@@ -111,7 +112,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
111
112
  * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
112
113
  * in other cases.
113
114
  */
114
- getDefinition(item: string | Item | DocumentFragment | SchemaContextItem): SchemaCompiledItemDefinition | undefined;
115
+ getDefinition(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): ModelSchemaCompiledItemDefinition | undefined;
115
116
  /**
116
117
  * Returns `true` if the given item is registered in the schema.
117
118
  *
@@ -121,10 +122,10 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
121
122
  * schema.isRegistered( 'foo' ); // -> false
122
123
  * ```
123
124
  */
124
- isRegistered(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
125
+ isRegistered(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
125
126
  /**
126
127
  * Returns `true` if the given item is defined to be
127
- * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.
128
+ * a block by the {@link module:engine/model/schema~ModelSchemaItemDefinition}'s `isBlock` property.
128
129
  *
129
130
  * ```ts
130
131
  * schema.isBlock( 'paragraph' ); // -> true
@@ -137,14 +138,14 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
137
138
  * See the {@glink framework/deep-dive/schema#block-elements Block elements} section of
138
139
  * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
139
140
  */
140
- isBlock(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
141
+ isBlock(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
141
142
  /**
142
143
  * Returns `true` if the given item should be treated as a limit element.
143
144
  *
144
145
  * It considers an item to be a limit element if its
145
- * {@link module:engine/model/schema~SchemaItemDefinition}'s
146
- * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or
147
- * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
146
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition}'s
147
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition#isLimit `isLimit`} or
148
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition#isObject `isObject`} property
148
149
  * was set to `true`.
149
150
  *
150
151
  * ```ts
@@ -157,13 +158,13 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
157
158
  * See the {@glink framework/deep-dive/schema#limit-elements Limit elements} section of
158
159
  * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
159
160
  */
160
- isLimit(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
161
+ isLimit(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
161
162
  /**
162
163
  * Returns `true` if the given item should be treated as an object element.
163
164
  *
164
165
  * It considers an item to be an object element if its
165
- * {@link module:engine/model/schema~SchemaItemDefinition}'s
166
- * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
166
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition}'s
167
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition#isObject `isObject`} property
167
168
  * was set to `true`.
168
169
  *
169
170
  * ```ts
@@ -177,10 +178,10 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
177
178
  * See the {@glink framework/deep-dive/schema#object-elements Object elements} section of
178
179
  * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
179
180
  */
180
- isObject(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
181
+ isObject(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
181
182
  /**
182
183
  * Returns `true` if the given item is defined to be
183
- * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.
184
+ * an inline element by the {@link module:engine/model/schema~ModelSchemaItemDefinition}'s `isInline` property.
184
185
  *
185
186
  * ```ts
186
187
  * schema.isInline( 'paragraph' ); // -> false
@@ -193,10 +194,10 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
193
194
  * See the {@glink framework/deep-dive/schema#inline-elements Inline elements} section of
194
195
  * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
195
196
  */
196
- isInline(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
197
+ isInline(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
197
198
  /**
198
199
  * Returns `true` if the given item is defined to be
199
- * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.
200
+ * a selectable element by the {@link module:engine/model/schema~ModelSchemaItemDefinition}'s `isSelectable` property.
200
201
  *
201
202
  * ```ts
202
203
  * schema.isSelectable( 'paragraph' ); // -> false
@@ -211,10 +212,10 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
211
212
  * See the {@glink framework/deep-dive/schema#selectable-elements Selectable elements section} of
212
213
  * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
213
214
  */
214
- isSelectable(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
215
+ isSelectable(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
215
216
  /**
216
217
  * Returns `true` if the given item is defined to be
217
- * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.
218
+ * a content by the {@link module:engine/model/schema~ModelSchemaItemDefinition}'s `isContent` property.
218
219
  *
219
220
  * ```ts
220
221
  * schema.isContent( 'paragraph' ); // -> false
@@ -229,7 +230,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
229
230
  * See the {@glink framework/deep-dive/schema#content-elements Content elements section} of
230
231
  * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.
231
232
  */
232
- isContent(item: string | Item | DocumentFragment | SchemaContextItem): boolean;
233
+ isContent(item: string | ModelItem | ModelDocumentFragment | ModelSchemaContextItem): boolean;
233
234
  /**
234
235
  * Checks whether the given node can be a child of the given context.
235
236
  *
@@ -243,8 +244,9 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
243
244
  * schema.checkChild( model.document.getRoot(), paragraph ); // -> true
244
245
  * ```
245
246
  *
246
- * Both {@link module:engine/model/schema~Schema#addChildCheck callback checks} and declarative rules (added when
247
- * {@link module:engine/model/schema~Schema#register registering} and {@link module:engine/model/schema~Schema#extend extending} items)
247
+ * Both {@link module:engine/model/schema~ModelSchema#addChildCheck callback checks} and declarative rules (added when
248
+ * {@link module:engine/model/schema~ModelSchema#register registering} and
249
+ * {@link module:engine/model/schema~ModelSchema#extend extending} items)
248
250
  * are evaluated when this method is called.
249
251
  *
250
252
  * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.
@@ -252,13 +254,13 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
252
254
  * Note that when verifying whether the given node can be a child of the given context, the schema also verifies the entire
253
255
  * context &ndash; from its root to its last element. Therefore, it is possible for `checkChild()` to return `false` even though
254
256
  * the `context` last element can contain the checked child. It happens if one of the `context` elements does not allow its child.
255
- * When `context` is verified, {@link module:engine/model/schema~Schema#addChildCheck custom checks} are considered as well.
257
+ * When `context` is verified, {@link module:engine/model/schema~ModelSchema#addChildCheck custom checks} are considered as well.
256
258
  *
257
259
  * @fires checkChild
258
260
  * @param context The context in which the child will be checked.
259
261
  * @param def The child to check.
260
262
  */
261
- checkChild(context: SchemaContextDefinition, def: string | Node | DocumentFragment): boolean;
263
+ checkChild(context: ModelSchemaContextDefinition, def: string | ModelNode | ModelDocumentFragment): boolean;
262
264
  /**
263
265
  * Checks whether the given attribute can be applied in the given context (on the last item of the context).
264
266
  *
@@ -272,8 +274,9 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
272
274
  * schema.checkAttribute( textNode, 'bold' ); // -> true
273
275
  * ```
274
276
  *
275
- * Both {@link module:engine/model/schema~Schema#addAttributeCheck callback checks} and declarative rules (added when
276
- * {@link module:engine/model/schema~Schema#register registering} and {@link module:engine/model/schema~Schema#extend extending} items)
277
+ * Both {@link module:engine/model/schema~ModelSchema#addAttributeCheck callback checks} and declarative rules (added when
278
+ * {@link module:engine/model/schema~ModelSchema#register registering} and
279
+ * {@link module:engine/model/schema~ModelSchema#extend extending} items)
277
280
  * are evaluated when this method is called.
278
281
  *
279
282
  * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.
@@ -282,14 +285,14 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
282
285
  * @param context The context in which the attribute will be checked.
283
286
  * @param attributeName Name of attribute to check in the given context.
284
287
  */
285
- checkAttribute(context: SchemaContextDefinition, attributeName: string): boolean;
286
- checkMerge(position: Position): boolean;
287
- checkMerge(baseElement: Element, elementToMerge: Element): boolean;
288
+ checkAttribute(context: ModelSchemaContextDefinition, attributeName: string): boolean;
289
+ checkMerge(position: ModelPosition): boolean;
290
+ checkMerge(baseElement: ModelElement, elementToMerge: ModelElement): boolean;
288
291
  /**
289
292
  * Allows registering a callback to the {@link #checkChild} method calls.
290
293
  *
291
294
  * Callbacks allow you to implement rules which are not otherwise possible to achieve
292
- * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
295
+ * by using the declarative API of {@link module:engine/model/schema~ModelSchemaItemDefinition}.
293
296
  *
294
297
  * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.
295
298
  *
@@ -342,19 +345,19 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
342
345
  * Adding callbacks this way can also negatively impact editor performance.
343
346
  *
344
347
  * @param callback The callback to be called. It is called with two parameters:
345
- * {@link module:engine/model/schema~SchemaContext} (context) instance and
346
- * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (definition). The callback may return `true/false` to override
347
- * `checkChild()`'s return value. If it does not return a boolean value, the default algorithm (or other callbacks) will define
348
+ * {@link module:engine/model/schema~ModelSchemaContext} (context) instance and
349
+ * {@link module:engine/model/schema~ModelSchemaCompiledItemDefinition} (definition). The callback may return `true/false` to
350
+ * override `checkChild()`'s return value. If it does not return a boolean value, the default algorithm (or other callbacks) will define
348
351
  * `checkChild()`'s return value.
349
352
  * @param itemName Name of the schema item for which the callback is registered. If specified, the callback will be run only for
350
353
  * `checkChild()` calls which `def` parameter matches the `itemName`. Otherwise, the callback will run for every `checkChild` call.
351
354
  */
352
- addChildCheck(callback: SchemaChildCheckCallback, itemName?: string): void;
355
+ addChildCheck(callback: ModelSchemaChildCheckCallback, itemName?: string): void;
353
356
  /**
354
357
  * Allows registering a callback to the {@link #checkAttribute} method calls.
355
358
  *
356
359
  * Callbacks allow you to implement rules which are not otherwise possible to achieve
357
- * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
360
+ * by using the declarative API of {@link module:engine/model/schema~ModelSchemaItemDefinition}.
358
361
  *
359
362
  * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.
360
363
  *
@@ -407,16 +410,16 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
407
410
  * Adding callbacks this way can also negatively impact editor performance.
408
411
  *
409
412
  * @param callback The callback to be called. It is called with two parameters:
410
- * {@link module:engine/model/schema~SchemaContext `context`} and attribute name. The callback may return `true` or `false`, to
413
+ * {@link module:engine/model/schema~ModelSchemaContext `context`} and attribute name. The callback may return `true` or `false`, to
411
414
  * override `checkAttribute()`'s return value. If it does not return a boolean value, the default algorithm (or other callbacks)
412
415
  * will define `checkAttribute()`'s return value.
413
416
  * @param attributeName Name of the attribute for which the callback is registered. If specified, the callback will be run only for
414
417
  * `checkAttribute()` calls with matching `attributeName`. Otherwise, the callback will run for every `checkAttribute()` call.
415
418
  */
416
- addAttributeCheck(callback: SchemaAttributeCheckCallback, attributeName?: string): void;
419
+ addAttributeCheck(callback: ModelSchemaAttributeCheckCallback, attributeName?: string): void;
417
420
  /**
418
421
  * This method allows assigning additional metadata to the model attributes. For example,
419
- * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is
422
+ * {@link module:engine/model/schema~ModelAttributeProperties `AttributeProperties#isFormatting` property} is
420
423
  * used to mark formatting attributes (like `bold` or `italic`).
421
424
  *
422
425
  * ```ts
@@ -432,7 +435,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
432
435
  * ```
433
436
  *
434
437
  * Properties are not limited to members defined in the
435
- * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:
438
+ * {@link module:engine/model/schema~ModelAttributeProperties `AttributeProperties` type} and you can also use custom properties:
436
439
  *
437
440
  * ```ts
438
441
  * schema.setAttributeProperties( 'blockQuote', {
@@ -458,21 +461,21 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
458
461
  * @param attributeName A name of the attribute to receive the properties.
459
462
  * @param properties A dictionary of properties.
460
463
  */
461
- setAttributeProperties(attributeName: string, properties: AttributeProperties): void;
464
+ setAttributeProperties(attributeName: string, properties: ModelAttributeProperties): void;
462
465
  /**
463
466
  * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.
464
467
  *
465
468
  * @param attributeName A name of the attribute.
466
469
  */
467
- getAttributeProperties(attributeName: string): AttributeProperties;
470
+ getAttributeProperties(attributeName: string): ModelAttributeProperties;
468
471
  /**
469
- * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire
472
+ * Returns the lowest {@link module:engine/model/schema~ModelSchema#isLimit limit element} containing the entire
470
473
  * selection/range/position or the root otherwise.
471
474
  *
472
475
  * @param selectionOrRangeOrPosition The selection/range/position to check.
473
476
  * @returns The lowest limit element containing the entire `selectionOrRangeOrPosition`.
474
477
  */
475
- getLimitElement(selectionOrRangeOrPosition: Selection | DocumentSelection | Range | Position): Element;
478
+ getLimitElement(selectionOrRangeOrPosition: ModelSelection | ModelDocumentSelection | ModelRange | ModelPosition): ModelElement;
476
479
  /**
477
480
  * Checks whether the attribute is allowed in selection:
478
481
  *
@@ -483,7 +486,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
483
486
  * @param selection Selection which will be checked.
484
487
  * @param attribute The name of the attribute to check.
485
488
  */
486
- checkAttributeInSelection(selection: Selection | DocumentSelection, attribute: string): boolean;
489
+ checkAttributeInSelection(selection: ModelSelection | ModelDocumentSelection, attribute: string): boolean;
487
490
  /**
488
491
  * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).
489
492
  *
@@ -491,14 +494,14 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
491
494
  * @param attribute The name of the attribute to check.
492
495
  * @returns Ranges in which the attribute is allowed.
493
496
  */
494
- getValidRanges(ranges: Iterable<Range>, attribute: string): IterableIterator<Range>;
497
+ getValidRanges(ranges: Iterable<ModelRange>, attribute: string): IterableIterator<ModelRange>;
495
498
  /**
496
- * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is
499
+ * Basing on given `position`, finds and returns a {@link module:engine/model/range~ModelRange range} which is
497
500
  * nearest to that `position` and is a correct range for selection.
498
501
  *
499
502
  * The correct selection range might be collapsed when it is located in a position where the text node can be placed.
500
503
  * Non-collapsed range is returned when selection can be placed around element marked as an "object" in
501
- * the {@link module:engine/model/schema~Schema schema}.
504
+ * the {@link module:engine/model/schema~ModelSchema schema}.
502
505
  *
503
506
  * Direction of searching for the nearest correct selection range can be specified as:
504
507
  *
@@ -512,18 +515,18 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
512
515
  * @param direction Search direction.
513
516
  * @returns Nearest selection range or `null` if one cannot be found.
514
517
  */
515
- getNearestSelectionRange(position: Position, direction?: 'both' | 'forward' | 'backward'): Range | null;
518
+ getNearestSelectionRange(position: ModelPosition, direction?: 'both' | 'forward' | 'backward'): ModelRange | null;
516
519
  /**
517
520
  * Tries to find position ancestors that allow to insert a given node.
518
521
  * It starts searching from the given position and goes node by node to the top of the model tree
519
- * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an
520
- * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.
522
+ * as long as a {@link module:engine/model/schema~ModelSchema#isLimit limit element}, an
523
+ * {@link module:engine/model/schema~ModelSchema#isObject object element} or a topmost ancestor is not reached.
521
524
  *
522
525
  * @param position The position that the search will start from.
523
526
  * @param node The node for which an allowed parent should be found or its name.
524
527
  * @returns Allowed parent or null if nothing was found.
525
528
  */
526
- findAllowedParent(position: Position, node: Node | string): Element | null;
529
+ findAllowedParent(position: ModelPosition, node: ModelNode | string): ModelElement | null;
527
530
  /**
528
531
  * Sets attributes allowed by the schema on a given node.
529
532
  *
@@ -531,13 +534,13 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
531
534
  * @param attributes Attributes keys and values.
532
535
  * @param writer An instance of the model writer.
533
536
  */
534
- setAllowedAttributes(node: Node, attributes: Record<string, unknown>, writer: Writer): void;
537
+ setAllowedAttributes(node: ModelNode, attributes: Record<string, unknown>, writer: ModelWriter): void;
535
538
  /**
536
539
  * Removes attributes disallowed by the schema.
537
540
  *
538
541
  * @param nodes Nodes that will be filtered.
539
542
  */
540
- removeDisallowedAttributes(nodes: Iterable<Node>, writer: Writer): void;
543
+ removeDisallowedAttributes(nodes: Iterable<ModelNode>, writer: ModelWriter): void;
541
544
  /**
542
545
  * Gets attributes of a node that have a given property.
543
546
  *
@@ -548,11 +551,11 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
548
551
  * return attributes which given property's value is equal to this parameter.
549
552
  * @returns Object with attributes' names as key and attributes' values as value.
550
553
  */
551
- getAttributesWithProperty(node: Node, propertyName: string, propertyValue: unknown): Record<string, unknown>;
554
+ getAttributesWithProperty(node: ModelNode, propertyName: string, propertyValue: unknown): Record<string, unknown>;
552
555
  /**
553
556
  * Creates an instance of the schema context.
554
557
  */
555
- createContext(context: SchemaContextDefinition): SchemaContext;
558
+ createContext(context: ModelSchemaContextDefinition): ModelSchemaContext;
556
559
  private _clearCache;
557
560
  private _compile;
558
561
  private _checkContextMatch;
@@ -576,7 +579,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
576
579
  * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges
577
580
  * inside the given range on which the attribute can be applied.
578
581
  *
579
- * This is a helper function for {@link ~Schema#getValidRanges}.
582
+ * This is a helper function for {@link ~ModelSchema#getValidRanges}.
580
583
  *
581
584
  * @param range The range to process.
582
585
  * @param attribute The name of the attribute to check.
@@ -602,18 +605,18 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
602
605
  * The `after` value will try to find a position after selection.
603
606
  * @returns The optimal range.
604
607
  */
605
- findOptimalInsertionRange(selection: Selection | DocumentSelection, place?: 'auto' | 'before' | 'after'): Range;
608
+ findOptimalInsertionRange(selection: ModelSelection | ModelDocumentSelection, place?: 'auto' | 'before' | 'after'): ModelRange;
606
609
  }
607
610
  /**
608
- * Event fired when the {@link ~Schema#checkChild} method is called. It allows plugging in
611
+ * Event fired when the {@link ~ModelSchema#checkChild} method is called. It allows plugging in
609
612
  * additional behavior, for example implementing rules which cannot be defined using the declarative
610
- * {@link module:engine/model/schema~SchemaItemDefinition} interface.
613
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition} interface.
611
614
  *
612
- * **Note:** The {@link ~Schema#addChildCheck} method is a more handy way to register callbacks. Internally,
615
+ * **Note:** The {@link ~ModelSchema#addChildCheck} method is a more handy way to register callbacks. Internally,
613
616
  * it registers a listener to this event but comes with a simpler API and it is the recommended choice
614
617
  * in most of the cases.
615
618
  *
616
- * The {@link ~Schema#checkChild} method fires an event because it is
619
+ * The {@link ~ModelSchema#checkChild} method fires an event because it is
617
620
  * {@link module:utils/observablemixin~Observable#decorate decorated} with it. Thanks to that you can
618
621
  * use this event in various ways, but the most important use case is overriding standard behavior of the
619
622
  * `checkChild()` method. Let's see a typical listener template:
@@ -627,8 +630,8 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
627
630
  *
628
631
  * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
629
632
  * parameter contains arguments passed to `checkChild( context, child )`. However, the `context` parameter is already
630
- * normalized to a {@link module:engine/model/schema~SchemaContext} instance and `child` to a
631
- * {@link module:engine/model/schema~SchemaCompiledItemDefinition} instance, so you do not have to worry about
633
+ * normalized to a {@link module:engine/model/schema~ModelSchemaContext} instance and `child` to a
634
+ * {@link module:engine/model/schema~ModelSchemaCompiledItemDefinition} instance, so you do not have to worry about
632
635
  * the various ways how `context` and `child` may be passed to `checkChild()`.
633
636
  *
634
637
  * **Note:** `childDefinition` may be `undefined` if `checkChild()` was called with a non-registered element.
@@ -650,7 +653,7 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
650
653
  * ```
651
654
  *
652
655
  * Allowing elements in specific contexts will be a far less common use case, because it is normally handled by the
653
- * `allowIn` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
656
+ * `allowIn` rule from {@link module:engine/model/schema~ModelSchemaItemDefinition}. But if you have a complex scenario
654
657
  * where `listItem` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
655
658
  *
656
659
  * ```ts
@@ -667,23 +670,23 @@ export default class Schema extends /* #__PURE__ */ Schema_base {
667
670
  * }, { priority: 'high' } );
668
671
  * ```
669
672
  *
670
- * @eventName ~Schema#checkChild
673
+ * @eventName ~ModelSchema#checkChild
671
674
  * @param args The `checkChild()`'s arguments.
672
675
  */
673
- export type SchemaCheckChildEvent = {
676
+ export type ModelSchemaCheckChildEvent = {
674
677
  name: 'checkChild';
675
- args: [[context: SchemaContext, def: SchemaCompiledItemDefinition]];
678
+ args: [[context: ModelSchemaContext, def: ModelSchemaCompiledItemDefinition]];
676
679
  };
677
680
  /**
678
- * Event fired when the {@link ~Schema#checkAttribute} method is called. It allows plugging in
681
+ * Event fired when the {@link ~ModelSchema#checkAttribute} method is called. It allows plugging in
679
682
  * additional behavior, for example implementing rules which cannot be defined using the declarative
680
- * {@link module:engine/model/schema~SchemaItemDefinition} interface.
683
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition} interface.
681
684
  *
682
- * **Note:** The {@link ~Schema#addAttributeCheck} method is a more handy way to register callbacks. Internally,
685
+ * **Note:** The {@link ~ModelSchema#addAttributeCheck} method is a more handy way to register callbacks. Internally,
683
686
  * it registers a listener to this event but comes with a simpler API and it is the recommended choice
684
687
  * in most of the cases.
685
688
  *
686
- * The {@link ~Schema#checkAttribute} method fires an event because it is
689
+ * The {@link ~ModelSchema#checkAttribute} method fires an event because it is
687
690
  * {@link module:utils/observablemixin~Observable#decorate decorated} with it. Thanks to that you can
688
691
  * use this event in various ways, but the most important use case is overriding the standard behavior of the
689
692
  * `checkAttribute()` method. Let's see a typical listener template:
@@ -697,7 +700,7 @@ export type SchemaCheckChildEvent = {
697
700
  *
698
701
  * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
699
702
  * parameter contains arguments passed to `checkAttribute( context, attributeName )`. However, the `context` parameter is already
700
- * normalized to a {@link module:engine/model/schema~SchemaContext} instance, so you do not have to worry about
703
+ * normalized to a {@link module:engine/model/schema~ModelSchemaContext} instance, so you do not have to worry about
701
704
  * the various ways how `context` may be passed to `checkAttribute()`.
702
705
  *
703
706
  * So, in order to implement a rule "disallow `bold` in a text which is in a `heading1`, you can add such a listener:
@@ -717,7 +720,7 @@ export type SchemaCheckChildEvent = {
717
720
  * ```
718
721
  *
719
722
  * Allowing attributes in specific contexts will be a far less common use case, because it is normally handled by the
720
- * `allowAttributes` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
723
+ * `allowAttributes` rule from {@link module:engine/model/schema~ModelSchemaItemDefinition}. But if you have a complex scenario
721
724
  * where `bold` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
722
725
  *
723
726
  * ```ts
@@ -734,49 +737,50 @@ export type SchemaCheckChildEvent = {
734
737
  * }, { priority: 'high' } );
735
738
  * ```
736
739
  *
737
- * @eventName ~Schema#checkAttribute
740
+ * @eventName ~ModelSchema#checkAttribute
738
741
  * @param args The `checkAttribute()`'s arguments.
739
742
  */
740
- export type SchemaCheckAttributeEvent = {
743
+ export type ModelSchemaCheckAttributeEvent = {
741
744
  name: 'checkAttribute';
742
- args: [[context: SchemaContext, attributeName: string]];
745
+ args: [[context: ModelSchemaContext, attributeName: string]];
743
746
  };
744
747
  /**
745
- * A definition of a {@link module:engine/model/schema~Schema schema} item.
748
+ * A definition of a {@link module:engine/model/schema~ModelSchema schema} item.
746
749
  *
747
750
  * You can define the following rules:
748
751
  *
749
- * * {@link ~SchemaItemDefinition#allowIn `allowIn`} &ndash; Defines in which other items this item will be allowed.
750
- * * {@link ~SchemaItemDefinition#allowChildren `allowChildren`} &ndash; Defines which other items are allowed inside this item.
751
- * * {@link ~SchemaItemDefinition#allowAttributes `allowAttributes`} &ndash; Defines allowed attributes of the given item.
752
- * * {@link ~SchemaItemDefinition#disallowIn `disallowIn`} &ndash; Defines in which other items this item will be disallowed.
753
- * * {@link ~SchemaItemDefinition#disallowChildren `disallowChildren`} &ndash; Defines which other items are disallowed inside this item.
754
- * * {@link ~SchemaItemDefinition#disallowAttributes `disallowAttributes`} &ndash; Defines disallowed attributes of the given item.
755
- * * {@link ~SchemaItemDefinition#allowContentOf `allowContentOf`} &ndash; Makes this item allow children that are also allowed in the
752
+ * * {@link ~ModelSchemaItemDefinition#allowIn `allowIn`} &ndash; Defines in which other items this item will be allowed.
753
+ * * {@link ~ModelSchemaItemDefinition#allowChildren `allowChildren`} &ndash; Defines which other items are allowed inside this item.
754
+ * * {@link ~ModelSchemaItemDefinition#allowAttributes `allowAttributes`} &ndash; Defines allowed attributes of the given item.
755
+ * * {@link ~ModelSchemaItemDefinition#disallowIn `disallowIn`} &ndash; Defines in which other items this item will be disallowed.
756
+ * * {@link ~ModelSchemaItemDefinition#disallowChildren `disallowChildren`} &ndash; Defines which other items are
757
+ * disallowed inside this item.
758
+ * * {@link ~ModelSchemaItemDefinition#disallowAttributes `disallowAttributes`} &ndash; Defines disallowed attributes of the given item.
759
+ * * {@link ~ModelSchemaItemDefinition#allowContentOf `allowContentOf`} &ndash; Makes this item allow children that are also allowed in the
756
760
  * specified items. This acknowledges disallow rules.
757
- * * {@link ~SchemaItemDefinition#allowWhere `allowWhere`} &ndash; Makes this item allowed where the specified items are allowed. This
761
+ * * {@link ~ModelSchemaItemDefinition#allowWhere `allowWhere`} &ndash; Makes this item allowed where the specified items are allowed. This
758
762
  * acknowledges disallow rules.
759
- * * {@link ~SchemaItemDefinition#allowAttributesOf `allowAttributesOf`} &ndash; Inherits attributes from other items. This acknowledges
760
- * disallow rules.
761
- * * {@link ~SchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} &ndash; Inherits `is*` properties of other items.
762
- * * {@link ~SchemaItemDefinition#inheritAllFrom `inheritAllFrom`} &ndash;
763
+ * * {@link ~ModelSchemaItemDefinition#allowAttributesOf `allowAttributesOf`} &ndash; Inherits attributes from other items.
764
+ * This acknowledges disallow rules.
765
+ * * {@link ~ModelSchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} &ndash; Inherits `is*` properties of other items.
766
+ * * {@link ~ModelSchemaItemDefinition#inheritAllFrom `inheritAllFrom`} &ndash;
763
767
  * A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
764
768
  *
765
769
  * # The `is*` properties
766
770
  *
767
771
  * There are a couple commonly used `is*` properties. Their role is to assign additional semantics to schema items.
768
772
  *
769
- * * {@link ~SchemaItemDefinition#isBlock `isBlock`} &ndash; Whether this item is paragraph-like.
773
+ * * {@link ~ModelSchemaItemDefinition#isBlock `isBlock`} &ndash; Whether this item is paragraph-like.
770
774
  * Generally speaking, content is usually made out of blocks like paragraphs, list items, images, headings, etc.
771
- * * {@link ~SchemaItemDefinition#isInline `isInline`} &ndash; Whether an item is "text-like" and should be treated as an inline node.
775
+ * * {@link ~ModelSchemaItemDefinition#isInline `isInline`} &ndash; Whether an item is "text-like" and should be treated as an inline node.
772
776
  * Examples of inline elements: `$text`, `softBreak` (`<br>`), etc.
773
- * * {@link ~SchemaItemDefinition#isLimit `isLimit`} &ndash; It can be understood as whether this element
777
+ * * {@link ~ModelSchemaItemDefinition#isLimit `isLimit`} &ndash; It can be understood as whether this element
774
778
  * should not be split by <kbd>Enter</kbd>. Examples of limit elements: `$root`, table cell, image caption, etc.
775
779
  * In other words, all actions that happen inside a limit element are limited to its content.
776
780
  * All objects are treated as limit elements, too.
777
- * * {@link ~SchemaItemDefinition#isObject `isObject`} &ndash; Whether an item is "self-contained" and should be treated as a whole.
781
+ * * {@link ~ModelSchemaItemDefinition#isObject `isObject`} &ndash; Whether an item is "self-contained" and should be treated as a whole.
778
782
  * Examples of object elements: `imageBlock`, `table`, `video`, etc. An object is also a limit, so
779
- * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
783
+ * {@link module:engine/model/schema~ModelSchema#isLimit `isLimit()`} returns `true` for object elements automatically.
780
784
  *
781
785
  * Read more about the meaning of these types in the
782
786
  * {@glink framework/deep-dive/schema#defining-additional-semantics dedicated section of the Schema deep-dive} guide.
@@ -924,7 +928,7 @@ export type SchemaCheckAttributeEvent = {
924
928
  * * Remember about defining the `is*` properties. They do not affect the allowed structures, but they can
925
929
  * affect how the editor features treat your elements.
926
930
  */
927
- export interface SchemaItemDefinition {
931
+ export interface ModelSchemaItemDefinition {
928
932
  /**
929
933
  * Defines in which other items this item will be allowed.
930
934
  */
@@ -1013,7 +1017,7 @@ export interface SchemaItemDefinition {
1013
1017
  * `imageBlock`, `table`, `video`, etc.
1014
1018
  *
1015
1019
  * **Note:** An object is also a limit, so
1016
- * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
1020
+ * {@link module:engine/model/schema~ModelSchema#isLimit `isLimit()`} returns `true` for object elements automatically.
1017
1021
  *
1018
1022
  * Read more about the object elements in the
1019
1023
  * {@glink framework/deep-dive/schema#object-elements Object elements section} of the Schema deep-dive guide.
@@ -1024,7 +1028,7 @@ export interface SchemaItemDefinition {
1024
1028
  * Examples of selectable elements: `imageBlock`, `table`, `tableCell`, etc.
1025
1029
  *
1026
1030
  * **Note:** An object is also a selectable element, so
1027
- * {@link module:engine/model/schema~Schema#isSelectable `isSelectable()`} returns `true` for object elements automatically.
1031
+ * {@link module:engine/model/schema~ModelSchema#isSelectable `isSelectable()`} returns `true` for object elements automatically.
1028
1032
  *
1029
1033
  * Read more about selectable elements in the
1030
1034
  * {@glink framework/deep-dive/schema#selectable-elements Selectable elements section} of
@@ -1036,7 +1040,7 @@ export interface SchemaItemDefinition {
1036
1040
  * Examples of content elements: `$text`, `imageBlock`, `table`, etc. (but not `paragraph`, `heading1` or `tableCell`).
1037
1041
  *
1038
1042
  * **Note:** An object is also a content element, so
1039
- * {@link module:engine/model/schema~Schema#isContent `isContent()`} returns `true` for object elements automatically.
1043
+ * {@link module:engine/model/schema~ModelSchema#isContent `isContent()`} returns `true` for object elements automatically.
1040
1044
  *
1041
1045
  * Read more about content elements in the
1042
1046
  * {@glink framework/deep-dive/schema#content-elements Content elements section} of
@@ -1045,13 +1049,13 @@ export interface SchemaItemDefinition {
1045
1049
  isContent?: boolean;
1046
1050
  }
1047
1051
  /**
1048
- * A simplified version of {@link module:engine/model/schema~SchemaItemDefinition} after
1049
- * compilation by the {@link module:engine/model/schema~Schema schema}.
1050
- * Rules fed to the schema by {@link module:engine/model/schema~Schema#register}
1051
- * and {@link module:engine/model/schema~Schema#extend} methods are defined in the
1052
- * {@link module:engine/model/schema~SchemaItemDefinition} format.
1053
- * Later on, they are compiled to `SchemaCompiledItemDefinition` so when you use e.g.
1054
- * the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version.
1052
+ * A simplified version of {@link module:engine/model/schema~ModelSchemaItemDefinition} after
1053
+ * compilation by the {@link module:engine/model/schema~ModelSchema schema}.
1054
+ * Rules fed to the schema by {@link module:engine/model/schema~ModelSchema#register}
1055
+ * and {@link module:engine/model/schema~ModelSchema#extend} methods are defined in the
1056
+ * {@link module:engine/model/schema~ModelSchemaItemDefinition} format.
1057
+ * Later on, they are compiled to `ModelSchemaCompiledItemDefinition` so when you use e.g.
1058
+ * the {@link module:engine/model/schema~ModelSchema#getDefinition} method you get the compiled version.
1055
1059
  *
1056
1060
  * The compiled version contains only the following properties:
1057
1061
  *
@@ -1061,7 +1065,7 @@ export interface SchemaItemDefinition {
1061
1065
  * * The `allowChildren` array,
1062
1066
  * * The `allowAttributes` array.
1063
1067
  */
1064
- export interface SchemaCompiledItemDefinition {
1068
+ export interface ModelSchemaCompiledItemDefinition {
1065
1069
  name: string;
1066
1070
  isBlock: boolean;
1067
1071
  isContent: boolean;
@@ -1088,23 +1092,23 @@ export interface SchemaCompiledItemDefinition {
1088
1092
  * </$root>
1089
1093
  * ```
1090
1094
  *
1091
- * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:
1095
+ * The context of this position is its {@link module:engine/model/position~ModelPosition#getAncestors lists of ancestors}:
1092
1096
  *
1093
1097
  * [ rootElement, blockQuoteElement, paragraphElement ]
1094
1098
  *
1095
- * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and
1096
- * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition
1099
+ * Contexts are used in the {@link module:engine/model/schema~ModelSchema#event:checkChild `Schema#checkChild`} and
1100
+ * {@link module:engine/model/schema~ModelSchema#event:checkAttribute `Schema#checkAttribute`} events as a definition
1097
1101
  * of a place in the document where the check occurs. The context instances are created based on the first arguments
1098
- * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and
1099
- * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when
1100
- * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.
1102
+ * of the {@link module:engine/model/schema~ModelSchema#checkChild `Schema#checkChild()`} and
1103
+ * {@link module:engine/model/schema~ModelSchema#checkAttribute `Schema#checkAttribute()`} methods so when
1104
+ * using these methods you need to use {@link module:engine/model/schema~ModelSchemaContextDefinition}s.
1101
1105
  */
1102
- export declare class SchemaContext implements Iterable<SchemaContextItem> {
1106
+ export declare class ModelSchemaContext implements Iterable<ModelSchemaContextItem> {
1103
1107
  private _items;
1104
1108
  /**
1105
1109
  * Creates an instance of the context.
1106
1110
  */
1107
- constructor(context: SchemaContextDefinition);
1111
+ constructor(context: ModelSchemaContextDefinition);
1108
1112
  /**
1109
1113
  * The number of items.
1110
1114
  */
@@ -1112,20 +1116,20 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1112
1116
  /**
1113
1117
  * The last item (the lowest node).
1114
1118
  */
1115
- get last(): SchemaContextItem;
1119
+ get last(): ModelSchemaContextItem;
1116
1120
  /**
1117
1121
  * Iterable interface.
1118
1122
  *
1119
1123
  * Iterates over all context items.
1120
1124
  */
1121
- [Symbol.iterator](): IterableIterator<SchemaContextItem>;
1125
+ [Symbol.iterator](): IterableIterator<ModelSchemaContextItem>;
1122
1126
  /**
1123
1127
  * Returns a new schema context instance with an additional item.
1124
1128
  *
1125
1129
  * Item can be added as:
1126
1130
  *
1127
1131
  * ```ts
1128
- * const context = new SchemaContext( [ '$root' ] );
1132
+ * const context = new ModelSchemaContext( [ '$root' ] );
1129
1133
  *
1130
1134
  * // An element.
1131
1135
  * const fooElement = writer.createElement( 'fooElement' );
@@ -1139,29 +1143,29 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1139
1143
  * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]
1140
1144
  * ```
1141
1145
  *
1142
- * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item
1146
+ * **Note** {@link module:engine/model/node~ModelNode} that is already in the model tree will be added as the only item
1143
1147
  * (without ancestors).
1144
1148
  *
1145
1149
  * @param item An item that will be added to the current context.
1146
1150
  * @returns A new schema context instance with an additional item.
1147
1151
  */
1148
- push(item: string | Node): SchemaContext;
1152
+ push(item: string | ModelNode): ModelSchemaContext;
1149
1153
  /**
1150
1154
  * Returns a new schema context that is based on this context but has the last item removed.
1151
1155
  *
1152
1156
  * ```ts
1153
- * const ctxParagraph = new SchemaContext( [ '$root', 'blockQuote', 'paragraph' ] );
1157
+ * const ctxParagraph = new ModelSchemaContext( [ '$root', 'blockQuote', 'paragraph' ] );
1154
1158
  * const ctxBlockQuote = ctxParagraph.trimLast(); // Items in `ctxBlockQuote` are: `$root` an `blockQuote`.
1155
1159
  * const ctxRoot = ctxBlockQuote.trimLast(); // Items in `ctxRoot` are: `$root`.
1156
1160
  * ```
1157
1161
  *
1158
1162
  * @returns A new reduced schema context instance.
1159
1163
  */
1160
- trimLast(): SchemaContext;
1164
+ trimLast(): ModelSchemaContext;
1161
1165
  /**
1162
1166
  * Gets an item on the given index.
1163
1167
  */
1164
- getItem(index: number): SchemaContextItem;
1168
+ getItem(index: number): ModelSchemaContextItem;
1165
1169
  /**
1166
1170
  * Returns the names of items.
1167
1171
  */
@@ -1170,7 +1174,7 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1170
1174
  * Checks whether the context ends with the given nodes.
1171
1175
  *
1172
1176
  * ```ts
1173
- * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
1177
+ * const ctx = new ModelSchemaContext( [ rootElement, paragraphElement, textNode ] );
1174
1178
  *
1175
1179
  * ctx.endsWith( '$text' ); // -> true
1176
1180
  * ctx.endsWith( 'paragraph $text' ); // -> true
@@ -1183,7 +1187,7 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1183
1187
  * Checks whether the context starts with the given nodes.
1184
1188
  *
1185
1189
  * ```ts
1186
- * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
1190
+ * const ctx = new ModelSchemaContext( [ rootElement, paragraphElement, textNode ] );
1187
1191
  *
1188
1192
  * ctx.endsWith( '$root' ); // -> true
1189
1193
  * ctx.endsWith( '$root paragraph' ); // -> true
@@ -1194,7 +1198,7 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1194
1198
  startsWith(query: string): boolean;
1195
1199
  }
1196
1200
  /**
1197
- * The definition of a {@link module:engine/model/schema~SchemaContext schema context}.
1201
+ * The definition of a {@link module:engine/model/schema~ModelSchemaContext schema context}.
1198
1202
  *
1199
1203
  * Contexts can be created in multiple ways:
1200
1204
  *
@@ -1206,10 +1210,10 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1206
1210
  * way to define the context (e.g. when checking some hypothetical situation).
1207
1211
  * * By defining an **array of node names** (potentially, mixed with real nodes) – The same as **name of node**
1208
1212
  * but it is possible to create a path.
1209
- * * By defining a {@link module:engine/model/schema~SchemaContext} instance - in this case the same instance as provided
1213
+ * * By defining a {@link module:engine/model/schema~ModelSchemaContext} instance - in this case the same instance as provided
1210
1214
  * will be returned.
1211
1215
  *
1212
- * Examples of context definitions passed to the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`}
1216
+ * Examples of context definitions passed to the {@link module:engine/model/schema~ModelSchema#checkChild `Schema#checkChild()`}
1213
1217
  * method:
1214
1218
  *
1215
1219
  * ```ts
@@ -1233,7 +1237,7 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1233
1237
  * schema.checkChild( [ '$root', 'bar', paragraphElement ], 'foo' );
1234
1238
  * ```
1235
1239
  *
1236
- * All these `checkChild()` calls will fire {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`}
1240
+ * All these `checkChild()` calls will fire {@link module:engine/model/schema~ModelSchema#event:checkChild `Schema#checkChild`}
1237
1241
  * events in which `args[ 0 ]` is an instance of the context. Therefore, you can write a listener like this:
1238
1242
  *
1239
1243
  * ```ts
@@ -1252,8 +1256,8 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1252
1256
  * [ '$root', 'bar', 'paragraph' ]
1253
1257
  * ```
1254
1258
  *
1255
- * Note: When using the {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} method
1256
- * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~Text} is a
1259
+ * Note: When using the {@link module:engine/model/schema~ModelSchema#checkAttribute `Schema#checkAttribute()`} method
1260
+ * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~ModelText} is a
1257
1261
  * correct way to define a context so you can do this:
1258
1262
  *
1259
1263
  * ```ts
@@ -1268,9 +1272,9 @@ export declare class SchemaContext implements Iterable<SchemaContextItem> {
1268
1272
  * schema.checkChild( [ ...positionInParagraph.getAncestors(), '$text' ], 'bold' );
1269
1273
  * ```
1270
1274
  */
1271
- export type SchemaContextDefinition = Item | Position | SchemaContext | string | Array<string | Item>;
1275
+ export type ModelSchemaContextDefinition = ModelItem | ModelPosition | ModelSchemaContext | string | Array<string | ModelItem>;
1272
1276
  /**
1273
- * An item of the {@link module:engine/model/schema~SchemaContext schema context}.
1277
+ * An item of the {@link module:engine/model/schema~ModelSchemaContext schema context}.
1274
1278
  *
1275
1279
  * It contains 3 properties:
1276
1280
  *
@@ -1278,7 +1282,7 @@ export type SchemaContextDefinition = Item | Position | SchemaContext | string |
1278
1282
  * * `* getAttributeKeys()` – a generator of keys of item attributes,
1279
1283
  * * `getAttribute( keyName )` – a method to get attribute values.
1280
1284
  *
1281
- * The context item interface is a highly simplified version of {@link module:engine/model/node~Node} and its role
1285
+ * The context item interface is a highly simplified version of {@link module:engine/model/node~ModelNode} and its role
1282
1286
  * is to expose only the information which schema checks are able to provide (which is the name of the node and
1283
1287
  * node's attributes).
1284
1288
  *
@@ -1293,7 +1297,7 @@ export type SchemaContextDefinition = Item | Position | SchemaContext | string |
1293
1297
  * } );
1294
1298
  * ```
1295
1299
  */
1296
- export interface SchemaContextItem {
1300
+ export interface ModelSchemaContextItem {
1297
1301
  name: string;
1298
1302
  getAttributeKeys(): Generator<string>;
1299
1303
  getAttribute(keyName: string): unknown;
@@ -1301,9 +1305,9 @@ export interface SchemaContextItem {
1301
1305
  /**
1302
1306
  * A structure containing additional metadata describing the attribute.
1303
1307
  *
1304
- * See {@link module:engine/model/schema~Schema#setAttributeProperties `Schema#setAttributeProperties()`} for usage examples.
1308
+ * See {@link module:engine/model/schema~ModelSchema#setAttributeProperties `Schema#setAttributeProperties()`} for usage examples.
1305
1309
  */
1306
- export interface AttributeProperties {
1310
+ export interface ModelAttributeProperties {
1307
1311
  /**
1308
1312
  * Indicates that the attribute should be considered as a visual formatting, like `bold`, `italic` or
1309
1313
  * `fontSize` rather than semantic attribute (such as `src`, `listType`, etc.). For example, it is used by the "Remove format" feature.
@@ -1325,6 +1329,6 @@ export interface AttributeProperties {
1325
1329
  copyFromObject?: boolean;
1326
1330
  [name: string]: unknown;
1327
1331
  }
1328
- export type SchemaAttributeCheckCallback = (context: SchemaContext, attributeName: string) => boolean | undefined;
1329
- export type SchemaChildCheckCallback = (context: SchemaContext, definition: SchemaCompiledItemDefinition) => boolean | undefined;
1332
+ export type ModelSchemaAttributeCheckCallback = (context: ModelSchemaContext, attributeName: string) => boolean | undefined;
1333
+ export type ModelSchemaChildCheckCallback = (context: ModelSchemaContext, definition: ModelSchemaCompiledItemDefinition) => boolean | undefined;
1330
1334
  export {};