@ckeditor/ckeditor5-engine 48.2.0 → 48.3.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 (129) hide show
  1. package/dist/controller/datacontroller.d.ts +329 -328
  2. package/dist/controller/editingcontroller.d.ts +95 -94
  3. package/dist/conversion/comparemarkers.d.ts +45 -45
  4. package/dist/conversion/conversion.d.ts +474 -474
  5. package/dist/conversion/conversionhelpers.d.ts +21 -21
  6. package/dist/conversion/downcastdispatcher.d.ts +539 -538
  7. package/dist/conversion/downcasthelpers.d.ts +1129 -1129
  8. package/dist/conversion/mapper.d.ts +692 -697
  9. package/dist/conversion/modelconsumable.d.ts +196 -196
  10. package/dist/conversion/upcastdispatcher.d.ts +483 -482
  11. package/dist/conversion/upcasthelpers.d.ts +491 -491
  12. package/dist/conversion/viewconsumable.d.ts +330 -330
  13. package/dist/dataprocessor/basichtmlwriter.d.ts +15 -15
  14. package/dist/dataprocessor/dataprocessor.d.ts +57 -57
  15. package/dist/dataprocessor/htmldataprocessor.d.ts +72 -72
  16. package/dist/dataprocessor/htmlwriter.d.ts +11 -11
  17. package/dist/dataprocessor/xmldataprocessor.d.ts +86 -86
  18. package/dist/dev-utils/model.d.ts +128 -123
  19. package/dist/dev-utils/operationreplayer.d.ts +49 -49
  20. package/dist/dev-utils/utils.d.ts +33 -33
  21. package/dist/dev-utils/view.d.ts +314 -309
  22. package/dist/engineconfig.d.ts +39 -39
  23. package/dist/index.css.map +1 -1
  24. package/dist/index.d.ts +150 -150
  25. package/dist/index.js +34026 -40107
  26. package/dist/index.js.map +1 -1
  27. package/dist/legacyerrors.d.ts +0 -4
  28. package/dist/model/batch.d.ts +86 -86
  29. package/dist/model/differ.d.ts +504 -504
  30. package/dist/model/document.d.ts +265 -268
  31. package/dist/model/documentfragment.d.ts +214 -214
  32. package/dist/model/documentselection.d.ts +406 -410
  33. package/dist/model/element.d.ts +182 -182
  34. package/dist/model/history.d.ts +109 -109
  35. package/dist/model/item.d.ts +9 -9
  36. package/dist/model/liveposition.d.ts +70 -69
  37. package/dist/model/liverange.d.ts +93 -92
  38. package/dist/model/markercollection.d.ts +317 -324
  39. package/dist/model/model.d.ts +889 -909
  40. package/dist/model/node.d.ts +254 -254
  41. package/dist/model/nodelist.d.ts +110 -110
  42. package/dist/model/operation/attributeoperation.d.ts +98 -98
  43. package/dist/model/operation/detachoperation.d.ts +57 -57
  44. package/dist/model/operation/insertoperation.d.ts +85 -85
  45. package/dist/model/operation/markeroperation.d.ts +87 -87
  46. package/dist/model/operation/mergeoperation.d.ts +95 -95
  47. package/dist/model/operation/moveoperation.d.ts +97 -97
  48. package/dist/model/operation/nooperation.d.ts +33 -33
  49. package/dist/model/operation/operation.d.ts +94 -94
  50. package/dist/model/operation/operationfactory.d.ts +14 -14
  51. package/dist/model/operation/renameoperation.d.ts +78 -78
  52. package/dist/model/operation/rootattributeoperation.d.ts +93 -93
  53. package/dist/model/operation/rootoperation.d.ts +71 -71
  54. package/dist/model/operation/splitoperation.d.ts +104 -104
  55. package/dist/model/operation/transform.d.ts +91 -91
  56. package/dist/model/operation/utils.d.ts +58 -58
  57. package/dist/model/position.d.ts +535 -535
  58. package/dist/model/range.d.ts +458 -453
  59. package/dist/model/rootelement.d.ts +55 -55
  60. package/dist/model/schema.d.ts +1325 -1327
  61. package/dist/model/selection.d.ts +452 -471
  62. package/dist/model/text.d.ts +62 -62
  63. package/dist/model/textproxy.d.ts +140 -140
  64. package/dist/model/treewalker.d.ts +190 -190
  65. package/dist/model/typecheckable.d.ts +281 -281
  66. package/dist/model/utils/autoparagraphing.d.ts +29 -29
  67. package/dist/model/utils/deletecontent.d.ts +68 -68
  68. package/dist/model/utils/getselectedcontent.d.ts +27 -27
  69. package/dist/model/utils/insertcontent.d.ts +42 -42
  70. package/dist/model/utils/insertobject.d.ts +41 -41
  71. package/dist/model/utils/modifyselection.d.ts +44 -44
  72. package/dist/model/utils/selection-post-fixer.d.ts +71 -71
  73. package/dist/model/writer.d.ts +854 -854
  74. package/dist/view/attributeelement.d.ts +123 -123
  75. package/dist/view/containerelement.d.ts +49 -49
  76. package/dist/view/datatransfer.d.ts +70 -70
  77. package/dist/view/document.d.ts +175 -177
  78. package/dist/view/documentfragment.d.ts +158 -157
  79. package/dist/view/documentselection.d.ts +308 -307
  80. package/dist/view/domconverter.d.ts +612 -657
  81. package/dist/view/downcastwriter.d.ts +1006 -1006
  82. package/dist/view/editableelement.d.ts +64 -63
  83. package/dist/view/element.d.ts +754 -754
  84. package/dist/view/elementdefinition.d.ts +79 -79
  85. package/dist/view/emptyelement.d.ts +42 -42
  86. package/dist/view/filler.d.ts +75 -75
  87. package/dist/view/item.d.ts +9 -9
  88. package/dist/view/matcher.d.ts +412 -487
  89. package/dist/view/node.d.ts +164 -163
  90. package/dist/view/observer/arrowkeysobserver.d.ts +37 -37
  91. package/dist/view/observer/bubblingemittermixin.d.ts +163 -153
  92. package/dist/view/observer/bubblingeventinfo.d.ts +45 -42
  93. package/dist/view/observer/clickobserver.d.ts +36 -36
  94. package/dist/view/observer/compositionobserver.d.ts +67 -67
  95. package/dist/view/observer/domeventdata.d.ts +46 -46
  96. package/dist/view/observer/domeventobserver.d.ts +77 -74
  97. package/dist/view/observer/fakeselectionobserver.d.ts +42 -42
  98. package/dist/view/observer/focusobserver.d.ts +84 -84
  99. package/dist/view/observer/inputobserver.d.ts +76 -76
  100. package/dist/view/observer/keyobserver.d.ts +53 -53
  101. package/dist/view/observer/mouseobserver.d.ts +73 -73
  102. package/dist/view/observer/mutationobserver.d.ts +101 -101
  103. package/dist/view/observer/observer.d.ts +84 -83
  104. package/dist/view/observer/pointerobserver.d.ts +63 -63
  105. package/dist/view/observer/selectionobserver.d.ts +136 -136
  106. package/dist/view/observer/tabobserver.d.ts +38 -38
  107. package/dist/view/observer/touchobserver.d.ts +60 -60
  108. package/dist/view/placeholder.d.ts +80 -80
  109. package/dist/view/position.d.ts +187 -187
  110. package/dist/view/range.d.ts +282 -282
  111. package/dist/view/rawelement.d.ts +72 -72
  112. package/dist/view/renderer.d.ts +270 -272
  113. package/dist/view/rooteditableelement.d.ts +43 -43
  114. package/dist/view/selection.d.ts +356 -369
  115. package/dist/view/styles/background.d.ts +15 -15
  116. package/dist/view/styles/border.d.ts +27 -27
  117. package/dist/view/styles/margin.d.ts +12 -12
  118. package/dist/view/styles/padding.d.ts +12 -12
  119. package/dist/view/styles/utils.d.ts +72 -72
  120. package/dist/view/stylesmap.d.ts +715 -715
  121. package/dist/view/text.d.ts +75 -75
  122. package/dist/view/textproxy.d.ts +92 -92
  123. package/dist/view/tokenlist.d.ts +104 -104
  124. package/dist/view/treewalker.d.ts +201 -201
  125. package/dist/view/typecheckable.d.ts +445 -445
  126. package/dist/view/uielement.d.ts +93 -93
  127. package/dist/view/upcastwriter.d.ts +412 -412
  128. package/dist/view/view.d.ts +466 -469
  129. package/package.json +2 -2
