@ckeditor/ckeditor5-engine 44.2.1 → 44.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1677 -1258
- package/dist/index.js.map +1 -1
- package/package.json +2 -4
- package/src/conversion/downcasthelpers.js +14 -42
- package/src/conversion/viewconsumable.d.ts +65 -97
- package/src/conversion/viewconsumable.js +217 -215
- package/src/view/attributeelement.d.ts +14 -0
- package/src/view/attributeelement.js +26 -0
- package/src/view/domconverter.js +72 -7
- package/src/view/downcastwriter.d.ts +32 -20
- package/src/view/downcastwriter.js +18 -142
- package/src/view/element.d.ts +309 -17
- package/src/view/element.js +432 -137
- package/src/view/matcher.d.ts +38 -16
- package/src/view/matcher.js +91 -166
- package/src/view/stylesmap.d.ts +68 -6
- package/src/view/stylesmap.js +144 -8
- package/src/view/tokenlist.d.ts +109 -0
- package/src/view/tokenlist.js +196 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-engine",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.3.0-alpha.0",
|
|
4
4
|
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"type": "module",
|
|
25
25
|
"main": "src/index.js",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ckeditor/ckeditor5-utils": "44.
|
|
27
|
+
"@ckeditor/ckeditor5-utils": "44.3.0-alpha.0",
|
|
28
28
|
"lodash-es": "4.17.21"
|
|
29
29
|
},
|
|
30
30
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"src/**/*.js",
|
|
43
43
|
"src/**/*.d.ts",
|
|
44
44
|
"theme",
|
|
45
|
-
"ckeditor5-metadata.json",
|
|
46
45
|
"CHANGELOG.md"
|
|
47
46
|
],
|
|
48
47
|
"types": "src/index.d.ts",
|
|
@@ -63,7 +62,6 @@
|
|
|
63
62
|
"default": "./src/*"
|
|
64
63
|
},
|
|
65
64
|
"./theme/*": "./theme/*",
|
|
66
|
-
"./ckeditor5-metadata.json": "./ckeditor5-metadata.json",
|
|
67
65
|
"./package.json": "./package.json"
|
|
68
66
|
}
|
|
69
67
|
}
|
|
@@ -1353,57 +1353,29 @@ function changeAttribute(attributeCreator) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
// First remove the old attribute if there was one.
|
|
1355
1355
|
if (data.attributeOldValue !== null && oldAttribute) {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
for (const className of classes) {
|
|
1359
|
-
viewWriter.removeClass(className, viewElement);
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
else if (oldAttribute.key == 'style') {
|
|
1356
|
+
let value = oldAttribute.value;
|
|
1357
|
+
if (oldAttribute.key == 'style') {
|
|
1363
1358
|
if (typeof oldAttribute.value == 'string') {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
}
|
|
1359
|
+
value = new StylesMap(viewWriter.document.stylesProcessor)
|
|
1360
|
+
.setTo(oldAttribute.value)
|
|
1361
|
+
.getStylesEntries()
|
|
1362
|
+
.map(([key]) => key);
|
|
1369
1363
|
}
|
|
1370
1364
|
else {
|
|
1371
|
-
|
|
1372
|
-
for (const key of keys) {
|
|
1373
|
-
viewWriter.removeStyle(key, viewElement);
|
|
1374
|
-
}
|
|
1365
|
+
value = Object.keys(oldAttribute.value);
|
|
1375
1366
|
}
|
|
1376
1367
|
}
|
|
1377
|
-
|
|
1378
|
-
viewWriter.removeAttribute(oldAttribute.key, viewElement);
|
|
1379
|
-
}
|
|
1368
|
+
viewWriter.removeAttribute(oldAttribute.key, value, viewElement);
|
|
1380
1369
|
}
|
|
1381
1370
|
// Then set the new attribute.
|
|
1382
1371
|
if (data.attributeNewValue !== null && newAttribute) {
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
}
|
|
1389
|
-
else if (newAttribute.key == 'style') {
|
|
1390
|
-
if (typeof newAttribute.value == 'string') {
|
|
1391
|
-
const styles = new StylesMap(viewWriter.document.stylesProcessor);
|
|
1392
|
-
styles.setTo(newAttribute.value);
|
|
1393
|
-
for (const [key, value] of styles.getStylesEntries()) {
|
|
1394
|
-
viewWriter.setStyle(key, value, viewElement);
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
else {
|
|
1398
|
-
const keys = Object.keys(newAttribute.value);
|
|
1399
|
-
for (const key of keys) {
|
|
1400
|
-
viewWriter.setStyle(key, newAttribute.value[key], viewElement);
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
else {
|
|
1405
|
-
viewWriter.setAttribute(newAttribute.key, newAttribute.value, viewElement);
|
|
1372
|
+
let value = newAttribute.value;
|
|
1373
|
+
if (newAttribute.key == 'style' && typeof newAttribute.value == 'string') {
|
|
1374
|
+
value = Object.fromEntries(new StylesMap(viewWriter.document.stylesProcessor)
|
|
1375
|
+
.setTo(newAttribute.value)
|
|
1376
|
+
.getStylesEntries());
|
|
1406
1377
|
}
|
|
1378
|
+
viewWriter.setAttribute(newAttribute.key, value, false, viewElement);
|
|
1407
1379
|
}
|
|
1408
1380
|
};
|
|
1409
1381
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
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 type Element from '../view/element.js';
|
|
5
|
+
import type { default as Element, NormalizedConsumables } from '../view/element.js';
|
|
6
6
|
import type Node from '../view/node.js';
|
|
7
7
|
import type Text from '../view/text.js';
|
|
8
8
|
import type DocumentFragment from '../view/documentfragment.js';
|
|
@@ -41,29 +41,18 @@ export default class ViewConsumable {
|
|
|
41
41
|
*/
|
|
42
42
|
private _consumables;
|
|
43
43
|
/**
|
|
44
|
-
* Adds {@link module:engine/view/text~Text text node} or
|
|
44
|
+
* Adds view {@link module:engine/view/element~Element element}, {@link module:engine/view/text~Text text node} or
|
|
45
45
|
* {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
|
-
* viewConsumable.add( textNode ); // Adds text node to consume.
|
|
49
|
-
* viewConsumable.add( docFragment ); // Adds document fragment to consume.
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* See also: {@link #add:ELEMENT `add( element, consumables )`}.
|
|
53
|
-
*
|
|
54
|
-
* @label TEXT_OR_FRAGMENT
|
|
55
|
-
*/
|
|
56
|
-
add(textOrDocumentFragment: Text | DocumentFragment): void;
|
|
57
|
-
/**
|
|
58
|
-
* Adds {@link module:engine/view/element~Element view element} as ready to be consumed.
|
|
59
|
-
*
|
|
60
|
-
* ```ts
|
|
61
48
|
* viewConsumable.add( p, { name: true } ); // Adds element's name to consume.
|
|
62
49
|
* viewConsumable.add( p, { attributes: 'name' } ); // Adds element's attribute.
|
|
63
50
|
* viewConsumable.add( p, { classes: 'foobar' } ); // Adds element's class.
|
|
64
51
|
* viewConsumable.add( p, { styles: 'color' } ); // Adds element's style
|
|
65
52
|
* viewConsumable.add( p, { attributes: 'name', styles: 'color' } ); // Adds attribute and style.
|
|
66
53
|
* viewConsumable.add( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be provided.
|
|
54
|
+
* viewConsumable.add( textNode ); // Adds text node to consume.
|
|
55
|
+
* viewConsumable.add( docFragment ); // Adds document fragment to consume.
|
|
67
56
|
* ```
|
|
68
57
|
*
|
|
69
58
|
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
|
|
@@ -74,16 +63,13 @@ export default class ViewConsumable {
|
|
|
74
63
|
* viewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.
|
|
75
64
|
* ```
|
|
76
65
|
*
|
|
77
|
-
* See also: {@link #add:TEXT_OR_FRAGMENT `add( textOrDocumentFragment )`}.
|
|
78
|
-
*
|
|
79
|
-
* @label ELEMENT
|
|
80
66
|
* @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
|
|
81
67
|
* @param consumables.name If set to true element's name will be included.
|
|
82
68
|
* @param consumables.attributes Attribute name or array of attribute names.
|
|
83
69
|
* @param consumables.classes Class name or array of class names.
|
|
84
70
|
* @param consumables.styles Style name or array of style names.
|
|
85
71
|
*/
|
|
86
|
-
add(element: Element, consumables
|
|
72
|
+
add(element: Text | Element | DocumentFragment, consumables?: Consumables | NormalizedConsumables): void;
|
|
87
73
|
/**
|
|
88
74
|
* Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
|
|
89
75
|
* {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.
|
|
@@ -180,14 +166,7 @@ export default class ViewConsumable {
|
|
|
180
166
|
* @param consumables.classes Class name or array of class names.
|
|
181
167
|
* @param consumables.styles Style name or array of style names.
|
|
182
168
|
*/
|
|
183
|
-
revert(element: Node, consumables: Consumables): void;
|
|
184
|
-
/**
|
|
185
|
-
* Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include
|
|
186
|
-
* element's name and all its attributes, classes and styles.
|
|
187
|
-
*/
|
|
188
|
-
static consumablesFromElement(element: Element): Consumables & {
|
|
189
|
-
element: Element;
|
|
190
|
-
};
|
|
169
|
+
revert(element: Node, consumables: Consumables | Match): void;
|
|
191
170
|
/**
|
|
192
171
|
* Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from
|
|
193
172
|
* {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
|
|
@@ -199,9 +178,33 @@ export default class ViewConsumable {
|
|
|
199
178
|
*/
|
|
200
179
|
static createFrom(from: Node | DocumentFragment, instance?: ViewConsumable): ViewConsumable;
|
|
201
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Object describing all features of a view element that could be consumed and converted individually.
|
|
183
|
+
* This is a non-normalized form of {@link module:engine/view/element~NormalizedConsumables} generated from the view Element.
|
|
184
|
+
*
|
|
185
|
+
* Example element:
|
|
186
|
+
*
|
|
187
|
+
* ```html
|
|
188
|
+
* <a class="foo bar" style="color: red; margin: 5px" href="https://ckeditor.com" rel="nofollow noreferrer" target="_blank">
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* The `Consumables` would include:
|
|
192
|
+
*
|
|
193
|
+
* ```json
|
|
194
|
+
* {
|
|
195
|
+
* name: true,
|
|
196
|
+
* classes: [ "foo", "bar" ],
|
|
197
|
+
* styles: [ "color", "margin" ]
|
|
198
|
+
* }
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* You could convert a `Consumable` into a {@link module:engine/view/element~NormalizedConsumables}
|
|
202
|
+
* using the {@link module:engine/conversion/viewconsumable~normalizeConsumables} helper.
|
|
203
|
+
*/
|
|
202
204
|
export interface Consumables {
|
|
203
205
|
/**
|
|
204
|
-
* If set to true element's name will be included.
|
|
206
|
+
* If set to `true` element's name will be included in a consumable.
|
|
207
|
+
* Depending on the usage context it would be added as consumable, tested for being available for consume or consumed.
|
|
205
208
|
*/
|
|
206
209
|
name?: boolean;
|
|
207
210
|
/**
|
|
@@ -222,21 +225,24 @@ export interface Consumables {
|
|
|
222
225
|
* It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.
|
|
223
226
|
*/
|
|
224
227
|
export declare class ViewElementConsumables {
|
|
225
|
-
readonly element:
|
|
228
|
+
readonly element: Element;
|
|
226
229
|
/**
|
|
227
230
|
* Flag indicating if name of the element can be consumed.
|
|
228
231
|
*/
|
|
229
232
|
private _canConsumeName;
|
|
230
233
|
/**
|
|
231
|
-
*
|
|
234
|
+
* A map of element's consumables.
|
|
235
|
+
* * For plain attributes the value is a boolean indicating whether the attribute is available to consume.
|
|
236
|
+
* * For token based attributes (like class list and style) the value is a map of tokens to booleans
|
|
237
|
+
* indicating whether the token is available to consume on the given attribute.
|
|
232
238
|
*/
|
|
233
|
-
private readonly
|
|
239
|
+
private readonly _attributes;
|
|
234
240
|
/**
|
|
235
241
|
* Creates ViewElementConsumables instance.
|
|
236
242
|
*
|
|
237
|
-
* @param from View
|
|
243
|
+
* @param from View element from which `ViewElementConsumables` is being created.
|
|
238
244
|
*/
|
|
239
|
-
constructor(from:
|
|
245
|
+
constructor(from: Element);
|
|
240
246
|
/**
|
|
241
247
|
* Adds consumable parts of the {@link module:engine/view/element~Element view element}.
|
|
242
248
|
* Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and
|
|
@@ -249,22 +255,22 @@ export declare class ViewElementConsumables {
|
|
|
249
255
|
* Attributes classes and styles:
|
|
250
256
|
*
|
|
251
257
|
* ```ts
|
|
252
|
-
* consumables.add( { attributes: 'title',
|
|
253
|
-
* consumables.add( { attributes: [ 'title', 'name' ],
|
|
258
|
+
* consumables.add( { attributes: [ [ 'title' ], [ 'class', 'foo' ], [ 'style', 'color'] ] } );
|
|
259
|
+
* consumables.add( { attributes: [ [ 'title' ], [ 'name' ], [ 'class', 'foo' ], [ 'class', 'bar' ] ] } );
|
|
254
260
|
* ```
|
|
255
261
|
*
|
|
262
|
+
* Note: This method accepts only {@link module:engine/view/element~NormalizedConsumables}.
|
|
263
|
+
* You can use {@link module:engine/conversion/viewconsumable~normalizeConsumables} helper to convert from
|
|
264
|
+
* {@link module:engine/conversion/viewconsumable~Consumables} to `NormalizedConsumables`.
|
|
265
|
+
*
|
|
256
266
|
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
|
|
257
267
|
* attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.
|
|
258
268
|
*
|
|
259
269
|
* @param consumables Object describing which parts of the element can be consumed.
|
|
260
|
-
* @param consumables.name If set to `true` element's name will be added as consumable.
|
|
261
|
-
* @param consumables.attributes Attribute name or array of attribute names to add as consumable.
|
|
262
|
-
* @param consumables.classes Class name or array of class names to add as consumable.
|
|
263
|
-
* @param consumables.styles Style name or array of style names to add as consumable.
|
|
264
270
|
*/
|
|
265
|
-
add(consumables:
|
|
271
|
+
add(consumables: NormalizedConsumables): void;
|
|
266
272
|
/**
|
|
267
|
-
* Tests if parts of the {@link module:engine/view/
|
|
273
|
+
* Tests if parts of the {@link module:engine/view/element~Element view element} can be consumed.
|
|
268
274
|
*
|
|
269
275
|
* Element's name can be tested:
|
|
270
276
|
*
|
|
@@ -275,22 +281,19 @@ export declare class ViewElementConsumables {
|
|
|
275
281
|
* Attributes classes and styles:
|
|
276
282
|
*
|
|
277
283
|
* ```ts
|
|
278
|
-
* consumables.test( { attributes: 'title',
|
|
279
|
-
* consumables.test( { attributes: [ 'title', 'name' ],
|
|
284
|
+
* consumables.test( { attributes: [ [ 'title' ], [ 'class', 'foo' ], [ 'style', 'color' ] ] } );
|
|
285
|
+
* consumables.test( { attributes: [ [ 'title' ], [ 'name' ], [ 'class', 'foo' ], [ 'class', 'bar' ] ] } );
|
|
280
286
|
* ```
|
|
281
287
|
*
|
|
282
288
|
* @param consumables Object describing which parts of the element should be tested.
|
|
283
|
-
* @param consumables.name If set to `true` element's name will be tested.
|
|
284
|
-
* @param consumables.attributes Attribute name or array of attribute names to test.
|
|
285
|
-
* @param consumables.classes Class name or array of class names to test.
|
|
286
|
-
* @param consumables.styles Style name or array of style names to test.
|
|
287
289
|
* @returns `true` when all tested items can be consumed, `null` when even one of the items
|
|
288
290
|
* was never marked for consumption and `false` when even one of the items was already consumed.
|
|
289
291
|
*/
|
|
290
|
-
test(consumables:
|
|
292
|
+
test(consumables: NormalizedConsumables): boolean | null;
|
|
291
293
|
/**
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
+
* Tests if parts of the {@link module:engine/view/element~Element view element} can be consumed and consumes them if available.
|
|
295
|
+
* It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
|
|
296
|
+
*
|
|
294
297
|
* Element's name can be consumed:
|
|
295
298
|
*
|
|
296
299
|
* ```ts
|
|
@@ -300,17 +303,14 @@ export declare class ViewElementConsumables {
|
|
|
300
303
|
* Attributes classes and styles:
|
|
301
304
|
*
|
|
302
305
|
* ```ts
|
|
303
|
-
* consumables.consume( { attributes: 'title',
|
|
304
|
-
* consumables.consume( { attributes: [ 'title', 'name' ],
|
|
306
|
+
* consumables.consume( { attributes: [ [ 'title' ], [ 'class', 'foo' ], [ 'style', 'color' ] ] } );
|
|
307
|
+
* consumables.consume( { attributes: [ [ 'title' ], [ 'name' ], [ 'class', 'foo' ], [ 'class', 'bar' ] ] } );
|
|
305
308
|
* ```
|
|
306
309
|
*
|
|
307
310
|
* @param consumables Object describing which parts of the element should be consumed.
|
|
308
|
-
* @
|
|
309
|
-
* @param consumables.attributes Attribute name or array of attribute names to consume.
|
|
310
|
-
* @param consumables.classes Class name or array of class names to consume.
|
|
311
|
-
* @param consumables.styles Style name or array of style names to consume.
|
|
311
|
+
* @returns `true` when all tested items can be consumed and `false` when even one of the items could not be consumed.
|
|
312
312
|
*/
|
|
313
|
-
consume(consumables:
|
|
313
|
+
consume(consumables: NormalizedConsumables): boolean;
|
|
314
314
|
/**
|
|
315
315
|
* Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.
|
|
316
316
|
* Element's name can be reverted:
|
|
@@ -322,48 +322,16 @@ export declare class ViewElementConsumables {
|
|
|
322
322
|
* Attributes classes and styles:
|
|
323
323
|
*
|
|
324
324
|
* ```ts
|
|
325
|
-
* consumables.revert( { attributes: 'title',
|
|
326
|
-
* consumables.revert( { attributes: [ 'title', 'name' ],
|
|
325
|
+
* consumables.revert( { attributes: [ [ 'title' ], [ 'class', 'foo' ], [ 'style', 'color' ] ] } );
|
|
326
|
+
* consumables.revert( { attributes: [ [ 'title' ], [ 'name' ], [ 'class', 'foo' ], [ 'class', 'bar' ] ] } );
|
|
327
327
|
* ```
|
|
328
328
|
*
|
|
329
329
|
* @param consumables Object describing which parts of the element should be reverted.
|
|
330
|
-
* @param consumables.name If set to `true` element's name will be reverted.
|
|
331
|
-
* @param consumables.attributes Attribute name or array of attribute names to revert.
|
|
332
|
-
* @param consumables.classes Class name or array of class names to revert.
|
|
333
|
-
* @param consumables.styles Style name or array of style names to revert.
|
|
334
330
|
*/
|
|
335
|
-
revert(consumables:
|
|
336
|
-
/**
|
|
337
|
-
* Helper method that adds consumables of a given type: attribute, class or style.
|
|
338
|
-
*
|
|
339
|
-
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
|
|
340
|
-
* type is provided - it should be handled separately by providing actual style/class type.
|
|
341
|
-
*
|
|
342
|
-
* @param type Type of the consumable item: `attributes`, `classes` or `styles`.
|
|
343
|
-
* @param item Consumable item or array of items.
|
|
344
|
-
*/
|
|
345
|
-
private _add;
|
|
346
|
-
/**
|
|
347
|
-
* Helper method that tests consumables of a given type: attribute, class or style.
|
|
348
|
-
*
|
|
349
|
-
* @param type Type of the consumable item: `attributes`, `classes` or `styles`.
|
|
350
|
-
* @param item Consumable item or array of items.
|
|
351
|
-
* @returns Returns `true` if all items can be consumed, `null` when one of the items cannot be
|
|
352
|
-
* consumed and `false` when one of the items is already consumed.
|
|
353
|
-
*/
|
|
354
|
-
private _test;
|
|
355
|
-
/**
|
|
356
|
-
* Helper method that consumes items of a given type: attribute, class or style.
|
|
357
|
-
*
|
|
358
|
-
* @param type Type of the consumable item: `attributes`, `classes` or `styles`.
|
|
359
|
-
* @param item Consumable item or array of items.
|
|
360
|
-
*/
|
|
361
|
-
private _consume;
|
|
362
|
-
/**
|
|
363
|
-
* Helper method that reverts items of a given type: attribute, class or style.
|
|
364
|
-
*
|
|
365
|
-
* @param type Type of the consumable item: `attributes`, `classes` or , `styles`.
|
|
366
|
-
* @param item Consumable item or array of items.
|
|
367
|
-
*/
|
|
368
|
-
private _revert;
|
|
331
|
+
revert(consumables: NormalizedConsumables): void;
|
|
369
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Normalizes a {@link module:engine/conversion/viewconsumable~Consumables} or {@link module:engine/view/matcher~Match}
|
|
335
|
+
* to a {@link module:engine/view/element~NormalizedConsumables}.
|
|
336
|
+
*/
|
|
337
|
+
export declare function normalizeConsumables(consumables: Consumables | Match): NormalizedConsumables;
|