@ckeditor/ckeditor5-engine 48.2.0 → 48.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controller/datacontroller.d.ts +329 -328
- package/dist/controller/editingcontroller.d.ts +95 -94
- package/dist/conversion/comparemarkers.d.ts +45 -45
- package/dist/conversion/conversion.d.ts +474 -474
- package/dist/conversion/conversionhelpers.d.ts +21 -21
- package/dist/conversion/downcastdispatcher.d.ts +539 -538
- package/dist/conversion/downcasthelpers.d.ts +1129 -1129
- package/dist/conversion/mapper.d.ts +692 -697
- package/dist/conversion/modelconsumable.d.ts +196 -196
- package/dist/conversion/upcastdispatcher.d.ts +483 -482
- package/dist/conversion/upcasthelpers.d.ts +491 -491
- package/dist/conversion/viewconsumable.d.ts +330 -330
- package/dist/dataprocessor/basichtmlwriter.d.ts +15 -15
- package/dist/dataprocessor/dataprocessor.d.ts +57 -57
- package/dist/dataprocessor/htmldataprocessor.d.ts +72 -72
- package/dist/dataprocessor/htmlwriter.d.ts +11 -11
- package/dist/dataprocessor/xmldataprocessor.d.ts +86 -86
- package/dist/dev-utils/model.d.ts +128 -123
- package/dist/dev-utils/operationreplayer.d.ts +49 -49
- package/dist/dev-utils/utils.d.ts +33 -33
- package/dist/dev-utils/view.d.ts +314 -309
- package/dist/engineconfig.d.ts +39 -39
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +150 -150
- package/dist/index.js +34026 -40107
- package/dist/index.js.map +1 -1
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/model/batch.d.ts +86 -86
- package/dist/model/differ.d.ts +504 -504
- package/dist/model/document.d.ts +265 -268
- package/dist/model/documentfragment.d.ts +214 -214
- package/dist/model/documentselection.d.ts +406 -410
- package/dist/model/element.d.ts +182 -182
- package/dist/model/history.d.ts +109 -109
- package/dist/model/item.d.ts +9 -9
- package/dist/model/liveposition.d.ts +70 -69
- package/dist/model/liverange.d.ts +93 -92
- package/dist/model/markercollection.d.ts +317 -324
- package/dist/model/model.d.ts +889 -909
- package/dist/model/node.d.ts +254 -254
- package/dist/model/nodelist.d.ts +110 -110
- package/dist/model/operation/attributeoperation.d.ts +98 -98
- package/dist/model/operation/detachoperation.d.ts +57 -57
- package/dist/model/operation/insertoperation.d.ts +85 -85
- package/dist/model/operation/markeroperation.d.ts +87 -87
- package/dist/model/operation/mergeoperation.d.ts +95 -95
- package/dist/model/operation/moveoperation.d.ts +97 -97
- package/dist/model/operation/nooperation.d.ts +33 -33
- package/dist/model/operation/operation.d.ts +94 -94
- package/dist/model/operation/operationfactory.d.ts +14 -14
- package/dist/model/operation/renameoperation.d.ts +78 -78
- package/dist/model/operation/rootattributeoperation.d.ts +93 -93
- package/dist/model/operation/rootoperation.d.ts +71 -71
- package/dist/model/operation/splitoperation.d.ts +104 -104
- package/dist/model/operation/transform.d.ts +91 -91
- package/dist/model/operation/utils.d.ts +58 -58
- package/dist/model/position.d.ts +535 -535
- package/dist/model/range.d.ts +458 -453
- package/dist/model/rootelement.d.ts +55 -55
- package/dist/model/schema.d.ts +1325 -1327
- package/dist/model/selection.d.ts +452 -471
- package/dist/model/text.d.ts +62 -62
- package/dist/model/textproxy.d.ts +140 -140
- package/dist/model/treewalker.d.ts +190 -190
- package/dist/model/typecheckable.d.ts +281 -281
- package/dist/model/utils/autoparagraphing.d.ts +29 -29
- package/dist/model/utils/deletecontent.d.ts +68 -68
- package/dist/model/utils/getselectedcontent.d.ts +27 -27
- package/dist/model/utils/insertcontent.d.ts +42 -42
- package/dist/model/utils/insertobject.d.ts +41 -41
- package/dist/model/utils/modifyselection.d.ts +44 -44
- package/dist/model/utils/selection-post-fixer.d.ts +71 -71
- package/dist/model/writer.d.ts +854 -854
- package/dist/view/attributeelement.d.ts +123 -123
- package/dist/view/containerelement.d.ts +49 -49
- package/dist/view/datatransfer.d.ts +70 -70
- package/dist/view/document.d.ts +175 -177
- package/dist/view/documentfragment.d.ts +158 -157
- package/dist/view/documentselection.d.ts +308 -307
- package/dist/view/domconverter.d.ts +612 -657
- package/dist/view/downcastwriter.d.ts +1006 -1006
- package/dist/view/editableelement.d.ts +64 -63
- package/dist/view/element.d.ts +754 -754
- package/dist/view/elementdefinition.d.ts +79 -79
- package/dist/view/emptyelement.d.ts +42 -42
- package/dist/view/filler.d.ts +75 -75
- package/dist/view/item.d.ts +9 -9
- package/dist/view/matcher.d.ts +412 -487
- package/dist/view/node.d.ts +164 -163
- package/dist/view/observer/arrowkeysobserver.d.ts +37 -37
- package/dist/view/observer/bubblingemittermixin.d.ts +163 -153
- package/dist/view/observer/bubblingeventinfo.d.ts +45 -42
- package/dist/view/observer/clickobserver.d.ts +36 -36
- package/dist/view/observer/compositionobserver.d.ts +67 -67
- package/dist/view/observer/domeventdata.d.ts +46 -46
- package/dist/view/observer/domeventobserver.d.ts +77 -74
- package/dist/view/observer/fakeselectionobserver.d.ts +42 -42
- package/dist/view/observer/focusobserver.d.ts +84 -84
- package/dist/view/observer/inputobserver.d.ts +76 -76
- package/dist/view/observer/keyobserver.d.ts +53 -53
- package/dist/view/observer/mouseobserver.d.ts +73 -73
- package/dist/view/observer/mutationobserver.d.ts +101 -101
- package/dist/view/observer/observer.d.ts +84 -83
- package/dist/view/observer/pointerobserver.d.ts +63 -63
- package/dist/view/observer/selectionobserver.d.ts +136 -136
- package/dist/view/observer/tabobserver.d.ts +38 -38
- package/dist/view/observer/touchobserver.d.ts +60 -60
- package/dist/view/placeholder.d.ts +80 -80
- package/dist/view/position.d.ts +187 -187
- package/dist/view/range.d.ts +282 -282
- package/dist/view/rawelement.d.ts +72 -72
- package/dist/view/renderer.d.ts +270 -272
- package/dist/view/rooteditableelement.d.ts +43 -43
- package/dist/view/selection.d.ts +356 -369
- package/dist/view/styles/background.d.ts +15 -15
- package/dist/view/styles/border.d.ts +27 -27
- package/dist/view/styles/margin.d.ts +12 -12
- package/dist/view/styles/padding.d.ts +12 -12
- package/dist/view/styles/utils.d.ts +72 -72
- package/dist/view/stylesmap.d.ts +715 -715
- package/dist/view/text.d.ts +75 -75
- package/dist/view/textproxy.d.ts +92 -92
- package/dist/view/tokenlist.d.ts +104 -104
- package/dist/view/treewalker.d.ts +201 -201
- package/dist/view/typecheckable.d.ts +445 -445
- package/dist/view/uielement.d.ts +93 -93
- package/dist/view/upcastwriter.d.ts +412 -412
- package/dist/view/view.d.ts +466 -469
- package/package.json +2 -2
|
@@ -1,285 +1,285 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import type { Marker } from
|
|
9
|
-
import { type ModelDocumentFragment } from
|
|
10
|
-
import { type ModelDocumentSelection } from
|
|
11
|
-
import { type ModelElement } from
|
|
12
|
-
import { type ModelLivePosition } from
|
|
13
|
-
import { type ModelLiveRange } from
|
|
14
|
-
import { type ModelNode } from
|
|
15
|
-
import { type ModelPosition } from
|
|
16
|
-
import { type ModelRange } from
|
|
17
|
-
import { type ModelRootElement } from
|
|
18
|
-
import { type ModelSelection } from
|
|
19
|
-
import { type ModelText } from
|
|
20
|
-
import { type ModelTextProxy } from
|
|
6
|
+
* @module engine/model/typecheckable
|
|
7
|
+
*/
|
|
8
|
+
import type { Marker } from "./markercollection.js";
|
|
9
|
+
import { type ModelDocumentFragment } from "./documentfragment.js";
|
|
10
|
+
import { type ModelDocumentSelection } from "./documentselection.js";
|
|
11
|
+
import { type ModelElement } from "./element.js";
|
|
12
|
+
import { type ModelLivePosition } from "./liveposition.js";
|
|
13
|
+
import { type ModelLiveRange } from "./liverange.js";
|
|
14
|
+
import { type ModelNode } from "./node.js";
|
|
15
|
+
import { type ModelPosition } from "./position.js";
|
|
16
|
+
import { type ModelRange } from "./range.js";
|
|
17
|
+
import { type ModelRootElement } from "./rootelement.js";
|
|
18
|
+
import { type ModelSelection } from "./selection.js";
|
|
19
|
+
import { type ModelText } from "./text.js";
|
|
20
|
+
import { type ModelTextProxy } from "./textproxy.js";
|
|
21
21
|
export declare abstract class ModelTypeCheckable {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Checks whether the object is of type {@link module:engine/model/node~ModelNode} or its subclass.
|
|
24
|
+
*
|
|
25
|
+
* This method is useful when processing model objects that are of unknown type. For example, a function
|
|
26
|
+
* may return a {@link module:engine/model/documentfragment~ModelDocumentFragment} or a {@link module:engine/model/node~ModelNode}
|
|
27
|
+
* that can be either a text node or an element. This method can be used to check what kind of object is returned.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* someObject.is( 'element' ); // -> true if this is an element
|
|
31
|
+
* someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
|
|
32
|
+
* someObject.is( 'documentFragment' ); // -> true if this is a document fragment
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Since this method is also available on a range of view objects, you can prefix the type of the object with
|
|
36
|
+
* `model:` or `view:` to check, for example, if this is the model's or view's element:
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* modelElement.is( 'model:element' ); // -> true
|
|
40
|
+
* modelElement.is( 'view:element' ); // -> false
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* By using this method it is also possible to check a name of an element:
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* imageElement.is( 'element', 'imageBlock' ); // -> true
|
|
47
|
+
* imageElement.is( 'element', 'imageBlock' ); // -> same as above
|
|
48
|
+
* imageElement.is( 'model:element', 'imageBlock' ); // -> same as above, but more precise
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @label NODE
|
|
52
|
+
*/
|
|
53
|
+
is(type: "node" | "model:node"): this is ModelNode | ModelElement | ModelText | ModelRootElement;
|
|
54
|
+
/**
|
|
55
|
+
* Checks whether the object is of type {@link module:engine/model/element~ModelElement} or its subclass.
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* element.is( 'element' ); // -> true
|
|
59
|
+
* element.is( 'node' ); // -> true
|
|
60
|
+
* element.is( 'model:element' ); // -> true
|
|
61
|
+
* element.is( 'model:node' ); // -> true
|
|
62
|
+
*
|
|
63
|
+
* element.is( 'view:element' ); // -> false
|
|
64
|
+
* element.is( 'documentSelection' ); // -> false
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* Assuming that the object being checked is an element, you can also check its
|
|
68
|
+
* {@link module:engine/model/element~ModelElement#name name}:
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* element.is( 'element', 'imageBlock' ); // -> true if this is an <imageBlock> element
|
|
72
|
+
* text.is( 'element', 'imageBlock' ); -> false
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @label ELEMENT
|
|
76
|
+
*/
|
|
77
|
+
is(type: "element" | "model:element"): this is ModelElement | ModelRootElement;
|
|
78
|
+
/**
|
|
79
|
+
* Checks whether the object is of type {@link module:engine/model/rootelement~ModelRootElement}.
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* rootElement.is( 'rootElement' ); // -> true
|
|
83
|
+
* rootElement.is( 'element' ); // -> true
|
|
84
|
+
* rootElement.is( 'node' ); // -> true
|
|
85
|
+
* rootElement.is( 'model:rootElement' ); // -> true
|
|
86
|
+
* rootElement.is( 'model:element' ); // -> true
|
|
87
|
+
* rootElement.is( 'model:node' ); // -> true
|
|
88
|
+
*
|
|
89
|
+
* rootElement.is( 'view:element' ); // -> false
|
|
90
|
+
* rootElement.is( 'documentFragment' ); // -> false
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* Assuming that the object being checked is an element, you can also check its
|
|
94
|
+
* {@link module:engine/model/element~ModelElement#name name}:
|
|
95
|
+
*
|
|
96
|
+
* ```ts
|
|
97
|
+
* rootElement.is( 'rootElement', '$root' ); // -> same as above
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @label ROOT_ELEMENT
|
|
101
|
+
*/
|
|
102
|
+
is(type: "rootElement" | "model:rootElement"): this is ModelRootElement;
|
|
103
|
+
/**
|
|
104
|
+
* Checks whether the object is of type {@link module:engine/model/text~ModelText}.
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
107
|
+
* text.is( '$text' ); // -> true
|
|
108
|
+
* text.is( 'node' ); // -> true
|
|
109
|
+
* text.is( 'model:$text' ); // -> true
|
|
110
|
+
* text.is( 'model:node' ); // -> true
|
|
111
|
+
*
|
|
112
|
+
* text.is( 'view:$text' ); // -> false
|
|
113
|
+
* text.is( 'documentSelection' ); // -> false
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
|
|
117
|
+
* accepted for backward compatibility.
|
|
118
|
+
*
|
|
119
|
+
* @label TEXT
|
|
120
|
+
*/
|
|
121
|
+
is(type: "$text" | "model:$text"): this is ModelText;
|
|
122
|
+
/**
|
|
123
|
+
* Checks whether the object is of type {@link module:engine/model/position~ModelPosition} or its subclass.
|
|
124
|
+
*
|
|
125
|
+
* ```ts
|
|
126
|
+
* position.is( 'position' ); // -> true
|
|
127
|
+
* position.is( 'model:position' ); // -> true
|
|
128
|
+
*
|
|
129
|
+
* position.is( 'view:position' ); // -> false
|
|
130
|
+
* position.is( 'documentSelection' ); // -> false
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @label POSITION
|
|
134
|
+
*/
|
|
135
|
+
is(type: "position" | "model:position"): this is ModelPosition | ModelLivePosition;
|
|
136
|
+
/**
|
|
137
|
+
* Checks whether the object is of type {@link module:engine/model/liveposition~ModelLivePosition}.
|
|
138
|
+
*
|
|
139
|
+
* ```ts
|
|
140
|
+
* livePosition.is( 'position' ); // -> true
|
|
141
|
+
* livePosition.is( 'model:position' ); // -> true
|
|
142
|
+
* livePosition.is( 'liveposition' ); // -> true
|
|
143
|
+
* livePosition.is( 'model:livePosition' ); // -> true
|
|
144
|
+
*
|
|
145
|
+
* livePosition.is( 'view:position' ); // -> false
|
|
146
|
+
* livePosition.is( 'documentSelection' ); // -> false
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @label LIVE_POSITION
|
|
150
|
+
*/
|
|
151
|
+
is(type: "livePosition" | "model:livePosition"): this is ModelLivePosition;
|
|
152
|
+
/**
|
|
153
|
+
* Checks whether the object is of type {@link module:engine/model/range~ModelRange} or its subclass.
|
|
154
|
+
*
|
|
155
|
+
* ```ts
|
|
156
|
+
* range.is( 'range' ); // -> true
|
|
157
|
+
* range.is( 'model:range' ); // -> true
|
|
158
|
+
*
|
|
159
|
+
* range.is( 'view:range' ); // -> false
|
|
160
|
+
* range.is( 'documentSelection' ); // -> false
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @label RANGE
|
|
164
|
+
*/
|
|
165
|
+
is(type: "range" | "model:range"): this is ModelRange | ModelLiveRange;
|
|
166
|
+
/**
|
|
167
|
+
* Checks whether the object is of type {@link module:engine/model/liverange~ModelLiveRange}.
|
|
168
|
+
*
|
|
169
|
+
* ```ts
|
|
170
|
+
* liveRange.is( 'range' ); // -> true
|
|
171
|
+
* liveRange.is( 'model:range' ); // -> true
|
|
172
|
+
* liveRange.is( 'liveRange' ); // -> true
|
|
173
|
+
* liveRange.is( 'model:liveRange' ); // -> true
|
|
174
|
+
*
|
|
175
|
+
* liveRange.is( 'view:range' ); // -> false
|
|
176
|
+
* liveRange.is( 'documentSelection' ); // -> false
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @label LIVE_RANGE
|
|
180
|
+
*/
|
|
181
|
+
is(type: "liveRange" | "model:liveRange"): this is ModelLiveRange;
|
|
182
|
+
/**
|
|
183
|
+
* Checks whether the object is of type {@link module:engine/model/documentfragment~ModelDocumentFragment}.
|
|
184
|
+
*
|
|
185
|
+
* ```ts
|
|
186
|
+
* docFrag.is( 'documentFragment' ); // -> true
|
|
187
|
+
* docFrag.is( 'model:documentFragment' ); // -> true
|
|
188
|
+
*
|
|
189
|
+
* docFrag.is( 'view:documentFragment' ); // -> false
|
|
190
|
+
* docFrag.is( 'element' ); // -> false
|
|
191
|
+
* docFrag.is( 'node' ); // -> false
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* @label DOCUMENT_FRAGMENT
|
|
195
|
+
*/
|
|
196
|
+
is(type: "documentFragment" | "model:documentFragment"): this is ModelDocumentFragment;
|
|
197
|
+
/**
|
|
198
|
+
* Checks whether the object is of type {@link module:engine/model/selection~ModelSelection}
|
|
199
|
+
* or {@link module:engine/model/documentselection~ModelDocumentSelection}.
|
|
200
|
+
*
|
|
201
|
+
* ```ts
|
|
202
|
+
* selection.is( 'selection' ); // -> true
|
|
203
|
+
* selection.is( 'model:selection' ); // -> true
|
|
204
|
+
*
|
|
205
|
+
* selection.is( 'view:selection' ); // -> false
|
|
206
|
+
* selection.is( 'range' ); // -> false
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* @label SELECTION
|
|
210
|
+
*/
|
|
211
|
+
is(type: "selection" | "model:selection"): this is ModelSelection | ModelDocumentSelection;
|
|
212
|
+
/**
|
|
213
|
+
* Checks whether the object is of type {@link module:engine/model/documentselection~ModelDocumentSelection}.
|
|
214
|
+
*
|
|
215
|
+
* ```ts
|
|
216
|
+
* selection.is( 'selection' ); // -> true
|
|
217
|
+
* selection.is( 'documentSelection' ); // -> true
|
|
218
|
+
* selection.is( 'model:selection' ); // -> true
|
|
219
|
+
* selection.is( 'model:documentSelection' ); // -> true
|
|
220
|
+
*
|
|
221
|
+
* selection.is( 'view:selection' ); // -> false
|
|
222
|
+
* selection.is( 'element' ); // -> false
|
|
223
|
+
* selection.is( 'node' ); // -> false
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* @label DOCUMENT_SELECTION
|
|
227
|
+
*/
|
|
228
|
+
is(type: "documentSelection" | "model:documentSelection"): this is ModelDocumentSelection;
|
|
229
|
+
/**
|
|
230
|
+
* Checks whether the object is of type {@link module:engine/model/markercollection~Marker}.
|
|
231
|
+
*
|
|
232
|
+
* ```ts
|
|
233
|
+
* marker.is( 'marker' ); // -> true
|
|
234
|
+
* marker.is( 'model:marker' ); // -> true
|
|
235
|
+
*
|
|
236
|
+
* marker.is( 'view:element' ); // -> false
|
|
237
|
+
* marker.is( 'documentSelection' ); // -> false
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* @label MARKER
|
|
241
|
+
*/
|
|
242
|
+
is(type: "marker" | "model:marker"): this is Marker;
|
|
243
|
+
/**
|
|
244
|
+
* Checks whether the object is of type {@link module:engine/model/textproxy~ModelTextProxy}.
|
|
245
|
+
*
|
|
246
|
+
* ```ts
|
|
247
|
+
* textProxy.is( '$textProxy' ); // -> true
|
|
248
|
+
* textProxy.is( 'model:$textProxy' ); // -> true
|
|
249
|
+
*
|
|
250
|
+
* textProxy.is( 'view:$textProxy' ); // -> false
|
|
251
|
+
* textProxy.is( 'range' ); // -> false
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxt'` type is still
|
|
255
|
+
* accepted for backward compatibility.
|
|
256
|
+
*
|
|
257
|
+
* @label TEXT_PROXY
|
|
258
|
+
*/
|
|
259
|
+
is(type: "$textProxy" | "model:$textProxy"): this is ModelTextProxy;
|
|
260
|
+
/**
|
|
261
|
+
* Checks whether the object is of type {@link module:engine/model/element~ModelElement} or its subclass and has the specified `name`.
|
|
262
|
+
*
|
|
263
|
+
* ```ts
|
|
264
|
+
* element.is( 'element', 'imageBlock' ); // -> true if this is an <imageBlock> element
|
|
265
|
+
* text.is( 'element', 'imageBlock' ); -> false
|
|
266
|
+
* ```
|
|
267
|
+
*
|
|
268
|
+
* @label ELEMENT_NAME
|
|
269
|
+
*/
|
|
270
|
+
is<N extends string>(type: "element" | "model:element", name: N): this is (ModelElement | ModelRootElement) & {
|
|
271
|
+
name: N;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Checks whether the object is of type {@link module:engine/model/rootelement~ModelRootElement} and has the specified `name`.
|
|
275
|
+
*
|
|
276
|
+
* ```ts
|
|
277
|
+
* rootElement.is( 'rootElement', '$root' );
|
|
278
|
+
* ```
|
|
279
|
+
*
|
|
280
|
+
* @label ROOT_ELEMENT_NAME
|
|
281
|
+
*/
|
|
282
|
+
is<N extends string>(type: "rootElement" | "model:rootElement", name: N): this is ModelRootElement & {
|
|
283
|
+
name: N;
|
|
284
|
+
};
|
|
285
285
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { type ModelNode } from
|
|
9
|
-
import { type ModelPosition } from
|
|
10
|
-
import { type ModelSchema } from
|
|
11
|
-
import { type ModelWriter } from
|
|
6
|
+
* @module engine/model/utils/autoparagraphing
|
|
7
|
+
*/
|
|
8
|
+
import { type ModelNode } from "../node.js";
|
|
9
|
+
import { type ModelPosition } from "../position.js";
|
|
10
|
+
import { type ModelSchema } from "../schema.js";
|
|
11
|
+
import { type ModelWriter } from "../writer.js";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
* Fixes all empty roots.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
* @param writer The model writer.
|
|
17
|
+
* @returns `true` if any change has been applied, `false` otherwise.
|
|
18
|
+
*/
|
|
19
19
|
export declare function autoParagraphEmptyRoots(writer: ModelWriter): boolean;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
* Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
* @param position The position at which to check.
|
|
25
|
+
* @param nodeOrType The child node or child type to check.
|
|
26
|
+
* @param schema A schema instance used for element validation.
|
|
27
|
+
*/
|
|
28
28
|
export declare function isParagraphable(position: ModelPosition, nodeOrType: ModelNode | string, schema: ModelSchema): boolean;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
* Inserts a new paragraph at the given position and returns a position inside that paragraph.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
* @param position The position where a paragraph should be inserted.
|
|
34
|
+
* @param writer The model writer.
|
|
35
|
+
* @returns Position inside the created paragraph.
|
|
36
|
+
*/
|
|
37
37
|
export declare function wrapInParagraph(position: ModelPosition, writer: ModelWriter): ModelPosition;
|