@@ -1,449 +1,449 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module engine/view/typecheckable
7
- */
8
- import { type ViewAttributeElement } from './attributeelement.js';
9
- import { type ViewContainerElement } from './containerelement.js';
10
- import { type ViewDocumentFragment } from './documentfragment.js';
11
- import { type ViewDocumentSelection } from './documentselection.js';
12
- import { type ViewEditableElement } from './editableelement.js';
13
- import { type ViewElement } from './element.js';
14
- import { type ViewEmptyElement } from './emptyelement.js';
15
- import { type ViewNode } from './node.js';
16
- import { type ViewPosition } from './position.js';
17
- import { type ViewRange } from './range.js';
18
- import { type ViewRawElement } from './rawelement.js';
19
- import { type ViewRootEditableElement } from './rooteditableelement.js';
20
- import { type ViewSelection } from './selection.js';
21
- import { type ViewText } from './text.js';
22
- import { type ViewTextProxy } from './textproxy.js';
23
- import { type ViewUIElement } from './uielement.js';
6
+ * @module engine/view/typecheckable
7
+ */
8
+ import { type ViewAttributeElement } from "./attributeelement.js";
9
+ import { type ViewContainerElement } from "./containerelement.js";
10
+ import { type ViewDocumentFragment } from "./documentfragment.js";
11
+ import { type ViewDocumentSelection } from "./documentselection.js";
12
+ import { type ViewEditableElement } from "./editableelement.js";
13
+ import { type ViewElement } from "./element.js";
14
+ import { type ViewEmptyElement } from "./emptyelement.js";
15
+ import { type ViewNode } from "./node.js";
16
+ import { type ViewPosition } from "./position.js";
17
+ import { type ViewRange } from "./range.js";
18
+ import { type ViewRawElement } from "./rawelement.js";
19
+ import { type ViewRootEditableElement } from "./rooteditableelement.js";
20
+ import { type ViewSelection } from "./selection.js";
21
+ import { type ViewText } from "./text.js";
22
+ import { type ViewTextProxy } from "./textproxy.js";
23
+ import { type ViewUIElement } from "./uielement.js";
24
24
  export declare abstract class ViewTypeCheckable {
25
- /**
26
- * Checks whether this object is of type {@link module:engine/view/node~ViewNode} or its subclass.
27
- *
28
- * This method is useful when processing view objects that are of unknown type. For example, a function
29
- * may return a {@link module:engine/view/documentfragment~ViewDocumentFragment} or a {@link module:engine/view/node~ViewNode}
30
- * that can be either a text node or an element. This method can be used to check what kind of object is returned.
31
- *
32
- * ```ts
33
- * someObject.is( 'element' ); // -> true if this is an element
34
- * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
35
- * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
36
- * ```
37
- *
38
- * Since this method is also available on a range of model objects, you can prefix the type of the object with
39
- * `model:` or `view:` to check, for example, if this is the model's or view's element:
40
- *
41
- * ```ts
42
- * viewElement.is( 'view:element' ); // -> true
43
- * viewElement.is( 'model:element' ); // -> false
44
- * ```
45
- *
46
- * By using this method it is also possible to check a name of an element:
47
- *
48
- * ```ts
49
- * imgElement.is( 'element', 'img' ); // -> true
50
- * imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
51
- * ```
52
- * @label NODE
53
- */
54
- is(type: 'node' | 'view:node'): this is (ViewNode | ViewText | ViewElement | ViewAttributeElement | ViewContainerElement | ViewEditableElement | ViewEmptyElement | ViewRawElement | ViewRootEditableElement | ViewUIElement);
55
- /**
56
- * Checks whether this object is of type {@link module:engine/view/element~ViewElement} or its subclass.
57
- *
58
- * ```ts
59
- * element.is( 'element' ); // -> true
60
- * element.is( 'node' ); // -> true
61
- * element.is( 'view:element' ); // -> true
62
- * element.is( 'view:node' ); // -> true
63
- *
64
- * element.is( 'model:element' ); // -> false
65
- * element.is( 'documentSelection' ); // -> false
66
- * ```
67
- *
68
- * Assuming that the object being checked is an element, you can also check its
69
- * {@link module:engine/view/element~ViewElement#name name}:
70
- *
71
- * ```ts
72
- * element.is( 'element', 'img' ); // -> true if this is an <img> element
73
- * text.is( 'element', 'img' ); -> false
74
- * ```
75
- *
76
- * @label ELEMENT
77
- */
78
- is(type: 'element' | 'view:element'): this is (ViewElement | ViewAttributeElement | ViewContainerElement | ViewEditableElement | ViewEmptyElement | ViewRawElement | ViewRootEditableElement | ViewUIElement);
79
- /**
80
- * Checks whether this object is of type {@link module:engine/view/attributeelement~ViewAttributeElement}.
81
- *
82
- * ```ts
83
- * attributeElement.is( 'attributeElement' ); // -> true
84
- * attributeElement.is( 'element' ); // -> true
85
- * attributeElement.is( 'node' ); // -> true
86
- * attributeElement.is( 'view:attributeElement' ); // -> true
87
- * attributeElement.is( 'view:element' ); // -> true
88
- * attributeElement.is( 'view:node' ); // -> true
89
- *
90
- * attributeElement.is( 'model:element' ); // -> false
91
- * attributeElement.is( 'documentFragment' ); // -> false
92
- * ```
93
- *
94
- * Assuming that the object being checked is an attribute element, you can also check its
95
- * {@link module:engine/view/attributeelement~ViewAttributeElement#name name}:
96
- *
97
- * ```ts
98
- * attributeElement.is( 'element', 'b' ); // -> true if this is a bold element
99
- * attributeElement.is( 'attributeElement', 'b' ); // -> same as above
100
- * text.is( 'element', 'b' ); -> false
101
- * ```
102
- *
103
- * @label ATTRIBUTE_ELEMENT
104
- */
105
- is(type: 'attributeElement' | 'view:attributeElement'): this is ViewAttributeElement;
106
- /**
107
- * Checks whether this object is of type {@link module:engine/view/containerelement~ViewContainerElement} or its subclass.
108
- *
109
- * ```ts
110
- * containerElement.is( 'containerElement' ); // -> true
111
- * containerElement.is( 'element' ); // -> true
112
- * containerElement.is( 'node' ); // -> true
113
- * containerElement.is( 'view:containerElement' ); // -> true
114
- * containerElement.is( 'view:element' ); // -> true
115
- * containerElement.is( 'view:node' ); // -> true
116
- *
117
- * containerElement.is( 'model:element' ); // -> false
118
- * containerElement.is( 'documentFragment' ); // -> false
119
- * ```
120
- *
121
- * Assuming that the object being checked is a container element, you can also check its
122
- * {@link module:engine/view/containerelement~ViewContainerElement#name name}:
123
- *
124
- * ```ts
125
- * containerElement.is( 'element', 'div' ); // -> true if this is a div container element
126
- * containerElement.is( 'contaienrElement', 'div' ); // -> same as above
127
- * text.is( 'element', 'div' ); -> false
128
- * ```
129
- *
130
- * @label CONTAINER_ELEMENT
131
- */
132
- is(type: 'containerElement' | 'view:containerElement'): this is ViewContainerElement | ViewEditableElement | ViewRootEditableElement;
133
- /**
134
- * Checks whether this object is of type {@link module:engine/view/editableelement~ViewEditableElement} or its subclass.
135
- *
136
- * ```ts
137
- * editableElement.is( 'editableElement' ); // -> true
138
- * editableElement.is( 'element' ); // -> true
139
- * editableElement.is( 'node' ); // -> true
140
- * editableElement.is( 'view:editableElement' ); // -> true
141
- * editableElement.is( 'view:element' ); // -> true
142
- * editableElement.is( 'view:node' ); // -> true
143
- *
144
- * editableElement.is( 'model:element' ); // -> false
145
- * editableElement.is( 'documentFragment' ); // -> false
146
- * ```
147
- *
148
- * Assuming that the object being checked is an editbale element, you can also check its
149
- * {@link module:engine/view/editableelement~ViewEditableElement#name name}:
150
- *
151
- * ```ts
152
- * editableElement.is( 'element', 'div' ); // -> true if this is a div element
153
- * editableElement.is( 'editableElement', 'div' ); // -> same as above
154
- * text.is( 'element', 'div' ); -> false
155
- * ```
156
- *
157
- * @label EDITABLE_ELEMENT
158
- */
159
- is(type: 'editableElement' | 'view:editableElement'): this is ViewEditableElement | ViewRootEditableElement;
160
- /**
161
- * Checks whether this object is of type {@link module:engine/view/emptyelement~ViewEmptyElement}.
162
- *
163
- * ```ts
164
- * emptyElement.is( 'emptyElement' ); // -> true
165
- * emptyElement.is( 'element' ); // -> true
166
- * emptyElement.is( 'node' ); // -> true
167
- * emptyElement.is( 'view:emptyElement' ); // -> true
168
- * emptyElement.is( 'view:element' ); // -> true
169
- * emptyElement.is( 'view:node' ); // -> true
170
- *
171
- * emptyElement.is( 'model:element' ); // -> false
172
- * emptyElement.is( 'documentFragment' ); // -> false
173
- * ```
174
- *
175
- * Assuming that the object being checked is an empty element, you can also check its
176
- * {@link module:engine/view/emptyelement~ViewEmptyElement#name name}:
177
- *
178
- * ```ts
179
- * emptyElement.is( 'element', 'img' ); // -> true if this is a img element
180
- * emptyElement.is( 'emptyElement', 'img' ); // -> same as above
181
- * text.is( 'element', 'img' ); -> false
182
- * ```
183
- *
184
- * @label EMPTY_ELEMENT
185
- */
186
- is(type: 'emptyElement' | 'view:emptyElement'): this is ViewEmptyElement;
187
- /**
188
- * Checks whether this object is of type {@link module:engine/view/rawelement~ViewRawElement}.
189
- *
190
- * ```ts
191
- * rawElement.is( 'rawElement' ); // -> true
192
- * rawElement.is( 'element' ); // -> true
193
- * rawElement.is( 'node' ); // -> true
194
- * rawElement.is( 'view:rawElement' ); // -> true
195
- * rawElement.is( 'view:element' ); // -> true
196
- * rawElement.is( 'view:node' ); // -> true
197
- *
198
- * rawElement.is( 'model:element' ); // -> false
199
- * rawElement.is( 'documentFragment' ); // -> false
200
- * ```
201
- *
202
- * Assuming that the object being checked is a raw element, you can also check its
203
- * {@link module:engine/view/rawelement~ViewRawElement#name name}:
204
- *
205
- * ```ts
206
- * rawElement.is( 'img' ); // -> true if this is an img element
207
- * rawElement.is( 'rawElement', 'img' ); // -> same as above
208
- * text.is( 'img' ); -> false
209
- * ```
210
- *
211
- * @label RAW_ELEMENT
212
- */
213
- is(type: 'rawElement' | 'view:rawElement'): this is ViewRawElement;
214
- /**
215
- * Checks whether this object is of type {@link module:engine/view/rooteditableelement~ViewRootEditableElement}.
216
- *
217
- * ```ts
218
- * rootEditableElement.is( 'rootElement' ); // -> true
219
- * rootEditableElement.is( 'editableElement' ); // -> true
220
- * rootEditableElement.is( 'element' ); // -> true
221
- * rootEditableElement.is( 'node' ); // -> true
222
- * rootEditableElement.is( 'view:editableElement' ); // -> true
223
- * rootEditableElement.is( 'view:element' ); // -> true
224
- * rootEditableElement.is( 'view:node' ); // -> true
225
- *
226
- * rootEditableElement.is( 'model:element' ); // -> false
227
- * rootEditableElement.is( 'documentFragment' ); // -> false
228
- * ```
229
- *
230
- * Assuming that the object being checked is a root editable element, you can also check its
231
- * {@link module:engine/view/rooteditableelement~ViewRootEditableElement#name name}:
232
- *
233
- * ```ts
234
- * rootEditableElement.is( 'element', 'div' ); // -> true if this is a div root editable element
235
- * rootEditableElement.is( 'rootElement', 'div' ); // -> same as above
236
- * text.is( 'element', 'div' ); -> false
237
- * ```
238
- *
239
- * @label ROOT_ELEMENT
240
- */
241
- is(type: 'rootElement' | 'view:rootElement'): this is ViewRootEditableElement;
242
- /**
243
- * Checks whether this object is of type {@link module:engine/view/uielement~ViewUIElement}.
244
- *
245
- * ```ts
246
- * uiElement.is( 'uiElement' ); // -> true
247
- * uiElement.is( 'element' ); // -> true
248
- * uiElement.is( 'node' ); // -> true
249
- * uiElement.is( 'view:uiElement' ); // -> true
250
- * uiElement.is( 'view:element' ); // -> true
251
- * uiElement.is( 'view:node' ); // -> true
252
- *
253
- * uiElement.is( 'model:element' ); // -> false
254
- * uiElement.is( 'documentFragment' ); // -> false
255
- * ```
256
- *
257
- * Assuming that the object being checked is an ui element, you can also check its
258
- * {@link module:engine/view/uielement~ViewUIElement#name name}:
259
- *
260
- * ```ts
261
- * uiElement.is( 'element', 'span' ); // -> true if this is a span ui element
262
- * uiElement.is( 'uiElement', 'span' ); // -> same as above
263
- * text.is( 'element', 'span' ); -> false
264
- * ```
265
- *
266
- * @label UI_ELEMENT
267
- */
268
- is(type: 'uiElement' | 'view:uiElement'): this is ViewUIElement;
269
- /**
270
- * Checks whether this object is of type {@link module:engine/view/text~ViewText}.
271
- *
272
- * ```ts
273
- * text.is( '$text' ); // -> true
274
- * text.is( 'node' ); // -> true
275
- * text.is( 'view:$text' ); // -> true
276
- * text.is( 'view:node' ); // -> true
277
- *
278
- * text.is( 'model:$text' ); // -> false
279
- * text.is( 'element' ); // -> false
280
- * text.is( 'range' ); // -> false
281
- * ```
282
- *
283
- * @label TEXT
284
- */
285
- is(type: '$text' | 'view:$text'): this is ViewText;
286
- /**
287
- * hecks whether this object is of type {@link module:engine/view/documentfragment~ViewDocumentFragment}.
288
- *
289
- * ```ts
290
- * docFrag.is( 'documentFragment' ); // -> true
291
- * docFrag.is( 'view:documentFragment' ); // -> true
292
- *
293
- * docFrag.is( 'model:documentFragment' ); // -> false
294
- * docFrag.is( 'element' ); // -> false
295
- * docFrag.is( 'node' ); // -> false
296
- * ```
297
- *
298
- * @label DOCUMENT_FRAGMENT
299
- */
300
- is(type: 'documentFragment' | 'view:documentFragment'): this is ViewDocumentFragment;
301
- /**
302
- * Checks whether this object is of type {@link module:engine/view/textproxy~ViewTextProxy}.
303
- *
304
- * ```ts
305
- * textProxy.is( '$textProxy' ); // -> true
306
- * textProxy.is( 'view:$textProxy' ); // -> true
307
- *
308
- * textProxy.is( 'model:$textProxy' ); // -> false
309
- * textProxy.is( 'element' ); // -> false
310
- * textProxy.is( 'range' ); // -> false
311
- * ```
312
- *
313
- * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxy'` type is still
314
- * accepted for backward compatibility.
315
- *
316
- * @label TEXT_PROXY
317
- */
318
- is(type: '$textProxy' | 'view:$textProxy'): this is ViewTextProxy;
319
- /**
320
- * Checks whether this object is of type {@link module:engine/view/position~ViewPosition}.
321
- *
322
- * ```ts
323
- * position.is( 'position' ); // -> true
324
- * position.is( 'view:position' ); // -> true
325
- *
326
- * position.is( 'model:position' ); // -> false
327
- * position.is( 'element' ); // -> false
328
- * position.is( 'range' ); // -> false
329
- * ```
330
- *
331
- * @label POSITION
332
- */
333
- is(type: 'position' | 'view:position'): this is ViewPosition;
334
- /**
335
- * Checks whether this object is of type {@link module:engine/view/range~ViewRange}.
336
- *
337
- * ```ts
338
- * range.is( 'range' ); // -> true
339
- * range.is( 'view:range' ); // -> true
340
- *
341
- * range.is( 'model:range' ); // -> false
342
- * range.is( 'element' ); // -> false
343
- * range.is( 'selection' ); // -> false
344
- * ```
345
- *
346
- * @label RANGE
347
- */
348
- is(type: 'range' | 'view:range'): this is ViewRange;
349
- /**
350
- * Checks whether this object is of type {@link module:engine/view/selection~ViewSelection} or
351
- * {@link module:engine/view/documentselection~ViewDocumentSelection}.
352
- *
353
- * ```ts
354
- * selection.is( 'selection' ); // -> true
355
- * selection.is( 'view:selection' ); // -> true
356
- *
357
- * selection.is( 'model:selection' ); // -> false
358
- * selection.is( 'element' ); // -> false
359
- * selection.is( 'range' ); // -> false
360
- * ```
361
- *
362
- * @label SELECTION
363
- */
364
- is(type: 'selection' | 'view:selection'): this is ViewSelection | ViewDocumentSelection;
365
- /**
366
- * Checks whether this object is of type {@link module:engine/view/documentselection~ViewDocumentSelection}.
367
- *
368
- * ```ts
369
- * `docSelection.is( 'selection' ); // -> true
370
- * docSelection.is( 'documentSelection' ); // -> true
371
- * docSelection.is( 'view:selection' ); // -> true
372
- * docSelection.is( 'view:documentSelection' ); // -> true
373
- *
374
- * docSelection.is( 'model:documentSelection' ); // -> false
375
- * docSelection.is( 'element' ); // -> false
376
- * docSelection.is( 'node' ); // -> false
377
- * ```
378
- *
379
- * @label DOCUMENT_SELECTION
380
- */
381
- is(type: 'documentSelection' | 'view:documentSelection'): this is ViewDocumentSelection;
382
- /**
383
- * Checks whether the object is of type {@link module:engine/view/element~ViewElement} or its subclass and has the specified `name`.
384
- *
385
- * @label ELEMENT_NAME
386
- */
387
- is<N extends string>(type: 'element' | 'view:element', name: N): this is (ViewElement | ViewAttributeElement | ViewContainerElement | ViewEditableElement | ViewEmptyElement | ViewRawElement | ViewRootEditableElement | ViewUIElement) & {
388
- name: N;
389
- };
390
- /**
391
- * Checks whether the object is of type {@link module:engine/view/attributeelement~ViewAttributeElement} and has the specified `name`.
392
- *
393
- * @label ATTRIBUTE_ELEMENT_NAME
394
- */
395
- is<N extends string>(type: 'attributeElement' | 'view:attributeElement', name: N): this is ViewAttributeElement & {
396
- name: N;
397
- };
398
- /**
399
- * Checks whether the object is of type {@link module:engine/view/containerelement~ViewContainerElement}
400
- * or its subclass and has the specified `name`.
401
- *
402
- * @label CONTAINER_ELEMENT_NAME
403
- */
404
- is<N extends string>(type: 'containerElement' | 'view:containerElement', name: N): this is (ViewContainerElement | ViewEditableElement | ViewRootEditableElement) & {
405
- name: N;
406
- };
407
- /**
408
- * Checks whether the object is of type {@link module:engine/view/editableelement~ViewEditableElement}
409
- * or its subclass and has the specified `name`.
410
- *
411
- * @label EDITABLE_ELEMENT_NAME
412
- */
413
- is<N extends string>(type: 'editableElement' | 'view:editableElement', name: N): this is (ViewEditableElement | ViewRootEditableElement) & {
414
- name: N;
415
- };
416
- /**
417
- * Checks whether the object is of type {@link module:engine/view/emptyelement~ViewEmptyElement} has the specified `name`.
418
- *
419
- * @label EMPTY_ELEMENT_NAME
420
- */
421
- is<N extends string>(type: 'emptyElement' | 'view:emptyElement', name: N): this is ViewEmptyElement & {
422
- name: N;
423
- };
424
- /**
425
- * Checks whether the object is of type {@link module:engine/view/rawelement~ViewRawElement} and has the specified `name`.
426
- *
427
- * @label RAW_ELEMENT_NAME
428
- */
429
- is<N extends string>(type: 'rawElement' | 'view:rawElement', name: N): this is ViewRawElement & {
430
- name: N;
431
- };
432
- /**
433
- * Checks whether the object is of type {@link module:engine/view/rooteditableelement~ViewRootEditableElement}
434
- * and has the specified `name`.
435
- *
436
- * @label ROOT_ELEMENT_NAME
437
- */
438
- is<N extends string>(type: 'rootElement' | 'view:rootElement', name: N): this is ViewRootEditableElement & {
439
- name: N;
440
- };
441
- /**
442
- * Checks whether the object is of type {@link module:engine/view/uielement~ViewUIElement} and has the specified `name`.
443
- *
444
- * @label UI_ELEMENT_NAME
445
- */
446
- is<N extends string>(type: 'uiElement' | 'view:uiElement', name: N): this is ViewUIElement & {
447
- name: N;
448
- };
25
+ /**
26
+ * Checks whether this object is of type {@link module:engine/view/node~ViewNode} or its subclass.
27
+ *
28
+ * This method is useful when processing view objects that are of unknown type. For example, a function
29
+ * may return a {@link module:engine/view/documentfragment~ViewDocumentFragment} or a {@link module:engine/view/node~ViewNode}
30
+ * that can be either a text node or an element. This method can be used to check what kind of object is returned.
31
+ *
32
+ * ```ts
33
+ * someObject.is( 'element' ); // -> true if this is an element
34
+ * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
35
+ * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
36
+ * ```
37
+ *
38
+ * Since this method is also available on a range of model objects, you can prefix the type of the object with
39
+ * `model:` or `view:` to check, for example, if this is the model's or view's element:
40
+ *
41
+ * ```ts
42
+ * viewElement.is( 'view:element' ); // -> true
43
+ * viewElement.is( 'model:element' ); // -> false
44
+ * ```
45
+ *
46
+ * By using this method it is also possible to check a name of an element:
47
+ *
48
+ * ```ts
49
+ * imgElement.is( 'element', 'img' ); // -> true
50
+ * imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
51
+ * ```
52
+ * @label NODE
53
+ */
54
+ is(type: "node" | "view:node"): this is (ViewNode | ViewText | ViewElement | ViewAttributeElement | ViewContainerElement | ViewEditableElement | ViewEmptyElement | ViewRawElement | ViewRootEditableElement | ViewUIElement);
55
+ /**
56
+ * Checks whether this object is of type {@link module:engine/view/element~ViewElement} or its subclass.
57
+ *
58
+ * ```ts
59
+ * element.is( 'element' ); // -> true
60
+ * element.is( 'node' ); // -> true
61
+ * element.is( 'view:element' ); // -> true
62
+ * element.is( 'view:node' ); // -> true
63
+ *
64
+ * element.is( 'model:element' ); // -> false
65
+ * element.is( 'documentSelection' ); // -> false
66
+ * ```
67
+ *
68
+ * Assuming that the object being checked is an element, you can also check its
69
+ * {@link module:engine/view/element~ViewElement#name name}:
70
+ *
71
+ * ```ts
72
+ * element.is( 'element', 'img' ); // -> true if this is an <img> element
73
+ * text.is( 'element', 'img' ); -> false
74
+ * ```
75
+ *
76
+ * @label ELEMENT
77
+ */
78
+ is(type: "element" | "view:element"): this is (ViewElement | ViewAttributeElement | ViewContainerElement | ViewEditableElement | ViewEmptyElement | ViewRawElement | ViewRootEditableElement | ViewUIElement);
79
+ /**
80
+ * Checks whether this object is of type {@link module:engine/view/attributeelement~ViewAttributeElement}.
81
+ *
82
+ * ```ts
83
+ * attributeElement.is( 'attributeElement' ); // -> true
84
+ * attributeElement.is( 'element' ); // -> true
85
+ * attributeElement.is( 'node' ); // -> true
86
+ * attributeElement.is( 'view:attributeElement' ); // -> true
87
+ * attributeElement.is( 'view:element' ); // -> true
88
+ * attributeElement.is( 'view:node' ); // -> true
89
+ *
90
+ * attributeElement.is( 'model:element' ); // -> false
91
+ * attributeElement.is( 'documentFragment' ); // -> false
92
+ * ```
93
+ *
94
+ * Assuming that the object being checked is an attribute element, you can also check its
95
+ * {@link module:engine/view/attributeelement~ViewAttributeElement#name name}:
96
+ *
97
+ * ```ts
98
+ * attributeElement.is( 'element', 'b' ); // -> true if this is a bold element
99
+ * attributeElement.is( 'attributeElement', 'b' ); // -> same as above
100
+ * text.is( 'element', 'b' ); -> false
101
+ * ```
102
+ *
103
+ * @label ATTRIBUTE_ELEMENT
104
+ */
105
+ is(type: "attributeElement" | "view:attributeElement"): this is ViewAttributeElement;
106
+ /**
107
+ * Checks whether this object is of type {@link module:engine/view/containerelement~ViewContainerElement} or its subclass.
108
+ *
109
+ * ```ts
110
+ * containerElement.is( 'containerElement' ); // -> true
111
+ * containerElement.is( 'element' ); // -> true
112
+ * containerElement.is( 'node' ); // -> true
113
+ * containerElement.is( 'view:containerElement' ); // -> true
114
+ * containerElement.is( 'view:element' ); // -> true
115
+ * containerElement.is( 'view:node' ); // -> true
116
+ *
117
+ * containerElement.is( 'model:element' ); // -> false
118
+ * containerElement.is( 'documentFragment' ); // -> false
119
+ * ```
120
+ *
121
+ * Assuming that the object being checked is a container element, you can also check its
122
+ * {@link module:engine/view/containerelement~ViewContainerElement#name name}:
123
+ *
124
+ * ```ts
125
+ * containerElement.is( 'element', 'div' ); // -> true if this is a div container element
126
+ * containerElement.is( 'contaienrElement', 'div' ); // -> same as above
127
+ * text.is( 'element', 'div' ); -> false
128
+ * ```
129
+ *
130
+ * @label CONTAINER_ELEMENT
131
+ */
132
+ is(type: "containerElement" | "view:containerElement"): this is ViewContainerElement | ViewEditableElement | ViewRootEditableElement;
133
+ /**
134
+ * Checks whether this object is of type {@link module:engine/view/editableelement~ViewEditableElement} or its subclass.
135
+ *
136
+ * ```ts
137
+ * editableElement.is( 'editableElement' ); // -> true
138
+ * editableElement.is( 'element' ); // -> true
139
+ * editableElement.is( 'node' ); // -> true
140
+ * editableElement.is( 'view:editableElement' ); // -> true
141
+ * editableElement.is( 'view:element' ); // -> true
142
+ * editableElement.is( 'view:node' ); // -> true
143
+ *
144
+ * editableElement.is( 'model:element' ); // -> false
145
+ * editableElement.is( 'documentFragment' ); // -> false
146
+ * ```
147
+ *
148
+ * Assuming that the object being checked is an editbale element, you can also check its
149
+ * {@link module:engine/view/editableelement~ViewEditableElement#name name}:
150
+ *
151
+ * ```ts
152
+ * editableElement.is( 'element', 'div' ); // -> true if this is a div element
153
+ * editableElement.is( 'editableElement', 'div' ); // -> same as above
154
+ * text.is( 'element', 'div' ); -> false
155
+ * ```
156
+ *
157
+ * @label EDITABLE_ELEMENT
158
+ */
159
+ is(type: "editableElement" | "view:editableElement"): this is ViewEditableElement | ViewRootEditableElement;
160
+ /**
161
+ * Checks whether this object is of type {@link module:engine/view/emptyelement~ViewEmptyElement}.
162
+ *
163
+ * ```ts
164
+ * emptyElement.is( 'emptyElement' ); // -> true
165
+ * emptyElement.is( 'element' ); // -> true
166
+ * emptyElement.is( 'node' ); // -> true
167
+ * emptyElement.is( 'view:emptyElement' ); // -> true
168
+ * emptyElement.is( 'view:element' ); // -> true
169
+ * emptyElement.is( 'view:node' ); // -> true
170
+ *
171
+ * emptyElement.is( 'model:element' ); // -> false
172
+ * emptyElement.is( 'documentFragment' ); // -> false
173
+ * ```
174
+ *
175
+ * Assuming that the object being checked is an empty element, you can also check its
176
+ * {@link module:engine/view/emptyelement~ViewEmptyElement#name name}:
177
+ *
178
+ * ```ts
179
+ * emptyElement.is( 'element', 'img' ); // -> true if this is a img element
180
+ * emptyElement.is( 'emptyElement', 'img' ); // -> same as above
181
+ * text.is( 'element', 'img' ); -> false
182
+ * ```
183
+ *
184
+ * @label EMPTY_ELEMENT
185
+ */
186
+ is(type: "emptyElement" | "view:emptyElement"): this is ViewEmptyElement;
187
+ /**
188
+ * Checks whether this object is of type {@link module:engine/view/rawelement~ViewRawElement}.
189
+ *
190
+ * ```ts
191
+ * rawElement.is( 'rawElement' ); // -> true
192
+ * rawElement.is( 'element' ); // -> true
193
+ * rawElement.is( 'node' ); // -> true
194
+ * rawElement.is( 'view:rawElement' ); // -> true
195
+ * rawElement.is( 'view:element' ); // -> true
196
+ * rawElement.is( 'view:node' ); // -> true
197
+ *
198
+ * rawElement.is( 'model:element' ); // -> false
199
+ * rawElement.is( 'documentFragment' ); // -> false
200
+ * ```
201
+ *
202
+ * Assuming that the object being checked is a raw element, you can also check its
203
+ * {@link module:engine/view/rawelement~ViewRawElement#name name}:
204
+ *
205
+ * ```ts
206
+ * rawElement.is( 'img' ); // -> true if this is an img element
207
+ * rawElement.is( 'rawElement', 'img' ); // -> same as above
208
+ * text.is( 'img' ); -> false
209
+ * ```
210
+ *
211
+ * @label RAW_ELEMENT
212
+ */
213
+ is(type: "rawElement" | "view:rawElement"): this is ViewRawElement;
214
+ /**
215
+ * Checks whether this object is of type {@link module:engine/view/rooteditableelement~ViewRootEditableElement}.
216
+ *
217
+ * ```ts
218
+ * rootEditableElement.is( 'rootElement' ); // -> true
219
+ * rootEditableElement.is( 'editableElement' ); // -> true
220
+ * rootEditableElement.is( 'element' ); // -> true
221
+ * rootEditableElement.is( 'node' ); // -> true
222
+ * rootEditableElement.is( 'view:editableElement' ); // -> true
223
+ * rootEditableElement.is( 'view:element' ); // -> true
224
+ * rootEditableElement.is( 'view:node' ); // -> true
225
+ *
226
+ * rootEditableElement.is( 'model:element' ); // -> false
227
+ * rootEditableElement.is( 'documentFragment' ); // -> false
228
+ * ```
229
+ *
230
+ * Assuming that the object being checked is a root editable element, you can also check its
231
+ * {@link module:engine/view/rooteditableelement~ViewRootEditableElement#name name}:
232
+ *
233
+ * ```ts
234
+ * rootEditableElement.is( 'element', 'div' ); // -> true if this is a div root editable element
235
+ * rootEditableElement.is( 'rootElement', 'div' ); // -> same as above
236
+ * text.is( 'element', 'div' ); -> false
237
+ * ```
238
+ *
239
+ * @label ROOT_ELEMENT
240
+ */
241
+ is(type: "rootElement" | "view:rootElement"): this is ViewRootEditableElement;
242
+ /**
243
+ * Checks whether this object is of type {@link module:engine/view/uielement~ViewUIElement}.
244
+ *
245
+ * ```ts
246
+ * uiElement.is( 'uiElement' ); // -> true
247
+ * uiElement.is( 'element' ); // -> true
248
+ * uiElement.is( 'node' ); // -> true
249
+ * uiElement.is( 'view:uiElement' ); // -> true
250
+ * uiElement.is( 'view:element' ); // -> true
251
+ * uiElement.is( 'view:node' ); // -> true
252
+ *
253
+ * uiElement.is( 'model:element' ); // -> false
254
+ * uiElement.is( 'documentFragment' ); // -> false
255
+ * ```
256
+ *
257
+ * Assuming that the object being checked is an ui element, you can also check its
258
+ * {@link module:engine/view/uielement~ViewUIElement#name name}:
259
+ *
260
+ * ```ts
261
+ * uiElement.is( 'element', 'span' ); // -> true if this is a span ui element
262
+ * uiElement.is( 'uiElement', 'span' ); // -> same as above
263
+ * text.is( 'element', 'span' ); -> false
264
+ * ```
265
+ *
266
+ * @label UI_ELEMENT
267
+ */
268
+ is(type: "uiElement" | "view:uiElement"): this is ViewUIElement;
269
+ /**
270
+ * Checks whether this object is of type {@link module:engine/view/text~ViewText}.
271
+ *
272
+ * ```ts
273
+ * text.is( '$text' ); // -> true
274
+ * text.is( 'node' ); // -> true
275
+ * text.is( 'view:$text' ); // -> true
276
+ * text.is( 'view:node' ); // -> true
277
+ *
278
+ * text.is( 'model:$text' ); // -> false
279
+ * text.is( 'element' ); // -> false
280
+ * text.is( 'range' ); // -> false
281
+ * ```
282
+ *
283
+ * @label TEXT
284
+ */
285
+ is(type: "$text" | "view:$text"): this is ViewText;
286
+ /**
287
+ * hecks whether this object is of type {@link module:engine/view/documentfragment~ViewDocumentFragment}.
288
+ *
289
+ * ```ts
290
+ * docFrag.is( 'documentFragment' ); // -> true
291
+ * docFrag.is( 'view:documentFragment' ); // -> true
292
+ *
293
+ * docFrag.is( 'model:documentFragment' ); // -> false
294
+ * docFrag.is( 'element' ); // -> false
295
+ * docFrag.is( 'node' ); // -> false
296
+ * ```
297
+ *
298
+ * @label DOCUMENT_FRAGMENT
299
+ */
300
+ is(type: "documentFragment" | "view:documentFragment"): this is ViewDocumentFragment;
301
+ /**
302
+ * Checks whether this object is of type {@link module:engine/view/textproxy~ViewTextProxy}.
303
+ *
304
+ * ```ts
305
+ * textProxy.is( '$textProxy' ); // -> true
306
+ * textProxy.is( 'view:$textProxy' ); // -> true
307
+ *
308
+ * textProxy.is( 'model:$textProxy' ); // -> false
309
+ * textProxy.is( 'element' ); // -> false
310
+ * textProxy.is( 'range' ); // -> false
311
+ * ```
312
+ *
313
+ * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxy'` type is still
314
+ * accepted for backward compatibility.
315
+ *
316
+ * @label TEXT_PROXY
317
+ */
318
+ is(type: "$textProxy" | "view:$textProxy"): this is ViewTextProxy;
319
+ /**
320
+ * Checks whether this object is of type {@link module:engine/view/position~ViewPosition}.
321
+ *
322
+ * ```ts
323
+ * position.is( 'position' ); // -> true
324
+ * position.is( 'view:position' ); // -> true
325
+ *
326
+ * position.is( 'model:position' ); // -> false
327
+ * position.is( 'element' ); // -> false
328
+ * position.is( 'range' ); // -> false
329
+ * ```
330
+ *
331
+ * @label POSITION
332
+ */
333
+ is(type: "position" | "view:position"): this is ViewPosition;
334
+ /**
335
+ * Checks whether this object is of type {@link module:engine/view/range~ViewRange}.
336
+ *
337
+ * ```ts
338
+ * range.is( 'range' ); // -> true
339
+ * range.is( 'view:range' ); // -> true
340
+ *
341
+ * range.is( 'model:range' ); // -> false
342
+ * range.is( 'element' ); // -> false
343
+ * range.is( 'selection' ); // -> false
344
+ * ```
345
+ *
346
+ * @label RANGE
347
+ */
348
+ is(type: "range" | "view:range"): this is ViewRange;
349
+ /**
350
+ * Checks whether this object is of type {@link module:engine/view/selection~ViewSelection} or
351
+ * {@link module:engine/view/documentselection~ViewDocumentSelection}.
352
+ *
353
+ * ```ts
354
+ * selection.is( 'selection' ); // -> true
355
+ * selection.is( 'view:selection' ); // -> true
356
+ *
357
+ * selection.is( 'model:selection' ); // -> false
358
+ * selection.is( 'element' ); // -> false
359
+ * selection.is( 'range' ); // -> false
360
+ * ```
361
+ *
362
+ * @label SELECTION
363
+ */
364
+ is(type: "selection" | "view:selection"): this is ViewSelection | ViewDocumentSelection;
365
+ /**
366
+ * Checks whether this object is of type {@link module:engine/view/documentselection~ViewDocumentSelection}.
367
+ *
368
+ * ```ts
369
+ * `docSelection.is( 'selection' ); // -> true
370
+ * docSelection.is( 'documentSelection' ); // -> true
371
+ * docSelection.is( 'view:selection' ); // -> true
372
+ * docSelection.is( 'view:documentSelection' ); // -> true
373
+ *
374
+ * docSelection.is( 'model:documentSelection' ); // -> false
375
+ * docSelection.is( 'element' ); // -> false
376
+ * docSelection.is( 'node' ); // -> false
377
+ * ```
378
+ *
379
+ * @label DOCUMENT_SELECTION
380
+ */
381
+ is(type: "documentSelection" | "view:documentSelection"): this is ViewDocumentSelection;
382
+ /**
383
+ * Checks whether the object is of type {@link module:engine/view/element~ViewElement} or its subclass and has the specified `name`.
384
+ *
385
+ * @label ELEMENT_NAME
386
+ */
387
+ is<N extends string>(type: "element" | "view:element", name: N): this is (ViewElement | ViewAttributeElement | ViewContainerElement | ViewEditableElement | ViewEmptyElement | ViewRawElement | ViewRootEditableElement | ViewUIElement) & {
388
+ name: N;
389
+ };
390
+ /**
391
+ * Checks whether the object is of type {@link module:engine/view/attributeelement~ViewAttributeElement} and has the specified `name`.
392
+ *
393
+ * @label ATTRIBUTE_ELEMENT_NAME
394
+ */
395
+ is<N extends string>(type: "attributeElement" | "view:attributeElement", name: N): this is ViewAttributeElement & {
396
+ name: N;
397
+ };
398
+ /**
399
+ * Checks whether the object is of type {@link module:engine/view/containerelement~ViewContainerElement}
400
+ * or its subclass and has the specified `name`.
401
+ *
402
+ * @label CONTAINER_ELEMENT_NAME
403
+ */
404
+ is<N extends string>(type: "containerElement" | "view:containerElement", name: N): this is (ViewContainerElement | ViewEditableElement | ViewRootEditableElement) & {
405
+ name: N;
406
+ };
407
+ /**
408
+ * Checks whether the object is of type {@link module:engine/view/editableelement~ViewEditableElement}
409
+ * or its subclass and has the specified `name`.
410
+ *
411
+ * @label EDITABLE_ELEMENT_NAME
412
+ */
413
+ is<N extends string>(type: "editableElement" | "view:editableElement", name: N): this is (ViewEditableElement | ViewRootEditableElement) & {
414
+ name: N;
415
+ };
416
+ /**
417
+ * Checks whether the object is of type {@link module:engine/view/emptyelement~ViewEmptyElement} has the specified `name`.
418
+ *
419
+ * @label EMPTY_ELEMENT_NAME
420
+ */
421
+ is<N extends string>(type: "emptyElement" | "view:emptyElement", name: N): this is ViewEmptyElement & {
422
+ name: N;
423
+ };
424
+ /**
425
+ * Checks whether the object is of type {@link module:engine/view/rawelement~ViewRawElement} and has the specified `name`.
426
+ *
427
+ * @label RAW_ELEMENT_NAME
428
+ */
429
+ is<N extends string>(type: "rawElement" | "view:rawElement", name: N): this is ViewRawElement & {
430
+ name: N;
431
+ };
432
+ /**
433
+ * Checks whether the object is of type {@link module:engine/view/rooteditableelement~ViewRootEditableElement}
434
+ * and has the specified `name`.
435
+ *
436
+ * @label ROOT_ELEMENT_NAME
437
+ */
438
+ is<N extends string>(type: "rootElement" | "view:rootElement", name: N): this is ViewRootEditableElement & {
439
+ name: N;
440
+ };
441
+ /**
442
+ * Checks whether the object is of type {@link module:engine/view/uielement~ViewUIElement} and has the specified `name`.
443
+ *
444
+ * @label UI_ELEMENT_NAME
445
+ */
446
+ is<N extends string>(type: "uiElement" | "view:uiElement", name: N): this is ViewUIElement & {
447
+ name: N;
448
+ };
449
449
  }