@ckeditor/ckeditor5-engine 45.2.1 → 46.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2563 -2257
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/controller/datacontroller.d.ts +33 -32
- package/src/controller/datacontroller.js +29 -28
- package/src/controller/editingcontroller.d.ts +8 -8
- package/src/controller/editingcontroller.js +10 -10
- package/src/conversion/conversion.d.ts +18 -19
- package/src/conversion/conversion.js +4 -4
- package/src/conversion/conversionhelpers.d.ts +1 -1
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.d.ts +63 -69
- package/src/conversion/downcastdispatcher.js +16 -16
- package/src/conversion/downcasthelpers.d.ts +94 -83
- package/src/conversion/downcasthelpers.js +63 -53
- package/src/conversion/mapper.d.ts +27 -27
- package/src/conversion/mapper.js +15 -15
- package/src/conversion/modelconsumable.d.ts +26 -26
- package/src/conversion/modelconsumable.js +23 -23
- package/src/conversion/upcastdispatcher.d.ts +33 -32
- package/src/conversion/upcastdispatcher.js +19 -19
- package/src/conversion/upcasthelpers.d.ts +46 -38
- package/src/conversion/upcasthelpers.js +33 -24
- package/src/conversion/viewconsumable.d.ts +50 -45
- package/src/conversion/viewconsumable.js +32 -27
- package/src/dataprocessor/basichtmlwriter.d.ts +4 -2
- package/src/dataprocessor/basichtmlwriter.js +3 -1
- package/src/dataprocessor/dataprocessor.d.ts +7 -6
- package/src/dataprocessor/htmldataprocessor.d.ts +10 -10
- package/src/dataprocessor/htmldataprocessor.js +6 -6
- package/src/dataprocessor/htmlwriter.d.ts +1 -1
- package/src/dataprocessor/xmldataprocessor.d.ts +10 -10
- package/src/dataprocessor/xmldataprocessor.js +6 -6
- package/src/dev-utils/model.d.ts +25 -26
- package/src/dev-utils/model.js +35 -36
- package/src/dev-utils/operationreplayer.d.ts +5 -3
- package/src/dev-utils/operationreplayer.js +4 -2
- package/src/dev-utils/utils.d.ts +8 -0
- package/src/dev-utils/utils.js +8 -0
- package/src/dev-utils/view.d.ts +66 -63
- package/src/dev-utils/view.js +144 -134
- package/src/index.d.ts +135 -106
- package/src/index.js +120 -71
- package/src/legacyerrors.d.ts +5 -0
- package/src/legacyerrors.js +17 -0
- package/src/model/batch.d.ts +2 -15
- package/src/model/batch.js +1 -23
- package/src/model/differ.d.ts +54 -31
- package/src/model/differ.js +15 -15
- package/src/model/document.d.ts +31 -31
- package/src/model/document.js +13 -13
- package/src/model/documentfragment.d.ts +45 -45
- package/src/model/documentfragment.js +40 -40
- package/src/model/documentselection.d.ts +92 -92
- package/src/model/documentselection.js +71 -70
- package/src/model/element.d.ts +31 -31
- package/src/model/element.js +29 -29
- package/src/model/history.d.ts +3 -3
- package/src/model/history.js +2 -2
- package/src/model/item.d.ts +4 -5
- package/src/model/liveposition.d.ts +31 -31
- package/src/model/liveposition.js +18 -18
- package/src/model/liverange.d.ts +42 -38
- package/src/model/liverange.js +17 -16
- package/src/model/markercollection.d.ts +41 -40
- package/src/model/markercollection.js +22 -20
- package/src/model/model.d.ts +82 -81
- package/src/model/model.js +54 -54
- package/src/model/node.d.ts +48 -48
- package/src/model/node.js +31 -31
- package/src/model/nodelist.d.ts +17 -17
- package/src/model/nodelist.js +11 -11
- package/src/model/operation/attributeoperation.d.ts +10 -10
- package/src/model/operation/attributeoperation.js +7 -7
- package/src/model/operation/detachoperation.d.ts +11 -9
- package/src/model/operation/detachoperation.js +8 -6
- package/src/model/operation/insertoperation.d.ts +13 -13
- package/src/model/operation/insertoperation.js +15 -15
- package/src/model/operation/markeroperation.d.ts +12 -12
- package/src/model/operation/markeroperation.js +5 -5
- package/src/model/operation/mergeoperation.d.ts +16 -16
- package/src/model/operation/mergeoperation.js +18 -18
- package/src/model/operation/moveoperation.d.ts +16 -16
- package/src/model/operation/moveoperation.js +18 -15
- package/src/model/operation/nooperation.d.ts +4 -4
- package/src/model/operation/nooperation.js +2 -2
- package/src/model/operation/operation.d.ts +10 -10
- package/src/model/operation/operation.js +5 -5
- package/src/model/operation/operationfactory.d.ts +4 -4
- package/src/model/operation/operationfactory.js +12 -12
- package/src/model/operation/renameoperation.d.ts +10 -10
- package/src/model/operation/renameoperation.js +7 -7
- package/src/model/operation/rootattributeoperation.d.ts +12 -12
- package/src/model/operation/rootattributeoperation.js +8 -8
- package/src/model/operation/rootoperation.d.ts +8 -8
- package/src/model/operation/rootoperation.js +3 -3
- package/src/model/operation/splitoperation.d.ts +17 -17
- package/src/model/operation/splitoperation.js +19 -19
- package/src/model/operation/transform.d.ts +11 -8
- package/src/model/operation/transform.js +66 -49
- package/src/model/operation/utils.d.ts +24 -23
- package/src/model/operation/utils.js +20 -20
- package/src/model/position.d.ts +101 -97
- package/src/model/position.js +69 -64
- package/src/model/range.d.ts +90 -90
- package/src/model/range.js +87 -87
- package/src/model/rootelement.d.ts +11 -11
- package/src/model/rootelement.js +9 -9
- package/src/model/schema.d.ts +158 -154
- package/src/model/schema.js +93 -90
- package/src/model/selection.d.ts +73 -73
- package/src/model/selection.js +62 -62
- package/src/model/text.d.ts +11 -10
- package/src/model/text.js +11 -10
- package/src/model/textproxy.d.ts +39 -38
- package/src/model/textproxy.js +31 -30
- package/src/model/treewalker.d.ts +37 -37
- package/src/model/treewalker.js +14 -14
- package/src/model/typecheckable.d.ts +45 -45
- package/src/model/typecheckable.js +1 -1
- package/src/model/utils/autoparagraphing.d.ts +7 -7
- package/src/model/utils/deletecontent.d.ts +7 -5
- package/src/model/utils/deletecontent.js +13 -11
- package/src/model/utils/getselectedcontent.d.ts +6 -5
- package/src/model/utils/getselectedcontent.js +2 -1
- package/src/model/utils/insertcontent.d.ts +9 -8
- package/src/model/utils/insertcontent.js +41 -40
- package/src/model/utils/insertobject.d.ts +9 -9
- package/src/model/utils/insertobject.js +4 -4
- package/src/model/utils/modifyselection.d.ts +5 -4
- package/src/model/utils/modifyselection.js +12 -11
- package/src/model/utils/selection-post-fixer.d.ts +12 -8
- package/src/model/utils/selection-post-fixer.js +15 -11
- package/src/model/writer.d.ts +102 -101
- package/src/model/writer.js +99 -98
- package/src/view/attributeelement.d.ts +29 -29
- package/src/view/attributeelement.js +25 -25
- package/src/view/containerelement.d.ts +16 -15
- package/src/view/containerelement.js +15 -14
- package/src/view/datatransfer.d.ts +7 -7
- package/src/view/datatransfer.js +1 -1
- package/src/view/document.d.ts +25 -25
- package/src/view/document.js +15 -15
- package/src/view/documentfragment.d.ts +21 -21
- package/src/view/documentfragment.js +14 -14
- package/src/view/documentselection.d.ts +65 -63
- package/src/view/documentselection.js +27 -25
- package/src/view/domconverter.d.ts +94 -89
- package/src/view/domconverter.js +78 -73
- package/src/view/downcastwriter.d.ts +185 -181
- package/src/view/downcastwriter.js +222 -210
- package/src/view/editableelement.d.ts +13 -13
- package/src/view/editableelement.js +8 -8
- package/src/view/element.d.ts +75 -74
- package/src/view/element.js +58 -58
- package/src/view/elementdefinition.d.ts +3 -4
- package/src/view/emptyelement.d.ts +13 -13
- package/src/view/emptyelement.js +13 -13
- package/src/view/filler.d.ts +14 -3
- package/src/view/filler.js +12 -1
- package/src/view/item.d.ts +4 -5
- package/src/view/matcher.d.ts +22 -19
- package/src/view/matcher.js +6 -6
- package/src/view/node.d.ts +33 -33
- package/src/view/node.js +9 -9
- package/src/view/observer/arrowkeysobserver.d.ts +10 -10
- package/src/view/observer/arrowkeysobserver.js +5 -5
- package/src/view/observer/bubblingemittermixin.d.ts +5 -5
- package/src/view/observer/bubblingemittermixin.js +2 -9
- package/src/view/observer/bubblingeventinfo.d.ts +9 -9
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.d.ts +8 -8
- package/src/view/observer/clickobserver.js +4 -4
- package/src/view/observer/compositionobserver.d.ts +19 -19
- package/src/view/observer/compositionobserver.js +6 -6
- package/src/view/observer/domeventdata.d.ts +9 -9
- package/src/view/observer/domeventdata.js +2 -2
- package/src/view/observer/domeventobserver.d.ts +3 -3
- package/src/view/observer/domeventobserver.js +5 -5
- package/src/view/observer/fakeselectionobserver.d.ts +9 -9
- package/src/view/observer/fakeselectionobserver.js +8 -8
- package/src/view/observer/focusobserver.d.ts +16 -16
- package/src/view/observer/focusobserver.js +7 -7
- package/src/view/observer/inputobserver.d.ts +18 -18
- package/src/view/observer/inputobserver.js +5 -5
- package/src/view/observer/keyobserver.d.ts +11 -11
- package/src/view/observer/keyobserver.js +3 -3
- package/src/view/observer/mouseobserver.d.ts +16 -16
- package/src/view/observer/mouseobserver.js +3 -3
- package/src/view/observer/mutationobserver.d.ts +21 -21
- package/src/view/observer/mutationobserver.js +7 -7
- package/src/view/observer/observer.d.ts +12 -12
- package/src/view/observer/observer.js +6 -6
- package/src/view/observer/selectionobserver.d.ts +33 -33
- package/src/view/observer/selectionobserver.js +14 -14
- package/src/view/observer/tabobserver.d.ts +10 -10
- package/src/view/observer/tabobserver.js +5 -5
- package/src/view/observer/touchobserver.d.ts +13 -13
- package/src/view/observer/touchobserver.js +3 -3
- package/src/view/placeholder.d.ts +21 -21
- package/src/view/placeholder.js +23 -23
- package/src/view/position.d.ts +49 -49
- package/src/view/position.js +42 -42
- package/src/view/range.d.ts +76 -74
- package/src/view/range.js +67 -65
- package/src/view/rawelement.d.ts +19 -19
- package/src/view/rawelement.js +16 -16
- package/src/view/renderer.d.ts +14 -14
- package/src/view/renderer.js +7 -7
- package/src/view/rooteditableelement.d.ts +8 -7
- package/src/view/rooteditableelement.js +7 -6
- package/src/view/selection.d.ts +66 -64
- package/src/view/selection.js +50 -48
- package/src/view/styles/background.d.ts +2 -2
- package/src/view/styles/background.js +9 -9
- package/src/view/styles/border.d.ts +2 -2
- package/src/view/styles/border.js +13 -13
- package/src/view/styles/margin.d.ts +2 -2
- package/src/view/styles/margin.js +5 -5
- package/src/view/styles/padding.d.ts +2 -2
- package/src/view/styles/padding.js +5 -5
- package/src/view/styles/utils.d.ts +24 -24
- package/src/view/styles/utils.js +25 -25
- package/src/view/stylesmap.d.ts +28 -32
- package/src/view/stylesmap.js +52 -39
- package/src/view/text.d.ts +11 -11
- package/src/view/text.js +10 -10
- package/src/view/textproxy.d.ts +33 -32
- package/src/view/textproxy.js +23 -22
- package/src/view/tokenlist.d.ts +14 -14
- package/src/view/tokenlist.js +10 -10
- package/src/view/treewalker.d.ts +42 -40
- package/src/view/treewalker.js +36 -35
- package/src/view/typecheckable.d.ts +76 -75
- package/src/view/typecheckable.js +1 -1
- package/src/view/uielement.d.ts +22 -21
- package/src/view/uielement.js +17 -16
- package/src/view/upcastwriter.d.ts +70 -70
- package/src/view/upcastwriter.js +42 -42
- package/src/view/view.d.ts +70 -69
- package/src/view/view.js +56 -55
package/src/model/writer.d.ts
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
5
|
+
import { ModelDocumentFragment } from './documentfragment.js';
|
|
6
|
+
import { ModelElement } from './element.js';
|
|
7
|
+
import { ModelPosition, type ModelPositionOffset, type ModelPositionStickiness } from './position.js';
|
|
8
|
+
import { ModelRange } from './range.js';
|
|
9
|
+
import { ModelRootElement } from './rootelement.js';
|
|
10
|
+
import { ModelText } from './text.js';
|
|
11
11
|
import type { Marker } from './markercollection.js';
|
|
12
|
-
import type {
|
|
13
|
-
import type Batch from './batch.js';
|
|
14
|
-
import type
|
|
15
|
-
import type Model from './model.js';
|
|
16
|
-
import type {
|
|
12
|
+
import type { ModelSelection, ModelPlaceOrOffset, ModelSelectable } from './selection.js';
|
|
13
|
+
import { type Batch } from './batch.js';
|
|
14
|
+
import { type ModelItem } from './item.js';
|
|
15
|
+
import { type Model } from './model.js';
|
|
16
|
+
import type { ModelNode, ModelNodeAttributes } from './node.js';
|
|
17
17
|
/**
|
|
18
18
|
* The model can only be modified by using the writer. It should be used whenever you want to create a node, modify
|
|
19
19
|
* child nodes, attributes or text, set the selection's position and its attributes.
|
|
@@ -30,14 +30,14 @@ import type { default as Node, NodeAttributes } from './node.js';
|
|
|
30
30
|
* Note that the writer should never be stored and used outside of the `change()` and
|
|
31
31
|
* `enqueueChange()` blocks.
|
|
32
32
|
*
|
|
33
|
-
* Note that writer's methods do not check the {@link module:engine/model/schema~
|
|
33
|
+
* Note that writer's methods do not check the {@link module:engine/model/schema~ModelSchema}. It is possible
|
|
34
34
|
* to create incorrect model structures by using the writer. Read more about in
|
|
35
35
|
* {@glink framework/deep-dive/schema#who-checks-the-schema "Who checks the schema?"}.
|
|
36
36
|
*
|
|
37
37
|
* @see module:engine/model/model~Model#change
|
|
38
38
|
* @see module:engine/model/model~Model#enqueueChange
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export declare class ModelWriter {
|
|
41
41
|
/**
|
|
42
42
|
* Instance of the model on which this writer operates.
|
|
43
43
|
*/
|
|
@@ -56,7 +56,7 @@ export default class Writer {
|
|
|
56
56
|
*/
|
|
57
57
|
constructor(model: Model, batch: Batch);
|
|
58
58
|
/**
|
|
59
|
-
* Creates a new {@link module:engine/model/text~
|
|
59
|
+
* Creates a new {@link module:engine/model/text~ModelText text node}.
|
|
60
60
|
*
|
|
61
61
|
* ```ts
|
|
62
62
|
* writer.createText( 'foo' );
|
|
@@ -65,11 +65,11 @@ export default class Writer {
|
|
|
65
65
|
*
|
|
66
66
|
* @param data Text data.
|
|
67
67
|
* @param attributes Text attributes.
|
|
68
|
-
* @returns {module:engine/model/text~
|
|
68
|
+
* @returns {module:engine/model/text~ModelText} Created text node.
|
|
69
69
|
*/
|
|
70
|
-
createText(data: string, attributes?:
|
|
70
|
+
createText(data: string, attributes?: ModelNodeAttributes): ModelText;
|
|
71
71
|
/**
|
|
72
|
-
* Creates a new {@link module:engine/model/element~
|
|
72
|
+
* Creates a new {@link module:engine/model/element~ModelElement element}.
|
|
73
73
|
*
|
|
74
74
|
* ```ts
|
|
75
75
|
* writer.createElement( 'paragraph' );
|
|
@@ -80,13 +80,13 @@ export default class Writer {
|
|
|
80
80
|
* @param attributes Elements attributes.
|
|
81
81
|
* @returns Created element.
|
|
82
82
|
*/
|
|
83
|
-
createElement(name: string, attributes?:
|
|
83
|
+
createElement(name: string, attributes?: ModelNodeAttributes): ModelElement;
|
|
84
84
|
/**
|
|
85
|
-
* Creates a new {@link module:engine/model/documentfragment~
|
|
85
|
+
* Creates a new {@link module:engine/model/documentfragment~ModelDocumentFragment document fragment}.
|
|
86
86
|
*
|
|
87
87
|
* @returns Created document fragment.
|
|
88
88
|
*/
|
|
89
|
-
createDocumentFragment():
|
|
89
|
+
createDocumentFragment(): ModelDocumentFragment;
|
|
90
90
|
/**
|
|
91
91
|
* Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.
|
|
92
92
|
* If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
|
|
@@ -95,7 +95,7 @@ export default class Writer {
|
|
|
95
95
|
* @param deep If set to `true` clones element and all its children recursively. When set to `false`,
|
|
96
96
|
* element will be cloned without any child.
|
|
97
97
|
*/
|
|
98
|
-
cloneElement(element:
|
|
98
|
+
cloneElement(element: ModelElement, deep?: boolean): ModelElement;
|
|
99
99
|
/**
|
|
100
100
|
* Inserts item on given position.
|
|
101
101
|
*
|
|
@@ -132,16 +132,16 @@ export default class Writer {
|
|
|
132
132
|
* Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,
|
|
133
133
|
* `model-writer-insert-forbidden-move` is thrown.
|
|
134
134
|
*
|
|
135
|
-
* If you want to move {@link module:engine/model/range~
|
|
136
|
-
* {@link module:engine/model/item~
|
|
135
|
+
* If you want to move {@link module:engine/model/range~ModelRange range} instead of an
|
|
136
|
+
* {@link module:engine/model/item~ModelItem item} use {@link module:engine/model/writer~ModelWriter#move `Writer#move()`}.
|
|
137
137
|
*
|
|
138
138
|
* **Note:** For a paste-like content insertion mechanism see
|
|
139
139
|
* {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.
|
|
140
140
|
*
|
|
141
141
|
* @param item Item or document fragment to insert.
|
|
142
|
-
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~
|
|
142
|
+
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
143
143
|
*/
|
|
144
|
-
insert(item:
|
|
144
|
+
insert(item: ModelItem | ModelDocumentFragment, itemOrPosition: ModelItem | ModelDocumentFragment | ModelPosition, offset?: ModelPositionOffset): void;
|
|
145
145
|
/**
|
|
146
146
|
* Creates and inserts text on given position.
|
|
147
147
|
*
|
|
@@ -165,9 +165,9 @@ export default class Writer {
|
|
|
165
165
|
*
|
|
166
166
|
* @label WITHOUT_ATTRIBUTES
|
|
167
167
|
* @param text Text data.
|
|
168
|
-
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~
|
|
168
|
+
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
169
169
|
*/
|
|
170
|
-
insertText(text: string, itemOrPosition?:
|
|
170
|
+
insertText(text: string, itemOrPosition?: ModelItem | ModelPosition, offset?: ModelPositionOffset): void;
|
|
171
171
|
/**
|
|
172
172
|
* Creates and inserts text with specified attributes on given position.
|
|
173
173
|
*
|
|
@@ -192,9 +192,9 @@ export default class Writer {
|
|
|
192
192
|
* @label WITH_ATTRIBUTES
|
|
193
193
|
* @param text Text data.
|
|
194
194
|
* @param attributes Text attributes.
|
|
195
|
-
* @param offset Offset or one of the flags. Used only when third parameter is a {@link module:engine/model/item~
|
|
195
|
+
* @param offset Offset or one of the flags. Used only when third parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
196
196
|
*/
|
|
197
|
-
insertText(text: string, attributes?:
|
|
197
|
+
insertText(text: string, attributes?: ModelNodeAttributes, itemOrPosition?: ModelItem | ModelPosition, offset?: ModelPositionOffset): void;
|
|
198
198
|
/**
|
|
199
199
|
* Creates and inserts element on given position. You can optionally set attributes:
|
|
200
200
|
*
|
|
@@ -218,9 +218,9 @@ export default class Writer {
|
|
|
218
218
|
*
|
|
219
219
|
* @label WITHOUT_ATTRIBUTES
|
|
220
220
|
* @param name Name of the element.
|
|
221
|
-
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~
|
|
221
|
+
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
222
222
|
*/
|
|
223
|
-
insertElement(name: string, itemOrPosition:
|
|
223
|
+
insertElement(name: string, itemOrPosition: ModelItem | ModelDocumentFragment | ModelPosition, offset?: ModelPositionOffset): void;
|
|
224
224
|
/**
|
|
225
225
|
* Creates and inserts element with specified attributes on given position.
|
|
226
226
|
*
|
|
@@ -245,9 +245,9 @@ export default class Writer {
|
|
|
245
245
|
* @label WITH_ATTRIBUTES
|
|
246
246
|
* @param name Name of the element.
|
|
247
247
|
* @param attributes Elements attributes.
|
|
248
|
-
* @param offset Offset or one of the flags. Used only when third parameter is a {@link module:engine/model/item~
|
|
248
|
+
* @param offset Offset or one of the flags. Used only when third parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
249
249
|
*/
|
|
250
|
-
insertElement(name: string, attributes:
|
|
250
|
+
insertElement(name: string, attributes: ModelNodeAttributes, itemOrPosition: ModelItem | ModelDocumentFragment | ModelPosition, offset?: ModelPositionOffset): void;
|
|
251
251
|
/**
|
|
252
252
|
* Inserts item at the end of the given parent.
|
|
253
253
|
*
|
|
@@ -258,12 +258,12 @@ export default class Writer {
|
|
|
258
258
|
*
|
|
259
259
|
* Note that if the item already has parent it will be removed from the previous parent.
|
|
260
260
|
*
|
|
261
|
-
* If you want to move {@link module:engine/model/range~
|
|
262
|
-
* {@link module:engine/model/item~
|
|
261
|
+
* If you want to move {@link module:engine/model/range~ModelRange range} instead of an
|
|
262
|
+
* {@link module:engine/model/item~ModelItem item} use {@link module:engine/model/writer~ModelWriter#move `Writer#move()`}.
|
|
263
263
|
*
|
|
264
264
|
* @param item Item or document fragment to insert.
|
|
265
265
|
*/
|
|
266
|
-
append(item:
|
|
266
|
+
append(item: ModelItem | ModelDocumentFragment, parent: ModelElement | ModelDocumentFragment): void;
|
|
267
267
|
/**
|
|
268
268
|
* Creates text node and inserts it at the end of the parent.
|
|
269
269
|
*
|
|
@@ -274,7 +274,7 @@ export default class Writer {
|
|
|
274
274
|
* @label WITHOUT_ATTRIBUTES
|
|
275
275
|
* @param text Text data.
|
|
276
276
|
*/
|
|
277
|
-
appendText(text: string, parent:
|
|
277
|
+
appendText(text: string, parent: ModelElement | ModelDocumentFragment): void;
|
|
278
278
|
/**
|
|
279
279
|
* Creates text node with specified attributes and inserts it at the end of the parent.
|
|
280
280
|
*
|
|
@@ -286,7 +286,7 @@ export default class Writer {
|
|
|
286
286
|
* @param text Text data.
|
|
287
287
|
* @param attributes Text attributes.
|
|
288
288
|
*/
|
|
289
|
-
appendText(text: string, attributes:
|
|
289
|
+
appendText(text: string, attributes: ModelNodeAttributes, parent: ModelElement | ModelDocumentFragment): void;
|
|
290
290
|
/**
|
|
291
291
|
* Creates element and inserts it at the end of the parent.
|
|
292
292
|
*
|
|
@@ -297,7 +297,7 @@ export default class Writer {
|
|
|
297
297
|
* @label WITHOUT_ATTRIBUTES
|
|
298
298
|
* @param name Name of the element.
|
|
299
299
|
*/
|
|
300
|
-
appendElement(name: string, parent:
|
|
300
|
+
appendElement(name: string, parent: ModelElement | ModelDocumentFragment): void;
|
|
301
301
|
/**
|
|
302
302
|
* Creates element with specified attributes and inserts it at the end of the parent.
|
|
303
303
|
*
|
|
@@ -309,19 +309,19 @@ export default class Writer {
|
|
|
309
309
|
* @param name Name of the element.
|
|
310
310
|
* @param attributes Elements attributes.
|
|
311
311
|
*/
|
|
312
|
-
appendElement(name: string, attributes:
|
|
312
|
+
appendElement(name: string, attributes: ModelNodeAttributes, parent: ModelElement | ModelDocumentFragment): void;
|
|
313
313
|
/**
|
|
314
|
-
* Sets value of the attribute with given key on a {@link module:engine/model/item~
|
|
315
|
-
* or on a {@link module:engine/model/range~
|
|
314
|
+
* Sets value of the attribute with given key on a {@link module:engine/model/item~ModelItem model item}
|
|
315
|
+
* or on a {@link module:engine/model/range~ModelRange range}.
|
|
316
316
|
*
|
|
317
317
|
* @param key Attribute key.
|
|
318
318
|
* @param value Attribute new value.
|
|
319
319
|
* @param itemOrRange Model item or range on which the attribute will be set.
|
|
320
320
|
*/
|
|
321
|
-
setAttribute(key: string, value: unknown, itemOrRange:
|
|
321
|
+
setAttribute(key: string, value: unknown, itemOrRange: ModelItem | ModelRange): void;
|
|
322
322
|
/**
|
|
323
|
-
* Sets values of attributes on a {@link module:engine/model/item~
|
|
324
|
-
* or on a {@link module:engine/model/range~
|
|
323
|
+
* Sets values of attributes on a {@link module:engine/model/item~ModelItem model item}
|
|
324
|
+
* or on a {@link module:engine/model/range~ModelRange range}.
|
|
325
325
|
*
|
|
326
326
|
* ```ts
|
|
327
327
|
* writer.setAttributes( {
|
|
@@ -333,21 +333,21 @@ export default class Writer {
|
|
|
333
333
|
* @param attributes Attributes keys and values.
|
|
334
334
|
* @param itemOrRange Model item or range on which the attributes will be set.
|
|
335
335
|
*/
|
|
336
|
-
setAttributes(attributes:
|
|
336
|
+
setAttributes(attributes: ModelNodeAttributes, itemOrRange: ModelItem | ModelRange): void;
|
|
337
337
|
/**
|
|
338
|
-
* Removes an attribute with given key from a {@link module:engine/model/item~
|
|
339
|
-
* or from a {@link module:engine/model/range~
|
|
338
|
+
* Removes an attribute with given key from a {@link module:engine/model/item~ModelItem model item}
|
|
339
|
+
* or from a {@link module:engine/model/range~ModelRange range}.
|
|
340
340
|
*
|
|
341
341
|
* @param key Attribute key.
|
|
342
342
|
* @param itemOrRange Model item or range from which the attribute will be removed.
|
|
343
343
|
*/
|
|
344
|
-
removeAttribute(key: string, itemOrRange:
|
|
344
|
+
removeAttribute(key: string, itemOrRange: ModelItem | ModelRange): void;
|
|
345
345
|
/**
|
|
346
346
|
* Removes all attributes from all elements in the range or from the given item.
|
|
347
347
|
*
|
|
348
348
|
* @param itemOrRange Model item or range from which all attributes will be removed.
|
|
349
349
|
*/
|
|
350
|
-
clearAttributes(itemOrRange:
|
|
350
|
+
clearAttributes(itemOrRange: ModelItem | ModelRange): void;
|
|
351
351
|
/**
|
|
352
352
|
* Moves all items in the source range to the target position.
|
|
353
353
|
*
|
|
@@ -370,20 +370,20 @@ export default class Writer {
|
|
|
370
370
|
* These parameters work the same way as {@link #createPositionAt `writer.createPositionAt()`}.
|
|
371
371
|
*
|
|
372
372
|
* Note that items can be moved only within the same tree. It means that you can move items within the same root
|
|
373
|
-
* (element or document fragment) or between {@link module:engine/model/document~
|
|
373
|
+
* (element or document fragment) or between {@link module:engine/model/document~ModelDocument#roots documents roots},
|
|
374
374
|
* but you cannot move items from document fragment to the document or from one detached element to another. Use
|
|
375
|
-
* {@link module:engine/model/writer~
|
|
375
|
+
* {@link module:engine/model/writer~ModelWriter#insert} in such cases.
|
|
376
376
|
*
|
|
377
377
|
* @param range Source range.
|
|
378
|
-
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~
|
|
378
|
+
* @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
379
379
|
*/
|
|
380
|
-
move(range:
|
|
380
|
+
move(range: ModelRange, itemOrPosition: ModelItem | ModelPosition, offset?: ModelPositionOffset): void;
|
|
381
381
|
/**
|
|
382
|
-
* Removes given model {@link module:engine/model/item~
|
|
382
|
+
* Removes given model {@link module:engine/model/item~ModelItem item} or {@link module:engine/model/range~ModelRange range}.
|
|
383
383
|
*
|
|
384
384
|
* @param itemOrRange Model item or range to remove.
|
|
385
385
|
*/
|
|
386
|
-
remove(itemOrRange:
|
|
386
|
+
remove(itemOrRange: ModelItem | ModelRange): void;
|
|
387
387
|
/**
|
|
388
388
|
* Merges two siblings at the given position.
|
|
389
389
|
*
|
|
@@ -392,68 +392,68 @@ export default class Writer {
|
|
|
392
392
|
*
|
|
393
393
|
* @param position Position between merged elements.
|
|
394
394
|
*/
|
|
395
|
-
merge(position:
|
|
395
|
+
merge(position: ModelPosition): void;
|
|
396
396
|
/**
|
|
397
397
|
* Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.
|
|
398
398
|
*
|
|
399
399
|
* @param root Root of the position.
|
|
400
|
-
* @param path Position path. See {@link module:engine/model/position~
|
|
401
|
-
* @param stickiness Position stickiness. See {@link module:engine/model/position~
|
|
400
|
+
* @param path Position path. See {@link module:engine/model/position~ModelPosition#path}.
|
|
401
|
+
* @param stickiness Position stickiness. See {@link module:engine/model/position~ModelPositionStickiness}.
|
|
402
402
|
*/
|
|
403
|
-
createPositionFromPath(root:
|
|
403
|
+
createPositionFromPath(root: ModelElement | ModelDocumentFragment, path: ReadonlyArray<number>, stickiness?: ModelPositionStickiness): ModelPosition;
|
|
404
404
|
/**
|
|
405
405
|
* Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.
|
|
406
406
|
*
|
|
407
|
-
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~
|
|
407
|
+
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
408
408
|
*/
|
|
409
|
-
createPositionAt(itemOrPosition:
|
|
409
|
+
createPositionAt(itemOrPosition: ModelItem | ModelPosition | ModelDocumentFragment, offset?: ModelPositionOffset): ModelPosition;
|
|
410
410
|
/**
|
|
411
411
|
* Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.
|
|
412
412
|
*
|
|
413
413
|
* @param item Item after which the position should be placed.
|
|
414
414
|
*/
|
|
415
|
-
createPositionAfter(item:
|
|
415
|
+
createPositionAfter(item: ModelItem): ModelPosition;
|
|
416
416
|
/**
|
|
417
417
|
* Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.
|
|
418
418
|
*
|
|
419
419
|
* @param item Item after which the position should be placed.
|
|
420
420
|
*/
|
|
421
|
-
createPositionBefore(item:
|
|
421
|
+
createPositionBefore(item: ModelItem): ModelPosition;
|
|
422
422
|
/**
|
|
423
423
|
* Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.
|
|
424
424
|
*
|
|
425
425
|
* @param start Start position.
|
|
426
426
|
* @param end End position. If not set, range will be collapsed at `start` position.
|
|
427
427
|
*/
|
|
428
|
-
createRange(start:
|
|
428
|
+
createRange(start: ModelPosition, end?: ModelPosition): ModelRange;
|
|
429
429
|
/**
|
|
430
430
|
* Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.
|
|
431
431
|
*
|
|
432
432
|
* @param element Element which is a parent for the range.
|
|
433
433
|
*/
|
|
434
|
-
createRangeIn(element:
|
|
434
|
+
createRangeIn(element: ModelElement | ModelDocumentFragment): ModelRange;
|
|
435
435
|
/**
|
|
436
436
|
* Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.
|
|
437
437
|
*
|
|
438
438
|
* @param element Element which is a parent for the range.
|
|
439
439
|
*/
|
|
440
|
-
createRangeOn(element:
|
|
440
|
+
createRangeOn(element: ModelItem): ModelRange;
|
|
441
441
|
/**
|
|
442
442
|
* Shortcut for {@link module:engine/model/model~Model#createSelection:NODE_OFFSET `Model#createSelection()`}.
|
|
443
443
|
*
|
|
444
444
|
* @label NODE_OFFSET
|
|
445
445
|
*/
|
|
446
|
-
createSelection(selectable:
|
|
446
|
+
createSelection(selectable: ModelNode, placeOrOffset: ModelPlaceOrOffset, options?: {
|
|
447
447
|
backward?: boolean;
|
|
448
|
-
}):
|
|
448
|
+
}): ModelSelection;
|
|
449
449
|
/**
|
|
450
450
|
* Shortcut for {@link module:engine/model/model~Model#createSelection:SELECTABLE `Model#createSelection()`}.
|
|
451
451
|
*
|
|
452
452
|
* @label SELECTABLE
|
|
453
453
|
*/
|
|
454
|
-
createSelection(selectable?: Exclude<
|
|
454
|
+
createSelection(selectable?: Exclude<ModelSelectable, ModelNode>, options?: {
|
|
455
455
|
backward?: boolean;
|
|
456
|
-
}):
|
|
456
|
+
}): ModelSelection;
|
|
457
457
|
/**
|
|
458
458
|
* Performs merge action in a detached tree.
|
|
459
459
|
*
|
|
@@ -472,7 +472,7 @@ export default class Writer {
|
|
|
472
472
|
* @param element The element to rename.
|
|
473
473
|
* @param newName New element name.
|
|
474
474
|
*/
|
|
475
|
-
rename(element:
|
|
475
|
+
rename(element: ModelElement | ModelDocumentFragment, newName: string): void;
|
|
476
476
|
/**
|
|
477
477
|
* Splits elements starting from the given position and going to the top of the model tree as long as given
|
|
478
478
|
* `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.
|
|
@@ -486,27 +486,27 @@ export default class Writer {
|
|
|
486
486
|
* * `position` - Position between split elements.
|
|
487
487
|
* * `range` - Range that stars from the end of the first split element and ends at the beginning of the first copy element.
|
|
488
488
|
*/
|
|
489
|
-
split(position:
|
|
490
|
-
position:
|
|
491
|
-
range:
|
|
489
|
+
split(position: ModelPosition, limitElement?: ModelNode | ModelDocumentFragment): {
|
|
490
|
+
position: ModelPosition;
|
|
491
|
+
range: ModelRange;
|
|
492
492
|
};
|
|
493
493
|
/**
|
|
494
494
|
* Wraps the given range with the given element or with a new element (if a string was passed).
|
|
495
495
|
*
|
|
496
|
-
* **Note:** range to wrap should be a "flat range" (see {@link module:engine/model/range~
|
|
496
|
+
* **Note:** range to wrap should be a "flat range" (see {@link module:engine/model/range~ModelRange#isFlat `Range#isFlat`}).
|
|
497
497
|
* If not, an error will be thrown.
|
|
498
498
|
*
|
|
499
499
|
* @param range Range to wrap.
|
|
500
500
|
* @param elementOrString Element or name of element to wrap the range with.
|
|
501
501
|
*/
|
|
502
|
-
wrap(range:
|
|
502
|
+
wrap(range: ModelRange, elementOrString: ModelElement | string): void;
|
|
503
503
|
/**
|
|
504
504
|
* Unwraps children of the given element – all its children are moved before it and then the element is removed.
|
|
505
505
|
* Throws error if you try to unwrap an element which does not have a parent.
|
|
506
506
|
*
|
|
507
507
|
* @param element Element to unwrap.
|
|
508
508
|
*/
|
|
509
|
-
unwrap(element:
|
|
509
|
+
unwrap(element: ModelElement): void;
|
|
510
510
|
/**
|
|
511
511
|
* Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
|
|
512
512
|
* changes in the document and updates its range automatically, when model tree changes.
|
|
@@ -520,8 +520,8 @@ export default class Writer {
|
|
|
520
520
|
* The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
|
|
521
521
|
* `true` when the marker change changes the data returned by the
|
|
522
522
|
* {@link module:core/editor/editor~Editor#getData `editor.getData()`} method.
|
|
523
|
-
* When set to `true` it fires the {@link module:engine/model/document~
|
|
524
|
-
* When set to `false` it fires the {@link module:engine/model/document~
|
|
523
|
+
* When set to `true` it fires the {@link module:engine/model/document~ModelDocument#event:change:data `change:data`} event.
|
|
524
|
+
* When set to `false` it fires the {@link module:engine/model/document~ModelDocument#event:change `change`} event.
|
|
525
525
|
*
|
|
526
526
|
* Create marker directly base on marker's name:
|
|
527
527
|
*
|
|
@@ -554,7 +554,7 @@ export default class Writer {
|
|
|
554
554
|
addMarker(name: string, options: {
|
|
555
555
|
usingOperation: boolean;
|
|
556
556
|
affectsData?: boolean;
|
|
557
|
-
range:
|
|
557
|
+
range: ModelRange;
|
|
558
558
|
}): Marker;
|
|
559
559
|
/**
|
|
560
560
|
* Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
|
|
@@ -564,7 +564,8 @@ export default class Writer {
|
|
|
564
564
|
* As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique
|
|
565
565
|
* name is created and returned.
|
|
566
566
|
*
|
|
567
|
-
* **Note**: If you want to change the {@link module:engine/view/element~
|
|
567
|
+
* **Note**: If you want to change the {@link module:engine/view/element~ViewElement view element}
|
|
568
|
+
* of the marker while its data in the model
|
|
568
569
|
* remains the same, use the dedicated {@link module:engine/controller/editingcontroller~EditingController#reconvertMarker} method.
|
|
569
570
|
*
|
|
570
571
|
* The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See
|
|
@@ -574,8 +575,8 @@ export default class Writer {
|
|
|
574
575
|
* The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
|
|
575
576
|
* `true` when the marker change changes the data returned by
|
|
576
577
|
* the {@link module:core/editor/editor~Editor#getData `editor.getData()`} method.
|
|
577
|
-
* When set to `true` it fires the {@link module:engine/model/document~
|
|
578
|
-
* When set to `false` it fires the {@link module:engine/model/document~
|
|
578
|
+
* When set to `true` it fires the {@link module:engine/model/document~ModelDocument#event:change:data `change:data`} event.
|
|
579
|
+
* When set to `false` it fires the {@link module:engine/model/document~ModelDocument#event:change `change`} event.
|
|
579
580
|
*
|
|
580
581
|
* Update marker directly base on marker's name:
|
|
581
582
|
*
|
|
@@ -612,7 +613,7 @@ export default class Writer {
|
|
|
612
613
|
* @param options.affectsData Flag indicating that the marker changes the editor data.
|
|
613
614
|
*/
|
|
614
615
|
updateMarker(markerOrName: string | Marker, options?: {
|
|
615
|
-
range?:
|
|
616
|
+
range?: ModelRange;
|
|
616
617
|
usingOperation?: boolean;
|
|
617
618
|
affectsData?: boolean;
|
|
618
619
|
}): void;
|
|
@@ -634,7 +635,7 @@ export default class Writer {
|
|
|
634
635
|
* (e.g. `$block` elements are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.
|
|
635
636
|
* @returns The added root element.
|
|
636
637
|
*/
|
|
637
|
-
addRoot(rootName: string, elementName?: string):
|
|
638
|
+
addRoot(rootName: string, elementName?: string): ModelRootElement;
|
|
638
639
|
/**
|
|
639
640
|
* Detaches the root from the document.
|
|
640
641
|
*
|
|
@@ -650,24 +651,24 @@ export default class Writer {
|
|
|
650
651
|
*
|
|
651
652
|
* @param rootOrName Name of the detached root.
|
|
652
653
|
*/
|
|
653
|
-
detachRoot(rootOrName: string |
|
|
654
|
+
detachRoot(rootOrName: string | ModelRootElement): void;
|
|
654
655
|
/**
|
|
655
656
|
* Sets the document's selection (ranges and direction) to the specified location based on the given
|
|
656
|
-
* {@link module:engine/model/selection~
|
|
657
|
+
* {@link module:engine/model/selection~ModelSelectable selectable} or creates an empty selection if no arguments were passed.
|
|
657
658
|
*
|
|
658
659
|
* ```ts
|
|
659
660
|
* // Sets collapsed selection at the position of the given node and an offset.
|
|
660
661
|
* writer.setSelection( paragraph, offset );
|
|
661
662
|
* ```
|
|
662
663
|
*
|
|
663
|
-
* Creates a range inside an {@link module:engine/model/element~
|
|
664
|
+
* Creates a range inside an {@link module:engine/model/element~ModelElement element} which starts before the first child of
|
|
664
665
|
* that element and ends after the last child of that element.
|
|
665
666
|
*
|
|
666
667
|
* ```ts
|
|
667
668
|
* writer.setSelection( paragraph, 'in' );
|
|
668
669
|
* ```
|
|
669
670
|
*
|
|
670
|
-
* Creates a range on an {@link module:engine/model/item~
|
|
671
|
+
* Creates a range on an {@link module:engine/model/item~ModelItem item} which starts before the item and ends just after the item.
|
|
671
672
|
*
|
|
672
673
|
* ```ts
|
|
673
674
|
* writer.setSelection( paragraph, 'on' );
|
|
@@ -686,12 +687,12 @@ export default class Writer {
|
|
|
686
687
|
*
|
|
687
688
|
* @label NODE_OFFSET
|
|
688
689
|
*/
|
|
689
|
-
setSelection(selectable:
|
|
690
|
+
setSelection(selectable: ModelNode, placeOrOffset: ModelPlaceOrOffset, options?: {
|
|
690
691
|
backward?: boolean;
|
|
691
692
|
}): void;
|
|
692
693
|
/**
|
|
693
694
|
* Sets the document's selection (ranges and direction) to the specified location based on the given
|
|
694
|
-
* {@link module:engine/model/selection~
|
|
695
|
+
* {@link module:engine/model/selection~ModelSelectable selectable} or creates an empty selection if no arguments were passed.
|
|
695
696
|
*
|
|
696
697
|
* ```ts
|
|
697
698
|
* // Sets selection to the given range.
|
|
@@ -731,19 +732,19 @@ export default class Writer {
|
|
|
731
732
|
*
|
|
732
733
|
* @label SELECTABLE
|
|
733
734
|
*/
|
|
734
|
-
setSelection(selectable: Exclude<
|
|
735
|
+
setSelection(selectable: Exclude<ModelSelectable, ModelNode>, options?: {
|
|
735
736
|
backward?: boolean;
|
|
736
737
|
}): void;
|
|
737
738
|
/**
|
|
738
|
-
* Moves {@link module:engine/model/documentselection~
|
|
739
|
+
* Moves {@link module:engine/model/documentselection~ModelDocumentSelection#focus} to the specified location.
|
|
739
740
|
*
|
|
740
741
|
* The location can be specified in the same form as
|
|
741
742
|
* {@link #createPositionAt `writer.createPositionAt()`} parameters.
|
|
742
743
|
*
|
|
743
744
|
* @param itemOrPosition
|
|
744
|
-
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~
|
|
745
|
+
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
745
746
|
*/
|
|
746
|
-
setSelectionFocus(itemOrPosition:
|
|
747
|
+
setSelectionFocus(itemOrPosition: ModelItem | ModelPosition, offset?: ModelPositionOffset): void;
|
|
747
748
|
/**
|
|
748
749
|
* Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
|
|
749
750
|
*
|
|
@@ -774,7 +775,7 @@ export default class Writer {
|
|
|
774
775
|
* @label OBJECT
|
|
775
776
|
* @param objectOrIterable Object / iterable of key => value attribute pairs.
|
|
776
777
|
*/
|
|
777
|
-
setSelectionAttribute(objectOrIterable:
|
|
778
|
+
setSelectionAttribute(objectOrIterable: ModelNodeAttributes): void;
|
|
778
779
|
/**
|
|
779
780
|
* Removes attribute(s) with given key(s) from the selection.
|
|
780
781
|
*
|
|
@@ -794,7 +795,7 @@ export default class Writer {
|
|
|
794
795
|
*/
|
|
795
796
|
removeSelectionAttribute(keyOrIterableOfKeys: string | Iterable<string>): void;
|
|
796
797
|
/**
|
|
797
|
-
* Temporarily changes the {@link module:engine/model/documentselection~
|
|
798
|
+
* Temporarily changes the {@link module:engine/model/documentselection~ModelDocumentSelection#isGravityOverridden gravity}
|
|
798
799
|
* of the selection from left to right.
|
|
799
800
|
*
|
|
800
801
|
* The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,
|
|
@@ -817,13 +818,13 @@ export default class Writer {
|
|
|
817
818
|
*/
|
|
818
819
|
overrideSelectionGravity(): string;
|
|
819
820
|
/**
|
|
820
|
-
* Restores {@link ~
|
|
821
|
+
* Restores {@link ~ModelWriter#overrideSelectionGravity} gravity to default.
|
|
821
822
|
*
|
|
822
823
|
* Restoring the gravity is only possible using the unique identifier returned by
|
|
823
|
-
* {@link ~
|
|
824
|
+
* {@link ~ModelWriter#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored
|
|
824
825
|
* the same number of times it was overridden.
|
|
825
826
|
*
|
|
826
|
-
* @param uid The unique id returned by {@link ~
|
|
827
|
+
* @param uid The unique id returned by {@link ~ModelWriter#overrideSelectionGravity}.
|
|
827
828
|
*/
|
|
828
829
|
restoreSelectionGravity(uid: string): void;
|
|
829
830
|
/**
|