@ckeditor/ckeditor5-engine 45.2.1 → 46.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +96 -91
- 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/range.d.ts
CHANGED
|
@@ -5,56 +5,56 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/range
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import type
|
|
12
|
-
import type
|
|
13
|
-
import type
|
|
14
|
-
import type InsertOperation from './operation/insertoperation.js';
|
|
15
|
-
import type
|
|
16
|
-
import type MergeOperation from './operation/mergeoperation.js';
|
|
17
|
-
import type MoveOperation from './operation/moveoperation.js';
|
|
18
|
-
import type Operation from './operation/operation.js';
|
|
19
|
-
import type SplitOperation from './operation/splitoperation.js';
|
|
8
|
+
import { ModelTypeCheckable } from './typecheckable.js';
|
|
9
|
+
import { ModelPosition } from './position.js';
|
|
10
|
+
import { ModelTreeWalker, type ModelTreeWalkerOptions, type ModelTreeWalkerValue } from './treewalker.js';
|
|
11
|
+
import { type ModelDocument } from './document.js';
|
|
12
|
+
import { type ModelDocumentFragment } from './documentfragment.js';
|
|
13
|
+
import { type ModelElement } from './element.js';
|
|
14
|
+
import { type InsertOperation } from './operation/insertoperation.js';
|
|
15
|
+
import { type ModelItem } from './item.js';
|
|
16
|
+
import { type MergeOperation } from './operation/mergeoperation.js';
|
|
17
|
+
import { type MoveOperation } from './operation/moveoperation.js';
|
|
18
|
+
import { type Operation } from './operation/operation.js';
|
|
19
|
+
import { type SplitOperation } from './operation/splitoperation.js';
|
|
20
20
|
/**
|
|
21
21
|
* Represents a range in the model tree.
|
|
22
22
|
*
|
|
23
|
-
* A range is defined by its {@link module:engine/model/range~
|
|
23
|
+
* A range is defined by its {@link module:engine/model/range~ModelRange#start} and {@link module:engine/model/range~ModelRange#end}
|
|
24
24
|
* positions.
|
|
25
25
|
*
|
|
26
26
|
* You can create range instances via its constructor or the `createRange*()` factory methods of
|
|
27
|
-
* {@link module:engine/model/model~Model} and {@link module:engine/model/writer~
|
|
27
|
+
* {@link module:engine/model/model~Model} and {@link module:engine/model/writer~ModelWriter}.
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export declare class ModelRange extends ModelTypeCheckable implements Iterable<ModelTreeWalkerValue> {
|
|
30
30
|
/**
|
|
31
31
|
* Start position.
|
|
32
32
|
*/
|
|
33
|
-
readonly start:
|
|
33
|
+
readonly start: ModelPosition;
|
|
34
34
|
/**
|
|
35
35
|
* End position.
|
|
36
36
|
*/
|
|
37
|
-
readonly end:
|
|
37
|
+
readonly end: ModelPosition;
|
|
38
38
|
/**
|
|
39
39
|
* Creates a range spanning from `start` position to `end` position.
|
|
40
40
|
*
|
|
41
41
|
* @param start The start position.
|
|
42
42
|
* @param end The end position. If not set, the range will be collapsed at the `start` position.
|
|
43
43
|
*/
|
|
44
|
-
constructor(start:
|
|
44
|
+
constructor(start: ModelPosition, end?: ModelPosition | null);
|
|
45
45
|
/**
|
|
46
46
|
* Iterable interface.
|
|
47
47
|
*
|
|
48
|
-
* Iterates over all {@link module:engine/model/item~
|
|
49
|
-
* them together with additional information like length or {@link module:engine/model/position~
|
|
50
|
-
* grouped as {@link module:engine/model/treewalker~
|
|
51
|
-
* It iterates over all {@link module:engine/model/textproxy~
|
|
52
|
-
* and all the {@link module:engine/model/element~
|
|
48
|
+
* Iterates over all {@link module:engine/model/item~ModelItem items} that are in this range and returns
|
|
49
|
+
* them together with additional information like length or {@link module:engine/model/position~ModelPosition positions},
|
|
50
|
+
* grouped as {@link module:engine/model/treewalker~ModelTreeWalkerValue}.
|
|
51
|
+
* It iterates over all {@link module:engine/model/textproxy~ModelTextProxy text contents} that are inside the range
|
|
52
|
+
* and all the {@link module:engine/model/element~ModelElement}s that are entered into when iterating over this range.
|
|
53
53
|
*
|
|
54
|
-
* This iterator uses {@link module:engine/model/treewalker~
|
|
54
|
+
* This iterator uses {@link module:engine/model/treewalker~ModelTreeWalker} with `boundaries` set to this range
|
|
55
55
|
* and `ignoreElementEnd` option set to `true`.
|
|
56
56
|
*/
|
|
57
|
-
[Symbol.iterator](): IterableIterator<
|
|
57
|
+
[Symbol.iterator](): IterableIterator<ModelTreeWalkerValue>;
|
|
58
58
|
/**
|
|
59
59
|
* Describes whether the range is collapsed, that is if {@link #start} and
|
|
60
60
|
* {@link #end} positions are equal.
|
|
@@ -62,52 +62,52 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
62
62
|
get isCollapsed(): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* Describes whether this range is flat, that is if {@link #start} position and
|
|
65
|
-
* {@link #end} position are in the same {@link module:engine/model/position~
|
|
65
|
+
* {@link #end} position are in the same {@link module:engine/model/position~ModelPosition#parent}.
|
|
66
66
|
*/
|
|
67
67
|
get isFlat(): boolean;
|
|
68
68
|
/**
|
|
69
69
|
* Range root element.
|
|
70
70
|
*/
|
|
71
|
-
get root():
|
|
71
|
+
get root(): ModelElement | ModelDocumentFragment;
|
|
72
72
|
/**
|
|
73
|
-
* Checks whether this range contains given {@link module:engine/model/position~
|
|
73
|
+
* Checks whether this range contains given {@link module:engine/model/position~ModelPosition position}.
|
|
74
74
|
*
|
|
75
75
|
* @param position Position to check.
|
|
76
|
-
* @returns `true` if given {@link module:engine/model/position~
|
|
76
|
+
* @returns `true` if given {@link module:engine/model/position~ModelPosition position} is contained
|
|
77
77
|
* in this range,`false` otherwise.
|
|
78
78
|
*/
|
|
79
|
-
containsPosition(position:
|
|
79
|
+
containsPosition(position: ModelPosition): boolean;
|
|
80
80
|
/**
|
|
81
|
-
* Checks whether this range contains given {@link ~
|
|
81
|
+
* Checks whether this range contains given {@link ~ModelRange range}.
|
|
82
82
|
*
|
|
83
83
|
* @param otherRange Range to check.
|
|
84
84
|
* @param loose Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
|
|
85
85
|
* start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
|
|
86
86
|
* even be equal to this range. Note that collapsed ranges are always compared in strict mode.
|
|
87
|
-
* @returns {Boolean} `true` if given {@link ~
|
|
87
|
+
* @returns {Boolean} `true` if given {@link ~ModelRange range} boundaries are contained by this range, `false` otherwise.
|
|
88
88
|
*/
|
|
89
|
-
containsRange(otherRange:
|
|
89
|
+
containsRange(otherRange: ModelRange, loose?: boolean): boolean;
|
|
90
90
|
/**
|
|
91
|
-
* Checks whether given {@link module:engine/model/item~
|
|
91
|
+
* Checks whether given {@link module:engine/model/item~ModelItem} is inside this range.
|
|
92
92
|
*/
|
|
93
|
-
containsItem(item:
|
|
93
|
+
containsItem(item: ModelItem): boolean;
|
|
94
94
|
/**
|
|
95
95
|
* Two ranges are equal if their {@link #start} and {@link #end} positions are equal.
|
|
96
96
|
*
|
|
97
97
|
* @param otherRange Range to compare with.
|
|
98
98
|
* @returns `true` if ranges are equal, `false` otherwise.
|
|
99
99
|
*/
|
|
100
|
-
isEqual(otherRange:
|
|
100
|
+
isEqual(otherRange: ModelRange): boolean;
|
|
101
101
|
/**
|
|
102
102
|
* Checks and returns whether this range intersects with given range.
|
|
103
103
|
*
|
|
104
104
|
* @param otherRange Range to compare with.
|
|
105
105
|
* @returns `true` if ranges intersect, `false` otherwise.
|
|
106
106
|
*/
|
|
107
|
-
isIntersecting(otherRange:
|
|
107
|
+
isIntersecting(otherRange: ModelRange): boolean;
|
|
108
108
|
/**
|
|
109
|
-
* Computes which part(s) of this {@link ~
|
|
110
|
-
* Returned array contains zero, one or two {@link ~
|
|
109
|
+
* Computes which part(s) of this {@link ~ModelRange range} is not a part of given {@link ~ModelRange range}.
|
|
110
|
+
* Returned array contains zero, one or two {@link ~ModelRange ranges}.
|
|
111
111
|
*
|
|
112
112
|
* Examples:
|
|
113
113
|
*
|
|
@@ -132,9 +132,9 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
132
132
|
* @param otherRange Range to differentiate against.
|
|
133
133
|
* @returns The difference between ranges.
|
|
134
134
|
*/
|
|
135
|
-
getDifference(otherRange:
|
|
135
|
+
getDifference(otherRange: ModelRange): Array<ModelRange>;
|
|
136
136
|
/**
|
|
137
|
-
* Returns an intersection of this {@link ~
|
|
137
|
+
* Returns an intersection of this {@link ~ModelRange range} and given {@link ~ModelRange range}.
|
|
138
138
|
* Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
|
|
139
139
|
*
|
|
140
140
|
* Examples:
|
|
@@ -154,9 +154,9 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
154
154
|
* @param otherRange Range to check for intersection.
|
|
155
155
|
* @returns A common part of given ranges or `null` if ranges have no common part.
|
|
156
156
|
*/
|
|
157
|
-
getIntersection(otherRange:
|
|
157
|
+
getIntersection(otherRange: ModelRange): ModelRange | null;
|
|
158
158
|
/**
|
|
159
|
-
* Returns a range created by joining this {@link ~
|
|
159
|
+
* Returns a range created by joining this {@link ~ModelRange range} with the given {@link ~ModelRange range}.
|
|
160
160
|
* If ranges have no common part, returns `null`.
|
|
161
161
|
*
|
|
162
162
|
* Examples:
|
|
@@ -182,10 +182,10 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
182
182
|
* @param otherRange Range to be joined.
|
|
183
183
|
* @param loose Whether the intersection check is loose or strict. If the check is strict (`false`),
|
|
184
184
|
* ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),
|
|
185
|
-
* compared range is also checked if it's {@link module:engine/model/position~
|
|
185
|
+
* compared range is also checked if it's {@link module:engine/model/position~ModelPosition#isTouching touching} current range.
|
|
186
186
|
* @returns A sum of given ranges or `null` if ranges have no common part.
|
|
187
187
|
*/
|
|
188
|
-
getJoined(otherRange:
|
|
188
|
+
getJoined(otherRange: ModelRange, loose?: boolean): ModelRange | null;
|
|
189
189
|
/**
|
|
190
190
|
* Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.
|
|
191
191
|
*
|
|
@@ -221,7 +221,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
221
221
|
* ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = "se"
|
|
222
222
|
* ```
|
|
223
223
|
*
|
|
224
|
-
* **Note:** if an {@link module:engine/model/element~
|
|
224
|
+
* **Note:** if an {@link module:engine/model/element~ModelElement element} is not wholly contained in this range, it won't be returned
|
|
225
225
|
* in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range
|
|
226
226
|
* were omitted. Only their parts that were wholly in the range were returned.
|
|
227
227
|
*
|
|
@@ -229,9 +229,9 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
229
229
|
*
|
|
230
230
|
* @returns Array of flat ranges covering this range.
|
|
231
231
|
*/
|
|
232
|
-
getMinimalFlatRanges(): Array<
|
|
232
|
+
getMinimalFlatRanges(): Array<ModelRange>;
|
|
233
233
|
/**
|
|
234
|
-
* Creates a {@link module:engine/model/treewalker~
|
|
234
|
+
* Creates a {@link module:engine/model/treewalker~ModelTreeWalker TreeWalker} instance with this range as a boundary.
|
|
235
235
|
*
|
|
236
236
|
* For example, to iterate over all items in the entire document root:
|
|
237
237
|
*
|
|
@@ -245,36 +245,36 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
245
245
|
* }
|
|
246
246
|
* ```
|
|
247
247
|
*
|
|
248
|
-
* @param options Object with configuration options. See {@link module:engine/model/treewalker~
|
|
248
|
+
* @param options Object with configuration options. See {@link module:engine/model/treewalker~ModelTreeWalker}.
|
|
249
249
|
*/
|
|
250
|
-
getWalker(options?:
|
|
250
|
+
getWalker(options?: ModelTreeWalkerOptions): ModelTreeWalker;
|
|
251
251
|
/**
|
|
252
|
-
* Returns an iterator that iterates over all {@link module:engine/model/item~
|
|
252
|
+
* Returns an iterator that iterates over all {@link module:engine/model/item~ModelItem items} that are in this range and returns
|
|
253
253
|
* them.
|
|
254
254
|
*
|
|
255
|
-
* This method uses {@link module:engine/model/treewalker~
|
|
256
|
-
* set to `true`. However it returns only {@link module:engine/model/item~
|
|
257
|
-
* not {@link module:engine/model/treewalker~
|
|
255
|
+
* This method uses {@link module:engine/model/treewalker~ModelTreeWalker} with `boundaries` set to this range and
|
|
256
|
+
* `ignoreElementEnd` option set to `true`. However it returns only {@link module:engine/model/item~ModelItem model items},
|
|
257
|
+
* not {@link module:engine/model/treewalker~ModelTreeWalkerValue}.
|
|
258
258
|
*
|
|
259
|
-
* You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~
|
|
259
|
+
* You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~ModelTreeWalker} for
|
|
260
260
|
* a full list of available options.
|
|
261
261
|
*
|
|
262
|
-
* @param options Object with configuration options. See {@link module:engine/model/treewalker~
|
|
262
|
+
* @param options Object with configuration options. See {@link module:engine/model/treewalker~ModelTreeWalker}.
|
|
263
263
|
*/
|
|
264
|
-
getItems(options?:
|
|
264
|
+
getItems(options?: ModelTreeWalkerOptions): IterableIterator<ModelItem>;
|
|
265
265
|
/**
|
|
266
|
-
* Returns an iterator that iterates over all {@link module:engine/model/position~
|
|
266
|
+
* Returns an iterator that iterates over all {@link module:engine/model/position~ModelPosition positions} that are boundaries or
|
|
267
267
|
* contained in this range.
|
|
268
268
|
*
|
|
269
|
-
* This method uses {@link module:engine/model/treewalker~
|
|
270
|
-
* {@link module:engine/model/position~
|
|
269
|
+
* This method uses {@link module:engine/model/treewalker~ModelTreeWalker} with `boundaries` set to this range. However it returns only
|
|
270
|
+
* {@link module:engine/model/position~ModelPosition positions}, not {@link module:engine/model/treewalker~ModelTreeWalkerValue}.
|
|
271
271
|
*
|
|
272
|
-
* You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~
|
|
272
|
+
* You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~ModelTreeWalker} for
|
|
273
273
|
* a full list of available options.
|
|
274
274
|
*
|
|
275
|
-
* @param options Object with configuration options. See {@link module:engine/model/treewalker~
|
|
275
|
+
* @param options Object with configuration options. See {@link module:engine/model/treewalker~ModelTreeWalker}.
|
|
276
276
|
*/
|
|
277
|
-
getPositions(options?:
|
|
277
|
+
getPositions(options?: ModelTreeWalkerOptions): IterableIterator<ModelPosition>;
|
|
278
278
|
/**
|
|
279
279
|
* Returns a range that is a result of transforming this range by given `operation`.
|
|
280
280
|
*
|
|
@@ -285,26 +285,26 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
285
285
|
* @param operation Operation to transform range by.
|
|
286
286
|
* @returns Range which is the result of transformation.
|
|
287
287
|
*/
|
|
288
|
-
getTransformedByOperation(operation: Operation): Array<
|
|
288
|
+
getTransformedByOperation(operation: Operation): Array<ModelRange>;
|
|
289
289
|
/**
|
|
290
290
|
* Returns a range that is a result of transforming this range by multiple `operations`.
|
|
291
291
|
*
|
|
292
|
-
* @see ~
|
|
292
|
+
* @see ~ModelRange#getTransformedByOperation
|
|
293
293
|
* @param operations Operations to transform the range by.
|
|
294
294
|
* @returns Range which is the result of transformation.
|
|
295
295
|
*/
|
|
296
|
-
getTransformedByOperations(operations: Iterable<Operation>): Array<
|
|
296
|
+
getTransformedByOperations(operations: Iterable<Operation>): Array<ModelRange>;
|
|
297
297
|
/**
|
|
298
|
-
* Returns an {@link module:engine/model/element~
|
|
298
|
+
* Returns an {@link module:engine/model/element~ModelElement} or {@link module:engine/model/documentfragment~ModelDocumentFragment}
|
|
299
299
|
* which is a common ancestor of the range's both ends (in which the entire range is contained).
|
|
300
300
|
*/
|
|
301
|
-
getCommonAncestor():
|
|
301
|
+
getCommonAncestor(): ModelElement | ModelDocumentFragment | null;
|
|
302
302
|
/**
|
|
303
|
-
* Returns an {@link module:engine/model/element~
|
|
303
|
+
* Returns an {@link module:engine/model/element~ModelElement Element} contained by the range.
|
|
304
304
|
* The element will be returned when it is the **only** node within the range and **fully–contained**
|
|
305
305
|
* at the same time.
|
|
306
306
|
*/
|
|
307
|
-
getContainedElement():
|
|
307
|
+
getContainedElement(): ModelElement | null;
|
|
308
308
|
/**
|
|
309
309
|
* Converts `Range` to plain object and returns it.
|
|
310
310
|
*
|
|
@@ -322,7 +322,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
322
322
|
*
|
|
323
323
|
* @internal
|
|
324
324
|
*/
|
|
325
|
-
_getTransformedByInsertOperation(operation: InsertOperation, spread?: boolean): Array<
|
|
325
|
+
_getTransformedByInsertOperation(operation: InsertOperation, spread?: boolean): Array<ModelRange>;
|
|
326
326
|
/**
|
|
327
327
|
* Returns a result of transforming a copy of this range by move operation.
|
|
328
328
|
*
|
|
@@ -330,7 +330,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
330
330
|
*
|
|
331
331
|
* @internal
|
|
332
332
|
*/
|
|
333
|
-
_getTransformedByMoveOperation(operation: MoveOperation, spread?: boolean): Array<
|
|
333
|
+
_getTransformedByMoveOperation(operation: MoveOperation, spread?: boolean): Array<ModelRange>;
|
|
334
334
|
/**
|
|
335
335
|
* Returns a result of transforming a copy of this range by split operation.
|
|
336
336
|
*
|
|
@@ -338,7 +338,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
338
338
|
*
|
|
339
339
|
* @internal
|
|
340
340
|
*/
|
|
341
|
-
_getTransformedBySplitOperation(operation: SplitOperation):
|
|
341
|
+
_getTransformedBySplitOperation(operation: SplitOperation): ModelRange;
|
|
342
342
|
/**
|
|
343
343
|
* Returns a result of transforming a copy of this range by merge operation.
|
|
344
344
|
*
|
|
@@ -346,11 +346,11 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
346
346
|
*
|
|
347
347
|
* @internal
|
|
348
348
|
*/
|
|
349
|
-
_getTransformedByMergeOperation(operation: MergeOperation):
|
|
349
|
+
_getTransformedByMergeOperation(operation: MergeOperation): ModelRange;
|
|
350
350
|
/**
|
|
351
|
-
* Returns an array containing one or two {@link ~
|
|
352
|
-
* {@link ~
|
|
353
|
-
* returned if the insertion was inside this {@link ~
|
|
351
|
+
* Returns an array containing one or two {@link ~ModelRange ranges} that are a result of transforming this
|
|
352
|
+
* {@link ~ModelRange range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~ModelRange ranges} are
|
|
353
|
+
* returned if the insertion was inside this {@link ~ModelRange range} and `spread` is set to `true`.
|
|
354
354
|
*
|
|
355
355
|
* Examples:
|
|
356
356
|
*
|
|
@@ -379,10 +379,10 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
379
379
|
* was inside the range. Defaults to `false`.
|
|
380
380
|
* @returns Result of the transformation.
|
|
381
381
|
*/
|
|
382
|
-
_getTransformedByInsertion(insertPosition:
|
|
382
|
+
_getTransformedByInsertion(insertPosition: ModelPosition, howMany: number, spread?: boolean): Array<ModelRange>;
|
|
383
383
|
/**
|
|
384
|
-
* Returns an array containing {@link ~
|
|
385
|
-
* {@link ~
|
|
384
|
+
* Returns an array containing {@link ~ModelRange ranges} that are a result of transforming this
|
|
385
|
+
* {@link ~ModelRange range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
|
|
386
386
|
*
|
|
387
387
|
* @internal
|
|
388
388
|
* @param sourcePosition Position from which nodes are moved.
|
|
@@ -391,7 +391,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
391
391
|
* @param spread Whether the range should be spread if the move points inside the range.
|
|
392
392
|
* @returns Result of the transformation.
|
|
393
393
|
*/
|
|
394
|
-
_getTransformedByMove(sourcePosition:
|
|
394
|
+
_getTransformedByMove(sourcePosition: ModelPosition, targetPosition: ModelPosition, howMany: number, spread?: boolean): Array<ModelRange>;
|
|
395
395
|
/**
|
|
396
396
|
* Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.
|
|
397
397
|
*
|
|
@@ -404,30 +404,30 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
404
404
|
* @param howMany How many nodes are removed.
|
|
405
405
|
* @returns Result of the transformation.
|
|
406
406
|
*/
|
|
407
|
-
_getTransformedByDeletion(deletePosition:
|
|
407
|
+
_getTransformedByDeletion(deletePosition: ModelPosition, howMany: number): ModelRange | null;
|
|
408
408
|
/**
|
|
409
|
-
* Creates a new range, spreading from specified {@link module:engine/model/position~
|
|
409
|
+
* Creates a new range, spreading from specified {@link module:engine/model/position~ModelPosition position} to a position moved by
|
|
410
410
|
* given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
|
|
411
411
|
*
|
|
412
412
|
* @internal
|
|
413
413
|
* @param position Beginning of the range.
|
|
414
414
|
* @param shift How long the range should be.
|
|
415
415
|
*/
|
|
416
|
-
static _createFromPositionAndShift(position:
|
|
416
|
+
static _createFromPositionAndShift(position: ModelPosition, shift: number): ModelRange;
|
|
417
417
|
/**
|
|
418
|
-
* Creates a range inside an {@link module:engine/model/element~
|
|
418
|
+
* Creates a range inside an {@link module:engine/model/element~ModelElement element} which starts before the first child of
|
|
419
419
|
* that element and ends after the last child of that element.
|
|
420
420
|
*
|
|
421
421
|
* @internal
|
|
422
422
|
* @param element Element which is a parent for the range.
|
|
423
423
|
*/
|
|
424
|
-
static _createIn(element:
|
|
424
|
+
static _createIn(element: ModelElement | ModelDocumentFragment): ModelRange;
|
|
425
425
|
/**
|
|
426
|
-
* Creates a range that starts before given {@link module:engine/model/item~
|
|
426
|
+
* Creates a range that starts before given {@link module:engine/model/item~ModelItem model item} and ends after it.
|
|
427
427
|
*
|
|
428
428
|
* @internal
|
|
429
429
|
*/
|
|
430
|
-
static _createOn(item:
|
|
430
|
+
static _createOn(item: ModelItem): ModelRange;
|
|
431
431
|
/**
|
|
432
432
|
* Combines all ranges from the passed array into a one range. At least one range has to be passed.
|
|
433
433
|
* Passed ranges must not have common parts.
|
|
@@ -446,7 +446,7 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
446
446
|
* @param ranges Ranges to combine.
|
|
447
447
|
* @returns Combined range.
|
|
448
448
|
*/
|
|
449
|
-
static _createFromRanges(ranges: Array<
|
|
449
|
+
static _createFromRanges(ranges: Array<ModelRange>): ModelRange;
|
|
450
450
|
/**
|
|
451
451
|
* Creates a `Range` instance from given plain object (i.e. parsed JSON string).
|
|
452
452
|
*
|
|
@@ -454,5 +454,5 @@ export default class Range extends TypeCheckable implements Iterable<TreeWalkerV
|
|
|
454
454
|
* @param doc Document object that will be range owner.
|
|
455
455
|
* @returns `Range` instance created using given plain object.
|
|
456
456
|
*/
|
|
457
|
-
static fromJSON(json: any, doc:
|
|
457
|
+
static fromJSON(json: any, doc: ModelDocument): ModelRange;
|
|
458
458
|
}
|