1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import type { Element } from 'ckeditor5/src/engine.js';
|
9 | import { Command, type Editor } from 'ckeditor5/src/core.js';
|
10 |
|
11 |
|
12 |
|
13 | export default class ImageTypeCommand extends Command {
|
14 | |
15 |
|
16 |
|
17 | private readonly _modelElementName;
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 | constructor(editor: Editor, modelElementName: 'imageBlock' | 'imageInline');
|
24 | /**
|
25 | * @inheritDoc
|
26 | */
|
27 | refresh(): void;
|
28 | /**
|
29 | * Executes the command and changes the type of a selected image.
|
30 | *
|
31 | * @fires execute
|
32 | * @param options.setImageSizes Specifies whether the image `width` and `height` attributes should be set automatically.
|
33 | * The default is `true`.
|
34 | * @returns An object containing references to old and new model image elements
|
35 | * (for before and after the change) so external integrations can hook into the decorated
|
36 | * `execute` event and handle this change. `null` if the type change failed.
|
37 | */
|
38 | execute(options?: {
|
39 | setImageSizes?: boolean;
|
40 | }): {
|
41 | oldElement: Element;
|
42 | newElement: Element;
|
43 | } | null;
|
44 | }
|