@ckeditor/ckeditor5-engine 36.0.0 → 37.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.
Files changed (201) hide show
  1. package/README.md +1 -1
  2. package/package.json +24 -23
  3. package/src/controller/datacontroller.d.ts +331 -0
  4. package/src/controller/datacontroller.js +62 -109
  5. package/src/controller/editingcontroller.d.ts +98 -0
  6. package/src/controller/editingcontroller.js +22 -46
  7. package/src/conversion/conversion.d.ts +476 -0
  8. package/src/conversion/conversion.js +328 -347
  9. package/src/conversion/conversionhelpers.d.ts +26 -0
  10. package/src/conversion/conversionhelpers.js +1 -5
  11. package/src/conversion/downcastdispatcher.d.ts +547 -0
  12. package/src/conversion/downcastdispatcher.js +74 -152
  13. package/src/conversion/downcasthelpers.d.ts +1226 -0
  14. package/src/conversion/downcasthelpers.js +843 -762
  15. package/src/conversion/mapper.d.ts +499 -0
  16. package/src/conversion/mapper.js +84 -99
  17. package/src/conversion/modelconsumable.d.ts +201 -0
  18. package/src/conversion/modelconsumable.js +96 -99
  19. package/src/conversion/upcastdispatcher.d.ts +492 -0
  20. package/src/conversion/upcastdispatcher.js +73 -100
  21. package/src/conversion/upcasthelpers.d.ts +499 -0
  22. package/src/conversion/upcasthelpers.js +406 -373
  23. package/src/conversion/viewconsumable.d.ts +177 -0
  24. package/src/conversion/viewconsumable.js +157 -162
  25. package/src/dataprocessor/basichtmlwriter.d.ts +18 -0
  26. package/src/dataprocessor/basichtmlwriter.js +0 -9
  27. package/src/dataprocessor/dataprocessor.d.ts +61 -0
  28. package/src/dataprocessor/htmldataprocessor.d.ts +76 -0
  29. package/src/dataprocessor/htmldataprocessor.js +6 -28
  30. package/src/dataprocessor/htmlwriter.d.ts +16 -0
  31. package/src/dataprocessor/xmldataprocessor.d.ts +90 -0
  32. package/src/dataprocessor/xmldataprocessor.js +8 -40
  33. package/src/dev-utils/model.d.ts +124 -0
  34. package/src/dev-utils/model.js +41 -38
  35. package/src/dev-utils/operationreplayer.d.ts +51 -0
  36. package/src/dev-utils/operationreplayer.js +6 -14
  37. package/src/dev-utils/utils.d.ts +37 -0
  38. package/src/dev-utils/utils.js +5 -18
  39. package/src/dev-utils/view.d.ts +319 -0
  40. package/src/dev-utils/view.js +205 -226
  41. package/src/index.d.ts +105 -0
  42. package/src/index.js +1 -0
  43. package/src/model/batch.d.ts +106 -0
  44. package/src/model/differ.d.ts +329 -0
  45. package/src/model/document.d.ts +245 -0
  46. package/src/model/document.js +1 -1
  47. package/src/model/documentfragment.d.ts +196 -0
  48. package/src/model/documentfragment.js +2 -2
  49. package/src/model/documentselection.d.ts +420 -0
  50. package/src/model/element.d.ts +165 -0
  51. package/src/model/history.d.ts +114 -0
  52. package/src/model/item.d.ts +14 -0
  53. package/src/model/liveposition.d.ts +77 -0
  54. package/src/model/liverange.d.ts +102 -0
  55. package/src/model/markercollection.d.ts +335 -0
  56. package/src/model/model.d.ts +812 -0
  57. package/src/model/model.js +59 -30
  58. package/src/model/node.d.ts +256 -0
  59. package/src/model/nodelist.d.ts +91 -0
  60. package/src/model/operation/attributeoperation.d.ts +98 -0
  61. package/src/model/operation/detachoperation.d.ts +55 -0
  62. package/src/model/operation/insertoperation.d.ts +85 -0
  63. package/src/model/operation/markeroperation.d.ts +86 -0
  64. package/src/model/operation/mergeoperation.d.ts +95 -0
  65. package/src/model/operation/moveoperation.d.ts +91 -0
  66. package/src/model/operation/nooperation.d.ts +33 -0
  67. package/src/model/operation/operation.d.ts +89 -0
  68. package/src/model/operation/operationfactory.d.ts +18 -0
  69. package/src/model/operation/renameoperation.d.ts +78 -0
  70. package/src/model/operation/rootattributeoperation.d.ts +97 -0
  71. package/src/model/operation/rootattributeoperation.js +1 -1
  72. package/src/model/operation/splitoperation.d.ts +104 -0
  73. package/src/model/operation/transform.d.ts +100 -0
  74. package/src/model/operation/utils.d.ts +71 -0
  75. package/src/model/position.d.ts +539 -0
  76. package/src/model/position.js +1 -1
  77. package/src/model/range.d.ts +458 -0
  78. package/src/model/range.js +1 -1
  79. package/src/model/rootelement.d.ts +40 -0
  80. package/src/model/schema.d.ts +1176 -0
  81. package/src/model/schema.js +15 -15
  82. package/src/model/selection.d.ts +472 -0
  83. package/src/model/text.d.ts +66 -0
  84. package/src/model/text.js +0 -2
  85. package/src/model/textproxy.d.ts +144 -0
  86. package/src/model/treewalker.d.ts +186 -0
  87. package/src/model/treewalker.js +19 -10
  88. package/src/model/typecheckable.d.ts +255 -0
  89. package/src/model/utils/autoparagraphing.d.ts +37 -0
  90. package/src/model/utils/deletecontent.d.ts +58 -0
  91. package/src/model/utils/findoptimalinsertionrange.d.ts +32 -0
  92. package/src/model/utils/getselectedcontent.d.ts +30 -0
  93. package/src/model/utils/insertcontent.d.ts +46 -0
  94. package/src/model/utils/insertcontent.js +2 -12
  95. package/src/model/utils/insertobject.d.ts +44 -0
  96. package/src/model/utils/insertobject.js +3 -14
  97. package/src/model/utils/modifyselection.d.ts +48 -0
  98. package/src/model/utils/selection-post-fixer.d.ts +65 -0
  99. package/src/model/writer.d.ts +726 -0
  100. package/src/model/writer.js +6 -4
  101. package/src/view/attributeelement.d.ts +108 -0
  102. package/src/view/attributeelement.js +25 -69
  103. package/src/view/containerelement.d.ts +49 -0
  104. package/src/view/containerelement.js +10 -43
  105. package/src/view/datatransfer.d.ts +75 -0
  106. package/src/view/datatransfer.js +24 -27
  107. package/src/view/document.d.ts +184 -0
  108. package/src/view/document.js +15 -84
  109. package/src/view/documentfragment.d.ts +150 -0
  110. package/src/view/documentfragment.js +40 -81
  111. package/src/view/documentselection.d.ts +219 -0
  112. package/src/view/documentselection.js +75 -121
  113. package/src/view/domconverter.d.ts +620 -0
  114. package/src/view/domconverter.js +159 -276
  115. package/src/view/downcastwriter.d.ts +804 -0
  116. package/src/view/downcastwriter.js +336 -380
  117. package/src/view/editableelement.d.ts +52 -0
  118. package/src/view/editableelement.js +9 -49
  119. package/src/view/element.d.ts +466 -0
  120. package/src/view/element.js +150 -222
  121. package/src/view/elementdefinition.d.ts +87 -0
  122. package/src/view/emptyelement.d.ts +41 -0
  123. package/src/view/emptyelement.js +11 -44
  124. package/src/view/filler.d.ts +111 -0
  125. package/src/view/filler.js +24 -21
  126. package/src/view/item.d.ts +14 -0
  127. package/src/view/matcher.d.ts +486 -0
  128. package/src/view/matcher.js +247 -218
  129. package/src/view/node.d.ts +160 -0
  130. package/src/view/node.js +26 -100
  131. package/src/view/observer/arrowkeysobserver.d.ts +41 -0
  132. package/src/view/observer/arrowkeysobserver.js +0 -13
  133. package/src/view/observer/bubblingemittermixin.d.ts +166 -0
  134. package/src/view/observer/bubblingemittermixin.js +36 -25
  135. package/src/view/observer/bubblingeventinfo.d.ts +47 -0
  136. package/src/view/observer/bubblingeventinfo.js +3 -29
  137. package/src/view/observer/clickobserver.d.ts +43 -0
  138. package/src/view/observer/clickobserver.js +9 -19
  139. package/src/view/observer/compositionobserver.d.ts +82 -0
  140. package/src/view/observer/compositionobserver.js +13 -42
  141. package/src/view/observer/domeventdata.d.ts +50 -0
  142. package/src/view/observer/domeventdata.js +5 -30
  143. package/src/view/observer/domeventobserver.d.ts +69 -0
  144. package/src/view/observer/domeventobserver.js +19 -21
  145. package/src/view/observer/fakeselectionobserver.d.ts +46 -0
  146. package/src/view/observer/fakeselectionobserver.js +2 -15
  147. package/src/view/observer/focusobserver.d.ts +82 -0
  148. package/src/view/observer/focusobserver.js +14 -40
  149. package/src/view/observer/inputobserver.d.ts +86 -0
  150. package/src/view/observer/inputobserver.js +18 -64
  151. package/src/view/observer/keyobserver.d.ts +67 -0
  152. package/src/view/observer/keyobserver.js +8 -42
  153. package/src/view/observer/mouseobserver.d.ts +89 -0
  154. package/src/view/observer/mouseobserver.js +8 -28
  155. package/src/view/observer/mutationobserver.d.ts +82 -0
  156. package/src/view/observer/mutationobserver.js +7 -37
  157. package/src/view/observer/observer.d.ts +84 -0
  158. package/src/view/observer/observer.js +12 -25
  159. package/src/view/observer/selectionobserver.d.ts +143 -0
  160. package/src/view/observer/selectionobserver.js +9 -99
  161. package/src/view/observer/tabobserver.d.ts +42 -0
  162. package/src/view/observer/tabobserver.js +0 -14
  163. package/src/view/placeholder.d.ts +85 -0
  164. package/src/view/placeholder.js +26 -43
  165. package/src/view/position.d.ts +189 -0
  166. package/src/view/position.js +36 -83
  167. package/src/view/range.d.ts +279 -0
  168. package/src/view/range.js +79 -122
  169. package/src/view/rawelement.d.ts +73 -0
  170. package/src/view/rawelement.js +34 -48
  171. package/src/view/renderer.d.ts +265 -0
  172. package/src/view/renderer.js +105 -193
  173. package/src/view/rooteditableelement.d.ts +41 -0
  174. package/src/view/rooteditableelement.js +12 -40
  175. package/src/view/selection.d.ts +375 -0
  176. package/src/view/selection.js +79 -153
  177. package/src/view/styles/background.d.ts +33 -0
  178. package/src/view/styles/background.js +14 -12
  179. package/src/view/styles/border.d.ts +43 -0
  180. package/src/view/styles/border.js +58 -48
  181. package/src/view/styles/margin.d.ts +29 -0
  182. package/src/view/styles/margin.js +13 -11
  183. package/src/view/styles/padding.d.ts +29 -0
  184. package/src/view/styles/padding.js +13 -11
  185. package/src/view/styles/utils.d.ts +93 -0
  186. package/src/view/styles/utils.js +22 -48
  187. package/src/view/stylesmap.d.ts +675 -0
  188. package/src/view/stylesmap.js +249 -244
  189. package/src/view/text.d.ts +74 -0
  190. package/src/view/text.js +16 -46
  191. package/src/view/textproxy.d.ts +97 -0
  192. package/src/view/textproxy.js +10 -59
  193. package/src/view/treewalker.d.ts +195 -0
  194. package/src/view/treewalker.js +43 -106
  195. package/src/view/typecheckable.d.ts +401 -0
  196. package/src/view/uielement.d.ts +96 -0
  197. package/src/view/uielement.js +28 -62
  198. package/src/view/upcastwriter.d.ts +328 -0
  199. package/src/view/upcastwriter.js +124 -134
  200. package/src/view/view.d.ts +327 -0
  201. package/src/view/view.js +79 -150
