1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import type { Batch, Element } from 'ckeditor5/src/engine';
|
9 | import { Command, type Editor } from 'ckeditor5/src/core';
|
10 | export interface TablePropertyCommandExecuteOptions {
|
11 | batch?: Batch;
|
12 | columnWidths?: string;
|
13 | table?: Element;
|
14 | tableWidth?: string;
|
15 | value?: string;
|
16 | }
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export default class TablePropertyCommand extends Command {
|
23 | |
24 |
|
25 |
|
26 | readonly attributeName: string;
|
27 | |
28 |
|
29 |
|
30 | protected readonly _defaultValue: string | undefined;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | constructor(editor: Editor, attributeName: string, defaultValue?: string);
|
39 | /**
|
40 | * @inheritDoc
|
41 | */
|
42 | refresh(): void;
|
43 | /**
|
44 | * Executes the command.
|
45 | *
|
46 | * @fires execute
|
47 | * @param options.value If set, the command will set the attribute on the selected table.
|
48 | * If not set, the command will remove the attribute from the selected table.
|
49 | * @param options.batch Pass the model batch instance to the command to aggregate changes,
|
50 | * for example, to allow a single undo step for multiple executions.
|
51 | */
|
52 | execute(options?: TablePropertyCommandExecuteOptions): void;
|
53 | /**
|
54 | * Returns the attribute value for a table.
|
55 | */
|
56 | protected _getValue(table: Element): unknown;
|
57 | /**
|
58 | * Returns the proper model value. It can be used to add a default unit to numeric values.
|
59 | */
|
60 | protected _getValueToSet(value: string | number | undefined): unknown;
|
61 | }
|