1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
9 | import type { Consumables, DowncastWriter, Element, Item, ViewElement } from 'ckeditor5/src/engine.js';
|
10 | import ListEditing, { type ListItemAttributesMap } from '../list/listediting.js';
|
11 | import ListPropertiesUtils from './listpropertiesutils.js';
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export default class ListPropertiesEditing extends Plugin {
|
19 | |
20 |
|
21 |
|
22 | static get requires(): readonly [typeof ListEditing, typeof ListPropertiesUtils];
|
23 | |
24 |
|
25 |
|
26 | static get pluginName(): "ListPropertiesEditing";
|
27 | |
28 |
|
29 |
|
30 | constructor(editor: Editor);
|
31 | /**
|
32 | * @inheritDoc
|
33 | */
|
34 | init(): void;
|
35 | }
|
36 | /**
|
37 | * Strategy for dealing with `listItem` attributes supported by this plugin.
|
38 | *
|
39 | * @internal
|
40 | */
|
41 | export interface AttributeStrategy {
|
42 | |
43 |
|
44 |
|
45 | attributeName: keyof ListItemAttributesMap;
|
46 | |
47 |
|
48 |
|
49 | defaultValue: unknown;
|
50 | |
51 |
|
52 |
|
53 | viewConsumables: Consumables;
|
54 | |
55 |
|
56 |
|
57 | addCommand(editor: Editor): void;
|
58 | |
59 |
|
60 |
|
61 | appliesToListItem(element: Item): boolean;
|
62 | |
63 |
|
64 |
|
65 | hasValidAttribute(element: Element): boolean;
|
66 | |
67 |
|
68 |
|
69 | setAttributeOnDowncast(writer: DowncastWriter, value: unknown, element: ViewElement): void;
|
70 | |
71 |
|
72 |
|
73 | getAttributeOnUpcast(element: ViewElement): unknown;
|
74 | }
|
75 | declare module '../list/listediting' {
|
76 | interface ListItemAttributesMap {
|
77 | listStyle?: string;
|
78 | listStart?: number;
|
79 | listReversed?: boolean;
|
80 | }
|
81 | }
|
82 | declare module '../list/utils/model' {
|
83 | interface ListElement {
|
84 | getAttribute(key: 'listStyle'): string;
|
85 | getAttribute(key: 'listStart'): number;
|
86 | getAttribute(key: 'listReversed'): boolean;
|
87 | }
|
88 | }
|