@@ -0,0 +1,327 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module engine/view/view
7
+ */
8
+ import Document from './document';
9
+ import DowncastWriter from './downcastwriter';
10
+ import Renderer from './renderer';
11
+ import DomConverter from './domconverter';
12
+ import Position, { type PositionOffset } from './position';
13
+ import Range from './range';
14
+ import Selection, { type PlaceOrOffset, type Selectable, type SelectionOptions } from './selection';
15
+ import type { default as Observer, ObserverConstructor } from './observer/observer';
16
+ import type { StylesProcessor } from './stylesmap';
17
+ import type Element from './element';
18
+ import type Node from './node';
19
+ import type Item from './item';
20
+ declare const View_base: {
21
+ new (): import("@ckeditor/ckeditor5-utils").Observable;
22
+ prototype: import("@ckeditor/ckeditor5-utils").Observable;
23
+ };
24
+ /**
25
+ * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide
26
+ * abstraction over the DOM structure and events and hide all browsers quirks.
27
+ *
28
+ * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,
29
+ * all changes need to be done using the {@link module:engine/view/view~View#change} method, using
30
+ * {@link module:engine/view/downcastwriter~DowncastWriter}:
31
+ *
32
+ * ```ts
33
+ * view.change( writer => {
34
+ * writer.insert( position, writer.createText( 'foo' ) );
35
+ * } );
36
+ * ```
37
+ *
38
+ * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes
39
+ * on DOM and fire events on the {@link module:engine/view/document~Document Document}.
40
+ * Note that the following observers are added by the class constructor and are always available:
41
+ *
42
+ * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},
43
+ * * {@link module:engine/view/observer/focusobserver~FocusObserver},
44
+ * * {@link module:engine/view/observer/keyobserver~KeyObserver},
45
+ * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.
46
+ * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
47
+ * * {@link module:engine/view/observer/inputobserver~InputObserver}.
48
+ * * {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.
49
+ * * {@link module:engine/view/observer/tabobserver~TabObserver}.
50
+ *
51
+ * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.
52
+ *
53
+ * If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM
54
+ * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.
55
+ */
56
+ export default class View extends View_base {
57
+ /**
58
+ * Instance of the {@link module:engine/view/document~Document} associated with this view controller.
59
+ */
60
+ readonly document: Document;
61
+ /**
62
+ * Instance of the {@link module:engine/view/domconverter~DomConverter domConverter} used by
63
+ * {@link module:engine/view/view~View#_renderer renderer}
64
+ * and {@link module:engine/view/observer/observer~Observer observers}.
65
+ */
66
+ readonly domConverter: DomConverter;
67
+ /**
68
+ * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.
69
+ */
70
+ readonly domRoots: Map<string, HTMLElement>;
71
+ /**
72
+ * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
73
+ *
74
+ * @observable
75
+ * @readonly
76
+ */
77
+ isRenderingInProgress: boolean;
78
+ /**
79
+ * Informs whether the DOM selection is inside any of the DOM roots managed by the view.
80
+ *
81
+ * @observable
82
+ * @readonly
83
+ */
84
+ hasDomSelection: boolean;
85
+ /**
86
+ * Instance of the {@link module:engine/view/renderer~Renderer renderer}.
87
+ *
88
+ * @internal
89
+ */
90
+ readonly _renderer: Renderer;
91
+ /**
92
+ * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
93
+ * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when
94
+ * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.
95
+ * This way, the DOM element can go back to the (clean) state as if the editing view never used it.
96
+ */
97
+ private readonly _initialDomRootAttributes;
98
+ /**
99
+ * Map of registered {@link module:engine/view/observer/observer~Observer observers}.
100
+ */
101
+ private readonly _observers;
102
+ /**
103
+ * DowncastWriter instance used in {@link #change change method} callbacks.
104
+ */
105
+ private readonly _writer;
106
+ /**
107
+ * Is set to `true` when {@link #change view changes} are currently in progress.
108
+ */
109
+ private _ongoingChange;
110
+ /**
111
+ * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
112
+ */
113
+ private _postFixersInProgress;
114
+ /**
115
+ * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.
116
+ */
117
+ private _renderingDisabled;
118
+ /**
119
+ * Internal flag that disables rendering when there are no changes since the last rendering.
120
+ * It stores information about changed selection and changed elements from attached document roots.
121
+ */
122
+ private _hasChangedSinceTheLastRendering;
123
+ /**
124
+ * @param stylesProcessor The styles processor instance.
125
+ */
126
+ constructor(stylesProcessor: StylesProcessor);
127
+ /**
128
+ * Attaches a DOM root element to the view element and enable all observers on that element.
129
+ * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized
130
+ * with the view what means that all child nodes will be removed and replaced with content of the view root.
131
+ *
132
+ * This method also will change view element name as the same as tag name of given dom root.
133
+ * Name is always transformed to lower case.
134
+ *
135
+ * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.
136
+ *
137
+ * @param domRoot DOM root element.
138
+ * @param name Name of the root.
139
+ */
140
+ attachDomRoot(domRoot: HTMLElement, name?: string): void;
141
+ /**
142
+ * Detaches a DOM root element from the view element and restores its attributes to the state before
143
+ * {@link #attachDomRoot `attachDomRoot()`}.
144
+ *
145
+ * @param name Name of the root to detach.
146
+ */
147
+ detachDomRoot(name: string): void;
148
+ /**
149
+ * Gets DOM root element.
150
+ *
151
+ * @param name Name of the root.
152
+ * @returns DOM root element instance.
153
+ */
154
+ getDomRoot(name?: string): HTMLElement | undefined;
155
+ /**
156
+ * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it
157
+ * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future
158
+ * {@link #domRoots DOM roots}.
159
+ *
160
+ * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only
161
+ * when registered for the first time. This means that features and other components can register a single observer
162
+ * multiple times without caring whether it has been already added or not.
163
+ *
164
+ * @param ObserverConstructor The constructor of an observer to add.
165
+ * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.
166
+ * @returns Added observer instance.
167
+ */
168
+ addObserver(ObserverConstructor: ObserverConstructor): Observer;
169
+ /**
170
+ * Returns observer of the given type or `undefined` if such observer has not been added yet.
171
+ *
172
+ * @param ObserverConstructor The constructor of an observer to get.
173
+ * @returns Observer instance or undefined.
174
+ */
175
+ getObserver<T extends ObserverConstructor>(ObserverConstructor: T): InstanceType<T> | undefined;
176
+ /**
177
+ * Disables all added observers.
178
+ */
179
+ disableObservers(): void;
180
+ /**
181
+ * Enables all added observers.
182
+ */
183
+ enableObservers(): void;
184
+ /**
185
+ * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the
186
+ * caret, if not already visible to the user.
187
+ */
188
+ scrollToTheSelection(): void;
189
+ /**
190
+ * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}
191
+ * that is currently having selection inside.
192
+ */
193
+ focus(): void;
194
+ /**
195
+ * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.
196
+ * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed
197
+ * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows
198
+ * to nest calls one inside another and still performs a single rendering after all those changes are made.
199
+ * It also returns the return value of its callback.
200
+ *
201
+ * ```ts
202
+ * const text = view.change( writer => {
203
+ * const newText = writer.createText( 'foo' );
204
+ * writer.insert( position1, newText );
205
+ *
206
+ * view.change( writer => {
207
+ * writer.insert( position2, writer.createText( 'bar' ) );
208
+ * } );
209
+ *
210
+ * writer.remove( range );
211
+ *
212
+ * return newText;
213
+ * } );
214
+ * ```
215
+ *
216
+ * When the outermost change block is done and rendering to the DOM is over the
217
+ * {@link module:engine/view/view~View#event:render `View#render`} event is fired.
218
+ *
219
+ * This method throws a `applying-view-changes-on-rendering` error when
220
+ * the change block is used after rendering to the DOM has started.
221
+ *
222
+ * @param callback Callback function which may modify the view.
223
+ * @returns Value returned by the callback.
224
+ */
225
+ change<TReturn>(callback: (writer: DowncastWriter) => TReturn): TReturn;
226
+ /**
227
+ * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are
228
+ * currently in progress, rendering will start after all {@link #change change blocks} are processed.
229
+ *
230
+ * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}
231
+ * block and the view will automatically check whether it needs to render DOM or not.
232
+ *
233
+ * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when
234
+ * trying to re-render when rendering to DOM has already started.
235
+ */
236
+ forceRender(): void;
237
+ /**
238
+ * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
239
+ */
240
+ destroy(): void;
241
+ /**
242
+ * Creates position at the given location. The location can be specified as:
243
+ *
244
+ * * a {@link module:engine/view/position~Position position},
245
+ * * parent element and offset (offset defaults to `0`),
246
+ * * parent element and `'end'` (sets position at the end of that element),
247
+ * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
248
+ *
249
+ * This method is a shortcut to other constructors such as:
250
+ *
251
+ * * {@link #createPositionBefore},
252
+ * * {@link #createPositionAfter},
253
+ *
254
+ * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.
255
+ */
256
+ createPositionAt(itemOrPosition: Item | Position, offset?: PositionOffset): Position;
257
+ /**
258
+ * Creates a new position after given view item.
259
+ *
260
+ * @param item View item after which the position should be located.
261
+ */
262
+ createPositionAfter(item: Item): Position;
263
+ /**
264
+ * Creates a new position before given view item.
265
+ *
266
+ * @param item View item before which the position should be located.
267
+ */
268
+ createPositionBefore(item: Item): Position;
269
+ /**
270
+ * Creates a range spanning from `start` position to `end` position.
271
+ *
272
+ * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
273
+ *
274
+ * @param start Start position.
275
+ * @param end End position. If not set, range will be collapsed at `start` position.
276
+ */
277
+ createRange(start: Position, end?: Position | null): Range;
278
+ /**
279
+ * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
280
+ */
281
+ createRangeOn(item: Item): Range;
282
+ /**
283
+ * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
284
+ * that element and ends after the last child of that element.
285
+ *
286
+ * @param element Element which is a parent for the range.
287
+ */
288
+ createRangeIn(element: Element): Range;
289
+ createSelection(selectable: Node, placeOrOffset: PlaceOrOffset, options?: SelectionOptions): Selection;
290
+ createSelection(selectable?: Exclude<Selectable, Node>, options?: SelectionOptions): Selection;
291
+ /**
292
+ * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.
293
+ * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.
294
+ *
295
+ * @internal
296
+ * @param flag A flag indicates whether the rendering should be disabled.
297
+ */
298
+ _disableRendering(flag: boolean): void;
299
+ /**
300
+ * Renders all changes. In order to avoid triggering the observers (e.g. selection) all observers are disabled
301
+ * before rendering and re-enabled after that.
302
+ */
303
+ private _render;
304
+ }
305
+ /**
306
+ * Fired after a topmost {@link module:engine/view/view~View#change change block} and all
307
+ * {@link module:engine/view/document~Document#registerPostFixer post-fixers} are executed.
308
+ *
309
+ * Actual rendering is performed as a first listener on 'normal' priority.
310
+ *
311
+ * ```ts
312
+ * view.on( 'render', () => {
313
+ * // Rendering to the DOM is complete.
314
+ * } );
315
+ * ```
316
+ *
317
+ * This event is useful when you want to update interface elements after the rendering, e.g. position of the
318
+ * balloon panel. If you wants to change view structure use
319
+ * {@link module:engine/view/document~Document#registerPostFixer post-fixers}.
320
+ *
321
+ * @eventName render
322
+ */
323
+ export type ViewRenderEvent = {
324
+ name: 'render';
325
+ args: [];
326
+ };
327
+ export {};